Repository navigation
fix(studio): a sealed gesture recording shows every recorded value live - #8598
Conversation
… and saves the jump
…e reruns its script
…tand-in, one re-read per rerun
… an unsealed one does
…an open preview does
… into fix/sealed-recording-sets-gsap-live
…ed offset less its start
terencecho
left a comment
There was a problem hiding this comment.
P2 — Preserve sparse recording updates when a draft is in flight. packages/studio/src/components/editor/previewDrafts.ts:118–133 replaces the entire pending draft for a handle. Recording samples only include the properties changed by that frame. I held a draft reply, queued a depth update, then queued a position update. After the reply, the frame received only position. In the recorder, the wheel delta is cleared after that sample, so the depth change can be present in the saved recording without ever appearing in the sealed preview. Preserve pending updates to distinct properties in order, or send an equivalent state that respects the timeline seek.
All 244 focused core and Studio tests passed. A held-reply test reproduced the dropped property at this head. I did not rerun the browser bench.
— tai (automated review)
…replacing a waiting one
… fix/sealed-recording-sets-gsap-live # Conflicts: # packages/studio/src/hooks/useGestureRecording.sealed.test.tsx # packages/studio/src/hooks/useGestureRecording.ts
|
Fixed in 2e7040a: a waiting draw is replaced only when neither it nor the new one carries props, so recording samples queue in order and the frame applies each one after its own seek. Merging per property instead would keep an older x past the next seek on a tweened layer, where the open recorder lets the tween drive it. Your held-reply case is the row "sends every recording sample that waited, in order, so none the recording saves goes unshown" ( |
terencecho
left a comment
There was a problem hiding this comment.
The queue now preserves sparse recording samples in order, with each sample tied to its own seek. The held-reply regression reproduced the dropped depth update against the previous implementation and passed at this head. The merged recorder also keeps a single move-only fallback. All 245 focused tests passed. I did not rerun the browser bench. Full CI checks remain deferred until retargeting, as described in the PR.
— tai (automated review)
…ected undo redraws the drop
…draft # Conflicts: # packages/studio/src/components/editor/gsapMoveSealedPreview.test.ts # packages/studio/src/components/editor/manualOffsetDrag.ts
… secpub/sealed-recording-sets-gsap-live # Conflicts: # packages/studio/src/hooks/useGestureRecording.ts
terencecho
left a comment
There was a problem hiding this comment.
The patch against the merged base matches the previously reviewed changes. The focused Core and Studio suites passed all 136 tests, covering queued recording samples, draft clearing, and the merged tween-restore behavior. The PR body names the regression tests. The browser edit-accuracy run was outside this merge-delta review.
— tai (automated review)
# Conflicts: # packages/core/src/runtime/editingDraft.ts
terencecho
left a comment
There was a problem hiding this comment.
The import conflict resolution preserves both sides. Compared against their respective bases, the recording patches match apart from import placement. All 134 focused Core and Studio tests passed, and the PR body names the failing tests.
P2 — The inherited restore redraw can also overwrite a live recording sample. I exercised this head with real GSAP. A recording props draft on B drew x=81. Restoring an independent drag on A then returned B to the timeline's x=10, although B's recording draft was still active. That is the same redraw blocker reported on #8587, now verified for the props route here. The two PRs can share the fix that preserves active drafts during restore. Base review
I did not rerun the full browser bench.
— tai (automated review)
… where it is drawn
# Conflicts: # packages/core/src/runtime/editingDraft.ts # packages/core/src/runtime/editingDraftRestore.test.ts
…, rotation included
# Conflicts: # packages/core/src/runtime/editingDraft.ts # packages/core/src/runtime/editingDraftRestore.test.ts
…root timeline it redraws
…ot timeline at the playhead
terencecho
left a comment
There was a problem hiding this comment.
P2 — Restoring one draft can rewind the shared playhead. In editingDraft.ts:267–276, restoring one element replays another element’s recording via drawProps, which seeks the root timeline to the recording’s last sample time. In a real GSAP runtime probe, B’s live sample was drawn at 1 s, the player then sought to 2 s, and restoring A rewound the root timeline to 1 s. Reapply the recorded values without seeking during restoration. The seek still belongs on the initial sample draw.
The earlier independent-layer recording and unowned-width cases pass. The runtime built and all 147 focused Core and Studio tests passed. The new playhead probe failed as described. I did not rerun the browser bench.
— tai (automated review)
Edit accuracy: accurate 273 (base branch 271), smooth 74 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) |
# Conflicts: # packages/core/src/runtime/editingDraft.test.ts # packages/core/src/runtime/editingDraft.ts # packages/core/src/runtime/editingDraftRestore.test.ts # packages/core/src/runtime/editingPort.ts
…s into named steps
terencecho
left a comment
There was a problem hiding this comment.
Restoring one layer now reapplies another layer’s live values without seeking the timeline. The regression test checks both the playhead and the replayed value. The latest delta preserves the rotation and property merge behavior, and Fallow passed. All 69 targeted runtime tests passed locally. The broader CI matrix is still running.
— tai (automated review)
What
On a sealed preview, a gesture recording now shows every recorded value live, the way an open preview does: scale and opacity (cmd), rotation (alt), 3D turns (shift) and depth (wheel), not only the move. A layer with its own position tween now shows the recorded position, not its tween plus an offset.
Stacked: waits on #8565 and #8587, and its base is #8587's branch. It goes back to
mainonce those land. A stacked PR's CI skips the Build and Studio edit-accuracy gates, so they run after the retarget.Why
An open preview's recorder seeks the film's timeline and calls
gsap.setwith every recorded value on each frame, thenclearPropswhen it stops (applyRuntimePreviewandreleaseRuntimePreviewinuseGestureRecording.ts). A sealed frame doesn't expose its window, so #8592 could only draw the move, as a CSS translate over the layer's own GSAP state.Related work
Builds on #8587's GSAP draft route, so there is one route that writes GSAP values from Studio into a sealed frame, and on #8592 (the move) and #8568 (the start values).
How
editingPort.ts: a draft may carryprops: { seconds, values }, wherevaluesare GSAP's x, y, opacity, scale, rotation, rotationX, rotationY and z. A draft whose props set x or y must have a null translate, so each draft has one writer of GSAP's position.editingDraft.ts: the frame seeks the film's timeline tosecondsandgsap.sets the values in the same task, so no paint shows the seek without them. It reveals the clip as the open preview does. A newclearend (editingDraftEnd.ts) clears exactly the props the draft set, puts the inline style back and redraws the timeline at its time.restoreis unchanged, for a cancelled drag.editingGestureStart.ts: thegesture-basereply saysdrawsProps, so Studio knows the frame can do this.useGestureRecording.tsandpreviewDrafts.ts: when the reply saysdrawsProps, each sample goes as a props draft and the playhead moves in the store, as the open recorder moves it. Stopping ends the draft withclear. An older runtime keeps fix(studio): a sealed gesture recording moves the layer live in the preview #8592's move.redrawOwned(from the base PR), which draws only the parts that draft carries; this PR adds the recorded values to it. A layer's live record keeps every value its recording has set so far, since a sample carries only what changed.Before
Sealed preview, a layer tweening its own x/y, mid-recording after a move and then an alt-drag turn: no turn, and the box sits at its tween plus the drawn move.
After
Same recording: the layer is turned and placed as the open preview shows it (the same box at all four corners).
Test plan
fails without the fix:
packages/core/src/runtime/editingDraft.test.ts: "seeks the film's timeline, then sets every recorded value, in one draw", "clears exactly what it set and gives the layer back its translate when the recording ends";packages/core/src/runtime/editingGestureStart.test.ts: "reads GSAP's x, y, opacity and scale for a layer no tween touches";packages/studio/src/hooks/useGestureRecording.sealed.test.tsx: "has a frame that can set every recorded value set them at the recording's time, and clear them on stop";packages/studio/src/components/editor/previewDrafts.test.ts: "sends every recording sample that waited, in order, so none the recording saves goes unshown".packages/core/src/runtime/editingDraftRestore.test.ts: "keeps another layer's live recording when a drag is restored", "keeps another layer's live recording when a recording ends", "replays every value another layer's live recording has set when a drag is restored". Each also fails alone with its own piece taken out: the clear path's replay, the recorded values inredrawOwned, and the live record's merge of earlier samples.The refused props drafts in
editingAgent.test.ts(empty, negative time, unknown prop, string value, extra key, and props with x beside a translate) pass before the change too, since the old parser refused any props.previewDrafts.test.tsanduseGestureCommit.test.tsxpass three runs in a row on Linux. Core'ssrc/runtime(3,618 tests) and Studio's editor, hooks and player (6,876 tests) pass, and both typecheck clean.move-tweencase (the layer tweens its own x/y), recording a move then an alt-drag turn: sealed, the layer's box mid-recording is the same as unsealed's at all four corners. Before, the sealed layer didn't turn and sat elsewhere.