Repository navigation
feat(screenshot): draw TV overlay refs at the page's capture scale - #4639
Conversation
screenshot --overlay-refs on the Tizen and webOS plugins projected CSS px rects 1:1 onto the capture. A Tizen page with a 1280 meta viewport is captured at 1.5x, so its boxes landed too small and offset; a webOS app at 1280x720 fills only the top-left of a 1920x1080 capture, so a node past the page edge was boxed over the padding. SnapshotState now carries the producer's captureScale beside viewport, and the overlay projects with that scale and clamps to viewport x captureScale, the same projection and frame the crop uses.
851a134 to
59f3856
Compare
|
This PR is ready at 59f3856. The projection and its fixtures (Save 10,10,40,20 at scale 1.5; Tile 1200+300 against a 1280 frame) look correct. All 16 checks are green, and there are no conflicts. The webOS and Tizen hardware evidence in the PR body predates a refactor-only amend, and the helper extraction at snapshot-state.ts:145-151 behaves the same. Not blocking, and you can take or leave these: the crop path still reads captureScale from raw snapshotData (screenshot-crop.ts:88) while the overlay reads it from SnapshotState; the overlay still picks the rect space inline instead of using resolveScreenshotRectSpace (screenshot-overlay.ts:273, from #4635); a TV page with no published scale is drawn 1:1 while --crop-on refuses it, which the PR and docs already state (screenshot-overlay.ts:278); and the Tizen and webOS doc sentences describe the same behavior in different words (webos.md:112). Only a maintainer merge is left. |
Summary
Follow-up to #4635. On Tizen and webOS,
screenshot --overlay-refsdrew CSS px rects 1:1 on the capture. Tizen boxes came out too small and offset (1280 meta viewport, captured at 1.5×). On webOS (1280×720 app), boxes for nodes past the page edge spilled onto the padding.8 files, no linked issue. Scope expansion:
SnapshotState.captureScale(internal). A tree without a scale keeps 1:1 boxes and is not refused.Validation
Tested
59f385621onbfb67d5cc; hardware ran on851a13449, before a refactor-only amend that keeps Fallow complexity under threshold. The local registry mirror lacks packages for this lockfile, so the local runs used the #4635 worktree with this patch applied. CI validates the head.capture-kit,daemon/src/execution,tv-cdp: 2071/2071. Typecheck, oxlint, oxfmt,fr: clean.overlayRectwas compared with the element's frame found from border pixels in a plainscreenshot:visualViewport.scale1.5): 600×360 at (300,450) and edge 120×150 at (1800,900) match. Before the fix: 400×240 at (200,300) and 300×100 at (1200,600).Screenshots:
Risks: on a scaled Tizen page, JSON
centeris in screenshot px, not the CSS px thatpresstakes.Two-way door. Blast radius: TV plugins.
🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.