fix(dashboard): give remaining srcDoc frames a compositing layer (#8075) - #8451
Conversation
Three sandboxed srcDoc iframes still carried no compositing-layer promotion, so an engine could lay the document out and report a correct height while rasterizing nothing — a skipped first paint renders blank: - McpAppFrame: the full-screen app overlay, where a skipped paint is a blank viewport with no error state. `translateZ(0)` joins the script-reported height in the style object. - BoardFrame + BoardThumb (pptx-maker): both frames carried a 2D `scale(...)` only, which makes a stacking context but does not force promotion. `translateZ(0)` is composed onto the scale — the scale is each frame's whole geometry, so replacing it would render the 1920px document at full size. - FileRenderers HtmlViewer: plain srcDoc preview, plain promotion. Per-site style assertions pin each transform; the BoardFrame test also pins that the scale survives the composition and transformOrigin is unchanged. Deliberately no registry or enumerating test for the class. This is a compositing hint with no visual delta in a healthy renderer, so the tests are the evidence rather than a screenshot. Closes #8075
UX Review (Fable 5) — ✅ PASSUX-level review of This PR is a pure rendering fix — adding UX-Verdict: PASS Invisible-by-design fix that removes a blank-frame failure; no strings, controls, or layout change, so there is no new surface to misread. [UX-REVIEWED] 38a1ba6 |
Design Review (Fable 5) — ✅ PASSDesign-level review of Design-Verdict: PASS Applies the already-merged compositing-promotion remedy to the three remaining srcDoc sites, composed onto existing transforms with the geometry and sandbox contracts pinned. [DESIGN-REVIEWED] 38a1ba6 |
Opus 4.8 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 5.6 Review — ✅ no blocking findingsGPT 5.6 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
First Principles Review (Fable 5) — ✅ PASSPremise-level review of All evidence gathered. The class is fully enumerated: of the five First-Principles-Verdict: PASS Completes an already-established fix class at every remaining site, with zero srcDoc frames left unpromoted and no new surface shipped. What this change shipsIntent: stop three preview frames rendering blank when the engine skips their first paint — a FIX.
Sibling count, grepped [FIRST-PRINCIPLES-REVIEWED] 38a1ba6 |
Summary
Follow-up enumeration to the compositing-promotion class: three remaining sandboxed
srcDociframes carried no compositing-layer promotion, so an engine could lay the document out, run its scripts and report a correct height while rasterizing nothing — a skipped first paint renders blank.McpAppFrame— the full-screen MCP app overlay, where a skipped paint is a blank viewport with no error state.transform: 'translateZ(0)'joins the script-reportedheightin the iframe's style object.BoardFrame+BoardThumb(pptx-maker) — both frames carried a 2Dscale(...)only, which makes a stacking context but does not force layer promotion.translateZ(0)is composed onto the scale (scale(...) translateZ(0)), never replacing it: the scale is each frame's whole geometry, andtransformOriginis unchanged. Same composition as the merged gallery-thumbnail precedent inArtifactThumbs.HtmlViewer(FileRenderers) — plainsrcDocpreview, plainstyle={{ transform: 'translateZ(0)' }}, consistent with sibling renderers.The sandbox attributes are untouched on all three sites (
allow-scripts allow-formson McpAppFrame; empty sandbox on the board frames and HtmlViewer), and the HtmlViewer test now pins the empty sandbox alongside the promotion.Evidence
This is a compositing hint with no visual delta in a healthy renderer, so a screenshot cannot demonstrate the fix. The per-site style assertions are the evidence instead, mirroring the existing promotion tests:
Why no screenshot: the change is a compositing hint (
translateZ(0)) with zero visual delta in a healthy renderer — the defect it prevents (a skipped first paint) is nondeterministic and cannot be staged for a capture, so the pinned style assertions below are the evidence.McpAppFrame.test.tsx— pinstransform: translateZ(0)and that the script-reported height sizing survives.PptxMakerPage.test.tsx— pinsscale(...) translateZ(0)on both board frames (measurement pinned so the scaled frame mounts in jsdom), that the scale survives the composition, and thattransformOriginstaystop left.FileRenderers.test.tsx— pins the HtmlViewer promotion and the empty sandbox.Deliberately no registry or enumerating test for the class — each site pins only its own style.
Testing
npx tsc -b— cleannpx eslinton all six changed files — cleanNotes
A local review pass flagged one Low advisory: promoting the intrinsic-height
BoardFrameiframe asks the compositor for a1920 × (1080+gap)·slideslayer on long decks — a bounded GPU-memory cost traded for a certain blank-frame bug, and Chromium tiles composited layers. If it ever shows up in profiling, the promotion can move to the fixed-size clipping wrapper instead.Pattern harvest
Rule candidate: a sandboxed
srcDociframe must carry compositing-layer promotion (translateZ(0), composed onto any existingscale(...)rather than replacing it) — a 2D transform alone makes a stacking context but does not force promotion, and an unpromoted frame can skip its first paint and render blank. This PR closes the last three known sites of the class; a newsrcDocframe added without promotion re-opens it, so the pattern is a reviewable rule candidate forwebsite/AUTOSDE.yaml.Closes #8075