Repository navigation
North-star reference re-captured with the pinned fonts, the video iframe slot and cover markers - #51
Conversation
…rs the pinned font map (tools/font-map.ts, shared with check.ts: Lato 2.015 and Dragon Sans by the T033 §1.3 stated reference), the video slot as the iframe REPL-a compiles (snapshot.ts withVideoIframe; the tree's video-placeholder becomes el iframe with the embed src), the embed URL served a labelled no-network stand-in (an empty HTML document with the slot's dark color-scheme, so its out-of-process canvas is transparent whether or not it has painted), any other request fails the capture, and the cover stand-ins carry nine flat marker patches (REPL-a R8). north-star-reference.test pins the font map and face bytes, Lato in the font key, the iframe slot and stand-in, and the marker patches; north-star-tree.test compares the tree with the iframe snapshot
…ee runs, byte-identical: chrome/**, covers/*.png, lane/manifest.json unchanged; font key f159ba87 = Inter-Regular, Lato-Bold, Lato-Regular, ZapfDingbatsITC; 100 captures, 27.63 MB plus 0.17 MB covers) and pnpm run north-star:check (twice, byte-identical; on master the iframe adds one DRAGON_UNSUPPORTED_ELEMENT and one DRAGON_UNSUPPORTED_ATTRIBUTE (src) per target until REPL-a)
| label: 'stand-in: an empty HTML document (color-scheme dark) in place of the YouTube embed (no network)', | ||
| } as const; | ||
|
|
||
| const PLACEHOLDER = '<div class="youtube-player-target" data-dragon-id="video-placeholder"></div'; |
There was a problem hiding this comment.
🟡 Medium tools/snapshot.ts:102
withVideoIframe emits an extra > after the replacement, so the captured DOM contains a visible text node after the video slot and its layout no longer matches the fixture. PLACEHOLDER stops at </div instead of the complete </div> tag; include the closing > in the placeholder.
| const PLACEHOLDER = '<div class="youtube-player-target" data-dragon-id="video-placeholder"></div'; | |
| const PLACEHOLDER = '<div class="youtube-player-target" data-dragon-id="video-placeholder"></div>'; |
🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file @examples/music-player/tools/snapshot.ts around line 102:
`withVideoIframe` emits an extra `>` after the replacement, so the captured DOM contains a visible text node after the video slot and its layout no longer matches the fixture. `PLACEHOLDER` stops at `</div` instead of the complete `</div>` tag; include the closing `>` in the placeholder.
There was a problem hiding this comment.
This one doesn't apply. snapshot.html breaks its lines inside tags (line 19 ends with ...></div and the next line starts with >), so the placeholder's </div is followed by \n>, and after the swap that \n> closes </iframe: the result is ...></iframe\n></div\n> with no stray >. The suggested ></div> occurs 0 times in snapshot.html, so withVideoIframe would throw on every capture. To pin it, 46a20b4 adds a test in north-star-reference.test.ts that parses the swapped snapshot and checks the frame host's only child is the childless iframe (class, decoded src, id), that swapping the div back gives snapshot.html byte for byte, and that no capture records a text node in the video slot area; with an extra > planted after </iframe that test fails. A comment in snapshot.ts now says why the placeholder ends at </div.
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This PR recaptures and strengthens the north-star reference harness with pinned fonts, a deterministic iframe stand-in, and image markers; it does not modify production runtime behavior. The reported iframe substitution concern is covered by tests that verify the exact DOM shape and absence of stray text. You can add or adjust custom eligibility rules. Learn more. |
…der element (the frame host's only child is the childless iframe with class, decoded src and id; restoring the div gives snapshot.html byte for byte; no capture records a text node in the video shell, player, frame host or slot); it fails on a planted extra '>' after </iframe. snapshot.ts notes why the placeholder ends at '</div': snapshot.html breaks lines inside tags, so its '\n>' closes the iframe end tag (Macroscope 4154885119)
…d fonts and the iframe slot)
What changed (T034, after fonts wiring #29/#39 and the Lato ruling)
sans-serifas Dragon Sans (Inter 4.1), injected from the vendored bytes as T033 §1.3 states.tools/font-map.ts, socheck.tsand the capture can't disagree.check.tsthrows if its font list drifts from the map.f2115f3b(Helvetica) tof159ba87: Lato-Regular, Lato-Bold, Inter-Regular and ZapfDingbatsITC. The last is the one host fallback left, for U+275A, which neither pinned face has; symbol fallback is TXT1d's job.video-placeholdernode is nowel: iframe, with the embedsrc(the controller's playerVars plusenablejsapi=1; host-dependentorigin/widgetidare left out).color-scheme, so the out-of-process frame is transparent and the capture is deterministic.Passed (macOS)
north-star:capturethree times: byte-identicalnorth-star:checktwice: byte-identicalpnpm typecheckpnpm test: 143 files, 3028 testsTest changes, with reasons
north-star-tree.testnow compares the tree withwithVideoIframe(freeStateHtml(...)). The tree models the DOM after the IFrame API runs, which is what the reference captures; the intent is unchanged.north-star-reference.testgains checks for:north-star-check.jsonon master gains oneDRAGON_UNSUPPORTED_ELEMENTand oneDRAGON_UNSUPPORTED_ATTRIBUTE(the iframesrc) per target. These are true diagnostics until REPL-a, which supports the iframe, lands.🤖 Generated with Claude Code
Note
Re-capture north-star music-player reference with pinned fonts, iframe video slot, and cover markers
Regenerates the music-player Chrome reference captures against a pinned font stack, a local YouTube embed stand-in, and marker patches on the generated cover images.
withVideoIframetransformer in snapshot.ts to replace the video placeholder with an iframe at a fixed embed URL, routed to a local dark-scheme stand-in instead of the live YouTube document.library-buttonscrollbar-colortransition record, and the new cover hashes.tree/fixture.jsonrepresents the YouTube slot as an iframe instead of a div, and captured text metrics and element geometry change to match the pinned fonts. Regenerate local captures before comparing against these fixtures.Macroscope summarized 46a20b4.