Repository navigation
fix(core): a sealed move inside a nested composition shows where it was dropped - #8517
Merged
Merged
Conversation
…e the frame says patched
…ers-nested-timeline
…ers-nested-timeline
…ers-nested-timeline
Contributor
Edit accuracy: accurate 271 (base branch 271), smooth 66 of thoseThe gate passes. Quarantined, measured but not gated (0) Unstable (1)
|
jrusso1020
approved these changes
Nov 22, 2026
jrusso1020
left a comment
Collaborator
There was a problem hiding this comment.
A sealed move inside a nested composition now redraws that composition, and the frame answers patched only once the patched tween has actually rendered.
Need ✅ · Size ✅ · Reuse ✅ · Simpler ✅ · Structure ✅
Risk: low. Redraw marks come only from patchTween, so playback and renders keep the skip for scenes at rest. The new patched: false answers go to Studio's existing reload fallback.
- Which tests fail without the fix: with main's
gsap.ts,patchTween.tsandinit.tsput back, all 5 rows named in the body fail. In the 1-deep scene case the element stays at 40 instead of 300; the others get the wrongpatchedanswer. At this head all 7 pass, and so do the 1,460 tests underruntime/editing,runtime/adaptersandruntime/init*. - Scene skip:
takeSceneRedrawDueis read beforerestsAt, so a marked scene is always seeked once, then redrawn byredrawGsapTimelineAtwhen the seek itself drew nothing.markRestingScenesForRedrawonly marks timelines that are already inrestingAt, so the root and scenes never seeked are left alone. A mark on a scene the loop doesn't visit just stays put: its tween doesn't render, and the frame answerspatched: false, so Studio reloads. patchedcheck:renderedOnceReachedcompares against the parent's localtime(), so a tween the playhead hasn't reached doesn't block the answer. A_inittedfalse-negative only costs a reload; it can't make a stale edit look applied.- Keyframe rebuild: the children snapshot is taken after
kill(), sofindreturns the replacement tween. IfgetChildrenwere missing, the patch would now report not-applied instead of applied. That's safe, and real GSAP always has it. - Reuse: the root path and
seekGsapTimelinenow shareredrawGsapTimelineAt, which removes the duplicated bind block ininit.ts. - Nit:
redrawGsapTimelineAtreturns early when there is nototalTime, butseekGsapTimelinestill returnstrue(redrawn) on that path. Main threw there instead. It's unreachable for GSAP timelines, so this is not a blocker.
— Rames (hf-review)
This was referenced Nov 22, 2026
Merged
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
On a sealed preview, moving an element that lives inside a nested composition now shows the move. Before, the save landed in the file, the frame said the edit was applied, and the element stayed where it was. When Studio then removed the drawn offset, the element jumped back to its old spot.
Why
A sealed save patches the live GSAP tween in the frame and asks for a redraw at the current time. The runtime seeks each nested composition's timeline on its own, and skips one that already rests at the time it would draw. That skip is right for playback and renders: nothing changed, so nothing needs drawing. After a patch, though, the scene still rests at the same time, so it was skipped. Even a seek to that same time draws nothing in GSAP. The root timeline doesn't have this problem because its seek redraws afterwards; the scene seek never did.
The frame then answered
patched: trueanyway. Studio trusted that answer, so the save's end dropped the drawn offset and the element showed its old position.The edit-accuracy sequence
seqheldtwice-tlhold-px-r0-nested-z100shows it on every sealed run: after the move, the element sits 312 px from where it was dropped, while the saved file is right. Unsealed, it passes.Related work
Refs #7846 (Studio's preview sealed by default): its edit-accuracy gate flags this sequence. Builds on #8473, whose save carries the end of the drawn offset and falls back when the frame says it could not apply the edit.
How
sceneRest.ts(new) owns the record of where each scene timeline last rested, whichinit.tskept in a private map, plus a "redraw due" mark.patchTweenmarks the resting timelines above the patched tween as due. The scene seek loop never skips a due scene, and redraws it after its seek with the same redraw the root timeline uses. That redraw is now one helper,redrawGsapTimelineAt, called by the root path,seekGsapTimelineand the scene path, instead of two copies.patchedonly when each patched tween that the playhead has reached has rendered since the patch. The check reads GSAP's internal_initted:invalidate()clears it and the tween's next render sets it again. The runtime already reads GSAP internals (_zTime,_act,_ts) in its redraw code; a test pins this one against the GSAP version we ship.patched: false, and Studio's existing fallback applies the edit by reloading instead of showing a stale element.Limit: a patched tween inside an author's own child timeline that has already ended is still not redrawn, by this change or by the root's redraw. It now answers
patched: false, so the edit shows after the fallback reload rather than staying stale.No visible change
On a sealed preview, a move of an element inside a nested composition now shows where it was dropped. The interface itself doesn't change.
Test plan
fails without the fix:
packages/core/src/runtime/editing/patchTween.sceneRest.test.ts, run against the real runtime and real GSAP:"still skips a scene at rest that no patch touched" passes before and after; it fails if every scene is redrawn, so the skip stays. "is cleared by invalidate() and set again by the tween's next render" pins GSAP's
_initted. With the reply trusting the redraw bookkeeping instead of the render, the ended-child and nothing-draws rows fail.packages/core/src/runtime(163 files, 3,570 tests) passes three runs in a row on Linux.coreRuntimeBrowser,bundleScriptPolicy,vfxDeterminismandhiddenClipCascade(130 tests), andfileServer,htmlCompilerandprobeStageunder bun (380 tests).gsap-call-render-seek,gsap-redraw-start-and-overlap,hf2550-video-subcomposition-ghost,nested-sequential-video-local-start,nested-subcomp-depth-3,static-dedup-nested-visibility,sub-comp-class-selector,sub-comp-height-percent,sub-comp-id-selector,sub-comp-t0,sub-composition-video,subcomp-bare-fragment.seqheldtwice-tlhold-px-r0-nested-z100the move now shows where it was dropped. Its drop and reload checks pass 3 of 3; before, they failed 3 of 3. Its undo check still fails sealed, from a separate cause.