fix: Move focus to newest item when using "scroll to bottom" button, transitions, and other follow ups to Chat component#10172
Open
LFDanLu wants to merge 9 commits into
Open
fix: Move focus to newest item when using "scroll to bottom" button, transitions, and other follow ups to Chat component#10172LFDanLu wants to merge 9 commits into
LFDanLu wants to merge 9 commits into
Conversation
…hen pressing the scroll down button
used to hit every toggle button group in the thread before exiting
|
Build successful! 🎉 |
…hat but outside the prompt field
|
Build successful! 🎉 |
|
Build successful! 🎉 |
yihuiliao
previously approved these changes
Jun 12, 2026
…_testing_followup
|
Build successful! 🎉 |
yihuiliao
previously approved these changes
Jun 12, 2026
devongovett
reviewed
Jun 13, 2026
| let isChatFocusWithinRef = useRef(false); | ||
| let hasNewMessagesRef = useRef(false); | ||
| let timeout = useRef<ReturnType<typeof setTimeout> | null>(null); | ||
| let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/s2'); |
Member
Author
There was a problem hiding this comment.
ugh copy pasta, thanks for the catch. I'll fix the other ones in the rest of the files
| [InternalChatContext, {announceItem, setIsNearBottom, setScrollElement}], | ||
| [ThreadScrollButtonContext, {isNearBottom, scrollToBottom}], | ||
| [ | ||
| TextFieldContext, |
Member
There was a problem hiding this comment.
Ah we'll need to update this to support TokenField too I guess.
Member
Author
There was a problem hiding this comment.
yep, I can update once your PR goes in. Maybe some kind of generic context could be used to pass this, ideally we'd just need to see if the user is inside what we consider the "field" regardless of what elements those would be
| onScroll={handleScroll} | ||
| keyboardNavigationBehavior="tab" | ||
| focusOnEntry={focusOnEntry} | ||
| UNSTABLE_focusonEntry={UNSTABLE_focusonEntry} |
Member
There was a problem hiding this comment.
Should the On be capitalized?
| @@ -31,21 +32,43 @@ import { | |||
| GridListItemProps, | |||
Member
There was a problem hiding this comment.
Is this file supposed to exist still since it is also in Chat.tsx?
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.
Follow ups to comments in #10045
Fixes the following:
✅ Pull Request Checklist:
📝 Test Instructions:
Test the Streaming Chat story, see the fixes above to see what to check
🧢 Your Project:
RSP