Skip to content

fix(studio): a waiting press says whether it waits on the frame or a save - #8596

Merged
miguel-heygen merged 6 commits into
mainfrom
test/bench-sealed-press-rest-2
Nov 23, 2026
Merged

miguel-heygen merged 6 commits into
mainfrom
test/bench-sealed-press-rest-2

Conversation

@miguel-heygen

Copy link
Copy Markdown
Collaborator

What

Studio's waiting selection box now says why a press waits: data-dom-edit-press-waiting="frame" when a sealed press only waits for the frame's answer, "save" when it waits on a save, a reload, or an earlier press. The edit-accuracy bench uses it to measure a sealed press the way it measures an open one: by the element until the pointer moves, unless the press waits on a save, where the element is stale and the box is what's shown.

This re-lands #8582, which was reverted because it read the element for every waiting press. In seqheldtwice-tlhold-px-r0-root-z100 the second resize is pressed while the first save is still in flight, so the element sat 312 px from the box Studio showed, and the case failed.

Why

Every sealed press waits about 24-38 ms for the frame's answer, with nothing reloading, and Studio marks its box as waiting meanwhile. An open press waits only when a save or reload is in flight. Until the pointer moves, a box waiting on the frame is Studio's outline at rest, up to 0.2 px off the element's own box in both modes, so scoring it made sealed tracking and teleport read 0.06-0.15 px worse than open on drags that draw the same thing. A box waiting on a save is different: it is drawn where the press will land while the element still sits where the last save left it. The attribute alone could not tell the two apart. Studio knows which it is when it starts the wait, so it says so.

How

  • packages/studio/src/components/editor/previewGestureStarts.ts: a waiting press is "save" when it queues behind another press, the preview is changing, or an edit is saving; otherwise "frame".
  • packages/studio/src/components/editor/pressOutline.ts: waitOnSave(reason) writes it. It stays the attribute's one setter; every reader tested only its presence.
  • packages/studio/tests/e2e/edit-accuracy/case.mjs and teleport.mjs: at the press, and in the tracker until the pointer first moves, a box waiting on "frame" gives way to the element; any other waiting box still stands in for it.

Test plan

  • 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

fails without the fix: packages/studio/src/components/editor/previewOverlayRects.test.ts, "says why a press on an opaque frame waits, the preview changing: %s" (on main the box reads "true" in both); packages/studio/tests/e2e/edit-accuracy/settle.test.mjs, "reads the waiting box at the press while it waits on a save" (with #8582's rule it read the element, 0 against 260) and "reads the element at the press, before the pointer moves"; packages/studio/tests/e2e/edit-accuracy/teleport.test.mjs, "scores a press that waits on Studio from the box Studio shows" (with #8582's rule 312 against 0) and "scores a press that waits with the pointer still like one that never waited".

Existing tests that changed: "drags its element on the reloaded preview, at the time it was pressed" (gestureHoldsPreviewReload.test.tsx) now checks the box says "save", not only that it waits; a stand-in outline in teleport.test.mjs gets the getAttribute the sampler now reads.

With the fix, on a Linux machine: the touched files and the bench's own tests pass three runs in a row (192 tests), the push gate's 16 covering files pass, and tsc, Fallow and pre-push are clean.

Bench, every seqheldtwice case (nested and root) built from main, four runs per mode, worst per run in px:

tracking teleport drop and reload
open 0.09-0.40 0.15-0.36 0.39
sealed 0.09-0.40 0.36-0.40 0.39

All 16 case runs pass every check. #8582 failed the root case in every run with a 312 px press jump. The 13 scale-resize cases were measured for #8582, whose rule for a press waiting on the frame this keeps; they were not rerun on this head.

No visible change

The box looks the same: the attribute's value changes and no style reads it.

…ss-rest-2

# Conflicts:
#	packages/studio/tests/e2e/edit-accuracy/case.mjs
#	packages/studio/tests/e2e/edit-accuracy/settle.test.mjs
#	packages/studio/tests/e2e/edit-accuracy/teleport.mjs
#	packages/studio/tests/e2e/edit-accuracy/teleport.test.mjs
@github-actions

Copy link
Copy Markdown
Contributor

Edit accuracy: accurate 271 (base branch 271), smooth 65 of those

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

Quarantined, measured but not gated (0)

@vanceingalls vanceingalls left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

#8582 was reverted because it read the element for every waiting press, and a press made while a save was in flight sat 312 px off. This version has Studio say why it waits: "save" when the press queues behind another press, the preview is changing, or an edit is saving, and "frame" otherwise; the bench reads the element before the pointer moves only for a frame wait, so the seqheldtwice case is scored as before. Other readers of data-dom-edit-press-waiting only check presence. Fix-line tests reproduce #8582's failure and edit-accuracy is green. Approving.

Note: this conflicts textually with #8578 in previewOverlayRects.test.ts (the opts object moved into pressOn()); whichever merges second needs a rebase and pressOn must carry onBlockedMoveRef.

@miguel-heygen
miguel-heygen added this pull request to the merge queue Nov 23, 2026
Merged via the queue into main with commit d3c16bb Nov 23, 2026
83 checks passed
@miguel-heygen
miguel-heygen deleted the test/bench-sealed-press-rest-2 branch November 23, 2026 20:17
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