Skip to content

feat(studio): runtime-first dynamic keyframe system [8/10]#1190

Open
miguel-heygen wants to merge 1 commit into
feat/keyframes-5-split-clipfrom
feat/keyframes-6-dynamic-keyframes
Open

feat(studio): runtime-first dynamic keyframe system [8/10]#1190
miguel-heygen wants to merge 1 commit into
feat/keyframes-5-split-clipfrom
feat/keyframes-6-dynamic-keyframes

Conversation

@miguel-heygen
Copy link
Copy Markdown
Collaborator

Summary

  • Read GSAP keyframes from live runtime (tween.vars.keyframes) instead of AST only
  • hasUnresolvedKeyframes / hasUnresolvedSelector flags on GsapAnimation
  • scanAllRuntimeKeyframes discovers all keyframed tweens in the iframe
  • materializeKeyframesInScript + unrollDynamicAnimations — on first edit, dynamic loops are replaced with individual static tl.to() calls
  • Keyframe cache: interval-based runtime scan, dual-write keys, immediate update from mutation response
  • easeEach placement fix (inside keyframes object, not tween vars level)
  • Retry effect for cold-load animation fetch race

+773 LOC

…lization

Read GSAP keyframe data from the live runtime instead of only the AST parser.
Dynamic keyframes (loops, variables, computed selectors) now show diamonds
on timeline clips and animation cards in the design panel.

On first edit, dynamic code is automatically materialized:
- Unresolved keyframes (keyframes: kf) replaced with static object
- Unresolved selectors (tl.to(sel, ...)) entire loop unrolled into
  individual static tl.to() calls per element

Key changes:
- Parser: hasUnresolvedKeyframes/hasUnresolvedSelector flags
- Runtime bridge: scanAllRuntimeKeyframes reads tween.vars from iframe
- Tween cache: interval-based runtime scan for dynamic animations
- materializeKeyframesInScript + unrollDynamicAnimations parser functions
- Keyframe cache dual-writes both sourceFile#id and index.html#id keys
- commitMutation updates cache from mutation response
- easeEach placement fix (inside keyframes object, not tween vars)
@miguel-heygen miguel-heygen force-pushed the feat/keyframes-6-dynamic-keyframes branch from 6e391b2 to eca150f Compare June 4, 2026 04:57
@miguel-heygen miguel-heygen force-pushed the feat/keyframes-5-split-clip branch from 4e164ee to 0dbfe93 Compare June 4, 2026 04:57
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