feat(web): keyboard shortcut registry + useShortcut hook #1018
Labels
No labels
area:agents
area:dashboard
area:database
area:design
area:design-review
area:flows
area:infra
area:meta
area:security
area:sessions
area:webhook
area:workdir
security
type:bug
type:chore
type:meta
type:user-story
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
charles/claude-hooks#1018
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
As a developer wiring keyboard behaviour,
I want a single typed registry of every keyboard shortcut + a
useShortcuthook that consumes it,so that the upcoming
<ShortcutOverlay>(#nav-v2-8) and runtime hooks read the same source-of-truth and never drift.Resolves the "drift between docs and behaviour" risk called out during spec review.
Acceptance criteria
Registry
apps/web/src/lib/shortcuts.tsexportsinterface ShortcutDef { keys: string[]; label: string; scope: ShortcutScope; description?: string }.SHORTCUTS: ShortcutDef[]constant lists every shortcut in the app, grouped by scope (global,board,agents,flows, …).global(?,g h,g b,g a,g w,g f,[,Esc),board(h j k l,a,r,/).Hook
useShortcut(scope: ShortcutScope, handler: (def: ShortcutDef, e: KeyboardEvent) => void)subscribes for the page lifetime.Shift+/matches?. AZERTY chord aliasg hmatches the same overlay.[contenteditable]are excluded from key matching unless the shortcut is explicitly scoped to inputs.g b) with 1 s timeout; chord state visible (no UI yet, but auseChordStatereturns the buffered prefix).Refactor
apps/web/src/components/board/use-board-keymap.tsrewritten to consume the registry instead of inlining key strings.Tests
Out of scope
g betc.) — registry only declares the shortcuts; runtime wiring lands with the sidebar (#nav-v2-5).References
docs/specs/nav-consolidation.md§ Global keyboard shortcut overlay.apps/web/src/components/board/use-board-keymap.ts.🧹 janitor: this ticket has been idle-assigned since 2026-05-09T20:59:58.000Z. Re-dispatching.