Skip to content

Apply timeline changes to the chat list inside the frame - #490

Merged
Tryanks merged 1 commit into
mainfrom
fix/chat-scroll-prepend-jump
Sep 20, 2026
Merged

Tryanks merged 1 commit into
mainfrom
fix/chat-scroll-prepend-jump

Conversation

@Tryanks

@Tryanks Tryanks commented Sep 20, 2026

Copy link
Copy Markdown
Owner

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 List captures the scroll anchor at paint and resolves every wheel/pan packet against it. ChatView spliced 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; render mirrors the timeline into the list before the list paints, so input and layout share one index space. remeasure_expanded follows the same path.

Tests

wheel_event_between_a_prepend_and_its_frame_keeps_the_reading_position dispatches a 40px pan after a page arrives and before the frame. Without the fix it fails with moved the reader off turn 105 to turn 85.

Checks run

  • cargo fmt --all --check
  • cargo clippy -p tcode-ui --all-targets --locked -- -D warnings
  • cargo nextest run -p tcode-ui --locked (300 passed)

No visual run; this is a timing fix and the regression test is the evidence.

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.
@Tryanks
Tryanks merged commit e753cd2 into main Sep 20, 2026
7 checks passed
@Tryanks
Tryanks deleted the fix/chat-scroll-prepend-jump branch September 20, 2026 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant