Skip to content

feat(studio): an element's source-parsed animations are part of Studio's API - #8061

Merged
miguel-heygen merged 1 commit into
mainfrom
feat/studio-export-element-animations
Nov 17, 2026
Merged

miguel-heygen merged 1 commit into
mainfrom
feat/studio-export-element-animations

Conversation

@miguel-heygen

Copy link
Copy Markdown
Collaborator

What changes

@hyperframes/studio now exports fetchParsedAnimations and getAnimationsForElement, the two steps Studio's own panels use to find the GSAP tweens that address an element:

  • fetchParsedAnimations parses the element's source file on the server.
  • getAnimationsForElement matches the parsed tweens to the element by id or selector.

No behaviour changes.

Why

A host that embeds Studio decides whether a hand move would fight a tween. Until now it read the film's live gsap. Over an opaque (sealed) preview that window is out of reach, and the editing port has no tween read. The source-parsed animations are the same answer either way, and they come from the one place Studio already keeps them. Exporting them lets a host make that check over a sealed preview without a second copy of the parser or the matcher.

What I measured

  • packages/studio/src/elementAnimations.test.ts: green 3 runs in a row; the studio type check is clean.
  • fails without the fix: packages/studio/src/elementAnimations.test.ts "are the parsed tweens that address it by id or selector, read where a sealed preview's host can" fails with the export removed (getAnimationsForElement is not a function).

What I did NOT exercise

  • A host calling fetchParsedAnimations end to end: the function is Studio's own, unchanged; its use in the host comes with the host's change.

No visible change

Two exports, no UI.

@jrusso1020 jrusso1020 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

APPROVE at 13879ab2

  • Export only: index.ts adds fetchParsedAnimations and getAnimationsForElement from hooks/useGsapTweenCache. Their code and the server route fetchParsedAnimations calls are unchanged, so no new server surface.
  • elementAnimations.test.ts imports through the package entry and checks the id and selector matches. With the export removed, it fails with getAnimationsForElement is not a function, which matches the "fails without the fix" line.
  • The commit is verified. No version bump.

Need ✅ · Size ✅ · Reuse ✅ (hosts reuse Studio's parser and matcher instead of copying them) · Simpler ✅
Risk: none. Additive API.

— Rames

@github-actions

Copy link
Copy Markdown
Contributor

Edit accuracy: accurate 267 (base branch 267), smooth 102 of those

The gate passes.
Smoothness is reported in the artifact, not gated. A case fails only if it fails 2 of 3 runs.

Quarantined, measured but not gated (8)

Unstable (1)

  • seqplainkeys-none-px-r0-root-z100: tracking 0.06, pressJump 0, drop 0, reload 0, render 0.03, renderKey -, undo true, teleport true / tracking 0.06, pressJump 0, drop 0, reload 0, render 0.03, renderKey -, undo true, teleport true / tracking 0.06, pressJump 0, drop 0, reload 0, render 0.03, renderKey -, undo true, teleport true

@miguel-heygen
miguel-heygen added this pull request to the merge queue Nov 17, 2026
Merged via the queue into main with commit efc91fc Nov 17, 2026
77 checks passed
@miguel-heygen
miguel-heygen deleted the feat/studio-export-element-animations branch November 17, 2026 09:40
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.

2 participants