Streaming output now follows the bottom of the page when the user is
already at the bottom, and stops doing so the moment they scroll up.
Scrolling back down re-engages autoscroll. A 64px tolerance covers
sub-pixel scroll positions and the sticky prompt-bar's offset.
Mechanics:
* Module-level scrollPinned flag, recomputed on every window scroll
event (passive).
* maybeAutoscroll() jumps to the bottom only when pinned. Called
from attachStreaming's appendText / appendNewline so every
chunk-text / chunk-eol arriving from the worker tracks.
* renderAll still does an unconditional jump (it fires on
user-initiated actions — send, tab switch, etc. — where the
most-recent content is what they want) and re-pins scrollPinned
afterward so the streaming follow-ups continue to track.
Smoke-tested headlessly: streaming 30+ lines while at bottom keeps
viewport at bottom; scrolling to top during streaming leaves scrollY=0
even as the doc grows to 2KB tall.
|
||
|---|---|---|
| .. | ||
| app | ||
| asm | ||
| c | ||
| dist-repl | ||
| python | ||
| repl | ||
| tests | ||
| Makefile | ||