Apply timeline changes to the chat list inside the frame - #490
Merged
Merged
Conversation
GPUI's List resolves wheel and touch packets against the scroll anchor it captured at paint. ChatView spliced prepended history rows into the list from the store observer, between two frames, so a packet arriving before the next frame was resolved with stale row indices and moved the reader one history page up. The observer now only marks the timeline stale and render mirrors it before the list paints, so input and layout share one index space. Regression test dispatches a 40px pan after a page arrives and before the frame; without the fix it moves the reader from turn 105 to turn 85.
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.
Behaviour
Scrolling up a little while an earlier history page arrives no longer jumps the reader a whole page (many turns) up, on desktop trackpads and on touch.
Cause
GPUI's
Listcaptures the scroll anchor at paint and resolves every wheel/pan packet against it.ChatViewspliced prepended history rows from the store observer, i.e. between two frames. A packet delivered before the next frame was resolved with stale row indices, landing the viewport one page earlier.Change
The observer only marks
timeline_stale;rendermirrors the timeline into the list before the list paints, so input and layout share one index space.remeasure_expandedfollows the same path.Tests
wheel_event_between_a_prepend_and_its_frame_keeps_the_reading_positiondispatches a 40px pan after a page arrives and before the frame. Without the fix it fails withmoved the reader off turn 105 to turn 85.Checks run
cargo fmt --all --checkcargo clippy -p tcode-ui --all-targets --locked -- -D warningscargo nextest run -p tcode-ui --locked(300 passed)No visual run; this is a timing fix and the regression test is the evidence.