fix(web-ui): stabilize FlowChat history paging - #1925
Merged
Conversation
- Keep the static history scroller mounted while prepending older turns. - Restore a semantic user-message anchor across window expansion and prepend. - Trigger pagination near the loaded-history boundary with a fixed loading sentinel. - Remove the sentinel after the full history has been revealed. - Add focused regression coverage for paging boundaries and static expansion.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #1537
FlowChat history paging no longer replaces the active scroller during upward navigation. The existing static history viewport stays mounted, expands before prepend, and restores the visible user-message anchor across both expansion and older-history insertion.
The loading sentinel is shown only while older history remains available. It is removed when
isPartialbecomesfalse, so the first turn aligns directly with the chat header.Type and Areas
Type:
Regression fix / UI/UX / test
Areas:
Web UI / FlowChat / virtual message list
Motivation / Impact
Previously, scrolling toward the oldest loaded turn could insert a large estimated spacer, briefly blank the viewport, and restore the user to the wrong position. An intermediate attempt to switch from the static list to Virtuoso during the scroll transaction could also return the viewport to the latest turn.
This change keeps the scroller stable, preserves a semantic message anchor, loads older turns near the actual boundary, and removes the loading placeholder once the first turn is reached.
Verification
pnpm exec vitest run src/flow_chat/components/modern/VirtualMessageList.session-boundary.test.tsx src/flow_chat/components/modern/VirtualMessageList.layout.test.ts --pool=threads --maxWorkers=1 --no-file-parallelismfromsrc/web-uipnpm run type-check:webpnpm exec eslint src/flow_chat/components/modern/VirtualMessageList.tsx --no-warn-ignoredfromsrc/web-uigit diff --checkReviewer Notes
user-messageelement and is restored in a layout effect before the next paint.Checklist