fix(ui): preserve manual scroll during streaming#356
fix(ui): preserve manual scroll during streaming#356pascalandr wants to merge 4 commits intoNeuralNomadsAI:devfrom
Conversation
Disable auto-follow as soon as the user expresses an explicit upward scroll intent, so streaming renders stop snapping the message list back to bottom before the upward scroll can take effect.
|
I want you to perform the gatekeeper checks for latest PR state check for regressions |
|
Gatekeeper review for the latest PR state. What I understood: you wanted a ruthless review of the current patch for regressions and for any stronger implementation option, without broadening scope beyond this PR. Findings
The new block flips if (direction === "up" && autoScroll() && activeHoldTargetKey() === null) {
setAutoScroll(false)
lastObservedPinnedAtBottom = false
suppressAutoScrollOnce = true
}That fixes the race you were targeting, but it also changes semantics from "user scrolled up" to "user tried to scroll up". Regression path:
This is a behavior regression relative to the previous contract, where follow mode only broke after an actual upward movement away from bottom was observed in Better implementation directionA safer approach is to keep the new race fix separate from the persisted follow state:
That preserves the fix for the stream race without breaking follow on non-moving input. Validation gaps
I did not find a second issue that was as strong as the regression above. That one is significant enough that I would block on it before merging. -- |
Convert the streaming scroll fix into a two-step flow: upward intent suppresses the next auto-pin immediately, but follow mode only turns off once the viewport actually moves away from bottom, avoiding false negatives when the list cannot scroll yet.
|
PR builds are available as GitHub Actions artifacts: https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/24848915679 Artifacts expire in 7 days.
|
|
I want you to perform the gatekeeper checks for latest PR state check for regressions |
|
Gatekeeper review for the latest PR state. What I understood: you wanted a fresh ruthless review of the current revision of this PR, focused on regressions and whether the implementation can be made safer without expanding scope. Findings
The previous regression was addressed well by separating "upward intent" from the persisted follow state. But the new
That leaves a concrete stale-state path:
So the component can ignore an explicit user request to resume follow for up to 600 ms. That is still a correctness issue in a streaming message list. Better implementation directionIf the user or caller explicitly opts back into follow, that should win immediately. The minimal fix is to clear the pending flag in the explicit resume paths, for example:
That keeps the race fix while avoiding a stale guard overriding a newer user action. Validation gaps
Net: the earlier blocker is fixed, but I would still block this revision until the stale -- |
|
I want you to perform the gatekeeper checks for latest PR state check for regressions |
|
Gatekeeper review for the latest PR state. What I understood: you wanted a fresh ruthless pass on the current revision of this PR, focused on regressions and on whether the implementation can be made safer without expanding scope. Findings
The previous blocker was addressed correctly for explicit resume paths like Concrete path:
So the list can be visibly back at bottom with follow re-enabled, but still ignore streamed auto-follow work for up to 600 ms because the stale pending flag keeps winning. This is still a correctness bug in the same interaction family: a newer, real user state should override the temporary guard immediately. Better implementation directionThe minimal safer change is to clear the pending upward break as soon as the list confirms it is back at bottom, including inside the user-scroll synchronization path. In practice, when Validation gaps
Net: the last revision improved the implementation, but I would still block this PR until the remaining stale Side note: -- |
|
I want you to perform the gatekeeper checks for latest PR state check for regressions |
|
PR builds are available as GitHub Actions artifacts: https://github.com/NeuralNomadsAI/CodeNomad/actions/runs/24851801866 Artifacts expire in 7 days. |
|
Gatekeeper review for the latest PR state. What I understood: you wanted a fresh ruthless pass on the current revision of this PR, focused on regressions and on whether there is a safer implementation available without expanding scope. FindingsI do not currently see a blocking correctness issue in the latest revision. The previous regressions I called out have been addressed in the current patch:
That leaves the follow-state transitions internally consistent for the race this PR is targeting. Residual risks / gaps
Gatekeeper verdictFrom a code-review perspective, I would no longer block this PR on the implementation itself. If CI is green in the real project environment, this looks mergeable to me. -- |
|
@pascalandr - Do you still see this issue happening in latest develop? Can you please check and confirm as I remember working on it recently |
Fixes #305
Summary
Why
The message stream already tries to leave follow mode when the user scrolls up, but streaming renders can still re-pin the list before the upward movement is fully observed.
This makes scrolling upward feel broken while the agent is still responding.
What Changed
packages/ui/src/components/virtual-follow-list.tsxValidation
npm run build --workspace @codenomad/ui