Skip to content

fix(flow-chat): stabilize sticky pins across session re-entry - #1847

Merged
wsp1911 merged 1 commit into
GCWing:mainfrom
wsp1911:dev2
Jul 29, 2026
Merged

fix(flow-chat): stabilize sticky pins across session re-entry#1847
wsp1911 merged 1 commit into
GCWing:mainfrom
wsp1911:dev2

Conversation

@wsp1911

@wsp1911 wsp1911 commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • 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.

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:web
    • Passed.
  • pnpm --dir src/web-ui exec vitest run src/flow_chat/components/modern/VirtualMessageList.session-boundary.test.tsx --pool=forks --maxWorkers=1
    • Passed: 1 file, 32 tests.
  • pnpm --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=1
    • Passed: 3 files, 33 tests.
  • Focused ESLint checks for the modified production files.
    • Passed.
  • git diff --cached --check
    • Passed.

Reviewer Notes

  • Pending sticky pin remains responsible for materializing a virtualized target, but all retries now carry synchronous generation, session, and turn identity.
  • Pin-owned reservation is capped at clientHeight.
  • Collapse reservation and total footer compensation remain uncapped because large or cumulative tool-card collapses may legitimately require more than one viewport.
  • Viewport clamp events are logged only when FlowChat diagnostics are enabled.

Checklist

  • This PR is focused and does not include secrets, temporary prompts, generated scratch files, or unrelated artifacts.
  • Relevant verification is recorded above, or skipped checks are explained.
  • User-facing strings, docs, and locales are updated where applicable.

- 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.
@wsp1911
wsp1911 merged commit 10807cd into GCWing:main Jul 29, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant