fix(chat): stop yanking the transcript back down while the reader scrolls up - #184
Open
Nordalux wants to merge 1 commit into
Open
fix(chat): stop yanking the transcript back down while the reader scrolls up#184Nordalux wants to merge 1 commit into
Nordalux wants to merge 1 commit into
Conversation
…olls up Both chat views pinned the scroll container to the bottom on every messages change. During a streaming reply that fires on each token, so scrolling up to re-read something is undone within milliseconds and the transcript is effectively unreadable until the answer finishes. Pin only while the reader is still at the bottom. Scrolling away releases it, scrolling back re-arms it. The shared hook replaces the duplicated effect in SAM and onboarding; the pin decision is a pure function so it can be tested without a DOM.
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.
SamConversationandOnboardingChatConversationboth pinned their scroll container to the bottom on everymessageschange. During a streaming reply that fires per token, so scrolling up to re-read something is undone within milliseconds. Fixes #160, which reports it for SAM; the onboarding chat carried the same three lines.The pin now holds only while the reader is still at the bottom — scrolling away releases it, scrolling back re-arms it. The duplicated effect moves into one hook, with the pin decision as a pure function so it is testable without a DOM.
Verified in:
pnpm ci:checkclean,pnpm test:ci774 passed,pnpm vite buildgreenVerified and tested by hand. The description was drafted with AI assistance — I'd rather let the diff do the talking than a long write-up.