GeezerVison is showing github.com — fix(web): preserve scroll when collapsing large changed-files trees by CodeZeno · Pull Request #1113 · pingdotgg/t3code
Conversation
CodeZeno
commented
Mar 15, 2026
•
edited by macroscopeapp
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Summary
Fix chat scroll jumps when collapsing very large changed-files trees.
Problem
When a changed-files section contains hundreds of entries, collapsing the tree can shrink the rendered message enough that the timeline repositions the viewport unexpectedly. In practice this makes the collapse controls feel broken because the user gets pulled away from the message they were interacting with.
What changed
- stop virtualizer scroll compensation when the resized row is currently visible
- mark changed-files collapse and directory toggle controls with
data-scroll-anchor-ignore so click-anchor restoration does not interfere with those interactions
Why
The bug happens during an intentional height change inside the message the user is actively viewing. In that case, preserving the current viewport is more stable than trying to compensate for the size change. The virtualizer can still adjust scroll for off-screen rows, but visible changed-files interactions now keep the user anchored in place.
UI Changes
Before:
https://github.com/user-attachments/assets/60f06a27-9776-4c6d-b553-611fbbf5b2a0
- Notice tree collapses correctly but the user is then immediately taken to the top of thread
- 'Collapse all' button immediately takes the user to the top of thread
After:
https://github.com/user-attachments/assets/eacd53a5-66f9-41e7-b70c-7b4de1b0292d
- Tree collapses work fine, keeping position
- 'Collapse all' button also keeps position
Good to have
Might also be nice to have the default as collapsed if the number of changed files is greater then a certain number?
Checklist
- This PR is small and focused
- I explained what changed and why
- I included before/after screenshots for any UI changes
- I included a video for animation/interaction changes
Note
Preserve scroll position when collapsing changed-files trees in the chat timeline
- Adds
data-scroll-anchor-ignore to directory toggle buttons in ChangedFilesTree.tsx and the collapse/expand button in MessagesTimeline.tsx so clicks on these buttons don't trigger scroll anchor adjustments.
- Updates
shouldAdjustScrollPositionOnItemSizeChange in MessagesTimeline to skip scroll adjustments when the resized item is within the viewport, preventing jarring scroll jumps when collapsing large file trees.
- Behavioral Change: scroll position adjustments now only fire when the resized item is outside the viewport and the remaining distance to the bottom exceeds
AUTO_SCROLL_BOTTOM_THRESHOLD_PX.
Macroscope summarized 7b0d5e8.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Important
Review skipped
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: eff497c1-37b9-490d-bb56-890b5ce25eb4
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
✨ Finishing Touches
🧪 Generate unit tests (beta)
- Create PR with unit tests
- Post copyable unit tests in a comment
📝 Coding Plan
- Generate coding plan for human review comments
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
Comment @coderabbitai help to get the list of available commands and usage tips.
Tip
You can get early access to new features in CodeRabbit.
Enable the early_access setting to enable early access features such as new models, tools, and more.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Just confirming still an issue in v0.0.15
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Labels
size:XS
0-9 changed lines (additions + deletions).
vouch:unvouched
Author is not yet trusted in the VOUCHED list.
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|