- 
                Notifications
    
You must be signed in to change notification settings  - Fork 2.4k
 
ChatView: smoother stick-to-bottom during streaming #8999
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
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.
Pull Request Overview
This PR refactors the auto-scroll behavior in the chat view by replacing the disableAutoScrollRef pattern with a more intuitive "sticky follow" approach that works in conjunction with Virtuoso's built-in followOutput feature.
Key changes:
- Renamed 
disableAutoScrollReftostickyFollowRefwith inverted logic (true = follow enabled, false = follow disabled) - Added 
followOutput="smooth"to the Virtuoso component to leverage built-in scroll following - Removed the custom auto-scroll effect that triggered on message length changes
 - Simplified scroll behavior logic in 
atBottomStateChangeand wheel event handlers 
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
… sync, and hide button flash when engaging sticky follow (#8999)
… forced scroll in atBottomStateChange to reduce jank
Fixes issues where sometimes the session would lose its stickyness to the bottom of the window during streaming events.
BEFORE
Sticky.-.Old.mp4
AFTER
Sticky.-.New.mp4
Summary
Key changes
Tests
Rationale
Important
Enhances stick-to-bottom behavior in
ChatView.tsxduring streaming by usingstickyFollowRefandisAtBottomfor smoother scrolling and accurate UI updates.ChatView.tsxusingstickyFollowRefandisAtBottom.VirtuosowithfollowOutput="smooth"for smoother scrolling.disableAutoScrollRefwithstickyFollowReffor managing sticky follow state.isAtBottomstate to track scroll position and control UI elements.isAtBottomstate.This description was created by
 for 9df6649. You can customize this summary. It will automatically update as commits are pushed.