Repository navigation
Conversation
…Forward Claim side buttons on pointer events with press-origin tracking, treat the annotation overlay as page content, queue remote page history behind pending input, handle ensureRemotePage failures, and rename the shared guest mouse slot.
…ward e2e Seed navigable worktree and host-document history so isolation checks can fail, cover a divider that cancels pointerdown, and drop the store type assertion.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (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. 📝 WalkthroughWalkthroughThe change adds Back and Forward mouse-button handling for guest browser pages, app-shell worktree history, and remote browser pages. Guest events are forwarded to the renderer, while app-shell and remote-page handlers distinguish browser-page input from worktree navigation. The remote input hook captures side-button presses and queues navigation on matching releases. Navigation setup errors now produce pane notices. Unit and end-to-end tests cover routing, event cancellation, cleanup, and history behavior. Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to This change routes mouse Back and Forward buttons to the right target. I found no concrete merge-blocking issue in the selected changes. Physical side-button hardware testing is still unreported, so a quick manual check is worthwhile. 🚥 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:
66e9b6c0-53bc-4513-807d-94bbfab82d72
📒 Files selected for processing (22)
src/main/browser/browser-guest-mouse-history.test.tssrc/main/browser/browser-guest-mouse-history.tssrc/main/browser/browser-manager-bindings.tssrc/main/browser/browser-manager-destroyed-guest-test-fixture.tssrc/main/browser/browser-manager-registration.tssrc/main/browser/browser-manager-state.tssrc/renderer/src/app-shell/app-command-handlers-worktree-history.test.tssrc/renderer/src/app-shell/mouse-history-buttons.test.tssrc/renderer/src/app-shell/mouse-history-buttons.tssrc/renderer/src/app-shell/use-global-keybindings.tssrc/renderer/src/components/browser-pane/stream-remote/remote-browser-page-input-model.test.tssrc/renderer/src/components/browser-pane/stream-remote/remote-browser-page-input-model.tssrc/renderer/src/components/browser-pane/stream-remote/remote-browser-page-pane.tsxsrc/renderer/src/components/browser-pane/stream-remote/remote-browser-page-viewport.tsxsrc/renderer/src/components/browser-pane/stream-remote/use-remote-browser-page-input.test.tsxsrc/renderer/src/components/browser-pane/stream-remote/use-remote-browser-page-input.tssrc/renderer/src/components/browser-pane/stream-remote/use-remote-browser-page-navigation-failure.test.tssrc/renderer/src/components/browser-pane/stream-remote/use-remote-browser-page-navigation.tssrc/renderer/src/lib/browser-page-surface.tstests/e2e/browser-mouse-back-forward.spec.tstests/e2e/helpers/host-history-probe.tstests/e2e/workspace-back-forward-navigation.spec.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.
- Remote browser frame keeps a side-button press with the surface it started on: capture the pointer on press, navigate only on the matching release, and drop the press when capture is lost.
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:
07239173-8020-4b37-b99e-04986c6e7f72
📒 Files selected for processing (7)
src/renderer/src/components/browser-pane/stream-remote/remote-browser-page-pane.address-bar.test.tsxsrc/renderer/src/components/browser-pane/stream-remote/remote-browser-page-pane.chrome-chords.test.tsxsrc/renderer/src/components/browser-pane/stream-remote/remote-browser-page-pane.tsxsrc/renderer/src/components/browser-pane/stream-remote/remote-browser-page-viewport.tsxsrc/renderer/src/components/browser-pane/stream-remote/use-remote-browser-page-input.test.tsxsrc/renderer/src/components/browser-pane/stream-remote/use-remote-browser-page-input.tssrc/renderer/src/components/browser-pane/stream-remote/use-remote-browser-side-button-press.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.
- Handle a side button pressed or released while another button is held. That transition arrives as a chorded pointermove, so both the window listener and the remote frame now read side-button presses and releases from pointerdown, pointerup, and pointermove alike. The window listener also cancels the side-button mouseup, because cancelling a pointermove does not suppress the compat mouse events.
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:
e13c5f0e-c63c-420a-a6c1-3f00ab19ff7a
📒 Files selected for processing (11)
src/renderer/src/app-shell/mouse-history-buttons.test.tssrc/renderer/src/app-shell/mouse-history-buttons.tssrc/renderer/src/components/browser-pane/stream-remote/remote-browser-page-pane.address-bar.test.tsxsrc/renderer/src/components/browser-pane/stream-remote/remote-browser-page-pane.chrome-chords.test.tsxsrc/renderer/src/components/browser-pane/stream-remote/remote-browser-page-pane.tsxsrc/renderer/src/components/browser-pane/stream-remote/remote-browser-page-viewport.tsxsrc/renderer/src/components/browser-pane/stream-remote/use-remote-browser-page-input.test.tsxsrc/renderer/src/components/browser-pane/stream-remote/use-remote-browser-page-input.tssrc/renderer/src/components/browser-pane/stream-remote/use-remote-browser-side-button-press.tssrc/renderer/src/lib/side-button-transition.tstests/e2e/workspace-back-forward-navigation.spec.ts
🚧 Files skipped from review as they are similar to previous changes (3)
- tests/e2e/workspace-back-forward-navigation.spec.ts
- src/renderer/src/components/browser-pane/stream-remote/use-remote-browser-page-input.test.tsx
- src/renderer/src/app-shell/mouse-history-buttons.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
- Capture the pointer for a side button chorded with another button too, so its release over Orca chrome still reaches the remote frame.
…ack/Forward buttons
…ack/Forward buttons
ELI5
Your mouse's side buttons now work like the ← → buttons in Orca's title bar. Back takes you to the worktree or page you were on before, and Forward takes you back again. If the pointer is over a web page open inside Orca, the buttons go back and forward in that page instead.
What Changed
Before: Orca ignored mouse Back/Forward. In the web client, pressing Back could even take the browser tab away from Orca.
After:
Mod+Alt+←/→browser.back/forwardruntime callEach press moves exactly one step and never navigates Orca's own document. History still records only worktrees and pages, not tabs.
Mechanism:
pointerdown/pointerupwith button 3/4 cancels the browser's default action and calls the existingworktree.history.back/forwardcommand handlers, so it reuses their view gating. Whether a press goes to worktree history or to a web page depends on where it started, so a press that starts on a page and ends over Orca chrome stays with the page.<webview>pages need a main-process forwarder (browser-guest-mouse-history.ts). Chromium routes an unhandled side-button press to the outermost WebContents (WebContentsImpl::HandleMouseEvent→GetOutermostWebContents()), which is Orca's window, not the page under the pointer. The forwarder catches the press inbefore-mouse-eventand sends the existingui:browserHistoryNavigateIPC, which the Logitech keystroke remaps already use.Why
app-command:app-commandexists only on Windows and Linux, fires on both press and release on Linux ([Bug]: Linux: Double actions when handling app-command handlers: browser-backward and browser-forward #18322 electron/electron#32763), and fires at window level whatever the pointer is over, which would break page navigation inside embedded browsers.pointerdown. That suppresses the follow-upmousedown/mouseup, so a mouse-event listener would let the browser's default navigation through.Linked Issue
Related: #23255 (asks for rebindable mouse-button keybindings; this PR adds fixed history navigation, not rebinding)
Visual Proof
To be attached (needs a physical side-button mouse): before (side buttons do nothing) and after (Back/Forward switch worktrees; over an embedded page they navigate the page).
Testing
Automated:
pointerdown, a press that starts on one surface and ends on another, the annotation overlay, the guest forwarder, remote input ordering, and remote failure handling. The ordering, failure, and divider tests fail without their fixes.ORCA_BACKGROUND_LAUNCH=1, CDPInput.dispatchMouseEventwithbutton: 'back'/'forward':workspace-back-forward-navigation.spec.ts: one step per press, a double step is detectable, Settings does nothing.browser-mouse-back-forward.spec.ts: a local page navigates while worktree history stays put, and a host-side press over a webview changes nothing.browser-mouse-back-forward.spec.ts: Back over a split divider (which cancelspointerdown) still steps worktree history. This test fails on the earlier mouse-event version.pnpm tc(web/node), changed-code quality gate, oxlint: clean.src/main/browser/browser-manager-tab-identity.test.tsandbrowser-manager-viewport-ownership.test.tsfail; they fail identically on the base commit without this branch.Not yet verified: physical side-button mice on macOS, Windows, and Linux, and the web client in Firefox/Safari.
AI Disclosure
Planned, implemented, and reviewed with an AI coding agent (Claude Opus via pi). Code review used parallel Claude and GPT arms; all 7 findings were applied.
Review
Known limits, intentionally out of scope:
Mod+Alt+←/→shortcut already does.button: 'back' | 'forward'inbefore-mouse-event. Electron's converter does this, but its typings list only left/middle/right.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
Ensure no issues in: Security, Cross-platoform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
browser.back/forwardruntime RPC. No wire change.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)