Pull requests / #2946
#2946 web: preserve nested answer scroll positions during streaming
open · @toawotaq05 · 0 comments · View on GitHub
Description
Long streamed answers repeatedly replace the answer HTML, recreating code and tool-output scroll containers. Scrolling inside those boxes jumps back on the next update, even when the outer chat scrollbar stays in place. Preserve vertical and horizontal scroll offsets in nested code/tool output and the answer container when rebuilding changed HTML, and leave the DOM intact when the rendered answer is unchanged. Preserve the Thinking pane's reading position and capture outer-chat follow intent before a growing answer changes its height, including the final paint. Validation: - `node tools/test_chat_scroll.cjs`: 6/6 pass; 5/6 fail against the unchanged upstream renderer. The tests execute the actual renderer and streaming paint callback with synthetic DOM scroll-reset behavior; no GPU or model is needed. - `node --check serve/web/app.js` and `git diff --check` pass. - A user who reproduced the jump-back problem in the running Strata web UI confirmed that this patch fixed it after a hard refresh. No automated real-browser test was run. Related: #1106 (closed replacement for #1075). This also covers the nested answer code/tool containers recreated by `innerHTML` updates. No engine, model, API or startup configuration changes.
Related on this site
Quick links to related pages.