Repository navigation
fix(studio): sealed keyframe edits save the same values as a regular preview - #8668
Merged
Merged
Conversation
Contributor
Edit accuracy: accurate 273 (base branch 271), smooth 58 of thoseThe gate passes. Newly passing (2)
Not banked yet, reported and not gated (bank a full-grid run's baseline.json) (2)
Quarantined, measured but not gated (0) |
3 of 4 tasks
jrusso1020
approved these changes
Nov 24, 2026
jrusso1020
left a comment
Collaborator
There was a problem hiding this comment.
Approving at 29d4556.
- fails without the fix: checked. With both source files reverted to the merge-base, the sealed test fails with
borderRadius: 12. The 3 test files pass 20/20 at head, andtscis clean. - The baseline read: the CSS baseline now comes through
previewComputedStyles, so sealed and unsealed compare GSAP's value against the same CSS. Only the 15 baseline properties used the empty read. Rotation, scale and opacity come from the tween. Per-corner radius is covered, and so is an element with no radius (0 against an empty value). - Unsealed path: the only change there is an extra await, and the snapshot wait returns immediately for an unsealed frame.
commitKeyframePropsis the only caller, and it awaits. - File size and captures:
useAnimatedPropertyCommit.tsis 598 lines on the merged result, under the cap, andgsapRuntimeReaders.tsis 126. Before/After captures are present.
Nit: no test covers the new settleGsapSnapshot wait. The test settles before it calls the reader, so removing that await still passes.
Review by Rames
This was referenced Nov 24, 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
Adding a keyframe from the Design panel in a sealed preview now saves the same keyframe as in a regular preview. Before, it also copied the element's corner radius (and any other value another tween animates) into every keyframe of the edited tween, which froze that value for the whole tween.
Why
To fill in a keyframe, Studio reads the element's current GSAP values. For values like
borderRadius,fontSizeorstrokeWidth, it keeps one only when GSAP's value differs from the element's computed CSS, so it never writes a value the stylesheet already gives.A regular preview reads that CSS from the frame's own document. A sealed preview has no document Studio can reach, so the comparison value was always missing and every such value counted as "differs". On a box that rotates in one tween and rounds its corners in another, one rotation keyframe added at 1 s saved
borderRadius: 12and all four corner longhands into the rotation tween's keyframes. That overrides the corner tween, so the corners stop animating. A regular preview saves only the rotation.The read also ran without waiting for the sealed frame's GSAP values at the playhead. Right after a seek, the read could find nothing and the keyframe got no values from GSAP at all.
Related work
Refs #7846 (Studio's preview sealed by default): one of the sealed readers that must give the same result as a regular preview.
How
hooks/gsapRuntimeReaders.ts:readAllAnimatedPropertiesis now async.settleGsapSnapshot, aseditsPlainCssSettleddoes).previewComputedStyles), the same read the property panel uses for a sealed element (components/editor/previewSelection.ts:374). A regular preview still readsgetComputedStyleon its own element.hooks/useAnimatedPropertyCommit.ts: its only caller,commitKeyframeProps, awaits it.Test plan
src/hooks/gsapSealedReads.browser.test.ts: the runtime and GSAP in a sealed frame and in a same-origin one. In both, a rotation commit's read of the box returns only{ rotation: 10 }.HF_PARITY_MODE=sealed|unsealedruns one mode.a rotation commit reads only the rotation tween's channels (sealed)insrc/hooks/gsapSealedReads.browser.test.tsfailed on main withborderRadius,borderTopLeftRadius,borderTopRightRadius,borderBottomLeftRadiusandborderBottomRightRadiusall 12 next torotation: 10. The unsealed case passed on main.gsapRuntimeReaders.test.tsanduseAnimatedPropertyCommit.test.tsx, 3 runs each, green. All 24 Studio test files that cover the changed files, green. tsc, Fallow and the pre-push hooks clean.VITE_STUDIO_OPAQUE_PREVIEW_ENABLED=true) and regular, with a fixture project (a box with a keyframed rotation tween and a separateborderRadiustween). Select the box at 00:01, add a rotation keyframe from the Design panel, then readindex.html:borderRadius: 12and four corner longhandsBefore
Sealed preview on main, the saved timeline after adding the rotation keyframe:
After
Sealed preview on this branch, the saved timeline:
Studio after the edit, sealed, on this branch (the keyframe at 00:01 on the Rotation lane, angle 10°):
Regular preview on this branch, for comparison (same save as on main):