Expand description
Navigating between the pages of one app.
A page is a key, navigation is a write to a reserved signal, and the
<if> reconciler does the mounting: the assembled tree is one gate per
page, and the resolver decides which gate is open. Nothing here knows
where the pages came from, so the same resolver serves an app loaded from
.lmn files, one loaded from a compiled artifact, and one running in a
browser.
A requested path resolves by longest existing key (lumen_core::nav):
/settings reaches settings, and /user/7 with no user/7 page
reaches user with /7 left on the route.segment signal for the page
to read.
RouteHistory is the back/forward stack an app keeps in memory. A
desktop window steps through it; a browser hands back and forward to its
own history instead, and a popstate comes back here as a navigation.
Structs§
- Anchor
- Navigation target attached to a spawned
<a href="...">element. A click on the entity navigates the active page. - Host
Follows Links - Host policy: the host follows a link click on its own, so a click on an
Anchorraises no navigation here. - Location
- One entry on the in-memory history stack.
- Page
Registry - Runtime page registry - the resolver’s view of the loaded pages.
- Route
History - In-memory back/forward history. A desktop window steps through this; in a browser the browser’s own history is what answers back and forward, and this records where the app has been without being stepped.
Functions§
- apply_
navigation - The single navigation resolver. Reads the reserved request signal (written
by every surface via
lumen_core::nav::request), resolves the target by longest existing-file prefix, updates the reservedroute.path/route.segmentcells, and maintains the in-memory history stack. - install_
routing - Install navigation for a known page set: the registry, the in-memory history, the reserved-signal seeds, and the two navigation systems.
- navigate_
on_ anchor_ click - Declarative navigation: a click on a spawned
<a href>navigates the active page. The anchor is a real element; on the web target it is a real DOM<a href>, and under[web] navigation = "soft"the browser’s own anchor navigation is prevented so that this system’s swap is what the click ends at. A host holdingHostFollowsLinksfollows the link itself, and the click raises nothing here.