-
Notifications
You must be signed in to change notification settings - Fork 11
added spec for scroll behavior #2800
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
Draft
aangerhofer
wants to merge
2
commits into
main
Choose a base branch
from
scrolling_behavior
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+52
β0
Draft
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
52 changes: 52 additions & 0 deletions
52
packages/spright-components/src/chat/specs/scrolling-behavior.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,52 @@ | ||
| # Chat Component - Scrolling Behavior Specification | ||
|
|
||
| ## Overview | ||
| This document defines the scrolling behavior for the chat component specifically system-initiated scrolling and how user-initiated scrolling impacts it. | ||
|
|
||
| ### Background | ||
| - The Nigel chat needs defined scrolling behavior to balance automatic updates with user control | ||
|
|
||
| ### Types of Scrolling in AI Chat | ||
|
|
||
| **User-initiated scrolling:** | ||
| User initiated scrolling is done by the user to view previous chats in the message area. User scrolling can be initiated with the mouse, keyboard, or clicking on the scrollbar. | ||
| -**Manual interruption:** A specific type of user scrolling that takes place when the user scrolls up while AI is generating response to stop auto-scroll. | ||
|
|
||
| **System-initiated scrolling:** | ||
| - **Post send auto-scroll:** Automatic scrolling to the users next message when the user sends a message | ||
| - **AI response auto-scroll:** Scrolling as AI generates and streams response content | ||
|
|
||
| ## Auto-scrolling behavior | ||
|
|
||
| **Post send auto-scroll** | ||
| Post send auto-scrolling should appear any time the user sends a new message (regardless of where they are in the chat history at the time) | ||
|
|
||
| **AI response auto-scroll** | ||
| AI response auto-scroll should occur only if the AI streams responses. Long responses should auto scroll because streaming should be happening at a human readable pace and therefore start removing the old (assumed read) content off screen. If we are not streaming the response and instead returning a block of text, we should not autoscroll because this would take unread content off the screen. | ||
|
|
||
| System-initiated auto-scrolling should stop when a manual interruption occurs. | ||
|
|
||
| **Auto-scroll Re-engagement** | ||
| Auto scroll is re-rengaged when a user does any action to return to the bottom of the chat | ||
|
|
||
| **Scroll position memory:** | ||
| - Scroll position should only be preserved for the open chat, we do not need to remember scroll position history when navigating the chat history | ||
|
|
||
| ## Mouse Interactions | ||
|
|
||
| ### Scrolling Behavior | ||
| - **Mouse wheel scrolling:** Standard scrolling behavior, disables auto-scroll when user scrolls up | ||
| - **Scrollbar dragging:** Precise scroll control, temporarily disables auto-scroll | ||
|
|
||
| ## Non-Mouse Interactions | ||
|
|
||
| ### Keyboard Navigation | ||
| - **Page Up/Down in message area:** Navigate through message history, disables auto-scroll | ||
| - **Tab navigation:** Focus management doesn't affect scroll position for on screen elements but if we begin to tab upwards in the chat to nonvisible content we should scroll to it | ||
|
|
||
| ### Accessibility Considerations | ||
| - **Screen readers:** Announce new messages without forcing scroll position changes | ||
| - **Focus management:** Maintain logical tab order regardless of scroll position | ||
|
|
||
| ## Open Issues | ||
| None | ||
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.
This should be any scroll, not just scroll up?