0
Fork 0
mirror of https://github.com/zeronsh/comet.git synced 2026-11-16 18:57:19 +00:00
comet/docs/media/smooth-scroll
Alexandre V.L 3d2f1e64af
Smooth scrolling: mouse-wheel notches glide like Chrome's, with a setting (#1005)
* Smooth scrolling: mouse-wheel notches glide like Chrome's, with a setting

A mouse-wheel notch moved content in one jump: GPUI hands non-precise
wheels to containers as `ScrollDelta::Lines`, applied at once. The window
root now takes each notch at the end of the capture phase and replays it
over the following frames as fractional `Lines` slices, on Chrome's wheel
curve (`cc::ScrollOffsetAnimationCurve` for `kMouseWheel`): ease-in-out,
cubic-bezier(0.42, 0, 0.58, 1), over 200ms, shortening to 100ms for long
moves. A notch in flight retargets at the current speed, so a spin is one
continuous glide. Slices stay in lines, so every container keeps its own
line height and a notch travels exactly as far as before.

Precise input, notches with Ctrl, Alt, Cmd or Fn held, and content that
eases notches itself (WebView2) stay raw; a press ends a glide.

The in-app browser on macOS glides too. AppKit hands a page its wheel
directly and WKWebView applies a tick at once, so a local event monitor
holds the page's ticks and replays the same glide as precise pixel deltas,
which WebKit routes like a trackpad's: to the scroller under the pointer,
clamped at its edges.

Settings → Appearance → Motion → Smooth scrolling, on by default. Reduced
motion turns it off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Transcript: upward input breaks the bottom pin as it arrives

The pin broke only when one wheel event moved the view more than 1px from
the bottom, decided in a deferred check. A glided notch starts and ends
with sub-pixel slices, and its slices arrive on frames, where the spring's
step runs before that check: it pulled the view back and recorded the
distance the check compared against. A notch up from the bottom of a chat
drifted back down. Upward input over a scrollable transcript now breaks
the pin on the spot, as use-stick-to-bottom's wheel handler does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs: smooth scrolling media

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Transcript: only a wheel the list took breaks the bottom pin

`on_scroll_wheel` broke the pin for any upward wheel that bubbled to the
transcript root, including one an overlay above the list let through
(an image viewer at its pan limit, say) while the list never moved. The
list's scroll handler now marks the event it took, and only that event
can escape the pin.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com>

* Smooth scrolling: the AppKit glide flag is macOS-only

Only `browser::macos` reads it; elsewhere `gliding` was dead code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com>

* Smooth scrolling: leave touchpads alone on X11 and Windows

X11 reports touchpads (and high-resolution wheels) as fractional
`ScrollDelta::Lines`, so every touchpad event was held back and eased
over 200ms. Outside macOS, where trackpads are flagged precise, only a
whole-line delta is a wheel notch; fractional lines now pass through.

The transcript's arrival-time pin escape is for wheel notches only:
precise input keeps the distance test it had before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com>

* Smooth scrolling: drop the browser's unused wheel fixture hook

No fixture calls fixture_wheel; it served a throwaway capture that was never
committed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com>

* Smooth scrolling: findable in settings search

The Motion row joins the settings index under Appearance → Motion, with the
words people reach for: mouse, wheel, glide, ease.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com>

* Settings search: the Appshots pick test runs where Appshots shows

Appshots is hidden off macOS and Linux, so search can't find its rows there
and the test failed on Windows since #1018.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Wing <44917547+wingleeio@users.noreply.github.com>
Co-authored-by: zeronsh[bot] <346184242+zeronsh[bot]@users.noreply.github.com>
History 2026-10-27 06:12:52 +00:00
..
settings-dark.png Smooth scrolling: mouse-wheel notches glide like Chrome's, with a setting (#1005) 2026-10-27 06:12:52 +00:00
settings-light.png Smooth scrolling: mouse-wheel notches glide like Chrome's, with a setting (#1005) 2026-10-27 06:12:52 +00:00
settings-reduced-motion.png Smooth scrolling: mouse-wheel notches glide like Chrome's, with a setting (#1005) 2026-10-27 06:12:52 +00:00
smooth-scroll-off-vs-on.gif Smooth scrolling: mouse-wheel notches glide like Chrome's, with a setting (#1005) 2026-10-27 06:12:52 +00:00
smooth-scroll-off-vs-on.mp4 Smooth scrolling: mouse-wheel notches glide like Chrome's, with a setting (#1005) 2026-10-27 06:12:52 +00:00