You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(patchy): a look preview --compare screenshot shows only the top of each look #595
The compare page puts each look in a 100vh iframe that scrolls on its own, so a full-page screenshot (what an agent takes) shows only the first screen of each pane; the table, form, states and swatches never appear. The global skill works around it ("open it for the person, or screenshot each look alone"). A generous fixed frame height, or frames sized to their content, would make one screenshot enough.
Found while building the company look (#547). Filed by Claude Fable 5.1 (orchestrator) in Claude Code, running in T3 Code, for Allison.
Category: bug Summary: On patchy look preview <dir> --compare, size each look's frame to its specimen, so one full-page screenshot shows both whole looks.
Current behavior:
The two-pane previewPage(first, second) puts each look in its own <iframe srcdoc> with height: 100vh. Each specimen is about 2,200–4,900px tall, depending on the look and pane width. So each frame scrolls on its own, and a full-page screenshot (what an agent takes) is one viewport tall. At 1280×800 the screenshot is 1280×800 and shows only the masthead, headings and buttons; the cards, table, form, states and swatches never appear. The global patchy skill works around this by telling agents to screenshot each look alone.
Desired behavior:
On the compare page each frame is as tall as its specimen. The outer page scrolls as one, and a full-page screenshot holds both complete specimens. This stays true when the window crosses the 900px stacking breakpoint and back: frames shrink as well as grow and never get stuck at a larger height. Late font loads update the height.
The approach both triage traces verified in Chromium:
Add a small inline script to the two-pane page only, allowed by a script-src 'sha256-…' entry computed from the exact script text.
After the page loads, read each frame's .specimen through contentDocument (the srcdoc frames are same-origin). Observe it with a ResizeObserver on its border box and set the frame's height from it. That alone handled the first fit, late fonts and window resizes.
Before observing, set min-height: 0; height: auto on .specimen from the script, so a look's own main { min-height: 100vh } or main { height: 100vh } can't tie the specimen to the frame height.
Measure the specimen, not the frame's root scrollHeight, which includes the frame's viewport and stops it shrinking.
Allow for the 1px divider between panes.
Keep height: 100vh as the CSS default, so the page without JavaScript behaves as it does today.
Side by side, equal heights or a height per frame are both fine.
Constraints:
The single-look page, including the --compare fallback when the company has no look, stays script-free and passes tier 0 validateHtml. Only the two-pane page changes.
Each specimen keeps its own CSP unchanged. srcdoc frames enforce both their own policy and the parent's, so specimen scripts and every remote request stay blocked, and the file still works offline.
The frames stay. They keep each look's :root tokens, element styles and @font-face rules from reaching the other.
Key interfaces:
previewPage(first: Pane, second?: Pane): string: the signature is unchanged. Only the two-pane output changes: its CSP gains the script hash, and it gains the <script>.
CLI contract unchanged: same flags, the same { ok, path, failures, warnings? }, exit codes and file location. ADR-0004 needs no edit.
Global patchy skill, "Changing the look": replace "Its two frames scroll on their own, so open it for the person, or screenshot each look alone (…)" with guidance that a full-page screenshot shows both looks whole. Then refresh the skill's hash in skills-lock.json.
CLI README, look preview: say the compare frames fit their content, so one screenshot shows both looks.
Acceptance criteria:
Extend the existing Chromium compare case in the tier 1 browser spec. At 1280px wide, for each frame, poll until the frame is at least as tall as the bottom of .specimenand the frame document's documentElement.scrollHeight ≤ iframe.clientHeight. Assert it again after resizing to 375px and back to 1280px, so frames shrink back rather than stick. The case fails on today's code.
That case keeps its existing checks: each frame shows its own look, there's no horizontal overflow, and no requests are made.
A look whose look.css adds main { min-height: 100vh } and main { height: 100vh } neither grows without bound nor clips, covered in the same spec.
The CLI test for the no-current-look --compare fallback also asserts validateHtml(page) is ok.
The skill text is updated and its skills-lock.json hash refreshed; the lock test passes.
Out of scope:
A fixed frame height: real specimens run about 2,200–4,900px, and a valid 16px spacing token passes 6,800px.
CSS frame-sizing: content-height: Chrome 154+ only, and the bundled Chromium is 153.
Merging both looks into one document.
Changing the specimen's content or the single-look page.
Firefox and WebKit coverage: the tier 1 suite is Chromium only.
Activity
allisonmahmood commentedon Oct 9, 2026
Agent Brief
Category: bug
Summary: On
patchy look preview <dir> --compare, size each look's frame to its specimen, so one full-page screenshot shows both whole looks.Current behavior:
The two-pane
previewPage(first, second)puts each look in its own<iframe srcdoc>withheight: 100vh. Each specimen is about 2,200–4,900px tall, depending on the look and pane width. So each frame scrolls on its own, and a full-page screenshot (what an agent takes) is one viewport tall. At 1280×800 the screenshot is 1280×800 and shows only the masthead, headings and buttons; the cards, table, form, states and swatches never appear. The globalpatchyskill works around this by telling agents to screenshot each look alone.Desired behavior:
On the compare page each frame is as tall as its specimen. The outer page scrolls as one, and a full-page screenshot holds both complete specimens. This stays true when the window crosses the 900px stacking breakpoint and back: frames shrink as well as grow and never get stuck at a larger height. Late font loads update the height.
The approach both triage traces verified in Chromium:
script-src 'sha256-…'entry computed from the exact script text..specimenthroughcontentDocument(the srcdoc frames are same-origin). Observe it with aResizeObserveron its border box and set the frame's height from it. That alone handled the first fit, late fonts and window resizes.min-height: 0; height: autoon.specimenfrom the script, so a look's ownmain { min-height: 100vh }ormain { height: 100vh }can't tie the specimen to the frame height.scrollHeight, which includes the frame's viewport and stops it shrinking.height: 100vhas the CSS default, so the page without JavaScript behaves as it does today.Side by side, equal heights or a height per frame are both fine.
Constraints:
--comparefallback when the company has no look, stays script-free and passes tier 0validateHtml. Only the two-pane page changes.:roottokens, element styles and@font-facerules from reaching the other.Key interfaces:
previewPage(first: Pane, second?: Pane): string: the signature is unchanged. Only the two-pane output changes: its CSP gains the script hash, and it gains the<script>.{ ok, path, failures, warnings? }, exit codes and file location. ADR-0004 needs no edit.patchyskill, "Changing the look": replace "Its two frames scroll on their own, so open it for the person, or screenshot each look alone (…)" with guidance that a full-page screenshot shows both looks whole. Then refresh the skill's hash inskills-lock.json.look preview: say the compare frames fit their content, so one screenshot shows both looks.Acceptance criteria:
.specimenand the frame document'sdocumentElement.scrollHeight ≤ iframe.clientHeight. Assert it again after resizing to 375px and back to 1280px, so frames shrink back rather than stick. The case fails on today's code.look.cssaddsmain { min-height: 100vh }andmain { height: 100vh }neither grows without bound nor clips, covered in the same spec.--comparefallback also assertsvalidateHtml(page)is ok.skills-lock.jsonhash refreshed; the lock test passes.Out of scope:
frame-sizing: content-height: Chrome 154+ only, and the bundled Chromium is 153.fix(patchy): look preview --compare shows both whole looks in one scr…