fix: stop reasoning auto-scroll from fighting manual scroll-up during streaming#154
Draft
cursor[bot] wants to merge 2 commits into
Draft
fix: stop reasoning auto-scroll from fighting manual scroll-up during streaming#154cursor[bot] wants to merge 2 commits into
cursor[bot] wants to merge 2 commits into
Conversation
The reasoning/thinking container auto-scroll effect forced scrollTop to scrollHeight on every streamed chunk while status === 'streaming', with no check on the user's current scroll position. Scrolling up to re-read earlier chain-of-thought was immediately reverted by the next token update, making it impossible to read anything until generation finished. Only auto-scroll when the user is already within a small threshold of the bottom, matching the stick-to-bottom pattern used by the main conversation view. Fixes #153 Co-authored-by: Mike <Vect0rM@users.noreply.github.com>
Co-authored-by: Mike <Vect0rM@users.noreply.github.com>
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.
Describe Your Changes
web-app/src/routes/threads/$threadId.tsxran on every streamed token whilestatus === 'streaming'and unconditionally forcedscrollTop = scrollHeight, with no check of the user's current scroll position. Scrolling up to re-read earlier chain-of-thought was reverted on the very next token update, so it was effectively impossible to read anything until generation finished — exactly the scroll behavior described in the issue.REASONING_AUTO_SCROLL_THRESHOLD_PX = 24px), mirroring the stick-to-bottom pattern already used by the main conversation view (use-stick-to-bottom). The box still auto-follows new content while the user hasn't scrolled away, but stops yanking the view down once they scroll up on purpose.Scope note
Issue #153 bundles several complaints. This PR addresses only the one that was concrete and traceable without logs — the reasoning auto-scroll bug quoted above. The other reported symptoms (app crashes/freezes shortly after generation completes, a "shaky" UI during token generation, and "code rendering is a mess") have no logs, stack traces, or specific repro steps attached to the issue, so their root cause(s) can't be safely pinned from the codebase alone. Those remain open; the reporter would need to attach
Settings → General → Data Folder → App Logsplus explicit repro steps (which build/backend, which model, does it always happen, etc.) for someone to investigate further.Fixes Issues
Self Checklist
AGENTS.md§7Verification
yarn workspace @janhq/web-app lint— no new errors/warnings introduced (all pre-existing lint errors are in unrelated files:codeBlockDownload.ts,ttft-timing.ts,thread-read-store.ts)yarn tsc -b --noEmit— clean, no type errors