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
Draft
miguel-heygen wants to merge 1 commit into
miguel-heygen wants to merge 1 commit into
Conversation
…side its template
Edit accuracy: 461 passing here, 434 on the base branchThe gate fails: 27 newly passing case(s) are not banked in baseline.json. Newly passing (27)
Not banked (commit the artifact's baseline.json) (27)
|
This branch has not been deployed
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.
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-serverroutes/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>.