[GH-ISSUE #4014] [GUI] Chat page: mouse wheel cannot scroll up while an answer streams — only dragging the scrollbar escapes #1729

Closed
opened 2026-11-04 01:53:32 +07:00 by bsakaguchi · 2 comments
Owner

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:

  1. the desktop window's own chat screen, apps/host/src/screens/Chat.tsx (this is where I hit it every day);
  2. the chat page the server serves, serve/web/app.js (also what the installed app ships at control/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, current main)

The follow state is one ref, pinned, and three places touch it. On main as fetched on 24 Oct (721 lines):

// 264-271: runs on every streamed token (messages.at(-1).content changes)
const nearBottom = el.scrollHeight - el.scrollTop - el.clientHeight < 120;
if (nearBottom)
    scrollToLatest();          // which also sets pinned.current = true

// 415-425: the scroller's own handler releases the follow only past 400 px
const away = el.scrollHeight - el.scrollTop - el.clientHeight > 400;
pinned.current = !away;
setAwayFromBottom(away);

// 247-251: and pinned drives a re-aim that fires on every content growth, i.e. every token
const ro = new ResizeObserver(() => { if (pinned.current) el.scrollTop = el.scrollHeight; });

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():

function nearBottom() { const s = $("chat-scroll"); return s.scrollHeight - s.scrollTop - s.clientHeight < 120; }
function scrollDown(force) { const s = $("chat-scroll"); if (force || nearBottom()) s.scrollTop = s.scrollHeight; }

send() runs paint() on every animation frame while the stream is open, and paint() ends with
scrollDown(), without force. So every frame asks "is the reader within 120 px of the bottom?" and, if
yes, sets scrollTop = scrollHeight. A wheel move smaller than that band lands inside it, and the next
frame (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. At 7dd5cf18e68c639a8773e096c5c79f971ea2a9f5 the two lines above are
still in serve/web/app.js, directly after renderChat(), and Chat.tsx on main still has the 120 px
re-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:

  1. Open the chat; have enough messages that the chat scrolls.
  2. Send a prompt that gives a long answer (I used "List 120 short numbered facts about the sea, one per
    line. Be brief.").
  3. While the answer is still streaming, put the pointer over the chat and turn the mouse wheel up several
    times, or roll a trackpad.
  4. Nothing moves. Drag the scrollbar thumb up: the chat moves, and the wheel works from there.

Without a model, against the page's own code:

  1. Serve serve/web and open the page, with a seeded strata.chat in localStorage (28 messages, chat
    content about 7200 px, chat area 544 px).
  2. Run the loop send() runs: requestAnimationFrame calling updateAssistant(el, m, true) and
    scrollDown() every frame.
  3. Move the pointer over the chat and send eight wheel events of -40 px.

Reproduction status

Reproduced locally, in the installed app, on both surfaces.

Strata version

Desktop app 0.2.3 (host/package.json version, and strata-desktop.exe FileVersion 0.2.3; host bundle
built 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 the
running page (the React onScroll prop), and they match main.

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 ...) in
CMakeLists.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 - clientHeight in px after each event; 0 means that event did nothing. Chat
column 390 px wide, transcript area 506-528 px tall.

As shipped, six wheel events of -100 px while the answer streamed:

notch 1 2 3 4 5 6
px from the bottom 0 0 0 0 0 100

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:

notch 1 2 3 4 5 6
px from the bottom 1 191 654 1162 1625 2201

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 dispatched
at a pointer held over the chat area. "Distance from the bottom" is scrollHeight - scrollTop - clientHeight
in px after each wheel event; 0 means that event did nothing. Streaming is the page's own per-frame path:
updateAssistant(el, m, true) then scrollDown() from a requestAnimationFrame loop, with the last answer
growing — exactly what paint() does while a stream is open. The unfixed column is the shipped file; the
fixed 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:

engine as shipped with the change
Chromium 131 (v1148) 0, 0, 0, 0, 0, 0, 0, 0 65, 130, 194, 259, 324, 414, 478, 543
Firefox 132 (v1466) 0, 0, 0, 0, 0, 0, 0, 0 39, 129, 243, 333, 422, 537, 626, 741
WebKit 18.2 (v2104, the engine Safari uses) 0, 0, 0, 0, 0, 0, 0, 0 64, 128, 192, 256, 320, 384, 448, 512

Six wheel events of -100 px, same page and same loop:

engine as shipped with the change
Chromium 131 0, 149, 274, 399, 524, 648 (escapes on the 2nd notch, since its notch there is 125-149 px) 125, 274, 399, 524, 673, 798
Firefox 132 0, 0, 0, 0, 175, 324 150, 324, 474, 623, 773, 947
WebKit 18.2 0, 0, 0, 0, 0, 0 124, 248, 372, 496, 620, 744

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:

  • Following the newest token: the reader at the bottom, the loop running, more tokens arriving — the
    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).
  • Phone width 390x844, four notches of -100 px: Chromium 149, 324, 498, 672; Firefox 224, 473, 697, 946;
    WebKit 148, 296, 468, 616.
  • Trackpad-style input, eight deltas of -25 px at 1280x760: Chromium 50, 124, 174, 224, 274, 323, 398, 448;
    Firefox 25, 50, 125, 199, 299, 373, 448, 547; WebKit 49, 98, 147, 196, 245, 294, 343, 392.
  • Touch: a 400 px swipe up on a 390x844 touch view (Chromium with touch emulation, streaming): the view went
    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 pinned as the single follow flag and leaving the pill's own
threshold alone:

// 264-271: follow on the reader's intent, not on a 120 px band
useEffect(() => {
    const el = scroller.current;
    if (!el || (session?.showcase && !streaming))
        return;
    if (pinned.current)
        scrollToLatest();
}, [session?.messages.length, session?.messages.at(-1)?.content, scrollToLatest]);

// 423-425: release the follow as soon as the reader leaves the bottom; the pill keeps its 400 px
const away = el.scrollHeight - el.scrollTop - el.clientHeight > 400;
pinned.current = el.scrollHeight - el.scrollTop - el.clientHeight <= 24;
setAwayFromBottom(away);

24 is 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+↓ and Ctrl+↓ turn
navigation in focus mode, per-conversation scroll restore, the ResizeObserver re-aim that keeps a pinned
transcript 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 onScroll prop off the running page, with the follow and
pill paths re-tested afterwards.

The change for the served page, and what it leaves alone

serve/web/app.js only, those two lines replaced:

// Follow the answer only while the user is at the bottom of the chat, and let them leave.
// Asking "am I within 120px of the bottom?" every frame pinned the view: one mouse wheel notch is about
// 100px, so the next frame pulled it back and scrolling up during a long answer was impossible - only a
// drag of the scrollbar, which jumps past that band, could get away. So an upward wheel releases the follow
// at once, and it re-arms when the user comes back to the bottom (a scroll event, whatever moved it).
let stickToBottom = true;
const atBottom = () => { const s = $("chat-scroll"); return s.scrollHeight - s.scrollTop - s.clientHeight <= 24; };
function scrollDown(force) { if (force) stickToBottom = true; if (stickToBottom) $("chat-scroll").scrollTop = $("chat-scroll").scrollHeight; }
$("chat-scroll").addEventListener("wheel", (e) => { if (e.deltaY < 0) stickToBottom = false; }, {passive: true});
$("chat-scroll").addEventListener("scroll", () => { stickToBottom = atBottom(); }, {passive: true});

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) from renderChat()), the Thinking pane, tool blocks,
the Monitor and About tabs, and everything on the server side. nearBottom() has no other caller in the
file.

What I did not test

  • The desktop window's packaged webview: I drove the app's chat screen over the app's own host in Chromium —
    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 wheel hardware: the wheel events in both sets of measurements were dispatched programmatically. A
    real mouse wheel on Windows scrolls roughly 100-150 px per notch, which is inside both bands.
  • Real model tokens for the served page: those measurements drive the page's own paint loop, not a live
    stream. The desktop-window measurements do use a live stream.
  • Keyboard scrolling of the chat (PageUp / arrow keys with the chat or transcript focused): not tested.
  • Coming back down with the wheel alone in the desktop window: slow in a long streaming transcript, because
    content-visibility: auto moves 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.
  • Whether the pill should sit closer than 400 px now that the desktop follow band is 24 px: between 24 px and
    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.
  • Safari on macOS: not installed here. WebKit 18.2 (Safari's engine, Playwright build on Windows) is tested
    for the served page, and it pins on every notch.
  • Fling and momentum scrolling after a touch swipe: not measured; the swipe itself is, above.
  • Anything below 390 px wide, and a HiDPI phone: only 390x844 was measured.
  • macOS and Linux: not tested (Windows only).

Searched open and closed issues and pull requests for scroll, wheel, pinned, follow, nearBottom,
scroll up, Chat.tsx. The closest threads:

  • #3818 — the same re-pin-to-bottom pattern, in the desktop app's own chat screen (the same file and the
    same pinned ref), reported from the text-selection side. Closest match. If the maintainers would rather
    track the fix there, this report adds the wheel symptom, the numbers for both surfaces and the two changes.
  • #2946 web: preserve nested answer scroll positions during streaming and #1106 / #1075
    web: follow streaming Thinking and preserve reading position — all closed without merging and not on
    main: the tools/test_chat_scroll.cjs they mention is not in the tree at 7dd5cf1 (I fetched it: 404),
    and nearBottom() with the 120 px band is still the code there. They are about inner scroll boxes (code
    blocks, the Thinking pane) drifting, not about the wheel being unable to leave the bottom.
  • #3594 — wide content at phone width; unrelated.
  • #1257 — a copy button position request; unrelated.
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: 1. the **desktop window's own chat screen**, `apps/host/src/screens/Chat.tsx` (this is where I hit it every day); 2. the **chat page the server serves**, `serve/web/app.js` (also what the installed app ships at `control/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`, current `main`) The follow state is one ref, `pinned`, and three places touch it. On `main` as fetched on 24 Oct (721 lines): ```tsx // 264-271: runs on every streamed token (messages.at(-1).content changes) const nearBottom = el.scrollHeight - el.scrollTop - el.clientHeight < 120; if (nearBottom) scrollToLatest(); // which also sets pinned.current = true // 415-425: the scroller's own handler releases the follow only past 400 px const away = el.scrollHeight - el.scrollTop - el.clientHeight > 400; pinned.current = !away; setAwayFromBottom(away); // 247-251: and pinned drives a re-aim that fires on every content growth, i.e. every token const ro = new ResizeObserver(() => { if (pinned.current) el.scrollTop = el.scrollHeight; }); ``` 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()`: ```js function nearBottom() { const s = $("chat-scroll"); return s.scrollHeight - s.scrollTop - s.clientHeight < 120; } function scrollDown(force) { const s = $("chat-scroll"); if (force || nearBottom()) s.scrollTop = s.scrollHeight; } ``` `send()` runs `paint()` on every animation frame while the stream is open, and `paint()` ends with `scrollDown()`, without `force`. So every frame asks "is the reader within 120 px of the bottom?" and, if yes, sets `scrollTop = scrollHeight`. A wheel move smaller than that band lands inside it, and the next frame (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`. At `7dd5cf18e68c639a8773e096c5c79f971ea2a9f5` the two lines above are still in `serve/web/app.js`, directly after `renderChat()`, and `Chat.tsx` on `main` still has the 120 px re-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: 1. Open the chat; have enough messages that the chat scrolls. 2. Send a prompt that gives a long answer (I used "List 120 short numbered facts about the sea, one per line. Be brief."). 3. While the answer is still streaming, put the pointer over the chat and turn the mouse wheel up several times, or roll a trackpad. 4. Nothing moves. Drag the scrollbar thumb up: the chat moves, and the wheel works from there. Without a model, against the page's own code: 1. Serve `serve/web` and open the page, with a seeded `strata.chat` in localStorage (28 messages, chat content about 7200 px, chat area 544 px). 2. Run the loop `send()` runs: `requestAnimationFrame` calling `updateAssistant(el, m, true)` and `scrollDown()` every frame. 3. Move the pointer over the chat and send eight wheel events of -40 px. ## Reproduction status Reproduced locally, in the installed app, on both surfaces. ## Strata version Desktop app **0.2.3** (`host/package.json` version, and `strata-desktop.exe` FileVersion 0.2.3; host bundle built 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 the running page (the React `onScroll` prop), and they match `main`. 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 ...)` in `CMakeLists.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 - clientHeight` in px after each event; 0 means that event did nothing. Chat column 390 px wide, transcript area 506-528 px tall. As shipped, six wheel events of -100 px while the answer streamed: | notch | 1 | 2 | 3 | 4 | 5 | 6 | |---|---|---|---|---|---|---| | px from the bottom | 0 | 0 | 0 | 0 | 0 | 100 | 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: | notch | 1 | 2 | 3 | 4 | 5 | 6 | |---|---|---|---|---|---|---| | px from the bottom | 1 | 191 | 654 | 1162 | 1625 | 2201 | 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 dispatched at a pointer held over the chat area. "Distance from the bottom" is `scrollHeight - scrollTop - clientHeight` in px after each wheel event; 0 means that event did nothing. Streaming is the page's own per-frame path: `updateAssistant(el, m, true)` then `scrollDown()` from a `requestAnimationFrame` loop, with the last answer growing — exactly what `paint()` does while a stream is open. The unfixed column is the shipped file; the fixed 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: | engine | as shipped | with the change | |---|---|---| | Chromium 131 (v1148) | 0, 0, 0, 0, 0, 0, 0, 0 | 65, 130, 194, 259, 324, 414, 478, 543 | | Firefox 132 (v1466) | 0, 0, 0, 0, 0, 0, 0, 0 | 39, 129, 243, 333, 422, 537, 626, 741 | | WebKit 18.2 (v2104, the engine Safari uses) | 0, 0, 0, 0, 0, 0, 0, 0 | 64, 128, 192, 256, 320, 384, 448, 512 | Six wheel events of -100 px, same page and same loop: | engine | as shipped | with the change | |---|---|---| | Chromium 131 | 0, 149, 274, 399, 524, 648 (escapes on the 2nd notch, since its notch there is 125-149 px) | 125, 274, 399, 524, 673, 798 | | Firefox 132 | 0, 0, 0, 0, 175, 324 | 150, 324, 474, 623, 773, 947 | | WebKit 18.2 | 0, 0, 0, 0, 0, 0 | 124, 248, 372, 496, 620, 744 | 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: - Following the newest token: the reader at the bottom, the loop running, more tokens arriving — the 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). - Phone width 390x844, four notches of -100 px: Chromium 149, 324, 498, 672; Firefox 224, 473, 697, 946; WebKit 148, 296, 468, 616. - Trackpad-style input, eight deltas of -25 px at 1280x760: Chromium 50, 124, 174, 224, 274, 323, 398, 448; Firefox 25, 50, 125, 199, 299, 373, 448, 547; WebKit 49, 98, 147, 196, 245, 294, 343, 392. - Touch: a 400 px swipe up on a 390x844 touch view (Chromium with touch emulation, streaming): the view went 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 `pinned` as the single follow flag and leaving the pill's own threshold alone: ```tsx // 264-271: follow on the reader's intent, not on a 120 px band useEffect(() => { const el = scroller.current; if (!el || (session?.showcase && !streaming)) return; if (pinned.current) scrollToLatest(); }, [session?.messages.length, session?.messages.at(-1)?.content, scrollToLatest]); // 423-425: release the follow as soon as the reader leaves the bottom; the pill keeps its 400 px const away = el.scrollHeight - el.scrollTop - el.clientHeight > 400; pinned.current = el.scrollHeight - el.scrollTop - el.clientHeight <= 24; setAwayFromBottom(away); ``` `24` is 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+↓` and `Ctrl+↓` turn navigation in focus mode, per-conversation scroll restore, the `ResizeObserver` re-aim that keeps a pinned transcript 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 `onScroll` prop off the running page, with the follow and pill paths re-tested afterwards. ## The change for the served page, and what it leaves alone `serve/web/app.js` only, those two lines replaced: ```js // Follow the answer only while the user is at the bottom of the chat, and let them leave. // Asking "am I within 120px of the bottom?" every frame pinned the view: one mouse wheel notch is about // 100px, so the next frame pulled it back and scrolling up during a long answer was impossible - only a // drag of the scrollbar, which jumps past that band, could get away. So an upward wheel releases the follow // at once, and it re-arms when the user comes back to the bottom (a scroll event, whatever moved it). let stickToBottom = true; const atBottom = () => { const s = $("chat-scroll"); return s.scrollHeight - s.scrollTop - s.clientHeight <= 24; }; function scrollDown(force) { if (force) stickToBottom = true; if (stickToBottom) $("chat-scroll").scrollTop = $("chat-scroll").scrollHeight; } $("chat-scroll").addEventListener("wheel", (e) => { if (e.deltaY < 0) stickToBottom = false; }, {passive: true}); $("chat-scroll").addEventListener("scroll", () => { stickToBottom = atBottom(); }, {passive: true}); ``` 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)` from `renderChat()`), the Thinking pane, tool blocks, the Monitor and About tabs, and everything on the server side. `nearBottom()` has no other caller in the file. ## What I did not test - The desktop window's packaged webview: I drove the app's chat screen over the app's own host in Chromium — 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 wheel hardware: the wheel events in both sets of measurements were dispatched programmatically. A real mouse wheel on Windows scrolls roughly 100-150 px per notch, which is inside both bands. - Real model tokens for the served page: those measurements drive the page's own paint loop, not a live stream. The desktop-window measurements do use a live stream. - Keyboard scrolling of the chat (PageUp / arrow keys with the chat or transcript focused): not tested. - Coming back down with the wheel alone in the desktop window: slow in a long streaming transcript, because `content-visibility: auto` moves 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. - Whether the pill should sit closer than 400 px now that the desktop follow band is 24 px: between 24 px and 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. - Safari on macOS: not installed here. WebKit 18.2 (Safari's engine, Playwright build on Windows) is tested for the served page, and it pins on every notch. - Fling and momentum scrolling after a touch swipe: not measured; the swipe itself is, above. - Anything below 390 px wide, and a HiDPI phone: only 390x844 was measured. - macOS and Linux: not tested (Windows only). ## Duplicate search Searched open and closed issues and pull requests for `scroll`, `wheel`, `pinned`, `follow`, `nearBottom`, `scroll up`, `Chat.tsx`. The closest threads: - **#3818** — the same re-pin-to-bottom pattern, in the desktop app's own chat screen (the same file and the same `pinned` ref), reported from the text-selection side. Closest match. If the maintainers would rather track the fix there, this report adds the wheel symptom, the numbers for both surfaces and the two changes. - #2946 `web: preserve nested answer scroll positions during streaming` and #1106 / #1075 `web: follow streaming Thinking and preserve reading position` — all closed without merging and not on `main`: the `tools/test_chat_scroll.cjs` they mention is not in the tree at `7dd5cf1` (I fetched it: 404), and `nearBottom()` with the 120 px band is still the code there. They are about inner scroll boxes (code blocks, the Thinking pane) drifting, not about the wheel being unable to leave the bottom. - #3594 — wide content at phone width; unrelated. - #1257 — a copy button position request; unrelated.
Author
Owner

@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

<!-- gh-comment-id:6445856156 --> @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
Author
Owner

@Memphad commented on GitHub (Oct 27, 2026):

Great stuff Niko! Keep up the amazing work, thank you.

<!-- gh-comment-id:6446387429 --> @Memphad commented on GitHub (Oct 27, 2026): Great stuff Niko! Keep up the amazing work, thank you.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#1729
No description provided.