Repository navigation
Revert "Support mouse Back/Forward buttons in shortcuts" - #23350
Conversation
This reverts commit a86fae0.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
This run reviewed the single-commit revert of #23287 ("Support mouse Back/Forward buttons in shortcuts") — 27 files, 1 commit.
- Mouse shortcut feature removed end to end. Deleted
src/shared/mouse-shortcut-input.ts,src/renderer/src/lib/mouse-shortcut-dispatch.ts, andsrc/renderer/src/app-shell/register-app-mouse-shortcuts.ts, along with their unit tests, the main-process routing test, and thetests/e2e/mouse-button-shortcuts.spec.tse2e spec. - Shared keybinding support reverted.
parser.tsdrops theMOUSEBACK/MOUSEFORWARDtokens,normalization.tsdrops theisMouseButtonbare-binding allowance, andformatting.tsdrops the mouse labels. - IPC and renderer wiring removed. The
ui:dispatchMouseShortcuthandler is gone frommain-window-shortcut-routing.ts(and the now-unusedipcMainimport),dispatchMouseShortcutis gone from the preload surface, anduse-global-keybindings.tsno longer registers the mouse dispatcher. - Pre-feature guards restored.
terminal-workspace-keydown.tsreturns toif (!activeWorktreeId)anduse-hold-dictation-gesture.tsdrops the recorder guard, matching the pre-#23287 behavior. - User-facing copy reverted.
ShortcutCommandBlock.tsx, six locale JSONs, anddocs/site/content/docs/settings.mdxno longer mention mouse Back/Forward recording.
Verification: grepped every removed symbol (MouseBack, MouseForward, dispatchMouseShortcut, parseMouseShortcutInput, registerMouseShortcutDispatch, and each deleted module name) — no dangling references remain. pnpm run tc:node and pnpm run tc:web both pass on the revert head.
ℹ️ Two non-blocking notes
config/scripts/ci-shard-timings.jsonstill lists the deletedmouse-shortcut-dispatch.test.tsandmouse-shortcut-input.test.ts. This is harmless —balanceFilesiterates the actual test set and ignores unknown keys — so no change is needed; the next timing refresh drops them.- Users who saved a
MouseBack/MouseForwardbinding while #23287 was live will, after this revert, have that action's entire override rejected on load:normalizeKeybindingArrayWithOptionsreturns on the first unparseable entry andparseBindingSectiondrops the action, so a keyboard shortcut sharing the same array is ignored too. This is the same failure class the revert targets, and a cleanup/preserve step plausibly belongs to the reland rather than here.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 📝 WalkthroughWalkthroughThe changes remove Mouse Back/Forward shortcut parsing, recording, and dispatch, along with their associated tests. Keyboard shortcut routing remains. Keydown events that are already prevented or originate inside an active shortcut recorder now proceed through existing shortcut logic. Shortcut prompts and settings documentation no longer describe mouse-button shortcuts. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description explains the regression and the intent to reland a fix, but it omits most required template sections, including ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, Review, Notes, and Checklist details. Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 7 files. (6 skipped: 6 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
🟡 Minor · Restore the recorder-target guard. · use-hold-dictation-gesture.ts:127
src/renderer/src/components/dictation/use-hold-dictation-gesture.ts:127
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winRestore the recorder-target guard.
In hold mode, when voice dictation is enabled and an STT model is configured, this capture-phase handler can intercept a matching keydown before
ShortcutRecorderButtonreceives it. It prevents recorder capture and can start dictation. The main-process recorder-focus safeguard only preventsbefore-input-eventfrom consuming the shortcut; it does not bypass this renderer capture handler.Suggested fix
const handleKeyDown = (e: KeyboardEvent): void => { + if (e.target instanceof Element && e.target.closest('[data-shortcut-recorder-active]')) { + return + } if (keybindingMatchesAction('voice.dictation', e, getShortcutPlatform(), keybindings)) {
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: cda256b3-cd53-4198-8e78-50ffacdc4c88
📒 Files selected for processing (27)
docs/site/content/docs/settings.mdxsrc/main/window/main-window-mouse-shortcuts.test.tssrc/main/window/main-window-shortcut-routing.tssrc/preload/api/ui-bridge-clipboard-and-window-controls.tssrc/preload/api/ui-window-api.tssrc/renderer/src/app-shell/register-app-mouse-shortcuts.tssrc/renderer/src/app-shell/use-global-keybindings.tssrc/renderer/src/components/dictation/use-hold-dictation-gesture.test.tsxsrc/renderer/src/components/dictation/use-hold-dictation-gesture.tssrc/renderer/src/components/settings/ShortcutCommandBlock.tsxsrc/renderer/src/components/terminal-workspace-keydown.test.tssrc/renderer/src/components/terminal-workspace-keydown.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/fr.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.jsonsrc/renderer/src/lib/mouse-shortcut-dispatch.test.tssrc/renderer/src/lib/mouse-shortcut-dispatch.tssrc/shared/keybindings-mouse.test.tssrc/shared/keybindings/formatting.tssrc/shared/keybindings/normalization.tssrc/shared/keybindings/parser.tssrc/shared/mouse-shortcut-input.test.tssrc/shared/mouse-shortcut-input.tstests/e2e/mouse-button-shortcuts.spec.ts
💤 Files with no reviewable changes (14)
- docs/site/content/docs/settings.mdx
- src/preload/api/ui-bridge-clipboard-and-window-controls.ts
- src/renderer/src/app-shell/use-global-keybindings.ts
- src/renderer/src/lib/mouse-shortcut-dispatch.test.ts
- src/shared/mouse-shortcut-input.ts
- src/preload/api/ui-window-api.ts
- src/renderer/src/components/dictation/use-hold-dictation-gesture.ts
- src/shared/keybindings-mouse.test.ts
- src/renderer/src/app-shell/register-app-mouse-shortcuts.ts
- src/renderer/src/lib/mouse-shortcut-dispatch.ts
- src/shared/mouse-shortcut-input.test.ts
- tests/e2e/mouse-button-shortcuts.spec.ts
- src/main/window/main-window-mouse-shortcuts.test.ts
- src/shared/keybindings/normalization.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
| (event.target instanceof Element && | ||
| event.target.closest('[data-shortcut-recorder-active]') !== null) | ||
| ) { | ||
| if (!activeWorktreeId) { |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Keep recorder keystrokes out of workspace shortcut handling.
When a user records a key that matches a workspace shortcut, this handler can now execute the workspace action instead of leaving the key solely to the recorder. For example, a matching key can call handleNewTab() while the recorder is active. Restore the active-recorder exclusion without restoring mouse shortcut support.
| BACKQUOTE: 'Backquote', | ||
| MOUSEBACK: 'MouseBack', | ||
| MOUSEFORWARD: 'MouseForward' | ||
| BACKQUOTE: 'Backquote' |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Inspect parser callers and handling of removed mouse tokens.
rg -n -C 6 'normalizeKeyToken|parseKeybinding|MouseBack|MouseForward' src --glob '*.{ts,tsx}'Repository: stablyai/orca
Length of output: 21715
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '%s\n' '--- candidate files ---'
rg -l -i 'keybinding|shortcut|rollback|paired.?app|pair(ed)?' src --glob '*.{ts,tsx}' | head -80
printf '%s\n' '--- persistence and rollback references ---'
rg -n -i -C 5 'localStorage|sessionStorage|persist|override|rollback|paired.?app|sync.*(binding|shortcut)|binding.*sync' src --glob '*.{ts,tsx}' | head -500Repository: stablyai/orca
Length of output: 43583
🏁 Script executed:
#!/bin/bash
set -euo pipefail
rg -n -i -C 8 'keybinding|shortcut|override|rollback|paired|pairing|sync' . --glob '!node_modules' --glob '!dist' --glob '!build' --glob '*.{ts,tsx,js,jsx,json,md}' | head -1000Repository: stablyai/orca
Length of output: 42010
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '%s\n' '--- keybinding module files ---'
git ls-files 'src/shared/keybindings/*' 'src/shared/*keybinding*' 'src/*/*keybinding*' | sort
printf '%s\n' '--- effective and override references ---'
rg -n -C 8 'getEffectiveKeybindingsForAction|getEffectiveKeybindingsForDefinition|KeybindingOverrides|keybindingOverrides|keybindings?Override|persisted.*keybinding|keybinding.*persist' src --glob '*.{ts,tsx}'
printf '%s\n' '--- state and paired-app exact references ---'
rg -n -C 8 'pairedApp|paired-app|pairedClient|pairing.*(rollback|restore)|rollback.*pair|restore.*keybinding|keybinding.*restore' src --glob '*.{ts,tsx}'Repository: stablyai/orca
Length of output: 45655
🏁 Script executed:
#!/bin/bash
set -euo pipefail
files=(
src/main/keybindings/keybinding-file.ts
src/main/keybindings/keybinding-service.ts
src/main/ipc/keybindings.ts
src/renderer/src/store/slices/keybindings.ts
src/renderer/src/components/settings/keybinding-override-edits.ts
src/shared/keybindings/effective.ts
src/shared/keybindings/normalization.ts
src/shared/keybindings/types.ts
)
for file in "${files[@]}"; do
printf '\n--- %s ---\n' "$file"
wc -l "$file"
rg -n -C 10 -i 'load|read|write|save|persist|restore|rollback|invalid|normalize|override|snapshot|mouseback|mouseforward|MOUSEBACK|MOUSEFORWARD' "$file" || true
doneRepository: stablyai/orca
Length of output: 33827
🏁 Script executed:
#!/bin/bash
set -euo pipefail
file=src/main/keybindings/keybinding-file-parser.ts
printf '%s\n' "--- $file ---"
wc -l "$file"
rg -n -C 18 'parseBindingSection|parsePlatformOverrides|removeConflictingOverrides|normalize|binding|invalid|diagnostic|actionId' "$file"Repository: stablyai/orca
Length of output: 8046
Preserve valid shortcuts in mixed saved bindings.
readKeybindingFile passes each saved binding array to normalizeKeybindingArrayForAction. That normalizer rejects the whole array when it contains an invalid token. parseBindingSection then ignores the complete action. A saved action such as ["MOUSEBACK", "Mod+K"] can therefore lose its valid Mod+K shortcut. Filter invalid entries during file loading and retain valid entries. Do not convert an all-invalid array into an unintended empty override.

This reverts #23287 because it introduced a launch-blocking regression.
Saving a mouse Back/Forward shortcut and then rolling back the paired web app can drop that action's saved shortcuts, including keyboard shortcuts stored on the same action.
We will reland with a fix. A Linear ticket will track the reland.