Repository navigation
Support mouse Back/Forward buttons in shortcuts - #23287
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthroughMouse Back and Mouse Forward can now be recorded as keybindings, with optional modifiers, and assigned to terminal-tab or native window actions. The renderer converts mouse side-button presses into shortcut events and routes matching actions through the preload API and main-window IPC. Shortcut recorder input is excluded from terminal shortcut and dictation handling. Tests cover parsing, dispatch, recording, and end-to-end tab switching and Settings access. The Settings documentation and translated recording prompts now mention mouse side buttons. Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to The change adds configurable mouse side-button shortcuts, with no confirmed regression remaining. The supplied tests cover parsing, dispatch, terminal-tab switching, and Settings actions; the change appears ready to merge subject to normal project checks. Architecture SummaryArchitecture risk: 🔵 Low · up to The change affects 3 systems. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ 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 |
|
Addressed the duplicate-press concern in 9f00941: a side button with an outstanding press is not dispatched again, and a handled press keeps consuming its release even if a duplicate changes modifiers. The regression test also verifies that the next complete gesture works. All 46 focused dispatch, tab-routing, and hold-dictation tests pass. The docstring-coverage suggestion is not applied because AGENTS.md explicitly asks for concise, non-obvious comments only. |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
MouseBack/MouseForwardas first-class keybindings — the parser, normalizer (bare mouse buttons allowed), and formatter now accept and label side buttons, with optional modifiers; a newMouseShortcutInputtype plusparseMouseShortcutInputvalidates the IPC payload at the main boundary.- Unified dispatch in the renderer —
registerMouseShortcutDispatchcaptures side-buttonmousedown, synthesizes akeydowndispatched atdocument.activeElement, and reuses the existing focused-surface keydown handlers, so mouse gestures flow through the same matcher, context, and conflict logic as keys. A handled press consumes the matchingmouseup/auxclickto suppress Chromium back/forward navigation, and a synthesizedkeyupon release supports hold dictation. - App-wide commands via the existing main-process dispatcher —
registerAppMouseShortcutsresolves the window shortcut policy and forwards to a newui:dispatchMouseShortcutIPC, which main re-resolves and dispatches through the sameWindowShortcutActionallowlist. The handler checks sender, main frame, and the recorder flag. - Recorder and isolation — the recorder message documents side buttons, and recorder guards were added to the global app dispatcher, the terminal workspace handler, and hold dictation so recording a mouse shortcut does not execute the binding it is capturing.
- Tests — 7 new/updated suites cover parsing, conflicts, modifier capture across platforms, event consumption and release, recorder isolation, terminal/floating routing, the native main-process dispatch, and an end-to-end CDP-driven flow.
I traced the full renderer↔main event lifecycle: the input.defaultPrevented gate means the synthesized keydown cannot both execute in the renderer and reach the IPC path, and preventDefault on mouseup (the phase Chromium consults for history navigation) is correctly applied to consumed gestures. The tests assert exact values rather than loose truthiness, so they can genuinely fail.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Reviewed the delta since the prior pullfrog review (6e30bad → 9f00941), one commit.
- Ignore duplicate mouse presses until release —
onMouseDownnow early-returns whenpressedInputsalready owns the button, re-consuming the event (preventDefault+stopImmediatePropagation) only when that button was already a handled gesture. A duplicatemousedownbeforemouseup(e.g. modifiers change mid-press) can no longer resolve and fire a second binding, while an unhandled bound press still falls through to native navigation. - Test — a new case pins exact call counts across the duplicate press, the release/
auxclick, and a fresh press after release.
The guard is placed before consumedButtons.delete, so ownership of an in-flight press is preserved until release, and pressedInputs is only populated for dispatched presses, so duplicate presses of unbound buttons still take the normal path. No regression found.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
|
@nwparker we reverted this in #23350. Please reland with a fix. 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. Tracking the reland in https://linear.app/stably/issue/STA-8684 |

ELI5
Assign your mouse's Back/Forward side buttons to Orca shortcuts, including switching terminal tabs. Modifiers such as Shift work too.
What Changed
Settings now records side buttons and shows Mouse Back / Mouse Forward labels.
keybindings.jsonacceptsMouseBackandMouseForward, with optional modifiers. Mouse presses reuse the existing focused shortcut handlers; app-wide commands use the existing Electron shortcut dispatcher. A handled press consumes its release so it runs once without also navigating history.Why
The recorder previously ignored side buttons and the file parser rejected them. Reusing the shortcut routing preserves context, conflict checks, and terminal/floating-workspace behavior without a separate set of mouse actions. This addresses the original issue only; navigation-history behavior is unchanged.
Linked Issue
Fixes #23255
Visual Proof
Before: Mouse Back leaves the recorder waiting.
After: the same button is saved as Mouse Back; Shift+Forward is also recorded.
Testing
pnpm tc, focused Vitest suites, changed-code quality gate, localization checks, and Electron build.Review
Agent skill upstream boundary
Notes
No default shortcuts changed. Primary, middle, right, and unbound side-button clicks retain their behavior.
Checklist
N/Awith reason