Repository navigation
fix(desktop): fitted browser snapshots no longer tile the page - #821
Merged
Merged
Conversation
A fitted <webview> guest only has its on-screen surface pixels. CDP screenshots of the logical viewport tiled that surface into the output instead of rendering beyond it. Capture the displayed surface with capturePage and map logical annotation crops into its pixels, as the DevTools fallback already did.
Upstream divergenceBoth sides are compared with upstream at the in-order tip
Upstream files whose difference changes (2)
|
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
Fitted desktop Browser snapshots now capture the complete displayed page instead of repeating the guest surface. Captures use the displayed surface's resolution; annotation coordinates remain logical page coordinates.
When a freeform viewport is larger than the Browser panel, the fork fits the Electron webview with device-metrics emulation.
Page.captureScreenshotthen tiles the smaller guest surface into the requested logical-sized bitmap. The page layout and interactive-element coordinates remain correct, but both inline snapshots and saved PNGs repeat the top-left page patch.Use the existing full-surface
webContents.capturePage()path for fitted viewports and map annotation crop rectangles into the captured image's pixels. Snapshots, saved screenshots, annotation crops, and the DevTools fallback share that path. Remove the broken CDP capture helpers and update the fork ledger.Add an intake note for upstream's server-browser migration: its relayed CDP screenshot would reproduce the fitted desktop capture problem unless intake preserves the full-surface path. Upstream retains a full-size webview under a CSS transform, so its presentation differs from this fork's.
Validation:
Manager.test.tstests pass on the final branch. The replacement fitted-capture and crop tests fail against the old implementation and pass with the fix. Existing tests cover adjacent native capture and DevTools fallback behavior.ClipboardItemmock-class warning.visible:false. The images below come from the isolated Electron harness, not an in-app capture of the patched desktop client.The trade-off is capture resolution: fitted captures contain the displayed surface's pixels, which may be fewer than the requested logical viewport dimensions, especially on 1× displays. This affects desktop-owned Browser capture flows; it does not add a contract, provider, entry point, or mobile navigation change.
Logical annotation crop at (800, 400):
Written by an agent (styal Codex harness, gpt-6.1-sol). Implementation and initial validation by an agent (styal Claude harness, claude-opus-5-5).