You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(browser): hover, drag, modifier clicks, cursor and link bubble on Server pages - #47119
A Server page in Orca's browser is a live picture of a page running on the paired server, and your mouse is relayed to it. Until now only clicks were relayed. Hover menus never opened, sliders and maps jumped from where you pressed to where you let go, Cmd/Ctrl+click opened the link in place, the cursor was always an arrow, and no link address showed at the bottom. All of these now work the way they do on a local page.
Files
Added
Deleted
Net
Test
0
0
0
0
Prod
25
$\color{#1a7f37}{\Huge{\mathbf{+}}}$505
$\color{#cf222e}{\Huge{\mathbf{−}}}$147
$\color{#1a7f37}{\Huge{\mathbf{+}}}$358
What Changed
Hover and drag: the pane forwarded pointer moves only while the element picker was armed (handleRemotePointerMove: pagePointerOwned ? … : undefined). It now always forwards moves through the existing latest-wins hover lane: one move in flight and the newest one waiting, so a slow link sends fewer, newer points and doesn't build a backlog. The host already sends held buttons with each move (cdpPointerStateFor), so dragging a slider or panning a map follows the pointer. Leaving the frame sends one move off the page, so hover and the hovered link clear the way a local mouseleave does. The hover code moved into use-remote-browser-page-hover.ts.
Modifier clicks:browser.mouseDown and browser.mouseUp take an optional modifiers field (the same enum mouseClick already had; the schema now lives on MouseButton), and the bridge passes it to CDP. The pane sends the keys held during the press. Cmd (macOS) and Ctrl (Windows/Linux) are swapped when the client and server run different OSes, using the server's last-verified hostPlatform, so Cmd+click from a Mac still opens a background tab on a Linux server. Control+click on a Mac counts as a right click, as it does in a local page.
Cursor and link bubble: the host follows each guest's Electron cursor-changed and update-target-url events for the guest's whole life (browser-guest-pointer-watch.ts). A viewer that passes pointerEvents: 1 to browser.screencast receives the current state in ready.pointer, then { type: 'pointer', cursor, targetUrl } events whenever either changes. The pane maps Electron's cursor names to CSS (Electron calls the arrow pointer and the link hand hand) and mounts the same LinkStatusBubble that local pages use. That bubble is now split into a thin IPC wrapper for local guests and a prop-driven core.
Why
Each of these sends what the local browser already does over the paths that exist today. Moves reuse the hover lane, which keeps moves, presses and wheel in the order the user made them. Presses reuse the mouseClick modifier enum and CDP mask. The bubble is the local component, not a copy. Cursor and link state ride the screencast stream, which already carries page events (dialogs), so no polling or extra RPC is involved.
Alternatives I ruled out:
Throttling moves on a timer: it adds latency on fast links and still floods slow ones. The one-in-flight lane adapts to the link.
Sending every move while a button is held: on a slow link this queues behind itself and the drag lags further and further behind the pointer.
Polling the cursor with browser.eval: Chromium doesn't expose the cursor to the page.
Linked Issue
No issue. This comes from the remote browser parity audit (gaps M11, M12 and NEW-srv-drag).
Visual Proof
Paired desktop client showing a Server page on a headless orca serve, captured from a hidden build over CDP.
Hovering the link. Before, no bubble. After, the bubble shows the link's address in the bottom-left corner:
Before
After
Hovering a CSS :hover menu. Before, it stays closed. After, "Item" shows:
Before
After
After, as a recording: hover, leaving the frame, the menu, a slider drag that follows the pointer, and Cmd+click. The OS cursor isn't drawn in a hidden window.
streamed-input-after.mp4
Testing
I ran a real paired setup from this branch on macOS: a worktree-built headless serve, a hidden Electron client paired to it, and a Server-placed page. I drove it with Playwright over CDP, using a scratch spec built from the paired-runtime e2e helpers, not committed. The page logs input and mousedown events.
Check
main
This branch
Link :hover while hovering it
false
true
Frame cursor over link / over text
default / default
pointer / text
Link bubble
none
shows the URL, fades on leave
Link :hover after leaving the frame
n/a
false
CSS hover menu
closed
open
Slider value halfway through a 10-step drag
0
50
Slider input events during the drag
[100]
[10, 20, …, 100]
Cmd+click on a link: page metaKey, host tabs, client tab
No unit test added. The change is relayed input and stream wiring, proved end to end. The Cmd/Ctrl swap was checked in a review probe: Mac→Linux sends ctrl, Linux→Mac sends cmd, an unknown host sends the keys as pressed.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Every added test fails without this change and avoids the test anti-patterns
Performance
Moves over a Server page are now relayed all the time, not only while the picker is armed. That is one browser.mouseMove RPC at a time per pane, with newer moves replacing older ones while it waits, so the rate is capped at one per round trip. Cursor and link updates are small stream events, sent only when the value changes and only to viewers that ask for them. The bubble re-renders only while a link is hovered (memoized wrapper, pointer refresh at most every 100 ms, as local does).
Risk
Level: Medium
The riskiest part is that every hover now reaches the server page. A person's moves update the same tracked CDP pointer position that an agent's separate mouse move / mouse down CLI calls rely on. So if an agent drives a page with raw low-level mouse steps while someone hovers the same page, the agent's next press can land at the person's point. Ref-based click and mouseClick carry their own coordinates and are unaffected. A viewer's click already did this before this PR.
Version skew:
Newer desktop with an older server: the server's schema drops pointerEvents and modifiers. Hover and drag still work (mouseMove already existed), the cursor stays an arrow, there's no bubble, and modifier clicks arrive plain, as today.
Older desktop with a newer server: it never asks for pointer events and sends no modifiers, so nothing changes for it.
Phones don't opt in, and mobile/ is unchanged.
To back it out, a plain revert.
AI Disclosure
Review
One review round (Codex and a Claude subagent). Fixed: pointer leave now clears hover and the bubble, guest cursor state now survives a stream restart, and the bubble's pointer is seeded from the last move. Not fixed: the per-guest pointer state that agent and person moves share (see Risk; follow-up), and the external-Chromium provider dropping mouseDown/mouseUp modifiers instead of refusing them (a plain press is the same degradation an older server gives).
Agent skill upstream boundary
Not applicable, or this change 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-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
Security: the cursor goes through an allowlist before it becomes a CSS value, and the link address is rendered as text.
Cross-platform: Cmd/Ctrl are swapped by OS, and Mac Control+click is treated as a right click. Keyboard chords are still sent as pressed (not changed here).
SSH and This-device pages are unchanged. orcad's Electron sidecar shares this code.
Checklist
This PR is small and focused
I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
I stated the risk: what could break, for whom, and how to back it out
Before/after screenshots or videos attached for UI changes, or N/A with reason
Self-reviewed for correctness, security, and performance
Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)
…nk bubble
Streamed pages sent pointer moves only while the element picker was armed and
dropped modifiers from presses, so hover menus never opened, drags jumped from
press to release and Cmd/Ctrl+click navigated in place. The host also never
reported the page's cursor or hovered link.
Forward every pointer move through the latest-wins hover lane, add modifiers to
mouseDown/mouseUp, and let viewers that ask with pointerEvents: 1 receive the
guest's cursor and target URL on the screencast stream. The pane draws the
cursor and mounts the local link status bubble.
Screencast streams now carry optional guest cursor and hovered-link data to remote browser views. The renderer displays the reported cursor and link target, and forwards remote pointer movement and leave events. Mouse-down and mouse-up commands now pass modifier keys through to CDP. Remote input maps modifiers for the host platform and handles macOS Control-clicks as right-button presses.
Merge Risk: Low · up to 301ae
Server-page hover, cursor, link bubble and modifier clicks should work as described. Two small visual glitches remain: the first stream may briefly show the default cursor or no link, and the link bubble may stay in the corner under the pointer after fast movement. Both are cosmetic and are worth fixing before or soon after merge.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: making hover, drag, modifier clicks, cursor, and link bubble work on Server (remote) browser pages. The changeset covers each of these areas, including pointer forward…
Description check
The description follows the repository template closely. It has ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, Performance, Risk, AI Disclosure, Review, Agent skill boundary, Notes, and…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the main change: making hover, drag, modifier clicks, cursor, and link bubble work on Server (remote) browser pages. The changeset covers each of these areas, including pointer forwarding, modifier masks on mouseDown/mouseUp, cursor mapping, and the link status bubble. The title is specific and follows conventional commit style. It runs about 82 characters, which is slightly long but acceptable.
Full details: Description check
Explanation
The description follows the repository template closely. It has ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, Performance, Risk, AI Disclosure, Review, Agent skill boundary, Notes, and Checklist sections. Each section has substantive content. The author explains the mechanism, alternatives considered, version-skew risks, and rollback path. Gaps: the Linked Issue section says no issue exists, which the template says should always be present for outside contributors. The Risk level is set. The AI Disclosure section is empty. The final lint/typecheck/test/build checklist item is unchecked, and the Testing section does not state which platforms were tested beyond macOS.
Resolution
Optional: link an issue or explain why none applies, fill in the AI Disclosure section if applicable, and either run pnpm lint, typecheck, test and build or state that CI will cover them.
Finishing Touches
Fix failing CI checks
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Minor · Functional Correctness · Quick win
Record guest pointer state before the first stream starts.
Pointer observation starts only on the first watchGuestPointer call. In the current code, that call runs when a page screencast becomes active (browser-screencasts.ts:93), and it is the only call site in src. Cursor and link changes that occur before then are not recorded. A stream that starts later can therefore report the default cursor and no hovered link. The viewer stays wrong until the next change event, which contradicts the file's stated intent at browser-guest-pointer-watch.ts:9-10.
Start observation before any stream can start. Call followGuestPointer(guest) when the guest is created, or at another point before the first screencast subscriber. The record then lives for the guest's lifetime, as the WeakMap design intends.
The reason will be displayed to describe this comment to others. Learn more.
Minor · Functional Correctness · Quick win
Publish the final pointer position after throttling.
If the pointer moves again within 100 ms and then stops, this branch never publishes that final position. With the same link still targeted, the URL effect does not publish it either. The bubble can remain in the bottom-left corner under the pointer indefinitely.
Schedule a trailing refresh from lastPointerRef. Preserve the refresh interval and cancel the pending timer during cleanup.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ELI5
A Server page in Orca's browser is a live picture of a page running on the paired server, and your mouse is relayed to it. Until now only clicks were relayed. Hover menus never opened, sliders and maps jumped from where you pressed to where you let go, Cmd/Ctrl+click opened the link in place, the cursor was always an arrow, and no link address showed at the bottom. All of these now work the way they do on a local page.
What Changed
handleRemotePointerMove: pagePointerOwned ? … : undefined). It now always forwards moves through the existing latest-wins hover lane: one move in flight and the newest one waiting, so a slow link sends fewer, newer points and doesn't build a backlog. The host already sends held buttons with each move (cdpPointerStateFor), so dragging a slider or panning a map follows the pointer. Leaving the frame sends one move off the page, so hover and the hovered link clear the way a local mouseleave does. The hover code moved intouse-remote-browser-page-hover.ts.browser.mouseDownandbrowser.mouseUptake an optionalmodifiersfield (the same enummouseClickalready had; the schema now lives onMouseButton), and the bridge passes it to CDP. The pane sends the keys held during the press. Cmd (macOS) and Ctrl (Windows/Linux) are swapped when the client and server run different OSes, using the server's last-verifiedhostPlatform, so Cmd+click from a Mac still opens a background tab on a Linux server. Control+click on a Mac counts as a right click, as it does in a local page.cursor-changedandupdate-target-urlevents for the guest's whole life (browser-guest-pointer-watch.ts). A viewer that passespointerEvents: 1tobrowser.screencastreceives the current state inready.pointer, then{ type: 'pointer', cursor, targetUrl }events whenever either changes. The pane maps Electron's cursor names to CSS (Electron calls the arrowpointerand the link handhand) and mounts the sameLinkStatusBubblethat local pages use. That bubble is now split into a thin IPC wrapper for local guests and a prop-driven core.Why
Each of these sends what the local browser already does over the paths that exist today. Moves reuse the hover lane, which keeps moves, presses and wheel in the order the user made them. Presses reuse the
mouseClickmodifier enum and CDP mask. The bubble is the local component, not a copy. Cursor and link state ride the screencast stream, which already carries page events (dialogs), so no polling or extra RPC is involved.Alternatives I ruled out:
browser.eval: Chromium doesn't expose the cursor to the page.Linked Issue
No issue. This comes from the remote browser parity audit (gaps M11, M12 and NEW-srv-drag).
Visual Proof
Paired desktop client showing a Server page on a headless
orca serve, captured from a hidden build over CDP.Hovering the link. Before, no bubble. After, the bubble shows the link's address in the bottom-left corner:
Hovering a CSS
:hovermenu. Before, it stays closed. After, "Item" shows:After, as a recording: hover, leaving the frame, the menu, a slider drag that follows the pointer, and Cmd+click. The OS cursor isn't drawn in a hidden window.
streamed-input-after.mp4
Testing
I ran a real paired setup from this branch on macOS: a worktree-built headless serve, a hidden Electron client paired to it, and a Server-placed page. I drove it with Playwright over CDP, using a scratch spec built from the paired-runtime e2e helpers, not committed. The page logs
inputandmousedownevents.main:hoverwhile hovering it:hoverafter leaving the frameinputevents during the drag[100][10, 20, …, 100]metaKey, host tabs, client tabFocused:
remote-browser-stream-lifecycle.test.ts(21 passed).pnpm check:changedpassed.No unit test added. The change is relayed input and stream wiring, proved end to end. The Cmd/Ctrl swap was checked in a review probe: Mac→Linux sends
ctrl, Linux→Mac sendscmd, an unknown host sends the keys as pressed.I manually tested these changes locally
Automated tests added/updated, or explained why not below
Every added test fails without this change and avoids the test anti-patterns
Performance
Moves over a Server page are now relayed all the time, not only while the picker is armed. That is one
browser.mouseMoveRPC at a time per pane, with newer moves replacing older ones while it waits, so the rate is capped at one per round trip. Cursor and link updates are small stream events, sent only when the value changes and only to viewers that ask for them. The bubble re-renders only while a link is hovered (memoized wrapper, pointer refresh at most every 100 ms, as local does).Risk
Level: Medium
The riskiest part is that every hover now reaches the server page. A person's moves update the same tracked CDP pointer position that an agent's separate
mouse move/mouse downCLI calls rely on. So if an agent drives a page with raw low-level mouse steps while someone hovers the same page, the agent's next press can land at the person's point. Ref-basedclickandmouseClickcarry their own coordinates and are unaffected. A viewer's click already did this before this PR.Version skew:
pointerEventsandmodifiers. Hover and drag still work (mouseMovealready existed), the cursor stays an arrow, there's no bubble, and modifier clicks arrive plain, as today.mobile/is unchanged.To back it out, a plain revert.
AI Disclosure
Review
One review round (Codex and a Claude subagent). Fixed: pointer leave now clears hover and the bubble, guest cursor state now survives a stream restart, and the bubble's pointer is seeded from the last move. Not fixed: the per-guest pointer state that agent and person moves share (see Risk; follow-up), and the external-Chromium provider dropping mouseDown/mouseUp modifiers instead of refusing them (a plain press is the same degradation an older server gives).
Agent skill upstream boundary
Notes
Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)