Skip to content

[tui] Implement NavigationProvider with stack-based screen routing and context#202

Open
roninjin10 wants to merge 1 commit intomainfrom
tui-impl/tui-navigation-provider
Open

[tui] Implement NavigationProvider with stack-based screen routing and context#202
roninjin10 wants to merge 1 commit intomainfrom
tui-impl/tui-navigation-provider

Conversation

@roninjin10
Copy link
Copy Markdown
Contributor

Implement NavigationProvider with stack-based screen routing and context

Create the NavigationProvider that manages the screen navigation stack consumed by the ScreenRouter, HeaderBar breadcrumbs, and all go-to/deep-link features. (1) providers/NavigationProvider.tsx: React context providing push(screen, params), pop(), replace(screen, params), reset(screen, params), canPop(), stack (read-only), current (top of stack). (2) router/types.ts: ScreenEntry type { id: string, params?: Record<string, string> }, NavigationContextType interface. (3) Stack model: array of ScreenEntry, max depth 32, oldest entry dropped on overflow, push deduplicates consecutive identical screens. (4) push() adds to stack, pop() removes top (no-op on root), replace() swaps top, reset() clears to single entry. (5) useNavigation() consumer hook. (6) Stack is not persisted across TUI restarts. (7) All operations are synchronous and trigger re-render.

Closes #40


Auto-generated by smithers workflow
Domain: Codeplane TUI
Ticket: tui-navigation-provider

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tui Terminal UI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[tui] Implement NavigationProvider with stack-based screen routing and context

1 participant