Repository navigation
Transcript: wheel direction decides tail-follow - #794
Open
RemingtonWilcox wants to merge 1 commit into
Open
RemingtonWilcox wants to merge 1 commit into
RemingtonWilcox wants to merge 1 commit into
Conversation
Pin decisions compared the distance from the bottom with the distance at the last observation. While a reply streams, that baseline can predate the latest growth by a layout, so a wheel-down mid-stream read as scrolling away and broke the pin, and re-sticking needed the very last pixel. The root now records each wheel event's vertical delta, and the scroll handler (only ever called from wheel input) decides by its sign: up breaks the pin, down inside the 70px band re-sticks. This is the same rule gpui's list uses to stop following its tail (delta.y > 0). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RemingtonWilcox
marked this pull request as ready for review
October 4, 2026 23:29
4 of 6 tasks
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.
Summary
last_scroll_distance, which can lag streaming growth by a layout, so growth looked like the user scrolling away.wheel_dy). The scroll handler decides from its sign: wheel up breaks the pin, wheel down inside the 70px band re-sticks, and reaching the bottom still re-sticks as before.delta.y > 0.should_resticktakes the wheel delta instead of the previous distance. The own-turn branch uses it too, so both branches follow one rule.Worth a close look
on_scroll_wheellistener. The list's wheel handler runs before it, andhandle_scrollreadswheel_dyin its deferred half, so the value is set before it is read. The list calls the scroll handler only from wheel/touch input (ListState::scrollis reached only from itsScrollWheelEventlistener), so every read follows a fresh write.dy == 0. It neither breaks nor re-sticks the pin; only landing at the bottom (≤ 2px) re-sticks.scroll_anim = None(a rail glide fighting the bottom spring) and skipping the prompt re-hold when the prompt row is gone. Both looked real, but neither has a failing test yet, so they can be separate PRs.Test plan
wheel_direction_not_a_stale_distance_decides_the_pin(Linux headless window test): pinned with a stale distance baseline, wheel down keeps the pin and wheel up breaks it.restick_is_direction_awareupdated to the delta signature; passes.cargo test -p zeron-ui --libon Windows: 1481 passed, 0 failed.user_fold_scrollsiblings) and was NOT run locally. It compiles, but Windows' headless platform can't open the window. CI's Linux UI job is the first run, so its fail-without-fix also hasn't been checked yet.ui-testsworkflow): https://github.com/RemingtonWilcox/zeron/actions/runs/37240660629Screenshots
Dark, about 15 s, mock harness streaming a long reply. The view follows the tail. One wheel notch up stops following while text keeps arriving below. One notch down lands inside the bottom band and following resumes without reaching the last pixel.
MP4 of the same clip: https://gist.githubusercontent.com/RemingtonWilcox/7274b28983e89f6b18cbb0b64a205134/raw/a266fbc0f006d297541e92fe7584b124e7ab567b/wheel-follow-dark.mp4
Not captured: the same steps on
main.🤖 Generated with Claude Code