mirror of
https://github.com/NeuralNomadsAI/CodeNomad.git
synced 2026-10-21 13:54:39 +00:00
fix(chat): give each transcript scroll decision a single owner Fix three proven message-scroll conflicts without adding delays or a new control layer. Session switch oscillation: when a restored anchor was already mounted, content-rendered and resize notifications re-issued scrollToIndex (start of the message) while the restore stabiliser re-applied the saved intra-message offset. The two imperative Virtua targets fought each other, producing the rapid back-and-forth seen after A -> B -> A while A streams. A mounted anchor with a recorded offset is now corrected only through that offset; the index jump is issued only while the anchor is unmounted. Premature follow resumption: the 48px proximity tolerance doubled as user authorisation to follow, so stopping a manual read just above the bottom re-pinned the transcript. A user gesture now resumes follow only at the true bottom (1px) or through an explicit command (bottom button, End, submit). The 48px tolerance only keeps an already-following reader pinned. A manual reader above the true bottom keeps the scroll-to-latest button and its exact anchor in the session snapshot, so returning to the session restores the same gap instead of jumping to the bottom without following. Late history paging: a pending older/newer page kept positioning authority after a new gesture and could pull the reader back. An opposite directional gesture now aborts the page through the existing controller before it positions the view. Taps, content clicks and horizontal wheel input carry no direction and no longer cancel it; a same-direction gesture keeps it running. Validation: new tests/browser/message-scroll.test.ts (22 cases with real SessionView and native event dispatch) fails on the previous code and passes with the fix, alongside a controller unit test for the true-bottom rule. Related browser suites (session rendering, history navigation, search, restore, streaming outline) and the UI unit suites pass. The intermittent render-cost "unrelated child text" case fails at the same rate or less than on dev (2/12 vs 4/12). A nominal backward jump while streaming at the bottom was not reproduced and is not claimed fixed. |
||
|---|---|---|
| .. | ||
| cloudflare | ||
| electron-app | ||
| remote-tunnel | ||
| server | ||
| tauri-app | ||
| ui | ||