Module nav_stack
Expand description
A reusable, app-agnostic navigation stack with a back action and an edge-swipe back-gesture hook.
Apps that model UI as a series of views need three things the toolkit can
own once: a history with push/pop (NavStack<T>), a single back intent
(NavAction) that gesture/key/button all resolve to, and a gesture
entry point (EdgeSwipeBack) so an edge-swipe drives the same action.
The stack stores cloneable descriptors, never widgets — pure state, unit-tested without a render pass.
Structs§
- Edge
Swipe Back - Arms when a press starts within
edge_widthof the left edge, firesNavAction::Backonce the pointer travelstrigger_distancepx right in a mostly-horizontal drag. No velocity/animation, but a complete pointer-event contract a richer recognizer can later drop into. - NavStack
- A generic navigation history.
Tnames a view (an app’s route/screen descriptor). Back and forward keep browser-style history; pushing after a Back clears the abandoned forward branch.
Enums§
- NavAction
- Navigation history intents shared by gestures, keys, and buttons.