Skip to content

fix(studio): a first animation in a sub-composition file runs from inside its template - #4806

Draft
miguel-heygen wants to merge 1 commit into
mainfrom
fix/studio-first-animation-in-template
Draft

miguel-heygen wants to merge 1 commit into
mainfrom
fix/studio-first-animation-in-template

Conversation

@miguel-heygen

Copy link
Copy Markdown
Collaborator

What changes

The first GSAP edit on a GSAP-free sub-composition file now puts the GSAP script and timeline inside the file's <template>, where the composition loader runs them. Before, a file with no <body> (every sub-composition file is only its <template>) got the script appended after </template>. The loader never runs it, so that first edit was saved but never showed, in the preview or in a render.

Moves and nudges of GSAP-free elements stop writing GSAP at all in #4799. This covers the remaining ways in, such as the first animation added to a GSAP-free sub-composition.

How

prepareGsapMutationScript (studio-server routes/files.ts) still inserts before </body> when the file has one. Otherwise it inserts before the last </template>, which in a nested template is the outer one. Only when a file has neither does it fall back to appending at the end. It is a string insertion, so no <head> or <body> is added to the file.

Test

files.test.ts: "a first animation in a sub-composition file lands inside its template". Without the fix it fails, because the script sits after </template>.

@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown

Edit accuracy: 461 passing here, 434 on the base branch

The gate fails: 27 newly passing case(s) are not banked in baseline.json.
Smoothness is reported in the artifact, not gated. A case fails only if it fails 2 of 3 runs.

Newly passing (27)

  • nudge-none-center-r0-nested-z100
  • resize-none-center-r0-nested-z50
  • resize-none-center-r30-nested-z200
  • move-none-center-r0-nested-z200
  • nudge-none-center-r30-nested-z50
  • rotate-none-center-r0-nested-z50
  • rotate-none-px-r0-nested-z50
  • move-none-center-r30-nested-z100
  • resize-none-center-r0-nested-z200
  • rotate-none-pct-r0-nested-z100
  • nudge-none-center-r0-nested-z50
  • nudge-none-center-r30-nested-z200
  • resize-none-center-r30-nested-z100
  • rotate-none-center-r0-nested-z200
  • rotate-none-px-r0-nested-z200
  • move-none-center-r0-nested-z100
  • move-none-center-r30-nested-z50
  • nudge-none-center-r0-nested-z200
  • resize-none-center-r0-nested-z100
  • rotate-none-pct-r0-nested-z50
  • nudge-none-center-r30-nested-z100
  • resize-none-center-r30-nested-z50
  • rotate-none-center-r0-nested-z100
  • rotate-none-px-r0-nested-z100
  • move-none-center-r0-nested-z50
  • move-none-center-r30-nested-z200
  • rotate-none-pct-r0-nested-z200

Not banked (commit the artifact's baseline.json) (27)

  • nudge-none-center-r0-nested-z100
  • resize-none-center-r0-nested-z50
  • resize-none-center-r30-nested-z200
  • move-none-center-r0-nested-z200
  • nudge-none-center-r30-nested-z50
  • rotate-none-center-r0-nested-z50
  • rotate-none-px-r0-nested-z50
  • move-none-center-r30-nested-z100
  • resize-none-center-r0-nested-z200
  • rotate-none-pct-r0-nested-z100
  • nudge-none-center-r0-nested-z50
  • nudge-none-center-r30-nested-z200
  • resize-none-center-r30-nested-z100
  • rotate-none-center-r0-nested-z200
  • rotate-none-px-r0-nested-z200
  • move-none-center-r0-nested-z100
  • move-none-center-r30-nested-z50
  • nudge-none-center-r0-nested-z200
  • resize-none-center-r0-nested-z100
  • rotate-none-pct-r0-nested-z50
  • nudge-none-center-r30-nested-z100
  • resize-none-center-r30-nested-z50
  • rotate-none-center-r0-nested-z100
  • rotate-none-px-r0-nested-z100
  • move-none-center-r0-nested-z50
  • move-none-center-r30-nested-z200
  • rotate-none-pct-r0-nested-z200

This branch has not been deployed

No deployments
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