Add customizable keyboard shortcuts#2581
Merged
Merged
Conversation
- Add customizable keybindings - Fix keybinding customization bypasses
This was referenced May 22, 2026
thomaszdxsn
pushed a commit
to thomaszdxsn/orca
that referenced
this pull request
Jun 15, 2026
* Add customizable keyboard shortcuts - Add customizable keybindings - Fix keybinding customization bypasses * Keep shortcut UI labels dynamic * Fix keybinding review gaps * Improve shortcut recording UX * Include settings section metadata in search * Polish shortcut settings editor * Tighten shortcut settings rows * Clarify keybindings file card * Clear settings search on section select * Remove keybindings file helper copy
yejinh
added a commit
to yejinh/orca
that referenced
this pull request
Jul 13, 2026
On macOS, tab.newSimulator (New mobile emulator tab) and sidebar.explorer.toggle (Show Explorer) both defaulted to Mod+Shift+E. Show Explorer had the chord first (stablyai#2581); stablyai#4754 reused it for the emulator. When focus is in a terminal, the terminal-scope keydown handler fires first, calls preventDefault(), and opens the emulator, so the global Show Explorer toggle never runs. The conflict detector missed this because the two actions live in different scopes (tabs vs global) and tab.newSimulator never declared a conflictGroup, unlike the comparable tab.openQuickCommandsMenu action. - Move tab.newSimulator's macOS default to Mod+Shift+S (S = Simulator), leaving Cmd+Shift+E to Show Explorer (matches VS Code). - Add conflictGroup: 'global' so findKeybindingConflicts and the Settings UI flag any future overlap with a global chord. - Add a regression test covering the default chord and the guard. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
yejinh
added a commit
to yejinh/orca
that referenced
this pull request
Jul 13, 2026
On macOS, tab.newSimulator (New mobile emulator tab) and sidebar.explorer.toggle (Show Explorer) both defaulted to Mod+Shift+E. Show Explorer had the chord first (stablyai#2581); stablyai#4754 reused it for the emulator. When focus is in a terminal, the terminal-scope keydown handler opens the emulator, so the chord no longer reliably shows the Explorer. The conflict detector missed this because the two actions live in different scopes (tabs vs global) and tab.newSimulator never declared a conflictGroup, unlike the comparable tab.openQuickCommandsMenu action. - Move tab.newSimulator's macOS default to Mod+Shift+S (S = Simulator), leaving Cmd+Shift+E to Show Explorer (matches VS Code). - Add conflictGroup: 'global' so findKeybindingConflicts and the Settings UI flag any future overlap with a global chord. - Add a regression test covering the default chord and the guard.
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
This PR adds a real custom keybinding system for Orca while preserving the current default shortcut ownership model. A shared registry now drives shortcut matching, Settings, file-backed overrides, menu accelerators, browser/terminal handling, conflict checks, and visible shortcut labels.
Users can customize shortcuts through a captured-key recorder in Settings > Keyboard Shortcuts or by editing the backing
~/.orca/keybindings.jsonfile directly. The Settings page includes a compact keybindings-file split action: Edit File in Orca opens the file in the floating workspace editor, while the dropdown offers default-app, external-editor, reveal, and reload paths.Refs #1493, #713, #891, #1502, #858, #1168.
Related: #1802.
Supersedes #2425, which GitHub would not reopen after the branch was recreated during conflict resolution.
Latest follow-up
mainand resolved the sidebar conflict by preserving both repository badge settings navigation and keybinding-aware worktree shortcut handling.The visual editor saves here.helper copy from the Keybindings JSON card.keyboardand clicking Shortcuts could leave Terminal content visible.User-facing behavior
~/.orca/keybindings.jsoninside Orca’s floating workspace editor, open it with the OS default app, open it with an external editor, reveal it in the file manager, or reload it from disk.sidebar.search.togglebinding instead of hardcodingCmd/Ctrl+Shift+F.Defaults and compatibility
This is intentionally customization-first, not a broad terminal/TUI pass-through rewrite.
Cmd+Jon macOS still opens the worktree switcher by default, including when focus is in a terminal/TUI. Users who need that chord for a TUI can disable or rebindworktree.palette.sidebar.checks.toggleis intentionally unassigned by default because the previous UI hint did not correspond to a consistently owned default main-process shortcut.Mod+Shift+Minus/_is no longer treated as a default zoom-out shortcut, so readline/terminal undo can pass through. Users can bind it explicitly if they want that behavior.Implementation
src/shared/keybindings.tsas the shared keybinding registry, parser, formatter, matcher, platform mapper, captured-key normalizer, and conflict detector.src/main/keybindings/keybinding-file.tsandsrc/main/keybindings/keybinding-service.tsfor~/.orca/keybindings.jsonpersistence, migration, validation, and runtime broadcasts.ShortcutsPaneplus stable row UI inShortcutBindingRow.KeybindingsFileActionsfor the backing file card, including in-Orca floating editor open and external/default open paths.Edit File in Orcacan read and save a config file outside workspace roots without relaxing general filesystem access.useShortcutLabeland routes visible hints through the effective keybindings.File format
The backing file is JSON and supports both common and per-platform overrides:
{ "version": 1, "keybindings": { "worktree.quickOpen": ["Mod+P"] }, "platforms": { "darwin": { "worktree.palette": ["Mod+J"] }, "linux": {}, "win32": {} } }Notes:
Modmaps toCmdon macOS andCtrlon Linux/Windows.[],null, orfalsedisables an action.Known technical tradeoffs
keybindingssection in JSON.~/.orca/keybindings.jsonfile directly.Testing
Latest local validation after rebase and the final Keybindings JSON copy removal:
pnpm lintpnpm typecheckgit diff --checkrg -n "The visual editor saves here" src/renderer/src/components/settings/KeybindingsFileActions.tsx src || truepnpm exec vitest run --config config/vitest.config.ts src/shared/keybindings.test.ts src/main/keybindings/keybinding-file.test.ts src/main/ipc/keybindings.test.tsEarlier focused validation for this PR also passed:
pnpm exec vitest run --config config/vitest.config.ts src/shared/keybindings.test.ts src/renderer/src/components/terminal-pane/keyboard-handlers.test.ts src/renderer/src/web/web-preload-api.test.ts src/main/keybindings/keybinding-file.test.ts src/main/window/createMainWindow.test.ts src/main/menu/register-app-menu.test.ts src/shared/window-shortcut-policy.test.ts src/renderer/src/components/terminal-pane/terminal-shortcut-policy.test.ts src/renderer/src/components/right-sidebar/FileExplorer.test.tsx src/renderer/src/components/sidebar/WorktreeCard.pr-display.test.tsx src/renderer/src/components/sidebar/WorktreeCard.lineage.test.tsx src/renderer/src/components/sidebar/WorktreeCard.quick-actions.test.tsxEdit File in Orcaopens/Users/nwparker/.orca/keybindings.jsonin the floating workspace editor and loads JSON content without filesystem access errors.keyboardin Settings and then clicking Shortcuts shows the Keyboard Shortcuts content instead of leaving Terminal content visible.