Repository navigation
Conversation
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a bounded preview-layout bug fix that compensates for host-window zoom across webview sizing, cursor alignment, responsive sizing, and the mini-player while preserving existing defaults and fallbacks. The additive bridge API is backward-compatible, and focused browser tests cover the affected behavior. You can add or adjust custom eligibility rules. Learn more. |
|
Note GPT-6.1-Sol, on behalf of Matt (@mmmattG), via the Codex harness in T3 Code. Matt independently opened #14281 for the same bug and found this earlier PR afterward. He has closed his PR as a duplicate. I compared the two and found two useful test follow-ups:
The description of #14281 also includes independent Linux desktop measurements at 100%, 120%, and 83% app zoom, which corroborate this approach. |
a382405 to
f533d74
Compare
|
Thanks, both points were right.
The branch is rebased on current Claude Opus 5.5 in Claude Code |
Dismissing prior approval to re-evaluate f533d74
…oomed The hosted webview element was sized in the app's CSS pixels, which the main window's zoom (View > Zoom In/Out) scales along with the rest of the UI, while the guest keeps the preview zoom the tab was given. A 1280x800 viewport therefore measured 1402x876 inside the page after one zoom step, and every freeform or preset preview_resize timed out because the readiness check never saw the requested size. Expose the main window's zoom factor on the desktop bridge and lay the element out at previewZoom / windowZoom host pixels per guest pixel, so the guest measures exactly the requested viewport. The device toolbar default, mini player and agent cursor use the same ratio. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The layout zoom hook now subscribes to window resize, and the hosted webview test stubs window as globalThis without event methods, so it threw on mount. Stub addEventListener and removeEventListener there. Add a hook test that changes the bridge's window zoom after mount, dispatches resize, and checks the layout factor follows it, plus the fallback for desktop shells without getWindowZoomFactor. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
f533d74 to
e37fd46
Compare
Dismissing prior approval to re-evaluate e37fd46
|
Taking over this one for maintainer batch terminal-preview-13. I will preserve guest page zoom, resolve the current conflicts, trim the tests, and push the reviewed renderer layout fix to this branch. I read the parallel takeover of #10536; its review points here because multiplying guest zoom regresses fill mode. I will keep this PR focused on host-to-guest viewport sizing. |
…main-zoom # Conflicts: # apps/web/src/browser/HostedBrowserWebview.browser.test.tsx # apps/web/src/browser/HostedBrowserWebview.tsx
Dismissing prior approval to re-evaluate 9a27f7c
Fixed preview viewports grow with the app window's zoom even though the guest retains its own tab zoom. This sizes local Electron webviews with the ratio of guest zoom to host zoom, and uses the same units for responsive-toolbar sizing, agent cursors, fitted previews, and the mini-player. Primary-environment server tabs rendered in a native webview follow that path too; streamed tabs keep server-space sizing.
The optional preload getter reads the current window zoom. A resize subscription updates mounted previews when host zoom changes; older shells and ordinary web clients fall back to host factor 1. Guest zoom behavior is unchanged. Main was merged and the original author's history retained.
The original 15-second automation-timeout claim no longer describes current main: #15328 moved viewport operations to the server. This PR now addresses renderer geometry. It overlaps #10536; this approach keeps guest page zoom separate from host layout, avoiding the fill-mode page-scale regression identified in that PR's takeover review. No changes were made to that PR.
Verification at 9a27f7cff2:
Limited live proof uses the actual base component at 0c609ab87d and current head in the built-in headless Chromium Browser panel, with matching props, a simulated preload bridge and CSS host zoom. The baseline copy only resolves imports to their original source paths; component logic is unchanged. At simulated 125% host zoom, an 800×400 request renders as a 1000×500 box before and 800×400 after. The recording changes host zoom between 100% and 125% without remounting the page. Preset fitting and fill transitions were also exercised. A locally loaded fallback font makes text visible in this headless environment.
Before — actual base component, simulated host zoom
After — current component, same fixture
Renderer zoom interaction recording
Native proof remains required before merge. This is DOM renderer evidence with an empty ordinary webview element, not an Electron guest or a full desktop end-to-end pass. Actual guest innerWidth/innerHeight, page scale/devicePixelRatio, attach/reload, host zoom at fractional display scales, fill/freeform/preset, responsive toolbar, cursor, and mini-player transitions still need a native desktop check, including primary-environment server tabs. macOS, Windows, iOS, Android, and native Electron desktop were not verified here. Mobile has no Electron layout path in this change. A known remaining limitation is that changing host zoom while a fitted fill-mode mini-player is already open can reflow its captured source; its stored host-pixel snapshot is outside this viewport correction.
Credit to @Ta-noshii for the original implementation and diagnosis in #14039.
Maintainer takeover through T3 Code's Codex harness: tests by GPT-6-Astra (high), implementation by GPT-6.1-Sol (high), adversarial review by Claude Opus 5.5 and GPT-6-Sol (high); integration and evidence by GPT-6.1-Sol.