fix(web): reduce chat timeline scroll twitching and overlap#1054
Open
huxcrux wants to merge 5 commits intopingdotgg:mainfrom
Open
fix(web): reduce chat timeline scroll twitching and overlap#1054huxcrux wants to merge 5 commits intopingdotgg:mainfrom
huxcrux wants to merge 5 commits intopingdotgg:mainfrom
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the 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. Comment |
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.
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
MIN_ROWS_TO_ENABLE_VIRTUALIZATION) to avoid measurement overhead when it isn't needed.estimateTimelineWorkGroupHeightin timelineHeight.ts to size work-group rows based on visible entries, chip wrapping, and expansion state.estimateChangedFilesSummaryHeightandestimateTimelineRowHeightin MessagesTimeline.tsx to account for completion dividers and changed-files summaries in assistant message rows.countVisibleTurnDiffTreeNodesin turnDiffTree.ts to compute visible diff-tree node counts based on directory expansion state.shouldAdjustScrollPositionOnItemSizeChangenow triggers when remaining scroll distance is ≤AUTO_SCROLL_BOTTOM_THRESHOLD_PX(previously only when greater), fixing auto-scroll near the bottom.Macroscope summarized 38d0d3a.