Repository navigation
fix(desktop): capture the whole oversized preview viewport - #36286
Conversation
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — Oversized background desktop previews are scaled to fit the host window so captures include the whole viewport. Visible previews remain unchanged, and reported Electron capture checks support the limited scope of the correction. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
A zero viewport would scale the guest to nothing. Trim the geometry matrix to a table of exact fits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The automated pipeline stopped on this pull request and will not merge it: the fix is written and reviewed, but proving it needs something no worker has:
It stays open for a person to finish or close. |
|
I reviewed the published agent feedback and the pipeline's The macOS proof requested in the pipeline stop comment is now available for current head
Raw metrics and pixel results · Runnable generic reproduction bundle This is native Electron capture proof, separate from the original integrated development-client pass; it does not claim a new end-to-end MCP run or resolve the covered-window CDP stall in #33719. All assets are generic, and owned test windows/server were cleaned up. Please reassess the |
Main's merge brought a second `windowSize` into HostedBrowserWebview and full-detail capture transforms. A plain `scale()` on the wrapper rasterizes the guest at the reduced size, which the inner matrix3d cannot undo because the wrapper's overflow clip flattens the 3D context. Fold the window fit into the webview's own viewport transform instead, so the guest keeps its DOM viewport and full-detail frames. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
EvidencemacOS 26, Apple silicon, Electron 44.10.1, light theme, fresh synthetic state on each commit. Establish a 1440×698 fill-mode preview, collapse the Browser panel, shrink the host viewport from 1440×790 to 900×600, and capture the remembered logical viewport. Both pages still report 1440×698. Retained stills matched byte-for-byte across captures 500 ms apart.
Driver, seed script, synthetic page, base measurements, head measurements. Not shown:
|


An oversized background preview can report a 3440×1440 DOM viewport while its screenshot contains only the top-left of the page. Reproduced on public main
9efd960925: Electron 44.10.1 returned 1300×870 from a guest extending beyond a 1000×668 host window, missing the right and bottom corner sentinels.Fit the background guest inside the host window with a CSS transform, preserving its logical viewport. Reuse the window-size subscription to refit on resize. Visible previews and suspended guests retain their existing placement; capture ownership, serialization, and image downscaling stay unchanged. This is desktop hosting geometry, including screenshots requested by remote clients or agents; headless web hosting and mobile rendering do not need changes.
Validation:
vp run check:changedpasses. The existing ElectronBrowserHost, ServerBrowserPage, and ServerBrowser suites pass 130 tests; the current geometry suite passes 4 tests.check:changedwas rerun successfully ondfcfd1a.Latest-head proof (
dfcfd1aversus original base9efd960): the macOS Electron fixture also includes the requested 1440×1700 band capture. All 14 head captures across seven viewport sizes and DPR 1/2 retain all four corners and all four bands. Base reproduces clipping. Exact metrics and pixel checks · Reproduction bundle. This uses the actual base/head style resolver outputs in native Electron; it is separate from the original integrated desktop pass.Limits: macOS only; no physical Retina display tested. Covered-window CDP capture can still time out, as tracked separately in #33719. This fixes successful-but-cropped captures, not that stall. Upstream's existing asynchronous desktop resize measurement remains intact. Explicit CDP clips were rejected as a solution because they produced repeated top-left pixels despite returning the requested dimensions.
Generic fixture evidence is hosted on the contributor fork, without committing screenshot assets:
Before:

After:

Capture geometry and pixel verification · Generic HTML fixture
This is a small reproducible capture bug under CONTRIBUTING.md’s obvious-bug exception; no feature or architecture change is included.
Implemented and verified with GPT-6-Astra (ultra) through the Codex harness in T3 Code. The upstream pipeline added the zero-viewport guard in
dfcfd1a, co-authored by Claude Opus 5.5.