mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #4014] [GUI] Chat page: mouse wheel cannot scroll up while an answer streams — only dragging the scrollbar escapes #1729
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#1729
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Memphad on GitHub (Oct 24, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4014
Area
[GUI]— two surfaces, one pattern each:apps/host/src/screens/Chat.tsx(this is where I hit it every day);serve/web/app.js(also what the installed app ships atcontrol/serve/web/app.js).Both ask "is the reader near the bottom?" every time the content changes, instead of asking whether the
reader asked to leave. A mouse wheel notch is about 100 px, so it always lands inside that band and gets
pulled back; a scrollbar drag covers hundreds of px in one move and gets away. That is exactly the symptom:
the wheel is dead, the slider works.
Desktop app, Terminal or source?
Desktop app (Windows) — the window's own chat screen, and the web page it serves. Also reproduced against
the page in a source tree.
What happened
I have a chat open and send a question. While the answer is being written I try to scroll back up — to
re-read the question or an earlier answer. The mouse wheel does nothing: the view stays glued to the newest
token, however many notches I turn. Dragging the scrollbar thumb with the mouse works, and once the answer
has finished the wheel works too. So while an answer streams, the wheel is the only input that is dead.
Expected: one wheel notch up moves the chat up by one notch, and it stays there until I come back to the
bottom.
Actual: the wheel moves nothing while an answer streams.
Cause, desktop window (
apps/host/src/screens/Chat.tsx, currentmain)The follow state is one ref,
pinned, and three places touch it. Onmainas fetched on 24 Oct (721 lines):A ~100 px wheel notch is inside the 120 px band and nowhere near the 400 px release, so the next token puts
the view back. A scrollbar drag clears 400 px in one move, which is why the thumb works and the wheel does
not.
Cause, served page (
serve/web/app.js)The two lines under
renderChat():send()runspaint()on every animation frame while the stream is open, andpaint()ends withscrollDown(), withoutforce. So every frame asks "is the reader within 120 px of the bottom?" and, ifyes, sets
scrollTop = scrollHeight. A wheel move smaller than that band lands inside it, and the nextframe (16 ms later) pulls the view back to the bottom. A drag of the scrollbar escapes because one drag
covers more than 120 px in a single go, after which the check stops firing.
Neither is fixed on current
main. At7dd5cf18e68c639a8773e096c5c79f971ea2a9f5the two lines above arestill in
serve/web/app.js, directly afterrenderChat(), andChat.tsxonmainstill has the 120 pxre-pin and the 400 px release quoted above.
Smallest steps or command that reproduce it
In the desktop window, and the same in the served page:
line. Be brief.").
times, or roll a trackpad.
Without a model, against the page's own code:
serve/weband open the page, with a seededstrata.chatin localStorage (28 messages, chatcontent about 7200 px, chat area 544 px).
send()runs:requestAnimationFramecallingupdateAssistant(el, m, true)andscrollDown()every frame.Reproduction status
Reproduced locally, in the installed app, on both surfaces.
Strata version
Desktop app 0.2.3 (
host/package.jsonversion, andstrata-desktop.exeFileVersion 0.2.3; host bundlebuilt 23 Oct) — that is the window where I hit it. Its chat screen is built from
apps/host/src/screens/Chat.tsx; the lines quoted above are what the installed bundle runs, read off therunning page (the React
onScrollprop), and they matchmain.Served page: control 0.1.48 and 0.1.49.2 installed, engine bundle
0.1.45.3-windows-x86_64-cuda-cuda13. Source tree also tested:project(strata VERSION 0.1.44 ...)inCMakeLists.txt.Graphics card, memory and system
RTX 5090 32 GB · 62 GB RAM · Windows 11 Pro 10.0.26300
Model, size and settings
Qwen3.8-Flash-Next IQ3_XXS · 131072 tokens context · pictures on. The bug is client-side and does not depend
on the model or the settings: any answer long enough to need scrolling shows it. The desktop-window numbers
below use real streamed answers from that model; the served-page numbers run the page's own paint loop with
no model in the loop.
Logs
No engine log: this is client-side. The engine answered normally (~179 tok/s on the reply used in the
desktop-window test).
Measurements — desktop window
The app's own chat screen, driven over the app's own host, real streamed answers typed into the app's
composer, wheel events dispatched at a pointer held over the transcript. Values are
scrollHeight - scrollTop - clientHeightin px after each event; 0 means that event did nothing. Chatcolumn 390 px wide, transcript area 506-528 px tall.
As shipped, six wheel events of -100 px while the answer streamed:
Five notches moved the transcript 0 px. The sixth moved only because the answer had just finished: the
transcript height stopped growing at 5714 px inside that same 150 ms.
With the change for that screen (below) applied to the installed built bundle, same app, same kind of
prompt:
The first notch reads 1 px because the answer grew about 100 px in the same 150 ms. Four seconds later, with
tokens still arriving, the view was still 3889 px from the bottom and was never pulled back.
What still works there: following the newest token while at the bottom — 0 px throughout a stream whose
transcript grew 6309 → 11947 → 16166 px; and the "jump to latest" pill, which still appears past 400 px and,
when clicked, lands at 0 px and resumes following (0 px while more tokens arrived). No console errors, and
the transcript, composer and per-conversation scroll restore behave as before.
Measurements — served page
Windows 11. The page served locally over
127.0.0.1, the page's own code, and real wheel events dispatchedat a pointer held over the chat area. "Distance from the bottom" is
scrollHeight - scrollTop - clientHeightin px after each wheel event; 0 means that event did nothing. Streaming is the page's own per-frame path:
updateAssistant(el, m, true)thenscrollDown()from arequestAnimationFrameloop, with the last answergrowing — exactly what
paint()does while a stream is open. The unfixed column is the shipped file; thefixed column is the same file with the change at the end of this report swapped in at load time, nothing else
touched.
Eight wheel events of -40 px (a light wheel turn, or a trackpad), chat area 544 px:
Six wheel events of -100 px, same page and same loop:
So Chromium can escape a 100 px notch, and only sometimes: it depends on how many pixels that wheel's notch
is worth on that machine, and on the size of the scroll area. On a smaller window it does not escape at all —
with the chat area 343 px tall, six notches of -100 px moved the unfixed page 0 px every time. In Firefox and
WebKit a 100 px notch never escaped. One big -600 px move (what a scrollbar drag amounts to) did escape on
the unfixed page, and the view stayed put after it.
What the change leaves working, same three engines:
distance stayed 0 px throughout, and after the wheel test the view held where it was left instead of
jumping back (for example 543 px left, still 547 px after 500 ms of more tokens).
WebKit 148, 296, 468, 616.
Firefox 25, 50, 125, 199, 299, 373, 448, 547; WebKit 49, 98, 147, 196, 245, 294, 343, 392.
to 1129 px from the bottom and held 1724 px while more tokens arrived. The same swipe with no stream moved
it 385 px, so the swipe itself was fine in both cases.
The change for the desktop window
Two edits in the one behaviour, keeping
pinnedas the single follow flag and leaving the pill's ownthreshold alone:
24is the slack the codebase already uses for "at the bottom" (src/lib/reasoning.ts,atBottom(el, slack = 24)).What stays as it was: following the newest token while at the bottom, the
Alt+↑/Alt+↓andCtrl+↓turnnavigation in focus mode, per-conversation scroll restore, the
ResizeObserverre-aim that keeps a pinnedtranscript pinned under
content-visibility: auto, and the "jump to latest" pill at 400 px.This is what I ran to get the desktop-window numbers above: those two replacements applied to the installed
built bundle, then confirmed by reading the live
onScrollprop off the running page, with the follow andpill paths re-tested afterwards.
The change for the served page, and what it leaves alone
serve/web/app.jsonly, those two lines replaced:What stays as it was: following the newest token while the reader is at the bottom, the forced jump to the
bottom on send / new chat / undo (
scrollDown(true)fromrenderChat()), the Thinking pane, tool blocks,the Monitor and About tabs, and everything on the server side.
nearBottom()has no other caller in thefile.
What I did not test
the same built bundle and the same host the window loads — but not the window's webview itself, and the
wheel events were dispatched by a driver rather than by a hand on a mouse.
real mouse wheel on Windows scrolls roughly 100-150 px per notch, which is inside both bands.
stream. The desktop-window measurements do use a live stream.
content-visibility: automoves the height under the reader - twelve notches of +100 px closed 1798 →698 px while the answer kept growing. Before the change that situation was pinned instead, so this is not
a regression, but I did not tune it.
400 px the transcript does not follow and no pill is offered. I left that alone rather than widen the
report; the comment at 421-422 says the 400 was chosen to stop the pill flickering as turns render, so it
may need its own look.
for the served page, and it pins on every notch.
Duplicate search
Searched open and closed issues and pull requests for
scroll,wheel,pinned,follow,nearBottom,scroll up,Chat.tsx. The closest threads:same
pinnedref), reported from the text-selection side. Closest match. If the maintainers would rathertrack the fix there, this report adds the wheel symptom, the numbers for both surfaces and the two changes.
web: preserve nested answer scroll positions during streamingand #1106 / #1075web: follow streaming Thinking and preserve reading position— all closed without merging and not onmain: thetools/test_chat_scroll.cjsthey mention is not in the tree at7dd5cf1(I fetched it: 404),and
nearBottom()with the 120 px band is still the code there. They are about inner scroll boxes (codeblocks, the Thinking pane) drifting, not about the wheel being unable to leave the bottom.
@Niko1221 commented on GitHub (Oct 27, 2026):
Thank you for the detailed report and the measurements. We reproduced the cause in the code: both the app chat and the served web page pull the view back to the bottom whenever you are within 120 px of it. It is Fixed in 0.2.7: The chat follows the answer only while you are at the bottom, and an upward wheel turn lets go at once.
Release: https://github.com/Niko1221/Strata/releases/tag/v0.2.7
@Memphad commented on GitHub (Oct 27, 2026):
Great stuff Niko! Keep up the amazing work, thank you.