mirror of
https://github.com/l0ng-ai/tty7.git
synced 2026-09-25 16:02:36 +00:00
Sub-line scroll positions were already in place — the view keeps a fractional remainder and paints the grid shifted by it — but the position was a function of the event, not of time. A notch arrived and the whole distance was applied at once, so whether it looked smooth came down to how fine-grained the platform's deltas happened to be. A macOS trackpad reports pixels, so it did. A wheel on Windows reports whole lines (gpui multiplies the notch by the system's scroll-lines setting, three by default), the fraction came out zero every time, and the view jumped three lines per notch. The sub-line machinery was present and never engaged. A 120-step notch is one discrete pulse; no arithmetic on the delta recovers a continuous gesture from it. So make position a function of time: a notch adds to a remaining distance and each frame consumes a share of what is left, ~120ms to land, exponential, with a sub-pixel remainder snapped rather than approached since every frame of it costs a repaint. Line deltas are discrete and get animated; pixel deltas are continuous and do not — putting an animation between a trackpad and the grid would only add lag. Mouse reporting and alternate-scroll keep forwarding whole lines, which cannot be spread over frames either. The distance in flight is relative rather than an absolute target, so output arriving mid-scroll shifts the grid without dragging the animation elsewhere. Everything that moves the view on its own cancels what is in flight first. Settings -> Terminal -> Scrolling -> Smooth scrolling, on by default. Also pin the scratch config dir in the terminal-view test harness: building a view reads the config, and which test got there first decided whether that touched the real user directory.