Repository navigation
Navigate workspace history with the mouse side buttons - #25555
AlexThunder1989 wants to merge 3 commits into
Conversation
Bind the mouse back/forward buttons to workspace history navigation, like Claude and Codex. Claude-Session: https://claude.ai/code/session_01WcDwAb4tuKmMBWsJD7guuN
|
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 configuration
📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe worktree IPC listener and capture-phase mouseup listener now use a shared handler for history navigation. The handler checks that the active view is terminal and dispatches back or forward navigation. Mouse buttons 3 and 4 map to back and forward. The browser link-routing listener handles trusted, unprevented mouseup events for those buttons by navigating browser history. The remote browser pane routes pointer buttons 3 and 4 to back and forward navigation. Priority: ⬇️ Low Merge Risk: 🔵 Low · up to Linux users could skip an extra history entry when using mouse Back or Forward if native traversal also occurs. The exact runtime behavior remains uncertain, so this is a bounded follow-up risk. Architecture SummaryArchitecture risk: 🔵 Low · up to The change affects 1 system. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
16adb0f9-a3a0-462b-8538-bb788a52765a
📒 Files selected for processing (1)
src/main/browser/browser-clicked-link-routing.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
4a11cd9 to
bb92170
Compare
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Reviewed the macOS swipe commit (4a11cd9) added since the prior review of bb92170. That commit touches only src/main/window/createMainWindow.ts.
- Added a macOS trackpad
swipelistener that routes a horizontal swipe to the hovered browser guest's history (navigationHistory.goToOffset) and otherwise forwardsui:worktreeHistoryNavigateto the renderer for workspace history.
I verified the direction === 'left' → back mapping against the pinned Electron 43.7.5 source (event.deltaX == 1.0 → "left"), Apple's NSEvent.deltaX convention, and the established Electron/macOS back-gesture implementations; it is not inverted, and the mouse side-button path reuses the same navigate function as the keyboard shortcut.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Re-reviewed after the branch was force-pushed back to bb92170.
- Removed the macOS trackpad
swipehandler fromsrc/main/window/createMainWindow.ts(and itswebContentsimport); that work now lives in #25592, matching the updated PR description.
No other files changed since the prior review; the side-button handling in browser-clicked-link-routing.ts and workspace-shortcut-ipc-bridge.ts is unchanged.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Re-reviewed the commit added since the prior pullfrog review of bb92170. 0691180 touches one file.
- Routed mouse side buttons (button 3 = back, 4 = forward) inside remote browser panes to the pane's own page history:
remote-browser-page-pane.tsx:425now wraps thehandleRemotePointerDownpassed toRemoteBrowserPageViewport, callsevent.preventDefault()for buttons 3/4, and issuesrunRemoteNavigation('browser.back' | 'browser.forward')instead of forwarding a mouse-down to the guest.
The load-bearing claim in the inline comment checks out: canceling pointerdown sets the PREVENT MOUSE EVENT flag for the pointer type (Pointer Events spec, "Mapping for devices that support hover"), which suppresses the subsequent compatibility mouseup for that pointer, so the capture-phase window mouseup listener in workspace-shortcut-ipc-bridge.ts will not also switch workspace history. The untouched handleRemotePointerUp is harmless here because getRemoteBrowserMouseButton returns null for buttons 3/4 and the handler early-returns.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
|
Latest commit (0691180) also covers remote (streamed) browser panes: the side buttons now go back/forward in the remote page instead of switching workspace. Tested on Linux with a remote project. |
3af118b to
0691180
Compare
There was a problem hiding this comment.
ℹ️ No critical issues — one minor test-isolation suggestion inline.
Reviewed changes
Re-reviewed the commit added since the prior pullfrog review of 0691180. 3af118b adds tests for the side-button paths and makes one supporting change to the local-guest routing guard.
- Added side-button tests for the workspace shortcut bridge (buttons 3/4 walk worktree history; other buttons and non-terminal views are ignored).
- Added side-button tests for the local browser guest (
history.go(-1|1)on buttons 3/4, page cancellation honored) and for the remote pane (side buttons route to remotebrowser.back/browser.forwardand suppress the workspace switch; ordinary pointer-downs still forward). - Widened the guest
mouseupguard fromevent.isTrustedtoevent.isTrusted || state.allowUntrustedEvents, mirroring the existingclicklistener so synthetic test events reach the handler. Production emits three arguments frombuildBrowserClickedLinkRoutingScript, soallowUntrustedEventsstays false and the guard change is a no-op outside tests.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Re-reviewed after the branch was force-pushed back to 0691180 while the previous review was in flight. The test commit (3af118b) was removed, leaving the three production files already reviewed in pullfrog review #5416220297; the inline test-isolation note raised against that transient test file was withdrawn and its thread resolved, since the file no longer exists.
- Removed the side-button test additions and the accompanying
allowUntrustedEventsguard widening;browser-clicked-link-routing.tsis back to theevent.isTrusted-only guard. remote-browser-page-pane.tsxandworkspace-shortcut-ipc-bridge.tsare unchanged from the previously approved revision.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

Binds the mouse back/forward buttons to the same function the existing keyboard shortcut already uses for switching workspaces. Over a web view, local or remote, they go back/forward in that page instead.
Minimal for Linux and Windows and does the job well. macOS swipes (trackpad and Logitech Options+) are handled standalone in #25592.
Workspace history is the same one the existing keyboard shortcut uses (⌘⌥←/→ on macOS, Ctrl+Alt+←/→ on Linux/Windows). The two PRs share no code and can merge in either order.
EDIT: Side buttons over a remote (streamed) web page now go back/forward in that page instead of switching workspace (0691180).
ELI5
The mouse back/forward buttons now switch workspaces, just like the existing keyboard shortcut. Over a web page they go back/forward in that page instead.
What Changed
A window
mouseuplistener sends buttons 3/4 to the existing workspace back/forward handler. Inside a local web page, the script Orca already injects callshistory.go. Over a remote web page, the pane runs the same remote back/forward the keyboard shortcut uses and cancels the press, so the workspace doesn't switch.Why
Each input is handled where it arrives and reuses existing navigation; no new state or settings.
Linked Issue
Fixes #25633
Related: #25592, #23255
Visual Proof
N/A — no UI change; existing workspace navigation gets a second input.
Testing
Test N/A: short code; a broken case is instantly visible.
AI Disclosure
Claude Opus 5.5 (Claude Code).
Review
N/A
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
N/A — renderer-only input listener; no SSH, mobile, security, performance or compatibility impact.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)