Navigation API¶
Source: ui/navigation.py
High-level navigation helpers for screen and control code. For when to call each helper, see the Navigation guide.
High-level navigation commands for route-aware UI controls.
navigate_to ¶
Replace the view stack with a route in a scheduled page task.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
page
|
Page
|
Page whose route stack should be replaced. |
required |
route
|
str
|
Route path without query parameters. |
required |
**params
|
object
|
Query parameters to encode in the route URL. Values set to
|
{}
|
Source code in src/learning_app/ui/navigation.py
navigate_to_async
async
¶
Replace the view stack with a route and wait for completion.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
page
|
Page
|
Page whose route stack should be replaced. |
required |
route
|
str
|
Route path without query parameters. |
required |
**params
|
object
|
Query parameters to encode in the route URL. Values set to
|
{}
|
Source code in src/learning_app/ui/navigation.py
push_view ¶
Push a deep-route view in a scheduled page task.
Non-deep routes are handled by the router as stack replacements.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
page
|
Page
|
Page whose route stack should be updated. |
required |
route
|
str
|
Route path without query parameters. |
required |
**params
|
object
|
Query parameters to encode in the route URL. Values set to
|
{}
|
Source code in src/learning_app/ui/navigation.py
go_back ¶
Pop the active route view, or close in-place search when it is open.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
page
|
Page
|
Page whose active view should be popped. |
required |
Source code in src/learning_app/ui/navigation.py
reanchor_edit_on_home ¶
Rebuild Home, then the canonical edit view, after creating a new set.
Drops intermediate views such as create-set and refreshes the home tile catalog so Back / system back land on an up-to-date list.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
page
|
Page
|
Page whose view stack should be rewritten. |
required |
file_name
|
str
|
Set file used to build the canonical edit route URL. |
required |
Source code in src/learning_app/ui/navigation.py
go_search ¶
Open in-place search over the selected tile collection.
Search UI is shown in the shared app bar so the tile body is never reparented (which breaks the sort dropdown after return).
When the chosen body has no content tiles, the call returns without changes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
page
|
Page
|
Page on which to open search. |
required |
mode
|
str
|
Tile collection to search. |
'home'
|