Repository navigation
fix(browser): restore hover after leaving a mobile viewport preset - #22846
Conversation
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Viewport touch reset (the fix) —
browser-manager-viewport.tsnow sends{ enabled: false }(nomaxTouchPoints) when leaving a mobile preset, via a sharedTOUCH_EMULATION_DISABLEDconst used by both the desktop-preset and no-preset branches. Mobile still sends{ enabled: true, maxTouchPoints: 5 }. - Stricter shared test mock —
browser-manager-viewport-test-fixtures.tsreplacesmockResolvedValue(undefined)withrejectInvalidTouchPoints, which rejects an out-of-rangemaxTouchPointsonsetTouchEmulationEnabledthe way Chromium does. - New regression test —
browser-manager-viewport-touch-reset.test.tscovers mobile → desktop preset and mobile → no preset, asserting the disabled payload and that a later navigation does not re-install the iPhone UA. - Existing assertion updated — the
override=nullcase inbrowser-manager-viewport-override.test.tsnow expects{ enabled: false }.
I verified the load-bearing claim against Chromium source: inspector_emulation_agent.cc's setTouchEmulationEnabled rejects maxTouchPoints outside 1..16 regardless of enabled, and dev_tools_emulator.cc restores the embedder's original max-touch-points, pointer and hover types when disabling. I also confirmed the new test fails on the pre-fix payload (both cases) and passes with it, that no other call site sends maxTouchPoints: 0, and that all 51 tests across the 6 files consuming the stricter fixture mock pass (ORCA_BACKGROUND_LAUNCH=1). oxlint is clean on the changed files.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Important Review skippedReview was skipped as selected files did not have any reviewable changes. ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📥 CommitsReviewing files that changed from the base of the PR and between 43f1236895cc2239c876e775cd370c2f4266315e and a5aaac1. You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📥 CommitsReviewing files that changed from the base of the PR and between e0b9ba0de2a33741258a6338f60333f2e1892470 and 43f1236895cc2239c876e775cd370c2f4266315e. 📒 Files selected for processing (3)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughTouch emulation is now disabled without a Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to The reset payload and regression tests address the mobile-to-desktop transition. No concrete current-head failure is established; behavior in the embedded Chromium version was not independently exercised. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The fix restores desktop input behavior without adding a new browser entrypoint or expanding its authority. Risk is limited, though actual Chromium behavior and unusual command failures have not been fully verified here. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
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 |
|
Thanks @AmoabaKelvin, the fix is right: Chromium rejects One catch that isn't on you: because that call always failed, the desktop-preset user-agent step after it has never run. With your fix it runs, and it drops the |
e0b9ba0 to
43f1236
Compare
|
Rebased this onto |
|
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Since the prior pullfrog review the branch was force-pushed onto current main (which now contains the tab-identity ownership refactor from #23718). The net PR-authored diff is unchanged; the fix simply moved into the refactored surrounding code.
- Touch fix re-homed, behavior unchanged —
browser-manager-viewport.tsstill sendsTOUCH_EMULATION_DISABLED = { enabled: false }(nomaxTouchPoints) for the desktop-preset and no-preset cases, now inside the sharedrunViewportEmulationSteppipeline rather than the oldif/else; the mobile branch still sends{ enabled: true, maxTouchPoints: 5 }. - Regression test unchanged —
browser-manager-viewport-touch-reset.test.tsand its assertions are identical to the previously reviewed revision. - Existing assertion unchanged — the
override=nullcase inbrowser-manager-viewport-override.test.tsstill expects{ enabled: false }.
I re-ran the eight test files that consume the now-stricter shared fixture mock (browser-manager-viewport-touch-reset, -override, -partial-failure, -ownership, browser-manager-tab-identity, browser-manager-auth-user-agent, browser-manager-worker-request-user-agent, browser-manager-annotation-bridge) with ORCA_BACKGROUND_LAUNCH=1: 82 tests pass. Main's new tab-identity case that rejects any touch payload regardless of shape (so it outlives a payload fix) also passes next to this branch's payload-validating mock.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
Turning touch emulation off sent maxTouchPoints: 0, which Chromium rejects (it only accepts 1-16, even when disabling). Touch emulation stayed on, so pages kept reporting no hover and a coarse pointer, and the desktop user agent was never restored. Omit maxTouchPoints when disabling so Chromium restores the original value.
43f1236 to
a5aaac1
Compare
…3745, #23783, #22971, #22565, #22846, #23724, #23721, #23693, #23810) into #23059 #23671 (group chat rows by the turn that produced them) is ported onto #23059's turn-scope model, so there is one grouping mechanism, not two: - A host that states each row's turn scope groups by that scope, as before. #23671's journal-order derivation (rows between one turn record and the next belong to it) moves from the timing selector into src/shared/native-chat-turn-grouping.ts and runs only for a host that states no scope, replacing the positional fallback there. - #23671's anchor rules live in structuredAgentTurnAnchors, which membership, settled timing and the live clock all read: a turn whose opener key nothing resolves yet takes the send still in flight ahead of its record (Codex before its echo), else its own record. - The live turn is one key again. #23671 made row liveness follow the owning turn, so the bar key and the liveness key are always the same; nativeChatTurnMembership now returns only liveTurnKey (barTurnKey, activeTurnOpenedBy and turnKeysByItemId are gone). - A turn with no user bubble draws its bar above its first row (nativeChatTurnBarRows, desktop and mobile), and a turn's diff rollup goes under its last row. - The Codex full-history restore writes each record ahead of its items; that also fixes the derived turn scope on #23059's journal. #23026 (Stop from the moment a message is sent) is ported onto #23059's command turns: the cancel paths ask the translator for a command's provider turn instead of the removed compaction tracker, and a Stop that names no turn still ends a running /compact through its child. performCancel moved to structured-agent-session-turns-cancel.ts to keep the turns module under the line limit. #22090's awaitingInput replaces showTurnStatus/showLiveTurnActivity; the waiting-behind-/compact rows are kept.

ELI5
If you switched Orca's built-in browser to a phone or tablet size and then back to a desktop size, the page kept thinking it was on a touch screen. Sites that only show hover effects when a mouse is present stopped showing them. Switching back now fully returns the page to desktop mode.
What Changed
Emulation.setTouchEmulationEnabled. We sent{ enabled: false, maxTouchPoints: 0 }, but Chromium only accepts 1–16 touch points, even when turning emulation off, so it rejected the whole call. Touch emulation stayed on, and the error also skipped the user-agent restore after it. We now send{ enabled: false }with nomaxTouchPoints, and Chromium puts back the original value itself. This covers both ways out of a mobile preset: switching to a desktop preset, or going back to Default.Why
The rejected call was the whole bug, so the fix is the smallest correct payload rather than a workaround such as detaching the debugger, which would also wipe the agent bridge's per-page state. It went unnoticed because the unit tests mocked the debugger and accepted any payload. The test mock now rejects out-of-range touch points the way Chromium does, so this can't regress silently.
Fixes #22749
Visual Proof
Before:
CleanShot.2026-09-25.at.12.08.31.2.mp4
After:
CleanShot.2026-09-25.at.12.11.04.mp4
Testing
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
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)