Repository navigation
fix(desktop): capture same-origin iframe annotations reliably - #198
Merged
Merged
Conversation
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.
Picking inside a same-origin iframe preserved the annotation but could lose its screenshot. The desktop passed a rectangle in page CSS pixels directly to Electron's native crop API. In a zoomed guest, that can select the wrong area, truncate the image, or fail with
UnknownVizError.Capture the complete guest surface, then map the CSS rectangle into the image before cropping. Preserve fractional coordinates until image rounding, clip iframe selections to their surrounding scroll panels while respecting positioned containing blocks, and retain the existing annotation delivery, cancellation, and screenshot failure fallback. No IPC schema or security settings change; cross-origin picking remains unsupported.
Validation: 169 focused tests, scoped desktop typecheck and lint, plus the actual Template Editor in an isolated Electron webview using the production picker and capture helper. Native capture passes for a normal Facsimile selection, iframe scrolling, and surrounding-panel scrolling. The synthetic native regression reproduces
UnknownVizErrorwith the former crop call and verifies the fixed PNG contains the selected target. Existing Chromium picking, frame navigation, cleanup, and annotation packaging checks pass.The installed app reproduced the original warning. It has not been modified or restarted; corrected native capture was verified in the isolated runtime. Template Editor evidence remains private; public evidence uses a synthetic same-origin iframe.
CI repair: the mobile cold-highlighting comparison freezes and restores its clock so Shiki’s tokenization budget cannot make identical input produce different token boundaries under runner load. Production mobile behavior is unchanged; all five focused highlighting tests pass.
Implemented with GPT-6 in the Codex harness.