Repository navigation
feat(render): add html films with a layout check - #21
Merged
Merged
Conversation
This was referenced Oct 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Summary
Adds a second kind of film,
html, so the skill can make videos without Claude Motion, and a layout check that catches overlapping or hidden elements before a video is rendered.This takes the route recommended in the Phase 0 spike (#17): our own minimal player rendered by
render.ts, which keeps the network block and the Chromium sandbox. Motion films and their path are unchanged; the skill uses Motion when the Motion Artifact type is available and the html path otherwise.Closes #18. Part of #19 (layout check and authoring guide; contrast and text-size checks are not in this PR). Part of #16.
Why the layout check
A video made in the spike had a ✕ mark half hidden under the condition box, a chip straddling a card's border, and a box sticking out of its panel. Nothing in the old flow caught them: they came from hand-computed coordinates and from relying on HTML order for stacking. Run on that film, the new check reports all three, plus four more that were missed in review.
Changes
motion-render kit <work>: sets up<work>/filmwith the player (kit/player.js), a base stylesheet with role-based stacking layers (kit/base.css), GSAP, Noto Sans JP (400/700, woff2,font-display: block) and the scene times fromtiming.json. The page fails to load with a pointer tokitwhen the font is missing.film.build(fn)(runs after fonts load, so measurements are right),film.at/film.end(scene-relative times),film.spot(el, target)(GSAP x/y that center an element on a target, so chips are not placed by hand).motion-render check <filmDir>: samples the film every 0.2s and reports elements that partly overlap, stick out of their parent, are cut by the frame, or are hidden under another solid element. Only still elements count, so a chip passing over a card is not reported.data-layout-okmarks intended overlaps (chart reference lines, strikethroughs).stillsruns the check and prints issues;buildstops on them.scripts/snapshot.js) is injected into the untrusted film page; its output is validated in Node (parseBoxes).buildrewriteskit/timing.jsfromtiming.json, so a film always follows the current narration.SKILL.md: step 3 splits into Motion (3A) and html (3B);references/html-film.mdholds the authoring rules (marks inside their target, stacking by role, flex/grid inside cards, chips stop inside a card or in free space), motion, typography, determinism and sound-effect timing.maincomplexity).@fontsource/noto-sans-jp@5.2.8(OFL),gsap@3.13.0(GSAP standard no-charge license).Test plan
make lint,make typecheck, Prettier check on changed filesvitest run --coverage: 89 tests pass, 95% lines (kit.ts100%,layout.ts100%)timing.json; the same frame twice is identical; missing font fails with a pointer tokit;film.spotcenters a chip on its target;kitandcheckas CLI commandsREADME (EN/JA) updates are left for #20.