Skip to content

fix(studio): a press on an animated layer in a sealed preview starts at once - #9121

Merged
miguel-heygen merged 1 commit into
mainfrom
fix/motion-path-read-only
Nov 30, 2026
Merged

miguel-heygen merged 1 commit into
mainfrom
fix/motion-path-read-only

Conversation

@miguel-heygen

Copy link
Copy Markdown
Collaborator

What

A press on an animated layer in a sealed preview starts its gesture at once again, as it does unsealed. Studio keeps a read of the selected layer's gesture start ready, so a press need not ask the frame first. Asking where a drawn motion path starts counted as a change to the frame, and a drawn motion path asks every frame, so that ready read was thrown away every frame. Each press on an animated layer then waited for the frame to answer. On a busy machine the wait outlasted the first move, so the first frame of a rotate or a resize showed the box one step behind the pointer.

  • Gate: unchanged at 40 behaviours, all with a test. This removes the cause of the sealed-only first-frame misses in the edit accuracy run, which failed rotate-keys-px-r30-root-z50-mid in 2 of its 3 runs in the merge queue and dropped pull requests that changed sealed preview paths.

Why

The sealed preview may only become the default once it behaves as the unsealed one does. In one merge queue run, 10 of 516 sealed drags showed their first tracked frame exactly one step behind (4.64 px for a rotate step, 3 px for a resize step) and none of 492 unsealed drags did. 9 of the 10 were in the first, full run of a shard.

Related work

Follow-up to #9068 and #9089 (the sealed edit accuracy run and its gate) and #9107.

How

  • player/lib/frameFacts.ts: motion-path-home joins the requests that only read the frame. The frame's handler (core/src/runtime/editing/motionPathHome.ts) only measures the layer. Two more reads that were missing join it: assets-unloaded (core/src/lottieReadiness.ts, which only checks media and Lottie load state) and stage-measure (stageMeasure.ts, which Studio itself does not send today).
  • I checked every other kind outside the list. resolve-canvas-key-action puts back deleted nodes, so it is a write. color-grading-previews renders through the grading runtime, which I have not shown leaves the frame unchanged, so it stays a write.
  • Why there: this list is the one place that decides whether a request can change what the frame answers. Any kind missing from it counts as a write, which is the safe default for a kind added later, and these three reads were never added.

Test plan

  • fails without the fix: "starts a press at once while a drawn motion path keeps asking the frame where it starts" (packages/studio/src/components/editor/gestureStartReadAhead.sealed.test.ts) asks the frame where the selected layer's motion path starts, then presses. Without the fix the press waits on the frame and no gesture starts.

  • frameFacts.test.ts now also sends the three kinds and hears no change.

  • The 17 Studio test files that use the frame facts, the read made before a press, the motion path data or the asset check: 197 of 197, 3 runs in a row. tsc --noEmit in packages/studio: exit 0.

  • Edit accuracy bench, sealed build, the 25 cases of the merge queue's shard 3 with a log of each press: before, 17, 19, 18 and 18 of 26, 26, 26 and 22 presses started from the read made before them, and every miss was that read thrown away by a frame change. In a separate logged run of the two rotate cases, 618 of the 809 requests counted as frame changes were motion path asks. After (a build with motion-path-home and stage-measure added, before assets-unloaded was), 24 and 25 of 26, and each miss followed an edit's save in a sequence case. The first-frame miss itself shows only on the merge queue's runners, so it is not measured here.

  • Unit tests added/updated

  • Manual testing performed

  • Documentation updated (if applicable)

  • Comments follow CONTRIBUTING.md "Comments": they say why, not what, and a bug fix says what the code must do and how to reproduce the bug

No visible change

The sealed preview is not on by default. In a sealed preview, the first frame of a drag on an animated layer now follows the pointer as it does unsealed.

…at once

A drawn motion path asks the frame where it starts every frame. That ask
counted as a change to the frame, so the read a press starts from was thrown
away every frame and each press on an animated layer waited for the frame.
On a busy machine the first move showed a step behind the pointer.

motion-path-home, assets-unloaded and stage-measure only read the frame; they
join the list of read-only requests.

@terencecho terencecho left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All three requests read frame state. A delayed gesture-start reply stayed usable across those reads and became stale after a draft write. The named regression passed and failed when motion-path-home was removed from the read list.

105 Studio tests, 232 Core tests, and the Chromium motion-path test passed. The sealed rotate case passed locally with no press jump. Merge-queue timing remains unverified.

— tai (automated review)

@github-actions

Copy link
Copy Markdown
Contributor

Edit accuracy: accurate 275 (base branch 273), smooth 51 of those

The gate passes.
Smoothness is reported in the artifact, not gated. A case fails only if it fails 2 of 3 runs.

Newly passing (2)

  • seqscaletwice-scale-px-r0-root-z100
  • seqscaletwice-scale-px-r0-nested-z100

Not banked yet, reported and not gated (bank a full-grid run's baseline.json) (2)

  • seqscaletwice-scale-px-r0-root-z100
  • seqscaletwice-scale-px-r0-nested-z100

Quarantined, measured but not gated (0)

@miguel-heygen
miguel-heygen added this pull request to the merge queue Nov 30, 2026
Merged via the queue into main with commit 8b80c24 Nov 30, 2026
84 checks passed
@miguel-heygen
miguel-heygen deleted the fix/motion-path-read-only branch November 30, 2026 06:15
@miguel-heygen miguel-heygen mentioned this pull request Nov 30, 2026
4 of 5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants