-
Notifications
You must be signed in to change notification settings - Fork 98
feat(ui): add scroll-to-bottom button and improve scroll navigation #1491
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
Merged
+154
−12
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
115 changes: 115 additions & 0 deletions
115
specs/frontend/sessions/messages/scroll-navigation.spec.md
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,115 @@ | ||
| # Session Message Scroll Navigation | ||
|
|
||
| ## Purpose | ||
|
|
||
| The session message view SHALL provide contextual scroll navigation buttons that allow users to quickly navigate to the top or bottom of the message list without manual scrolling. | ||
|
|
||
| ## Requirements | ||
|
|
||
| ### Requirement: Scroll-to-Top Button Visibility | ||
|
|
||
| The message view SHALL display a scroll-to-top button when the user has scrolled past a threshold distance from the top of the message container. | ||
|
|
||
| #### Scenario: Button appears after scrolling down | ||
|
|
||
| - GIVEN a message list with content taller than the viewport | ||
| - WHEN the user scrolls past a threshold distance from the top | ||
| - THEN a scroll-to-top button becomes visible | ||
|
|
||
| #### Scenario: Button hidden near the top | ||
|
|
||
| - GIVEN the scroll-to-top button is visible | ||
| - WHEN the user scrolls back within the threshold distance of the top | ||
| - THEN the button becomes hidden | ||
|
|
||
| ### Requirement: Scroll-to-Bottom Button Visibility | ||
|
|
||
| The message view SHALL display a scroll-to-bottom button when the user is not at the bottom of the message list. | ||
|
|
||
| #### Scenario: Button appears when scrolled up | ||
|
|
||
| - GIVEN a message list with content taller than the viewport | ||
| - WHEN the user scrolls up so the bottom of the content is not visible | ||
| - THEN a scroll-to-bottom button becomes visible | ||
|
|
||
| #### Scenario: Button hidden at bottom | ||
|
|
||
| - GIVEN the scroll-to-bottom button is visible | ||
| - WHEN the user scrolls to near the bottom of the content | ||
| - THEN the button becomes hidden | ||
|
|
||
| ### Requirement: No Buttons on Short Content | ||
|
|
||
| Neither scroll button SHALL appear when the message content does not overflow the container. | ||
|
|
||
| #### Scenario: Few messages | ||
|
|
||
| - GIVEN a message list shorter than the viewport height | ||
| - WHEN the view renders | ||
| - THEN neither scroll button is visible | ||
|
|
||
| ### Requirement: Smooth Animated Transitions | ||
|
|
||
| Both buttons SHALL animate in and out smoothly rather than appearing or disappearing abruptly. Hidden buttons SHALL NOT trigger hover effects or tooltips. | ||
|
|
||
| #### Scenario: Button fades in | ||
|
|
||
| - GIVEN a scroll button is hidden | ||
| - WHEN its visibility condition becomes true | ||
| - THEN the button transitions to visible smoothly | ||
|
|
||
| #### Scenario: Button fades out | ||
|
|
||
| - GIVEN a scroll button is visible | ||
| - WHEN its visibility condition becomes false | ||
| - THEN the button transitions to hidden smoothly | ||
| - AND the button does not receive pointer events while hidden | ||
| - AND the button's tooltip does not appear while hidden | ||
|
|
||
| ### Requirement: Smooth User-Initiated Scrolling | ||
|
|
||
| Both buttons SHALL scroll smoothly when activated by user click. | ||
|
|
||
| #### Scenario: Scroll to top | ||
|
|
||
| - GIVEN the scroll-to-top button is visible | ||
| - WHEN the user clicks it | ||
| - THEN the message container scrolls smoothly to the top | ||
|
|
||
| #### Scenario: Scroll to bottom | ||
|
|
||
| - GIVEN the scroll-to-bottom button is visible | ||
| - WHEN the user clicks it | ||
| - THEN the message container scrolls smoothly to the bottom | ||
|
|
||
| ### Requirement: Instant Auto-Scroll During Streaming | ||
|
|
||
| Auto-scroll that keeps the viewport pinned to new messages during streaming SHALL remain instant and not use smooth scrolling. | ||
|
|
||
| #### Scenario: New message during streaming | ||
|
|
||
| - GIVEN the user is at the bottom of the message list | ||
| - WHEN a new streaming message or token arrives | ||
| - THEN the container scrolls instantly to show the new content | ||
| - AND the scroll is not animated | ||
|
|
||
| ### Requirement: Button Tooltips | ||
|
|
||
| Both buttons SHALL display a tooltip describing their action. | ||
|
|
||
| #### Scenario: Tooltip content | ||
|
|
||
| - GIVEN either scroll button is visible | ||
| - WHEN the user hovers over the button | ||
| - THEN a tooltip appears with the text "Scroll to top" or "Scroll to bottom" respectively | ||
|
|
||
| ### Requirement: Button Layout | ||
|
|
||
| Both buttons SHALL be positioned in the bottom-right corner of the message container, stacked vertically with the scroll-to-top button above the scroll-to-bottom button. | ||
|
|
||
| #### Scenario: Both buttons visible | ||
|
|
||
| - GIVEN the user has scrolled past the top threshold and is not at the bottom | ||
| - WHEN both buttons are visible | ||
| - THEN they appear stacked vertically in the bottom-right corner of the message area | ||
| - AND the scroll-to-top button is above the scroll-to-bottom button |
Oops, something went wrong.
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.
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.
Make the hidden buttons unfocusable.
pointer-events-noneonly blocks mouse input. Both buttons still stay in the tab order while invisible, so keyboard users can land on hidden controls and potentially surface the tooltip.Fix
📝 Committable suggestion
🤖 Prompt for AI Agents