Skip to content

fix(studio): bound zoom-50 drag routes inside canvas and cover root z50 in PR grid - #9231

Queued
miguel-heygen wants to merge 1 commit into
mainfrom
dsurvey2/edit-accuracy-route-clamp
Queued

miguel-heygen wants to merge 1 commit into
mainfrom
dsurvey2/edit-accuracy-route-clamp

Conversation

@miguel-heygen

Copy link
Copy Markdown
Collaborator

Summary

Keep the pause and stray edit-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

  1. Every drag route in packages/studio/tests/e2e/edit-accuracy/sequences.mjs except pause and stray scales its waypoints to visibleCanvas(page, pre). pause and stray moved 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 +180 screen px to push #target past the 1920px right edge of the composition, clipping the rendered frame and failing render while tracking, drop, reload, and undo all pass.
  2. buildGrid("pr") filtered to zoom === 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: export ROUTES and bound pause and stray deltas inside visibleCanvas (boundedDelta), keeping the exact (180, 90) screen-px drag at zoom 100 while preventing #target from leaving the 1920x1080 canvas at zoom 50.
  • packages/studio/tests/e2e/edit-accuracy/sequences.test.mjs: unit test verifying all routes keep #target inside 1920x1080 across both zoom-100 and compact zoom-50 scales, and that pause/stray preserve (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) in buildGrid("pr") (275 -> 286 cases, under 1 extra case per shard across the 15 PR shards).

Verification

  • fails without the fix: vitest run tests/e2e/edit-accuracy/sequences.test.mjs failed on pause and stray (expected 2040 to be less than or equal to 1920) before bounding their deltas in sequences.mjs.
  • Ran all 14 edit-accuracy unit test files (151 tests) 3x shuffled: all green, including shard balance and 1.68x slow-runner checks for the 286-case PR grid.
  • Ran pathpause-none-px-r0-root-z50 and pathstray-none-px-r0-root-z50 end-to-end against a taller player deck CLI build: both flipped from render: 116.31px fail to render: 0.02px pass.

@jrusso1020 jrusso1020 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.

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/stray back to the fixed (+180, +90) makes both rows in sequences.test.mjs fail. Putting back the old zoom === 100 && rotation === 0 PR filter makes the grid.test.mjs 286-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

@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Edit accuracy: accurate 286 (base branch 286), 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.

Quarantined, measured but not gated (0)

@miguel-heygen
miguel-heygen added this pull request to the merge queue Dec 2, 2026
Any commits made after this event will not be merged.

This branch has not been deployed

No deployments
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