Repository navigation
fix(studio): a sealed scale resize lands where it was dropped - #8301
Merged
Merged
Conversation
A sealed preview's selection is a stand-in that is never in the page, so the nudge's check that the element is still there refused every key and nothing moved. It now uses the same check the selection publisher uses, which keeps a sealed selection until it is replaced.
…d saves where it was drawn A sealed preview's selected element is a stand-in with no animation or translate of its own, so a nudge guessed both from an empty page: it wrote a plain translate over the stylesheet's and the element landed elsewhere after a reload. The nudge now waits for the frame's gesture-start read, the one a press uses, and keys pressed meanwhile join the burst.
…not twice as far When a move ends, the sealed frame kept the translate the gesture drew. A move on GSAP's route saves the new position as GSAP's x and y, so the layer then showed the move twice until the frame loaded again. The frame now drops the drawn translate for those moves; a move saved as a plain translate still keeps it.
… selection or other edit
…ew does not start a nudge
# Conflicts: # packages/studio/src/components/editor/previewGestureStartRead.ts
…te the size as scale
…om/hyperframes into fix/sealed-scale-resize-drop
…ed the size, not scale
…lement no selector addresses
…om/hyperframes into fix/sealed-scale-resize-drop
…s edit is shown, as before
# Conflicts: # packages/studio/src/hooks/gsapResizeIntercept.test.ts
…om/hyperframes into fix/sealed-scale-resize-drop
Contributor
Edit accuracy: accurate 271 (base branch 271), smooth 74 of thoseThe gate passes. Quarantined, measured but not gated (0) |
…ze-drop # Conflicts: # packages/studio/src/components/editor/previewDrafts.ts
vanceingalls
approved these changes
Nov 22, 2026
vanceingalls
left a comment
Collaborator
There was a problem hiding this comment.
Approved at c5d657d, CI green. #8263 is merged, so this now targets main.
- Sealed finalize: it mirrors the live one over requests the port already serves. The drop point is the frame's
geometrywith the draft still drawn. Then it clears the draft,gsap-setdraws the committed scale at the pre-gesture position, re-measures, andgsap-setwrites the correction. The position write is the unsealed path's, and reporting the drag offset as handled removes the second move. - Live path: it moves into
correctOnElementunchanged, including the same-task correction so no frame shows the box off the drop point. previewDraftsSentcan't hang: resolvers flush whensendfinds an empty queue, which.finallyalways reaches, and the port request has its own timeout. A pendingsendsAtTaskEndmicrotask also lands there.- Flag-off: sealed previews are off until #7846, so this is inert for everyone today.
- Tests: the "fails without the fix" test uses the real runtime agent over the port. The bench takes sealed scale-resize drops from 40–54 px to 0.1–0.2 px, matching unsealed.
Non-blocking: on a sealed frame readGsapPositionFromIframe returns null (no contentDocument), so preGesture passes {0,0} and the base comes from the gesture stamp alone. The bench says that's right. A comment at preGesture saying the sealed base comes from the stamp would save the next reader the same trace, and the scale-finalize log's gsapPos will read 0,0 there.
This was referenced Nov 22, 2026
Merged
2 of 4 tasks
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.
Stacked on #8263; retargets main when it merges.
What
In a sealed preview (Studio cannot script the frame), resizing a layer whose GSAP animation scales it now leaves the box where it was dropped. Before, the box landed 40 to 54 px away from the drop, and stayed there after a reload. An unsealed preview already landed it on the drop point.
The sealed preview is off by default until the sealed-by-default change (#7846) lands, so nothing changes for anyone before then.
Why
A scale resize scales the box about its centre, not about the dragged corner. So after saving the scale, Studio measures where the scaled box renders and moves its position onto the point where it was dropped. That step drew on and measured the frame's own element (
iframe.contentDocument), which a sealed preview does not expose. So it skipped:How
The finalize step does the same thing on a sealed frame, over the requests the frame's port already serves (no new request):
geometry) of the element while the drag's draft is still drawn;draft), the committed scale and the pre-gesture position are drawn (gsap-set), and the frame measures the box again;gsap-set) and is saved through the same position write as an unsealed resize. The resize reports that it handled the drag's offset, so no second move is saved.previewDraftsSentwaits until the draft queue's sends are answered, so the measures see the drafts already drawn. The live path is unchanged; it moves intocorrectOnElementbeside the newcorrectOnFrame.Test plan
gsapResizeDropPoint.test.ts, "lands on the drop point in a sealed preview, measured by the frame, with no second move": a sealed frame served by the real runtime agent, with the drag's draft drawn over the port. The resize reports that it handled the drag's offset; the saved scale and position render the box on the drop point, and so does the frame.fails without the fix:
Run on Linux at this head: the drop-point tests pass three runs in a row (13); Studio's
hooks,components/editor,webmcpandplayertests (6690) pass; Studiotscno errors; format clean;fallow auditpasses.Bench
Edit-accuracy bench, move and resize drags of layers GSAP animates (
fromto,keys,scale,size) at r0, root, 100% zoom (24 per run). Compared at #8263's head before its main merge (5626b44) and at this change on top of it:smoothonly)smoothonly)The sealed scale resizes now land where unsealed ones do. Of the 5 sealed failures left, 3 are
keysresizes, which #8288 fixed on main; #8263's head now has main merged. The other 2 failsmoothonly.smooth(frame pacing) is reported and not gated.Before
Sealed preview at #8263, the bench's
scalelayer at 1 s, after a corner drag that grew it. The scale is saved (1.54), but the box sits up and to the left of where it was dropped (53 px at this playhead).After
The same drag at this change: the box sits where it was dropped, 0.2 px off.