Repository navigation
fix(studio): bound zoom-50 drag routes inside canvas and cover root z50 in PR grid - #9231
miguel-heygen wants to merge 1 commit into
Conversation
jrusso1020
left a comment
There was a problem hiding this comment.
Approve. No blockers at 42a1ed16.
Need ✅ · Size ✅ (4 test-harness files) · Reuse ✅ (bounds against the same visibleCanvas the other routes use) · Simpler ✅ · Structure ✅
Risk: low. Only the edit-accuracy harness changes, with no product code.
What I checked
- The edit-accuracy unit tests pass: 151/151 across 14 files.
- Fails without the fix: putting
pause/strayback to the fixed(+180, +90)makes both rows insequences.test.mjsfail. Putting back the oldzoom === 100 && rotation === 0PR filter makes thegrid.test.mjs286-case check fail. Removing the 0.55 margin (moving the full remaining distance) also fails pause and stray, so the margin is pinned. - The added cases are exactly the plain root zoom-50 rows: 5 core gestures plus 6 drag paths, 275 → 286.
Nit (no change needed for this PR): the bound can also shorten a drag at zoom 100, not only at zoom 50. boundedDelta caps the move at 0.55 × the remaining distance to the canvas edge. For the center placement the target centre starts at (960, 540), so the full (180, 90) holds only while the fit scale is at least about 0.34 (x) and 0.30 (y). Your own failure numbers (+180 px landing the target's right edge at 2040) put the zoom-50 scale near 0.15, so zoom 100 sits near 0.30. If the preview chrome grows again, the zoom-100 center pause/stray rows will quietly drag about 158 × 89 px instead of 180 × 90. They still test the same behaviour, but the PR body's "exact (180, 90) at zoom 100" holds only with that much room. The new zoom-100 test checks a synthetic 800 × 500 canvas, so it would not notice. You could reword the claim or cap only below fit.
— Rames
Edit accuracy: accurate 286 (base branch 286), smooth 51 of thoseThe gate passes. Quarantined, measured but not gated (0) |
Summary
Keep the
pauseandstrayedit-accuracy drag routes inside the visible canvas at zoom 50, and include plain root zoom-50 cases in the pull request grid so zoom-50 regressions are caught before the merge queue.Root Cause
packages/studio/tests/e2e/edit-accuracy/sequences.mjsexceptpauseandstrayscales its waypoints tovisibleCanvas(page, pre).pauseandstraymoved by a fixed(+180, +90)screen-px delta regardless of canvas scale. At zoom 50, any small increase in preview chrome height reduces the fitted canvas scale enough for+180screen px to push#targetpast the1920pxright edge of the composition, clipping the rendered frame and failingrenderwhiletracking,drop,reload, andundoall pass.buildGrid("pr")filtered tozoom === 100 && rotation === 0, so zoom-50 regressions passed the 15-shard pull request grid and only surfaced in the 30-shard merge-queue full grid.Changes
packages/studio/tests/e2e/edit-accuracy/sequences.mjs: exportROUTESand boundpauseandstraydeltas insidevisibleCanvas(boundedDelta), keeping the exact(180, 90)screen-px drag at zoom 100 while preventing#targetfrom leaving the1920x1080canvas at zoom 50.packages/studio/tests/e2e/edit-accuracy/sequences.test.mjs: unit test verifying all routes keep#targetinside1920x1080across both zoom-100 and compact zoom-50 scales, and thatpause/straypreserve(180, 90)at zoom 100.packages/studio/tests/e2e/edit-accuracy/grid.mjs&grid.test.mjs: include the 11 plain root zoom-50 cases (5 core gestures + 6 drag paths) inbuildGrid("pr")(275 -> 286cases, under 1 extra case per shard across the 15 PR shards).Verification
vitest run tests/e2e/edit-accuracy/sequences.test.mjsfailed onpauseandstray(expected 2040 to be less than or equal to 1920) before bounding their deltas insequences.mjs.151tests) 3x shuffled: all green, including shard balance and1.68xslow-runner checks for the 286-case PR grid.pathpause-none-px-r0-root-z50andpathstray-none-px-r0-root-z50end-to-end against a taller player deck CLI build: both flipped fromrender: 116.31pxfail torender: 0.02pxpass.