Skip to content

fix(web): a mouse wheel glides tab rows and the pane strip instead of jumping a notch at a time - #40795

Open
flamboh wants to merge 7 commits into
pingdotgg:maria/redesign/6-workspace-panesfrom
flamboh:t3/redesign-wheel-scroll-smooth
Open

flamboh wants to merge 7 commits into
pingdotgg:maria/redesign/6-workspace-panesfrom
flamboh:t3/redesign-wheel-scroll-smooth

Conversation

@flamboh

@flamboh flamboh commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Note

🤖 Claude Opus 5.5 on behalf of Oliver

Change for the redesign stack, targets layer 6 (#28845).

Needs Maria's review: it changes her tab row wheel handlers and the strip's script wheel paths.

Problem

With a notched mouse wheel, an overflowing tab row moved a whole notch in one frame, 100px or more at a time. Page scrolling glides. Over the gaps between tabs a vertical wheel did nothing at all. The same one-frame jumps happened wherever script moves the pane strip: the wheel with the layout chord held (alt+cmd on a Mac), a sideways wheel past a code block that ends the browser's scroll chain, and the wheel over the window chrome above the strip.

Fix

  • Notched wheels glide. A wheel notch now eases the row or strip toward a target that quick notches add to, and stops when it arrives. It runs only while a wheel is turning, and lets go as soon as anything else scrolls the row. Trackpad deltas still move at once. Reduced motion keeps every wheel instant.
  • Telling a mouse from a trackpad. On macOS, Chromium gives a notch the same legacy wheel delta a trackpad event of that size has: three times its pixel delta. One event can't tell them apart. So each event reads as notched, trackpad or either, and a wheel gesture moves directly from its first event that only a trackpad sends until it pauses. A trackpad delta that arrives while an ease runs moves at once and keeps the ease's remaining distance.
  • Browser zoom. Chromium divides the legacy wheel delta by devicePixelRatio, which includes page zoom, so a notch at 110% reads as 109 instead of 120. The check also accepts whole notches after multiplying by a fractional devicePixelRatio.
  • Gaps between tabs. A vertical wheel anywhere over an overflowing tab row now scrolls its tabs.

This covers the pane tab rows, the side panel's tab row, the row controls that pass a sideways wheel on to their tabs, and the strip's script paths. A plain sideways wheel over the strip still scrolls natively.

Before and after

A mouse wheel over a full tab row, both sides at half speed. Before, each notch jumps the row in one frame, and the wheel does nothing over the gap between tabs. After, each notch glides, and the wheel scrolls the tabs over the gap too.

https://gh-file-drop-api-prod-galwoqjslzlnws6s.oliver-boorstein.workers.dev/f/49bfb603b25a2901/tab-row-wheel-side-by-side.mp4

Validation

  • gesture.browser.test.ts:
    • a macOS notch stream (120/160/200 px with −360/−480/−600 legacy deltas) eases;
    • slow macOS notches with fractional deltas ease;
    • a trackpad swipe that passes 40 px and 120 px events mid-swipe moves exactly as before, event by event;
    • a first tick that turns out to start a trackpad swipe loses no distance;
    • notches at 110% and 150% browser zoom ease, using the values Chromium gives there, and zoomed trackpad deltas stay direct;
    • adding up notches, clamping to the scroll range and easing onto the target.
  • SurfaceHost.browser.test.tsx: a vertical wheel over a tab row's gap scrolls its tabs.
  • Frames sampled in headless Chromium with simulated notched and trackpad input. A notch moves the tab row over 7 to 13 frames, always in one direction. Trackpad input lands on the same position as before after every event.
  • Confirmed by hand on a Mac with a notched mouse in a Chromium browser, on the head before this branch took in the current layer 6: each notch glides.
  • vp run check:changed: format, lint, knip, typecheck, tests and the React compiler check pass.

Not tested: the Electron desktop shell, Windows and Linux mouse hardware, and browser zoom by hand with a real mouse. The zoom values come from Chromium's own input path in a test browser, not from a mouse.

Made with Claude Opus 5.5 in Claude Code (T3 Code).

Each notch of a mouse wheel moved the pane strip 85 to 200px in one frame.
A notch now eases the strip toward a target that quick notches add to, as page
scrolling does. Trackpad deltas still move it at once, and reduced motion
keeps it instant. A sideways notch is told from a trackpad by the legacy
wheel delta of its own axis.

Made with Claude Opus 5.5 in Claude Code (T3 Code).
A vertical mouse wheel over a pane's tab row, or a sideways wheel over the
row's controls, moved the row a whole notch in one frame, as did a vertical
wheel over a side panel's tab row. They now ease like the pane strip;
trackpads still move them at once.

Made with Claude Opus 5.5 in Claude Code (T3 Code).
…ts tabs

A vertical wheel scrolled an overflowing tab row only over a tab. Over the
gaps between tabs the row passes presses through, so the wheel did nothing
there. The row now scrolls its tabs from anywhere over them.

Made with Claude Opus 5.5 in Claude Code (T3 Code).
An eased wheel scroll took any other scroll that happened meanwhile, such as
the strip's camera or a tab reveal, as its new start and carried on to its
own target. It now stops there.

Made with Claude Opus 5.5 in Claude Code (T3 Code).
Chromium on macOS gives a notched wheel's event the same legacy delta, three
times its pixel delta, that a trackpad's event of that size has, so every
notch read as a trackpad and moved at once. Each event now reads as notched,
trackpad or either, and a wheel gesture moves directly from its first event
that only a trackpad sends until it pauses. A trackpad delta while an ease
runs moves at once and keeps the ease's remaining distance.

Made with Claude Opus 5.5 in Claude Code (T3 Code).
…' into t3/redesign-wheel-scroll-smooth

# Conflicts:
#	apps/web/src/layout/PaneTabs.tsx
#	apps/web/src/layout/SurfaceHost.tsx
#	apps/web/src/motion/gesture.browser.test.ts
#	apps/web/src/motion/gesture.ts
… stay direct

Uses the wheel event values Chromium gives at 110% and 150% browser zoom,
where the legacy wheel delta is 120 divided by the zoom.

Made with Claude Opus 5.5 in Claude Code (T3 Code).
@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Nov 22, 2026
@flamboh
flamboh marked this pull request as ready for review November 22, 2026 11:04

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

size:L 100-499 changed lines (additions + deletions). vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant