Repository navigation
fix(browser): restore configured zoom after page reload - #10800
Conversation
📝 WalkthroughWalkthroughBrowser page zoom application now uses the configured default level for zoom adjustments and reapplies it on every guest 🚥 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 |
Review fixes on top of PR stablyai#10800. The dom-ready reassert used the shared browserDefaultZoomLevel, which zoom in/out also writes. Two regressions followed: - Cmd/Ctrl+0 reset became a fixed point: reset targeted the same value zooming had just written, so it could never return to 100%. - Reloading a tab adopted a zoom the user applied to a *different* tab, since every pane reasserted the shared setting. Keep the per-pane level in paneZoomLevelRef (seeded from the configured default, moved only by zooming that pane) and reassert that on dom-ready. Reset goes back to Chromium's 100%. Also replaces the PR's unit test, which passed with the fix fully reverted, with tests that model the pane/reload state machine and fail without the fix, plus an e2e regression for the cross-tab case.
|
Reviewed with an independent reproduction. The bug is real and I confirmed it — on main a native zoom above 100% survives both normal and hard reload, and your But the fix as written was wired to the shared
Neither was caught by the new test — and this is the part worth internalizing: the unit test passed with the fix fully reverted, because it only exercises a module the PR doesn't change. A test that stays green when you delete the fix can't protect it. Pushed to this branch: a per-pane zoom level seeded from the configured default and reasserted on I verified the new tests aren't vacuous the same way I found the original problem — reverted the rewrite while keeping the tests, and 2 of 3 failed exactly on Cmd/Ctrl+0 (got 0.5) and cross-tab isolation (got 1). Restored: 3/3 pass. Validation: 167 browser-pane tests, 3 Playwright E2E, typecheck 0, oxlint clean. Thanks for finding this — the per-origin zoom restore is genuinely non-obvious behavior and the diagnosis was right. |
Reviewed with an independent reproduction. Rewrote the reload-zoom reassert to be per-pane instead of sharing the value zoom in/out writes, fixing Cmd/Ctrl+0 reset and cross-tab zoom leakage, with E2E coverage proven to fail on revert.
Summary
dom-readyevent.Root cause
Chromium can restore per-origin zoom when an embedded page reloads. Orca only enforced its configured zoom when the webview was first created, so a native zoom value above 100% could survive subsequent reloads.
User impact
Embedded browser pages now return to the configured zoom after reload instead of retaining an unexpected zoom above 100%. Explicit non-default browser zoom settings remain respected.
Validation
pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/browser-pane— 31 files, 162 tests passedpnpm run typecheckpnpm exec oxlinton changed filespnpm exec oxfmt --checkon changed filespnpm run check:max-lines-ratchetELI5
After reloading a page in Orca's embedded browser, Chromium could restore an old zoom level instead of your configured one. This re-applies your preferred zoom after every page load so zoom stays consistent.