Skip to content

fix(studio): a scroll right after a Zoom button press is kept - #5317

Open
miguel-heygen wants to merge 2 commits into
mainfrom
dpreview/zoom-glide-scroll
Open

miguel-heygen wants to merge 2 commits into
mainfrom
dpreview/zoom-glide-scroll

Conversation

@miguel-heygen

@miguel-heygen miguel-heygen commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

What changes

A scroll right after a Zoom button press is kept. Before, a sideways scroll made during the button's glide (about 220 ms) was undone, and the timeline jumped back to where the glide was heading.

Now a plain wheel over the timeline, or a press on it, lands the glide at its target at once. Then the scroll applies to the landed zoom. Pinch zoom keeps previewing through a scroll, as before.

Why this PR is small: it is one self-contained Studio fix in its own package; nothing open in this repo could carry it, and it should make the next Studio release.

Why

Since #5109, zoomTimelineStep eases through easeZoom. Each eased frame calls request(), which recomputes preview.shift from the current scrollLeft. A scroll made between two frames gets folded into the shift (so nothing moves on screen), and the commit at the end puts scrollLeft back at the eased target. Measured in a host app: the wheel moved scrollLeft from 0 to 1500 px, and about 50 ms later it was back at 0, with the clip unmoved.

This also happens at the zoom's limit. Zoom in is never disabled, so a press there runs a glide where nothing moves, and it still drops a scroll made during it.

settleTimelineZoom (a press) used to commit only the current frame of the glide, and the next frame carried on. It now lands the glide too, so a press meets the zoom it asked for.

Tests

  • timelineZoomInput.test.ts: "lands at once when settled mid-glide, and keeps a scroll made after". Fails without the fix: expected 13 to be close to 20.
  • useTimelinePlayhead.test.tsx: "lands a Zoom button's glide on a plain wheel, so the wheel scrolls the landed zoom". Fails without the fix: expected 100 to be close to 200.
  • src/player/components/ passes 3 runs in a row; tsc --noEmit for studio passes; oxfmt and oxlint pass on the changed files.

What it does not cover

  • A wheel made while gliding in from Fit still scrolls nothing. At Fit the timeline cannot scroll sideways yet, so the wheel has nowhere to go (it did nothing before this change either). The glide still lands.
  • Any plain wheel over the timeline lands the glide, a vertical one too. It only ends a 220 ms animation early.
  • Keyboard scrolling, middle-click autoscroll and scrolls made by a host app during a glide are still undone. A fix for those would have to carry the scroll through each eased frame, which is a larger change.

Before

On main, using the repo's ghost-lane e2e fixture: six Zoom in presses, then a 1500 px sideways wheel with no wait. The scroll is undone and the timeline stays at 00:00 (3 of 3 runs).

Before: the wheel's scroll is undone

before/before.webm

After

The same action on this branch: the scroll is kept, and the ruler starts at 00:01.1 (3 of 3 runs).

After: the wheel's scroll is kept

after/after.webm

before.webm
after.webm

@github-actions

github-actions Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Edit accuracy: accurate 2059 (base branch 2059), smooth 1426 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 marked this pull request as ready for review October 9, 2026 04:01
@miguel-heygen
miguel-heygen force-pushed the dpreview/zoom-glide-scroll branch from 5f6b2c8 to 4d4acac Compare October 9, 2026 16:23

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.

1 participant