Repository navigation
fix(web): keep a paired browser's UI zoom setting from zooming the desktop - #52390
Conversation
[Low impact] The PR appears safe to merge; browser zoom stays local and desktop zoom keeps its existing path. SummaryKeeps a paired browser’s UI zoom separate from the desktop’s zoom.
No actionable issues found. Tests and visual checks were not run during this review. Reviews (2) · Last reviewed commit: "fix(web): keep a paired browser's UI zoo..." · Reviewed by Greptile |
|
No actionable comments were generated in the recent review. Walkthrough
Severity of issue fixed: Medium Merge Risk:
|
…sktop The web client sent uiZoomLevel to the host with every ui.set, so pressing the UI zoom buttons in a paired browser rescaled the desktop's dashboard and workspace windows right away and its main window on the next reload, while the browser page itself never changed size. Treat uiZoomLevel as a pairing-local UI field like sidebarOpen: the web client keeps it in the browser, the host neither accepts it from nor returns it to a paired caller, and the web settings page hides the UI zoom row because a browser zooms with its own page zoom. Fixes stablyai#52388 Co-authored-by: Neil <[email protected]>
fc86343 to
f8adc77
Compare
ELI5
When you opened Orca in a web browser paired with your desktop, Settings showed a "UI zoom" row. Pressing + changed the number in the row, but the browser page stayed the same size. Instead, the desktop app quietly got zoomed, where the person at the browser could not see it. Now the browser keeps that setting to itself, the desktop ignores zoom changes sent from a browser, and the row is hidden in the browser. To zoom a browser page, use the browser's own zoom (Cmd/Ctrl +/-).
What Changed
ui.setsentuiZoomLevelto the host, and the host saved it as the desktop's app-wide zoom. The Agent Dashboard popout and Space windows followed the change right away (onUIChanged), and the desktop's main window came back zoomed after a reload or restart.uiZoomLevelis added toPAIRING_LOCAL_UI_FIELDS(src/shared/remote-runtime/pairing/pairing-local-ui-fields.ts), the shared list of per-device UI fields such assidebarOpen. That one list drives both ends: the web client strips listed fields beforeui.setand keeps them in browser storage, and the host drops them fromui.setand leaves them out ofui.getfor paired callers (omitPairingLocalUiFields/uiForCaller).mergeHostWebUIStatepins the browser's localuiZoomLevel(itssatisfies Record<PairingLocalUiField, unknown>check requires every listed key), so an older host that still echoes its zoom cannot overwrite the browser's value.mergeOsc52ClipboardNoticePendingnow takesPairedUiStatefor the incoming host state, which is what it actually receives.getZoomEntries()returns no entries whenisWebClientLocation()is true, the same check other desktop-only settings use. That hides the row inAppearanceInterfaceSectionand removes it from Appearance and global settings search, so search and the visible rows stay consistent.Why
The root cause is that
uiZoomLevelwas treated as shared host state even though it describes one window. The web preload'ssetZoomLevelonly keeps the number in memory and nothing applies it to the page, so in a browser the row's only effect was rescaling the desktop. Fixing the field's classification at the shared list fixes every direction at once (new and old clients, new and old hosts) instead of just hiding the button.Alternatives considered:
ui.setwould still carry the field, so older web clients could still change the desktop's zoom, and an older host'sui.getwould still copy its zoom into the browser.Linked Issue
Fixes #52388
Visual Proof
Paired browser, Settings > Appearance, in a real isolated dev instance (headless Chromium, 1280x860), captured by the original author:
main)UI zoom row at 120% after + twice, page not scaled
No UI zoom row
Desktop main window after a reload, following the browser steps above:
main)120% (
uiZoomLevel1)100% (
uiZoomLevel0)Component fixture of
AppearanceInterfaceSection(reviewer re-capture), web client vs desktop:main)Testing
Real app (macOS, original author): isolated dev instance (temporary
HOME/userData,ORCA_BACKGROUND_LAUNCH=1), browser pairing link opened in headless Chromium, both sides driven over CDP.main: pressing + twice in the browser moved the row from 100% to 120% while the page did not scale (devicePixelRatio1). The desktop's saveduiZoomLevelwent 0 -> 1, and after a reload the desktop window drew at 120%.window.api.ui.set({ uiZoomLevel: 1 })(what the + button did) changed only the browser's value; the desktop's saved and live zoom stayed 0, and it stayed at 100% after a reload.Reproduced in review on macOS: the new test fails on
main(theui.setpayload includes"uiZoomLevel": 2) and passes here. A scratch run of the host-side strip on{uiZoomLevel: 1, editorFontZoomLevel: 1}returned the payload unchanged onmainand{editorFontZoomLevel: 1}on this branch. Fixture screenshots above compare web client vs desktop.New
src/renderer/src/web/preload-api/preferences/web-ui-api.test.ts: setsuiZoomLevelandeditorFontZoomLeveltogether, checksui.setsends onlyeditorFontZoomLevel, and checks an older host echoinguiZoomLevel: 0onui.getdoes not overwrite the browser's 2.Targeted vitest (web preferences, pairing, settings appearance/search, main runtime RPC), oxlint, oxfmt, anti-slop, native code-quality plugins, ast-grep and the changed-code quality gate are all clean on the 5 changed files.
Not tested: Windows/Linux (no platform-specific code), the mobile app (never reads or writes
uiZoomLevel), the dashboard popout and Space window live while the browser changed zoom.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
None, because no hot path is touched.
omitPairingLocalUiFieldsis a Set lookup that runs once per webui.set/ui.getRPC; one more entry measured the same (120-126 vs 125-145 ns typical, 86-95 vs 85-94 us on a 590-key payload, noise).getZoomEntriesadds oneisWebClientLocation()check (~1.4 ns) when Appearance or settings search builds its entries, called the same number of times as before. No store, selector or cache changes, so nothing fans out with the number of tabs (0 extra calls per update at N=200, old and new).Risk
The riskiest part is dropping the field at the RPC boundary across versions:
uiZoomLevelfromui.set(the schema still accepts it, so the rest of the payload is applied) and omits it fromui.get. The old browser's row only changes its own stored number.uiZoomLevel. Remote server pairing: a desktop connected to a remote host only readsworkspaceStatusesfromui.get.Known limits: a desktop that a browser already zoomed stays zoomed until reset on the desktop, and a stale
uiZoomLevelin browser storage has no visible effect. A plain revert backs this out; no saved data changes shape.Level: Low
Review
Agent skill upstream boundary
Notes
Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
Original fix by @yeong-chae in #52390.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)