Repository navigation
feat(browser): make Orca shortcuts, split focus and mouse back/forward buttons work inside pages - #31859
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
Walkthrough
Priority: Severity of issue fixed: Medium Merge Risk:
|
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
25d052a5-b66e-4a1f-a94c-74c41e14952b
📒 Files selected for processing: 54
src/main/browser/agent-input-injection.tssrc/main/browser/browser-guest-mouse-press.tssrc/main/browser/browser-guest-shortcut-dispatch.tssrc/main/browser/browser-guest-shortcut-forwarding.test.tssrc/main/browser/browser-guest-tab-shortcut.tssrc/main/browser/browser-guest-wheel-zoom-scroll.test.tssrc/main/browser/browser-guest-wheel-zoom.tssrc/main/browser/browser-manager-grab-shortcuts.test.tssrc/main/browser/browser-manager-guest-shortcuts.test.tssrc/main/browser/cdp-bridge-integration.test.tssrc/main/browser/guest-cdp-command.test.tssrc/main/browser/guest-cdp-command.tssrc/main/window/createMainWindow.tssrc/main/window/main-window-swipe-navigation.tssrc/preload/api/ui-bridge-state-and-menu-commands.tssrc/preload/api/ui-bridge-tab-and-browser-commands.tssrc/preload/api/ui-command-event-api.tssrc/renderer/src/components/browser-pane/ClientHostedBrowserPagePane.chrome-parity.test.tsxsrc/renderer/src/components/browser-pane/ClientHostedBrowserPagePane.test.tsxsrc/renderer/src/components/browser-pane/ClientHostedBrowserPagePane.tsxsrc/renderer/src/components/browser-pane/assemble-chrome/BrowserPaneOverlayLayer.test.tsxsrc/renderer/src/components/browser-pane/assemble-chrome/BrowserPaneOverlayLayer.tsxsrc/renderer/src/components/browser-pane/assemble-chrome/browser-deferred-lifecycle.test.tsxsrc/renderer/src/components/browser-pane/assemble-chrome/browser-page-pane.tsxsrc/renderer/src/components/browser-pane/assemble-chrome/use-browser-page-chrome-focus.test.tsxsrc/renderer/src/components/browser-pane/assemble-chrome/use-browser-page-chrome-focus.tssrc/renderer/src/components/browser-pane/client-hosted-browser-pane-test-rig.tssrc/renderer/src/components/browser-pane/host-guest/browser-page-screen-point.tssrc/renderer/src/components/browser-pane/host-guest/use-browser-page-keyboard-shortcuts.split.test.tsxsrc/renderer/src/components/browser-pane/host-guest/use-browser-page-webview-shortcuts.tssrc/renderer/src/components/browser-pane/host-guest/use-client-hosted-guest-activation-focus.tssrc/renderer/src/components/browser-pane/host-guest/use-webview-drag-passthrough-active.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.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/use-remote-browser-page-pointer-history.tssrc/renderer/src/hooks/ipc-events-agent-status-window-test-fixtures.tssrc/renderer/src/hooks/ipc-events-close-routing-test-harness.tssrc/renderer/src/hooks/ipc-events-terminal-create-scenario-types.tssrc/renderer/src/hooks/ipc-events-terminal-create-test-harness.tssrc/renderer/src/hooks/ipc-events-terminal-create-window-test-fixtures.tssrc/renderer/src/hooks/ipc-events/content-creation-ipc-bridge.tssrc/renderer/src/hooks/ipc-events/tab-lifecycle-ipc-bridge.test.tssrc/renderer/src/hooks/ipc-events/tab-lifecycle-ipc-bridge.tssrc/renderer/src/hooks/useIpcEvents-browser-tab-create.test.tssrc/renderer/src/hooks/useIpcEvents-cli-worktree-activation.test.tssrc/renderer/src/hooks/useIpcEvents-close-routing-browser-pages.test.tssrc/renderer/src/hooks/useIpcEvents-ssh-disconnect-cleanup.test.tssrc/renderer/src/hooks/useIpcEvents-terminal-create-surfacing.test.tssrc/renderer/src/hooks/useIpcEvents-updater-status.test.tssrc/renderer/src/lib/app-keyboard-router.tssrc/renderer/src/web/preload-api/web-ui-api.tssrc/shared/browser-page-command-target.ts
💤 Files with no reviewable changes: 5
- src/renderer/src/hooks/ipc-events/tab-lifecycle-ipc-bridge.test.ts
- src/preload/api/ui-bridge-state-and-menu-commands.ts
- src/renderer/src/components/browser-pane/host-guest/use-client-hosted-guest-activation-focus.ts
- src/renderer/src/hooks/ipc-events-terminal-create-scenario-types.ts
- src/renderer/src/hooks/ipc-events/content-creation-ipc-bridge.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.
abd6aa3 to
b0326b0
Compare
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
🟡 Minor · Forward repeated page-owned tab shortcuts. · browser-guest-shortcut-dispatch.ts:157-176
src/main/browser/browser-guest-shortcut-dispatch.ts:157-176
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winForward repeated page-owned tab shortcuts.
forwardGuestShortcutInputreturns beforematchesGuestTabShortcutwheninput.isAutoRepeatis true. For example,tab.previousRecentis a tab-scope shortcut bound toCtrl+Tab, and the matcher does not exclude repeats. The initialCtrl+Tabis forwarded, but held repeats are dropped.The forwarded payload also has no repeat field. Carry the state through the payload and set
KeyboardEvent.repeatin the renderer bridge.Suggested fix
--- a/src/main/browser/browser-guest-shortcut-dispatch.ts +++ b/src/main/browser/browser-guest-shortcut-dispatch.ts @@ if (input.isAutoRepeat) { if ( (action?.type === 'dictationKeyDown' && shouldForwardDictationShortcut?.()) || action?.type === 'deleteCurrentWorkspace' ) { event.preventDefault() return true } - return false + if ( + !matchesGuestTabShortcut( + input, + process.platform, + keybindings, + isMobileEmulatorEnabled?.() ?? true + ) + ) { + return false + } } @@ - const { key, code, alt, meta, control, shift, doubleTapModifier } = input + const { key, code, alt, meta, control, shift, doubleTapModifier, isAutoRepeat } = input const shortcut: BrowserPageTabShortcut = { key, code, alt, meta, control, shift, - doubleTapModifier + doubleTapModifier, + ...(isAutoRepeat !== undefined ? { isAutoRepeat } : {}) }--- a/src/shared/browser-page-command-target.ts +++ b/src/shared/browser-page-command-target.ts @@ export type BrowserPageTabShortcut = Pick< WindowShortcutInput, 'key' | 'code' | 'alt' | 'meta' | 'control' | 'shift' | 'doubleTapModifier' -> +> & { + isAutoRepeat?: boolean +}--- a/src/renderer/src/hooks/ipc-events/tab-lifecycle-ipc-bridge.ts +++ b/src/renderer/src/hooks/ipc-events/tab-lifecycle-ipc-bridge.ts @@ ctrlKey: input.control, shiftKey: input.shift, + repeat: input.isAutoRepeat ?? false, cancelable: true
🟡 Minor · Convert the cursor coordinates before subtracting… · browser-page-screen-point.ts:15-17
src/renderer/src/components/browser-pane/host-guest/browser-page-screen-point.ts:15-17
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winConvert the cursor coordinates before subtracting
window.screenX/Y.
screen.getCursorScreenPoint()returns DIP coordinates, whilewindow.screenX/Yare CSS-pixel coordinates. At non-default UI zoom, the current subtraction mixes units beforewindowDipToCssPxconverts the result. A swipe near the edge of an active webview can therefore miss the page and skip navigation.🐛 Suggested fix
- windowDipToCssPx(screenX - window.screenX), - windowDipToCssPx(screenY - window.screenY) + windowDipToCssPx(screenX) - window.screenX, + windowDipToCssPx(screenY) - window.screenY
🟡 Minor · Hit-test swipes against the streamed frame. · use-remote-browser-page-pointer-history.ts:39-41
src/renderer/src/components/browser-pane/stream-remote/use-remote-browser-page-pointer-history.ts:39-41
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winHit-test swipes against the streamed frame.
When the frame is letterboxed, the outer viewport also contains the gutter and overlays.
isBrowserPageAtScreenPoint(viewport, ...)can therefore trigger remote navigation outside the streamed frame. PassimageRefto the swipe hit test.Suggested fix
diff --git a/src/renderer/src/components/browser-pane/stream-remote/use-remote-browser-page-pointer-history.ts b/src/renderer/src/components/browser-pane/stream-remote/use-remote-browser-page-pointer-history.ts @@ isActive, remoteViewportRef, + remoteFrameRef, runRemoteNavigation }: { isActive: boolean remoteViewportRef: RefObject<HTMLDivElement | null> + remoteFrameRef: RefObject<HTMLImageElement | null> runRemoteNavigation: (method: RemoteHistoryMethod) => Promise<void> | void }): void { @@ } const unsubscribeSwipe = window.api.ui.onBrowserPageSwipe(({ direction, screenX, screenY }) => { - if (isBrowserPageAtScreenPoint(viewport, screenX, screenY)) { + const frame = remoteFrameRef.current + if (frame && isBrowserPageAtScreenPoint(frame, screenX, screenY)) { void runRemoteNavigation(direction === 'back' ? 'browser.back' : 'browser.forward') } }) @@ - }, [isActive, remoteViewportRef, runRemoteNavigation]) + }, [isActive, remoteFrameRef, remoteViewportRef, runRemoteNavigation]) } diff --git a/src/renderer/src/components/browser-pane/stream-remote/remote-browser-page-pane.tsx b/src/renderer/src/components/browser-pane/stream-remote/remote-browser-page-pane.tsx @@ - useRemoteBrowserPagePointerHistory({ isActive, remoteViewportRef, runRemoteNavigation }) + useRemoteBrowserPagePointerHistory({ + isActive, + remoteViewportRef, + remoteFrameRef: imageRef, + runRemoteNavigation + })
ℹ️ Review info
⚙️ Run configuration
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
f01a9e82-ed06-41af-8c8f-cdb78f4619ff
📒 Files selected for processing: 1
src/renderer/src/i18n/en-runtime-required.json
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.
b0326b0 to
74272d7
Compare
|
@coderabbitai on the three outside-diff comments from the last review: Forward repeated page-owned tab shortcuts. Partly holds. Repeats of an Orca tab chord were leaking to the page. In 74272d7 they're now claimed on every repeat, same as Orca's own handler, which claims held tab chords but switches once. I didn't forward them: the renderer ignores repeats for tab commands anyway. Ctrl+Tab isn't affected because the held switcher in Convert the cursor coordinates before subtracting Hit-test swipes against the streamed frame. Leaving as is. The gutter around a letterboxed frame is part of that page's pane, and the side-button listeners use the same viewport element. A swipe over the gutter goes back on that page, like a swipe anywhere in a Chrome tab's content area. Nothing else in the viewport is a different page that could be hit by mistake. |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -eu
fd -t f '^(browser-guest-shortcut-forwarding|browser-guest-shortcut-dispatch|browser-page-context-menu|browser-page-screen-point|use-remote-browser-page-pointer-history|browser-guest-shortcut-forwarding\.test)\.tsx?$' src
for file in \
src/main/browser/browser-guest-shortcut-forwarding.ts \
src/main/browser/browser-guest-shortcut-dispatch.ts \
src/renderer/src/components/browser/browser-page-context-menu.tsx \
src/renderer/src/components/browser-pane/host-guest/browser-page-screen-point.ts \
src/renderer/src/components/browser-pane/stream-remote/use-remote-browser-page-pointer-history.ts; do
printf '\n--- OUTLINE %s ---\n' "$file"
ast-grep outline "$file" || true
printf '\n--- SOURCE %s ---\n' "$file"
sed -n '1,260p' "$file"
done
rg -n -C4 'isAutoRepeat|repeat|held|Ctrl.Tab' src/main/browser/browser-guest-shortcut-forwarding.test.ts src/main/browser/browser-guest-shortcut-forwarding.tsLength of output: 17242 🏁 Script executed: #!/bin/bash
set -eu
for file in \
src/renderer/src/components/browser-pane/assemble-chrome/browser-page-context-menu.tsx \
src/renderer/src/components/browser-pane/host-guest/browser-page-screen-point.ts \
src/renderer/src/components/browser-pane/stream-remote/use-remote-browser-page-pointer-history.ts; do
printf '\n--- OUTLINE %s ---\n' "$file"
ast-grep outline "$file" || true
printf '\n--- SOURCE %s ---\n' "$file"
sed -n '1,240p' "$file"
done
rg -n -C5 'isAutoRepeat|repeat|held' src/main/browser/browser-guest-shortcut-forwarding.test.tsLength of output: 13686
You are interacting with an AI system. |
74272d7 to
e4696ac
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
3c951078-4615-4b3a-8c46-fdfe14c0f68c
📒 Files selected for processing: 9
src/main/browser/agent-input-injection.tssrc/main/browser/browser-guest-shortcut-dispatch.tssrc/main/browser/browser-guest-shortcut-forwarding.test.tssrc/main/browser/browser-guest-wheel-zoom.tssrc/main/browser/browser-manager-grab-shortcuts.test.tssrc/main/browser/browser-manager-guest-shortcuts.test.tssrc/main/browser/cdp-bridge-integration.test.tssrc/main/browser/guest-cdp-command.tssrc/renderer/src/i18n/en-runtime-required.json
🚧 Files skipped from review as they are similar to previous changes: 1
- src/renderer/src/i18n/en-runtime-required.json
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
e4696ac to
6d36998
Compare
6d36998 to
5afe0ad
Compare
5afe0ad to
03e18c1
Compare
338 commits landed on main between dbde821 and fd25eb0. All seven catalogs and en-runtime-required.json conflicted, so they are taken from main and the prune is recomputed in one pass: the previous 1,633 keys plus 4, none left the set. stablyai#32971 dropped the readers of settings.agents.loadingHost and permissionChoiceDescription, stablyai#32334 the reader of permissionEachOwnDescription, and stablyai#31859 the reader of auto.hooks.useIpcEvents.56d3ec4203. The two permission descriptions exist only in en.json, so en.json sheds 1,637 and the other six catalogs 1,635. en.json goes from 17,143 entries to 15,506; en-runtime-required.json keeps 643 of them. catalog-nested-settings.test.ts listed loadingHost among the agent settings it checks across catalogs; with its last reader gone, the key comes off that list and the test checks the other ten. native-chat-shared-copy-matches-catalog.test.ts merged cleanly again and still differs from main by exactly the branch's edit.
…eat param, keybinding title - stablyai#31859 deleted the ui:newBrowserTab channel with its last listener; the voice navigate_ui new-browser-tab verb rode it. Restored the lane (optional bridge method, content-creation subscriber). - Main made PreambleParams.heartbeatIntervalMinutes required: voice dispatches pass null — they report through the mailbox reply pump. - Main's StaticKeybindingActionId title record needs a voice.control entry; added with all six catalogs. Co-Authored-By: Claude Code <[email protected]>
…eat param, keybinding title - stablyai#31859 deleted the ui:newBrowserTab channel with its last listener; the voice navigate_ui new-browser-tab verb rode it. Restored the lane (optional bridge method, content-creation subscriber). - Main made PreambleParams.heartbeatIntervalMinutes required: voice dispatches pass null — they report through the mailbox reply pump. - Main's StaticKeybindingActionId title record needs a voice.control entry; added with all six catalogs. Co-Authored-By: Claude Code <[email protected]>
…eat param, keybinding title - stablyai#31859 deleted the ui:newBrowserTab channel with its last listener; the voice navigate_ui new-browser-tab verb rode it. Restored the lane (optional bridge method, content-creation subscriber). - Main made PreambleParams.heartbeatIntervalMinutes required: voice dispatches pass null — they report through the mailbox reply pump. - Main's StaticKeybindingActionId title record needs a voice.control entry; added with all six catalogs. Co-Authored-By: Claude Code <[email protected]>
…eat param, keybinding title - stablyai#31859 deleted the ui:newBrowserTab channel with its last listener; the voice navigate_ui new-browser-tab verb rode it. Restored the lane (optional bridge method, content-creation subscriber). - Main made PreambleParams.heartbeatIntervalMinutes required: voice dispatches pass null — they report through the mailbox reply pump. - Main's StaticKeybindingActionId title record needs a voice.control entry; added with all six catalogs. Co-Authored-By: Claude Code <[email protected]>
…eat param, keybinding title - stablyai#31859 deleted the ui:newBrowserTab channel with its last listener; the voice navigate_ui new-browser-tab verb rode it. Restored the lane (optional bridge method, content-creation subscriber). - Main made PreambleParams.heartbeatIntervalMinutes required: voice dispatches pass null — they report through the mailbox reply pump. - Main's StaticKeybindingActionId title record needs a voice.control entry; added with all six catalogs. Co-Authored-By: Claude Code <[email protected]>
…eat param, keybinding title - stablyai#31859 deleted the ui:newBrowserTab channel with its last listener; the voice navigate_ui new-browser-tab verb rode it. Restored the lane (optional bridge method, content-creation subscriber). - Main made PreambleParams.heartbeatIntervalMinutes required: voice dispatches pass null — they report through the mailbox reply pump. - Main's StaticKeybindingActionId title record needs a voice.control entry; added with all six catalogs. Co-Authored-By: Claude Code <[email protected]>
…eat param, keybinding title - stablyai#31859 deleted the ui:newBrowserTab channel with its last listener; the voice navigate_ui new-browser-tab verb rode it. Restored the lane (optional bridge method, content-creation subscriber). - Main made PreambleParams.heartbeatIntervalMinutes required: voice dispatches pass null — they report through the mailbox reply pump. - Main's StaticKeybindingActionId title record needs a voice.control entry; added with all six catalogs. Co-Authored-By: Claude Code <[email protected]>
…eat param, keybinding title - stablyai#31859 deleted the ui:newBrowserTab channel with its last listener; the voice navigate_ui new-browser-tab verb rode it. Restored the lane (optional bridge method, content-creation subscriber). - Main made PreambleParams.heartbeatIntervalMinutes required: voice dispatches pass null — they report through the mailbox reply pump. - Main's StaticKeybindingActionId title record needs a voice.control entry; added with all six catalogs. Co-Authored-By: Claude Code <[email protected]>
…eat param, keybinding title - stablyai#31859 deleted the ui:newBrowserTab channel with its last listener; the voice navigate_ui new-browser-tab verb rode it. Restored the lane (optional bridge method, content-creation subscriber). - Main made PreambleParams.heartbeatIntervalMinutes required: voice dispatches pass null — they report through the mailbox reply pump. - Main's StaticKeybindingActionId title record needs a voice.control entry; added with all six catalogs. Co-Authored-By: Claude Code <[email protected]>
…eat param, keybinding title - stablyai#31859 deleted the ui:newBrowserTab channel with its last listener; the voice navigate_ui new-browser-tab verb rode it. Restored the lane (optional bridge method, content-creation subscriber). - Main made PreambleParams.heartbeatIntervalMinutes required: voice dispatches pass null — they report through the mailbox reply pump. - Main's StaticKeybindingActionId title record needs a voice.control entry; added with all six catalogs. Co-Authored-By: Claude Code <[email protected]>
…eat param, keybinding title - stablyai#31859 deleted the ui:newBrowserTab channel with its last listener; the voice navigate_ui new-browser-tab verb rode it. Restored the lane (optional bridge method, content-creation subscriber). - Main made PreambleParams.heartbeatIntervalMinutes required: voice dispatches pass null — they report through the mailbox reply pump. - Main's StaticKeybindingActionId title record needs a voice.control entry; added with all six catalogs. Co-Authored-By: Claude Code <[email protected]>
…eat param, keybinding title - stablyai#31859 deleted the ui:newBrowserTab channel with its last listener; the voice navigate_ui new-browser-tab verb rode it. Restored the lane (optional bridge method, content-creation subscriber). - Main made PreambleParams.heartbeatIntervalMinutes required: voice dispatches pass null — they report through the mailbox reply pump. - Main's StaticKeybindingActionId title record needs a voice.control entry; added with all six catalogs. Co-Authored-By: Claude Code <[email protected]>
…eat param, keybinding title - stablyai#31859 deleted the ui:newBrowserTab channel with its last listener; the voice navigate_ui new-browser-tab verb rode it. Restored the lane (optional bridge method, content-creation subscriber). - Main made PreambleParams.heartbeatIntervalMinutes required: voice dispatches pass null — they report through the mailbox reply pump. - Main's StaticKeybindingActionId title record needs a voice.control entry; added with all six catalogs. Co-Authored-By: Claude Code <[email protected]>
…eat param, keybinding title - stablyai#31859 deleted the ui:newBrowserTab channel with its last listener; the voice navigate_ui new-browser-tab verb rode it. Restored the lane (optional bridge method, content-creation subscriber). - Main made PreambleParams.heartbeatIntervalMinutes required: voice dispatches pass null — they report through the mailbox reply pump. - Main's StaticKeybindingActionId title record needs a voice.control entry; added with all six catalogs. Co-Authored-By: Claude Code <[email protected]>
…eat param, keybinding title - stablyai#31859 deleted the ui:newBrowserTab channel with its last listener; the voice navigate_ui new-browser-tab verb rode it. Restored the lane (optional bridge method, content-creation subscriber). - Main made PreambleParams.heartbeatIntervalMinutes required: voice dispatches pass null — they report through the mailbox reply pump. - Main's StaticKeybindingActionId title record needs a voice.control entry; added with all six catalogs. Co-Authored-By: Claude Code <[email protected]>
…eat param, keybinding title - stablyai#31859 deleted the ui:newBrowserTab channel with its last listener; the voice navigate_ui new-browser-tab verb rode it. Restored the lane (optional bridge method, content-creation subscriber). - Main made PreambleParams.heartbeatIntervalMinutes required: voice dispatches pass null — they report through the mailbox reply pump. - Main's StaticKeybindingActionId title record needs a voice.control entry; added with all six catalogs. Co-Authored-By: Claude Code <[email protected]>
ELI5
When you click into a web page in Orca's browser, the page takes the keyboard and Orca loses track of where you are. Cmd+Shift+T did nothing, Ctrl+Tab switched tabs in the wrong split, switching to a browser tab didn't let you type into it, and the mouse back/forward buttons did nothing. Now a page behaves like the rest of Orca, and like Chrome.
What Changed
Keys with a page focused: one rule. With a page focused, Orca takes its tab shortcuts (every
tabs-scope keybinding: new/close/reopen/close-all/switch/new agent tab), the browser commands it already took (find, reload, back/forward, address bar), and the app actions it already takes over a focused terminal (palette, quick open, workspaces, history, zoom). The page keeps everything else: text editing, its own shortcuts, and Orca's panel toggles like Mod+B (bold in web editors) and Mod+Shift+Up/Down (text selection).browser-guest-shortcut-dispatch.tskept a hand-written list of tab actions, plus seven guest-only IPC channels whose renderer handlers had drifted from the real ones. That list had missed reopen-closed, close-all and new-agent.tabs-scope chord and sends it as oneui:browserPageTabShortcut. The renderer replays it through the app keyboard router, so it runs the same owners as a key pressed in Orca's own UI, floating panel included. The seven channels (newTerminalTab,newBrowserTab,newMarkdownTab,newSimulatorTab,switchTab,switchTabAcrossAllTypes,switchTerminalTab) and their renderer bridges are deleted.Clicking a page makes its split active (#22144). A press inside a page never reaches the embedder's DOM (the webview
focusevent fires unreliably and never asfocusin), so main now reports each press from the guest'sbefore-mouse-event(ui:browserPagePointerDown) and the overlay layer focuses that page's group. Ctrl+Tab, Cmd+W and the new-tab shortcuts then act on the split you're in.Switching to a browser tab focuses the page (#20533). The once-per-activation rule that only client-hosted panes had moves into the shared
useBrowserPageChromeFocus, so local, client-hosted and streamed pages all get it. It only fires when the page's split is the focused one, a new blank tab still lands in the address bar, a tab drag defers it, a phone-driven page is left alone, and a late-attaching guest never takes focus the user has since moved.Mouse back/forward buttons navigate the page under the pointer.
button: 'back' | 'forward'from the guest'sbefore-mouse-event(Electron reports these at runtime though its typing doesn't list them) and sends the existingui:browserHistoryNavigateon release. Streamed pages map DOM buttons 3/4 to the remote back/forward RPC and claim the press so the paired web client's own browser doesn't also go back.Input.*CDP command an agent or a remote viewer sends now goes throughsendGuestCdpCommandmarked as agent input, so agent clicks can't move the desktop user's split or history.Why
The guest dispatch was a second, incomplete copy of the renderer's tab-shortcut owner. Making the rule "tab-scope keybindings go to Orca" and replaying them into the real owner fixes the whole class at once, including future tab actions and user-bound agent shortcuts, and removes code.
Design
Two blind design-challenge rounds before building; three Codex review rounds after.
Chosen
scope, replayed through the app keyboard router (not one IPC per shortcut, not a synthetic DOM event ondocument.activeElement).focuslistener on the webview; it passed unit tests but failed in the live app, where the embedder often gets no focus event for a click into a page.Ruled out
before-input-eventruns before the page, and there's no "page didn't handle it" hook at this layer. Unhandled guest keys do reach the embedder's menu accelerators after the page, which might be a way to build it; I haven't verified that.'swipe'for three-finger swipes, and the macOS default is two fingers, so a'swipe'handler did nothing on most Macs. ChatGPT.app gets two-finger swipes and the side arrows from native code in its Chromium fork (Chrome'sHistorySwiperplus its ownOwlHistorySwipeOverlayView, driven by a customBrowserWindow.setHistorySwipeNavigationState). Stock Electron has neither. Doing it here means a small native addon that tracks the gesture with AppKit'strackSwipeEventWithOptions, a check that the page can't scroll further sideways, and an arrow overlay. That's a follow-up.MouseBack/MouseForward): that's [Feature]: Support mouse buttons (Back/Forward) in keybindings #23255's feature and has its own reland (Reland mouse Back/Forward shortcuts, stored where a downgrade can't drop them #23787). Support mouse Back/Forward buttons in shortcuts #23287 was reverted for a keybinding-storage downgrade bug, not for input handling.Open questions for Kelvin
owned-targetscope. Same as main today.handleNewTabas Mod+T from Orca's UI. The deleted guest-only bridge refused an ambiguous "twin" workspace (fix(renderer): destructive host callers refuse an ambiguous owner instead of reading it as local #30035); the shared owner treats a twin as local. Should the shared owner refuse too?Linked Issue
Fixes #22144
Fixes #20533
Fixes #25633
Visual Proof
Hidden dev build driven over CDP. Keys go through
webview.sendInputEvent(main's realbefore-input-eventpath), and side buttons are CDP mouse events on the guest (main's realbefore-mouse-event). BEFORE for flow 4 is currentorigin/main; the captions read live store/DOM state.1. Click into a page in the right split, then Ctrl+Tab
before-1-split-click.mp4
after-1-split-click.mp4
Dark theme: https://github.com/user-attachments/assets/2f71caf2-5a78-467c-862e-3060a44a0c76
2. Cmd+W then Cmd+Shift+T from inside a page
before-2-reopen-closed.mp4
after-2-reopen-closed.mp4
3. Switch to a browser tab from the tab strip, then type
before-3-tab-strip-focus.mp4
after-3-tab-strip-focus.mp4
4. Mouse back/forward buttons over a page
before-4-mouse-buttons.mp4
after-4-mouse-buttons.mp4
Testing
Focused tests cover: tab chords replayed by the guest (incl. Cmd+Shift+T and double-tap bindings) and editing chords left to the page; press → split activation; side buttons on release and agent presses ignored; agent
Input.*marked at the CDP gate; activation focus, its split/lock/late-guest guards; streamed-page side buttons. Tests for the seven deleted channels were updated or removed with them. Not tested here: Windows/Linux (CI), a real trackpad, a real Logitech mouse.AI Disclosure
Review
Agent skill upstream boundary
Notes
browser-link-openingandbrowser-history-controls.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)