GIE-307: enable back to top while streaming#159
GIE-307: enable back to top while streaming#159kdoberst wants to merge 1 commit intoopenshift:mainfrom
Conversation
|
@kdoberst: This pull request references GIE-307 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
/retest |
1 similar comment
|
/retest |
vishsanghishetty
left a comment
There was a problem hiding this comment.
@kdoberst
Looks good overall 👏🏽 , this fixes the core issue with back-to-top during streaming, and the new tests cover the key race behavior well. I’m approving.
One follow-up I’d still like is if we can we replace the fixed 300ms grace window with intent/state-based suppression (stay suppressed after back-to-top until the user scrolls/clicks back to bottom)? The hardcoded timeout works, but this would be more robust across slower devices and long conversations.
How I QE'ed manually
- Started streaming and did not scroll; confirmed it stayed pinned to the latest streamed content.
- Scrolled up manually during streaming; confirmed autoscroll stopped.
- Clicked the back-to-top button while streaming; confirmed it moved to the top and stayed there (no immediate snap back).
- Clicked back-to-bottom button while streaming; confirmed it jumped to latest content and autoscroll resumed.
- Scrolled up, then manually returned to bottom; confirmed streaming stayed pinned again.
- Repeated top/bottom interactions quickly during streaming; confirmed no jitter/lockup and expected behavior.
- Switched conversations after top-click during streaming; confirmed scroll behavior initialized correctly in the new conversation.
How I QE'ed (automated):
yarn test src/components/chat/MessageList.test.tsx --watch=false
yarn test src/components/chat/Chat.test.tsx --watch=false
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: kdoberst, vishsanghishetty The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@kdoberst: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Yep - hate it too. It is to get around what is happening inside of PatternFly. It tried numerous ways more elegant approaches but this was the only way I could get around what ever PF is doing. |
Description
While testing the scrolling behavior while message streaming, it was discovered that the "back to top" button was not working correctly. This PR attempts to fix this bug.
Our wanted behavior appears to be not exactly what PatternFly implemented. In order to get what we want working - it means working around some internal PatternFly behavior. There is often a race condition that happens between turning autoscroll off and "back to top" behavior. That is why you will a check for timing in the code. Because we are working on a race condition, finding a solution was not easy. Cursor wrote a lot of the code in the PR.
Here is what should happen when messages are streaming:
Type of Change
Related Issues
Fixes # GIE-307
Changes Made
See description
Testing Done
Test Details:
Screenshots/Videos
Click to expand
Definition of Done (DOD)
Code Quality
Testing
Documentation
Review & Quality
Pre-Merge
Additional Notes
Reviewer Guidance