Skip to content

[tui] Implement global keybinding system with scope management and KeybindingProvider#204

Open
roninjin10 wants to merge 11 commits intotui-impl/tui-navigation-providerfrom
tui-impl/tui-global-keybindings
Open

[tui] Implement global keybinding system with scope management and KeybindingProvider#204
roninjin10 wants to merge 11 commits intotui-impl/tui-navigation-providerfrom
tui-impl/tui-global-keybindings

Conversation

@roninjin10
Copy link
Copy Markdown
Contributor

Implement global keybinding system with scope management and KeybindingProvider

Create the KeybindingProvider and global keybinding infrastructure consumed by all screens. (1) providers/KeybindingProvider.tsx: manages keybinding scopes (global, screen, overlay), resolves key events through priority layers (text input → modal → go-to mode → screen → global), provides registerKeybinding/unregisterKeybinding via context. (2) hooks/useGlobalKeybindings.ts: registers the always-active global keybindings — ? (toggle help), : (open command palette), q (pop screen / quit on root), Esc (close overlay or same as q), Ctrl+C (immediate quit). (3) Keybinding registration: { key: string, scope: 'global'|'screen'|'overlay', handler: () => void, description: string, when?: () => boolean }. (4) Scope priority: overlay > screen > global. (5) Input suppression: when a text input has focus, single-character keybindings are suppressed (only Ctrl/Esc/Enter reach the keybinding system). (6) useKeybindings() consumer hook for screen-specific bindings.

Closes #50


Auto-generated by smithers workflow
Domain: Codeplane TUI
Ticket: tui-global-keybindings

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.

1 participant