Improve chat scroll behavior and 508 usability#983
Merged
Conversation
…to the bottom suddenly when answer is done streaming.
Contributor
Author
|
@Bionic711 @paullizer Here's another PR for you. This adjusts the scroll behavior to more closely match other AI chat apps. Please let me know if you need updates/adjustments. |
Contributor
|
Interesting...This is not something I considered and I am looking forward to checking it out. Will review in the morning EST. |
Contributor
Contributor
|
This was a good change. I like it. Nice work! |
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.
Summary
Changes
selectConversationto load messages and reattach streaming, then scroll to the bottom once per branch (collaborative vs non‑collaborative), instead of scrolling multiple times during initial load.scrollConversationViewToBottomhelper that usesrequestAnimationFrameto scroll after layout settles.sendMessageso that after a message is sent, the chat view callswindow.scrollChatToBottom()to keep the newly submitted message in view.appendMessageso:<img>elements via DOM APIs (with error handlers) instead of string-built HTML with inlineonload/onerror, reducing attribute interpolation risk.Files Touched (high level)
Validation
fix-508-scrollis up to date withupstream/Development.git diff --check upstream/Development...HEADpython check_xss_sinks.py --full-file chat-conversations.js chat-messages.js application/single_app/templates/chats.htmlinnerHTMLand attribute interpolation patterns in chat JS.Versioning & Docs
VERSION = "0.250.006".Risks / Follow-Up
innerHTML/attribute interpolation with DOM APIs and explicit URL normalization).