Skip to content

feat: reels-grade kinetic templates + premiere-style timeline merge#20

Merged
cuio merged 1 commit intomainfrom
feat/reels-templates-and-timeline-merge
Apr 26, 2026
Merged

feat: reels-grade kinetic templates + premiere-style timeline merge#20
cuio merged 1 commit intomainfrom
feat/reels-templates-and-timeline-merge

Conversation

@cuio
Copy link
Copy Markdown
Owner

@cuio cuio commented Apr 26, 2026

Summary

  • Three new Reels-grade templates in packages/core/src/script/templates/kinetic.tshook-vhs-rip (chromatic VHS opener, ≤5-word title), kinetic-words (word-by-word reveal with scale-impact + camera shake on the punch word, 3–6 words hard-capped), editorial-serif (hairline + script-italic breath scene). Playbook now ships per-template on-screen-text budgets so the planner stops cramming sentences into kinetic slots.
  • Premiere-style timeline lanes — single VIDEO row for all scenes, single VOICE row for all voiceover audio, plus persistent empty MUSIC and SFX lanes ready to fill. Left gutter widened to 96px with text labels (V1 / VOICE / MUSIC / SFX) next to track-type icons. Drives off data-timeline-group so it generalises to any future lane.
  • Two pre-existing render bugs fixedhook-bigtext letter dropouts (cascade now fromTo + CSS keyframe safety net + nowrap per word), Timeline rows flickering / vanishing (RO race + finite-end filter for loop-inflated GSAP timelines).

Test plan

  • 687 core tests pass
  • 233 studio tests pass (7 new — regression coverage for computeEffectiveTimelineDuration and deriveTimelineLaneLabel)
  • Lint, format, typecheck clean across all touched files
  • Live studio confirms 4-lane layout with Premiere-style left-rail labels (VIDEO / VOICE / MUSIC / SFX)
  • Headless capture verifies all three new templates render cleanly at scene timestamps

🤖 Generated with Claude Code

Three connected upgrades in service of cinematic retention:

1) **Three new templates** (`packages/core/src/script/templates/kinetic.ts`)
   - `hook-vhs-rip` — VHS / broadcast-intercept opener with chromatic
     RGB split title, scanlines, jitter, blinking dot meta tags. Built
     for s01 scroll-stoppers. Title capped at ≤6 words.
   - `kinetic-words` — word-by-word reveal where the closing word lands
     heavier (italic + chromatic shadow). 3–6 word array, hard-capped.
     Adds zoom-burst photo entry, scale-impact on emphasis word, and an
     optional camera shake (`shake: true` default) timed to the punch.
   - `editorial-serif` — pure-typography breath scene: hairline rule
     with dot terminator + script-italic phrase. Light/dark variants.

2) **Premiere-style timeline lanes**
   - Runtime: `data-track-index` falls back to `0` (was per-DOM-index),
     so all clips without an explicit lane consolidate onto track 0
     instead of exploding into N rows for N scenes.
   - Assembler: every voiceover audio element now carries
     `data-track-index="1"` + `data-timeline-group="voiceover"` +
     `data-timeline-label="Voiceover"`. Two persistent overlay
     placeholders (`hf-track-music`, `hf-track-sfx`) ship in every
     assembled HTML, anchoring an empty Music lane (track 2) and SFX
     lane (track 3) so the studio always shows them ready to fill.
   - Studio: `TimelineElement.label` plumbed through and rendered on
     the clip face when present, so empty lanes read as MUSIC / SFX
     instead of "DIV".

3) **`hook-bigtext` letter-dropout fix**
   - Cascade switched from `tl.to` to `tl.fromTo` so initial state
     survives any seek order. Final-state `set` clamped to inside the
     scene window. CSS `@keyframes` safety net flips every letter to
     `opacity: 1` 50ms before scene end. Title gets `pre-wrap` +
     `break-word`; words get `nowrap` so individual letters can't wrap
     to a hidden line.

4) **Timeline rows flicker / vanish fix**
   - ResizeObserver no longer disconnects + recreates on same-element
     re-attach (the parent re-render race). Initial width read sync
     via `getBoundingClientRect()` to skip the `viewportWidth=0` flash.
     RO callback skips no-op deltas. `effectiveDuration` extracted to
     pure helper `computeEffectiveTimelineDuration` and now filters
     non-finite ends so a single Infinity-end clip from a loop-inflated
     GSAP timeline can't poison the max and collapse the track width
     to zero. 4 regression tests added.

5) **Visual director + planner**
   - Director: directs `imageId` for `hook-vhs-rip` / `kinetic-words`
     scenes via `treatment: null`, so the planner's chosen template
     stays in place and the photo flows in via `ctx.image`. Rule 9
     forbids attaching images to `editorial-serif` (typography only).
   - Assembler: any template can now resolve `props.imageId` from the
     manifest into `ctx.image`, not just `image-scene`.
   - Playbook: explicit on-screen-text budgets per template
     (≤8 / ≤6 / 3–6 / ≤4 words) with examples of how to compress a
     long narration sentence into a punch headline. Three new entries
     in the visual treatment matrix.
   - Atmosphere defaults: `hook-vhs-rip` / `kinetic-words` /
     `editorial-serif` ship with `studio-flat` so the templates'
     own dense visual layer carries the scene.

Tests: 687 core + 226 studio passing. Lint, format, typecheck clean.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant