Repository navigation
fix(studio): a sealed save draws in the reply's task and spares a regrab's draft - #8563
Conversation
Edit accuracy: accurate 271 (base branch 271), smooth 58 of thoseThe gate passes. Quarantined, measured but not gated (0) Unstable (1)
|
terencecho
left a comment
There was a problem hiding this comment.
P2 — The fallback redraw can rewind a repeating timeline. In patchTween.ts, drawWhatTheSeekLeft passes parent.time() to redrawGsapTimelineAt, which seeks with totalTime(). At total time 1.25 on a one-second yoyo timeline, the local time is 0.75. I checked with GSAP: this redraw seek moves the timeline from iteration 2 to iteration 1. The tween can then look initialized and the frame can answer patched after drawing the wrong iteration. Please preserve the repeat position and add a test with a deferred seek and a patched tween in a later iteration.
— tai (automated review)
|
Fixed in 254ed00: New row in |
terencecho
left a comment
There was a problem hiding this comment.
The fallback redraw now preserves the repeating timeline’s total position. The new second-pass yoyo regression checks both the patched value and the position. I ran 91 targeted core tests, including the redraw adapter tests. The PR still documents residual flashes in the broader edit bench. Required CI is still running.
— tai (automated review)
* chore: release v0.9.85 * chore: release notes for v0.9.85 list heygen-com#8563 * chore: release notes for v0.9.85 list heygen-com#8561 and heygen-com#8570
What
On a sealed preview, a move's save that the frame applies is now drawn in the same step as the reply, so the frame answers "patched" and Studio skips the soft-reload fallback. And a layer grabbed again before the previous drag's save lands keeps its new draft: the older save no longer ends it.
Both target the one-frame flash on the edit bench's
seqheldtwice-tlhold-pxcase: the held layer showed 312 px away, where the drag began, in 3 of 3 sealed runs (unsealed: 0.1 px). The flash is reduced, not gone. Something else still causes it, and it isn't rooted yet (see Test plan).Why
There were two causes, each enough to flash on its own.
A patch the frame applied but didn't draw. A sealed save asks the frame to patch the live tweens (
patch-tweens), and the drag's draft end rides that message (#8473). The frame ends the draft only if the patch is on screen, andpatchTweenschecks that through GSAP's_initted, as of #8517. A Studio preview's seek paints asynchronously (seekWhenReadyroutes to the native preview seek), so in a live preview the patched tween hadn't rendered when the reply was computed. The frame answeredpatched: false, and Studio sent the draft end alone and soft-reloaded. The end painted first, with the layer at the old held value under the drag's drawn offset, then the reload drew the saved place.An older save that ended a newer gesture's draft. When a layer is grabbed again before the previous drag's save goes out, the new drag draws into the same draft entry (
drawPreviewDraftmerges onto it), which is still armed for the older save. The older save then took that end with it, and its patch cleared the new drag's drawn offset for a frame, until the next pointer move drew it again.Related work
Refs #7846 (Studio's preview sealed by default). Follows #8473 (the draft end rides the save) and #8517 (the patch reply reads whether the tween rendered).
How
patchTween.ts): after a seeking patch,patchTweensredraws, in its own task, the timeline of any patched tween the playhead has reached but the seek left undrawn, at that timeline's total time so a repeating or yoyo timeline stays on its pass. It usesredrawGsapTimelineAt, the redraw the runtime already uses for held scenes. The reply is then true, and the draft end paints in the same task as the patched value. An unsealed preview's seek draws synchronously, so it never reaches the redraw.previewDrafts.ts): a draw onto a draft entry already armed for a save disarms it. A new draw there means a newer gesture owns the element. The older save carries no end, its.finallyalready skips a gesture that's no longer current, and the newer gesture arms its own end when it's released.patchTween.sceneRestrows that pinnedpatched: false(a set in a child timeline that already ended, and no player) now draw and answer patched.No visible change
On a sealed preview, a held layer's save no longer goes through a reload, and a quick second grab keeps following the pointer. The interface itself doesn't change.
Test plan
fails without the fix:
packages/core/src/runtime/editing/patchTween.sceneRest.test.ts: "draws a patched root hold in the patch's own task, and answers patched", "draws the patched set in a child timeline that already ended, and answers patched", "draws the patch itself when no player seeks the scene it changed", "draws a patched hold on a yoyo timeline's second pass without rewinding it to the first" (fails with the redraw at the timeline's local time);packages/studio/src/components/editor/gsapMoveSealedPreview.test.ts: "leaves the regrab's draft alone when the older save lands", "ends only the newest gesture's draft when three saves land out of order"."puts a cancelled regrab back where the older save left it, not where the older drag began" and "leaves the regrab's draft alone when the older save fails" pass on main too. They pin that disarming keeps a cancelled regrab and a failed older save right. In
previewDrafts.test.ts, #8537's flush row now arms after the last draw, the order a real release takes.src/runtime/editing(17 files, 208 tests) and StudiogsapMoveSealedPreviewandpreviewDrafts(40 tests) pass three runs in a row on Linux.src/runtime(164 files, 3,597 tests) and producer unit (1,540 tests) pass; core and Studio typecheck clean. Producer integration failed 1 of 344 and engine failed 1 of 3,644 (deliveryEncoderOptionsVBV bound); both passed when rerun on the branch, and the engine file passed twice.resize-*case plus the row's 12 sequences), 3 jobs, 2 sealed and 2 unsealed runs each; each run read its preview frame's origin in-run (nullsealed,http://127.0.0.1:5800unsealed). Unsealed: no failing check on either side. Sealed,seqheldtwice-tlhold-pxworst drag-step jump: root 312.4 and 234.3 px on main, 203.1 and 312.4 on the branch; nested 312.4 and 312.4 on main, 171.8 and 218.6 on the branch. The other sealed failing checks are the same set on both sides (seqfastkeys-none-pxteleport 2/2 each; a tracking miss in 1-2 runs ofseqheldtwiceandseqplainkeys-none-center;resize-scale-px-onteleport 1/2 on main, 2/2 here).