What Changed#
This PR reduces chat timeline scroll twitching and overlap.
Smaller and medium-sized threads now render without virtualization, which removes the late row mounting and remeasurement that were causing visible jumps while scrolling upward. Larger threads still use the standard virtualized path.
The remaining row height estimation is kept only for the cases that still need it:
grouped work/tool rows
assistant messages with changed-files summaries
Fixes #1035
Related to #988, #905, #860
Why#
Older rows were being mounted and resized after entering view, which caused the timeline to twitch while scrolling and sometimes contributed to overlap.
Disabling virtualization for the thread sizes users hit most often is the simplest and most reliable fix. It removes the unstable behavior directly while still keeping virtualization for larger threads.
UI Changes#
This PR improves chat scroll stability and removes visible upward-scroll twitching in affected threads.
Checklist#
Note
Improve timeline scroll stability with accurate row height estimation#
- Disables virtualization for short timelines (below
MIN_ROWS_TO_ENABLE_VIRTUALIZATION) to avoid measurement overhead when it isn't needed.
- Adds
estimateTimelineWorkGroupHeight in timelineHeight.ts to size work-group rows based on visible entries, chip wrapping, and expansion state.
- Adds
estimateChangedFilesSummaryHeight and estimateTimelineRowHeight in MessagesTimeline.tsx to account for completion dividers and changed-files summaries in assistant message rows.
- Adds
countVisibleTurnDiffTreeNodes in turnDiffTree.ts to compute visible diff-tree node counts based on directory expansion state.
- Behavioral Change:
shouldAdjustScrollPositionOnItemSizeChange now triggers when remaining scroll distance is ≤ AUTO_SCROLL_BOTTOM_THRESHOLD_PX (previously only when greater), fixing auto-scroll near the bottom.
Macroscope summarized 0b7ecce.
Important
Review skipped#
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID:
d90f1782-ff94-4231-b455-fced3f53d4b3You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share