feat(web): keyboard shortcuts (claude.ai parity)#133
Open
constkolesnyak wants to merge 1 commit into
Open
Conversation
Adds a small shortcut system around a single document-level keydown listener plus a help modal. Mirrors the bindings claude.ai/chat exposes, skipping ones that don't map (artifacts, force-send, settings). Global: ⌘⇧O new chat, ⌘K focus search, ⌘/ shortcuts modal, Esc cascades to modal → search → stop generation. Chat: ⌘⇧S sidebar, ⌘⇧; focus input, ⌘⇧C copy last response, ⌘⇧⌫ delete current (confirmed), ⌘\ side panel (already existed). Mac/Linux labels and Backspace/Delete aliases render automatically. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This was referenced Jun 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a small keyboard-shortcut system to the web UI plus a help modal, mirroring the bindings that claude.ai exposes. Skips ones that don't map to Nerve (artifacts, force-send, settings).
Bindings
Cmd/Ctrl + KCmd/Ctrl + BCmd/Ctrl + NCmd/Ctrl + ↑/↓Cmd/Ctrl + ⇧+⌫Cmd/Ctrl + \Cmd/Ctrl + /EscMac/Linux labels (
⌘vsCtrl) and Backspace/Delete aliases render automatically in the modal.Architecture
useKeyboardShortcuts) instead of per-component handlers — global behaviour stays consistent and we don't pile up listeners.keyboard.tsutils —formatShortcut(binding),matchShortcut(event, binding),isSafeInInputCombo()so chord-style shortcuts (Cmd/Ctrl combos and Esc) fire even when focus is in an input/textarea/contentEditable. Printable keys still require explicitallowInInput: true.ShortcutsModal— grouped reference list, opens onCmd/Ctrl + /.uiStore— Zustand store for the modal open state and the sidebar visibility toggle.App.tsx+ChatPage.tsx, with tiny adjustments toChatInputandSessionSidebar(focus IDs).Tests
No new tests — pure web feature with no backend touch.
npm run buildclean (✓ built in 8.57s).Files