fix(flow-chat): stabilize sticky pins across session re-entry - #1847
Merged
Conversation
- Scope pending sticky pin retries to their generation, session, and target turn so canceled RAF callbacks cannot restore stale footer reservations. - Drop unresolved provisional pin space on user navigation or expiry while preserving established pinned ranges. - Resume tail follow directly when reopening an already-streaming session instead of replaying new-turn sticky pin behavior. - Cap pin-owned footer compensation at one viewport without limiting collapse compensation or total footer space. - Add regression coverage for stale RAF callbacks, delayed virtual items, session re-entry, and viewport-bounded reservations.
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
No linked issue.
Type and Areas
Type:
Regression fix
Areas:
Web UI, FlowChat scrolling and virtualization
Motivation / Impact
Switching away from and back to a streaming conversation could create excessive tail space. If the user scrolled before automatic recovery, stale pending pin callbacks could restore or transfer that provisional space, leaving the viewport blank until the turn ended.
The updated request lifecycle prevents stale retries from mutating the active viewport, distinguishes mounted streaming sessions from genuinely new turns, and limits pin-generated footer space to the maximum geometrically useful range.
Verification
pnpm run type-check:webpnpm --dir src/web-ui exec vitest run src/flow_chat/components/modern/VirtualMessageList.session-boundary.test.tsx --pool=forks --maxWorkers=1pnpm --dir src/web-ui exec vitest run src/flow_chat/components/modern/useFlowChatFollowOutput.test.tsx src/flow_chat/components/modern/FlowChatViewportCoordinator.test.ts src/flow_chat/components/modern/VirtualMessageList.layout.test.ts --pool=forks --maxWorkers=1git diff --cached --checkReviewer Notes
clientHeight.Checklist