Repository navigation
fix(studio): a sealed resize stops asking the frame for an uncropped layer's size every step - #8895
miguel-heygen wants to merge 1 commit into
Conversation
…layer's size every step
|
The same sealed resize (edit accuracy bench, BeforeAfter |
Edit accuracy: accurate 273 (base branch 271), smooth 72 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) |
jrusso1020
left a comment
There was a problem hiding this comment.
Reviewed at a7cce2f. Read only (full readStandInStart, useStandInStart and manualEditGesture.ts); I did not run the tests.
Approve.
Need: yes, one frame read per pointer step for a layer whose handles cannot change · Size: small (15 source lines, 3 tests) · Reuse: isStudioManualEditGestureActive and afterStudioManualEditGestures, no new wait mechanism · Simpler: no · Structure: fine
Risk: low. The skip needs both a live gesture on this element and zero insets and radius, so a cropped layer keeps today's path. The crop press does its own read, so a stale start during the resize is never used for a drag.
Checked:
heldis set once (??=), cleared before the deferred read, and stopped on unmount, so there is one read at the end and none after the handles close. Both are pinned by tests.- Zero insets count as uncropped (
hasCropInsetsorradius > 0), and the cropped guard test fails if the skip ignores the crop. - Body names the tests on "fails without the fix:" lines.
Non-blocking:
- The wait ends when the last gesture in the document ends, not this element's. Fine today; worth a word in the comment if two elements can ever be in a gesture at once.
- If the selection changes while a read is held, the new element gets its normal read and then one more when the old gesture ends. Harmless, one extra round trip.
— Rames
|
On the two review notes, at
|


What
During a resize in a sealed preview, the crop handles no longer ask the frame for the selected layer's size on every step when the layer has no crop. They read it once when the resize ends.
Why
The crop handles re-read a sealed layer's size from the frame whenever its shown size changes, so its crop insets draw at the layer's own scale. A resize changes the shown size on every pointer step, so every step sent a full
gesture-startread to the frame, and each answer re-rendered the crop handles. For a layer with no crop the handles draw the same at any measured size, so those reads did nothing.Requests Studio sent the frame per resize drag (edit accuracy bench, 8 resize cases, the same change on an earlier main):
gesture-startreadsAccuracy was unchanged (8/8 tracking, teleport, drop and reload).
Related work
None open on the crop handles.
How
readStandInStartskips the read while the layer has a live Studio gesture (isStudioManualEditGestureActive) and no crop, and waits for that gesture to end (afterStudioManualEditGestures, the same helper undo uses to hold a repaint) to read once. A layer with crop insets or rounded corners keeps reading on every step, because its insets do scale with the measured size. An uncropped layer reads as zero insets rather than no crop, so "cropped" means any inset or radius above zero. If the crop handles close during the resize, the wait is dropped.Test plan
packages/studio/src/components/editor/DomEditCropHandles.sealed.test.ts:The two crop handle test files pass 3 runs in a row (31 tests). Studio unit suite at this head: 844 files, 9483 tests passed (1 skipped).