Repository navigation
fix(studio): a scroll right after a Zoom button press is kept - #5317
Open
miguel-heygen wants to merge 2 commits into
Open
miguel-heygen wants to merge 2 commits into
miguel-heygen wants to merge 2 commits into
Conversation
Contributor
Edit accuracy: accurate 2059 (base branch 2059), smooth 1426 of thoseThe gate passes. Quarantined, measured but not gated (0) |
miguel-heygen
marked this pull request as ready for review
October 9, 2026 04:01
miguel-heygen
force-pushed
the
dpreview/zoom-glide-scroll
branch
from
October 9, 2026 16:23
5f6b2c8 to
4d4acac
Compare
This branch has not been deployed
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.
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,
zoomTimelineStepeases througheaseZoom. Each eased frame callsrequest(), which recomputespreview.shiftfrom the currentscrollLeft. A scroll made between two frames gets folded into the shift (so nothing moves on screen), and the commit at the end putsscrollLeftback at the eased target. Measured in a host app: the wheel movedscrollLeftfrom 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 --noEmitfor studio passes; oxfmt and oxlint pass on the changed files.What it does not cover
Before
On main, using the repo's
ghost-lanee2e 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/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/after.webm
before.webm
after.webm