Repository navigation
Conversation
This was referenced Aug 3, 2026
Closed
Closed
Member
|
This branch has been upgraded to V2. We're no longer taking PRs for V1. If you think this is still relevant, please port it over and open it for V2. — from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊 |
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.
Issue for this PR
Closes #40322
Type of change
What does this PR do?
The session view pins the scroll position to the bottom while a response is streaming. Two problems cause this:
userScrolledincreate-auto-scroll) only updates from scroll events inside a 250ms gesture window. Events outside that window are ignored, so the flag never turns on for some scroll gestures (wheel over nested scrollables, keyboard scrolling). With the flag off, every streamed token callsscrollToEnd()and yanks the viewport back to the bottom.behavior: "smooth". The smooth animation gets cancelled by the per-tokenscrollToEndbefore the viewport moves more than ~10px, so the threshold check never observes the user leaving the bottom and the state machine stays stuck.Changes:
create-auto-scroll: track anatBottomflag from actual scroll positions (updated whereveruserScrolledis updated) and require it before auto-following in the ResizeObserver path.session.tsx:shouldAnchorBottomadditionally requiresautoScroll.atBottom(), so the virtualizer'sscrollToEndonly runs while the user is at the bottom.scroll-view: keyboard scrolling is now instant instead of smooth, so it cannot be cancelled mid-animation by content updates.Result: scrolling up during streaming holds the viewport in place; scrolling back to the bottom resumes auto-follow.
How did you verify your code works?
packages/uiandpackages/appScreenshots / recordings
Can be added on request.
Checklist