Skip to content

fix: stop reasoning auto-scroll from fighting manual scroll-up during streaming#154

Draft
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/reported-bug-investigation-72dd
Draft

fix: stop reasoning auto-scroll from fighting manual scroll-up during streaming#154
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/reported-bug-investigation-72dd

Conversation

@cursor

@cursor cursor Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Describe Your Changes

  • The reasoning/"thinking" container's auto-scroll effect in web-app/src/routes/threads/$threadId.tsx ran on every streamed token while status === 'streaming' and unconditionally forced scrollTop = 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.
  • The fix guards the auto-scroll with a small "near bottom" threshold (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.
  • No new state or event listeners were needed — the effect reads the container's current scroll position on each run, so a manual scroll-up is naturally respected until the user scrolls back near the bottom themselves.

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 Logs plus explicit repro steps (which build/backend, which model, does it always happen, etc.) for someone to investigate further.

Fixes Issues

  • Closes bug: Force closes #153 (partially — see scope note above; the crash/freeze, shaky-UI, and code-rendering complaints from the same issue are not addressed by this PR and should be tracked separately once more detail is available)

Self Checklist

  • Added relevant comments, esp in complex areas
  • Updated docs (for bug fixes / features) — logged an ADR entry in AGENTS.md §7
  • Created issues for follow-up changes or refactoring needed — n/a, follow-up is tracked on the original issue bug: Force closes #153 pending more info from the reporter

Verification

  • 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
Open in Web View Automation 

cursoragent and others added 2 commits July 3, 2026 04:07
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: Force closes

1 participant