Skip to main content

Module nav_stack

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§

EdgeSwipeBack
Arms when a press starts within edge_width of the left edge, fires NavAction::Back once the pointer travels trigger_distance px 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. T names 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.