Skip to content

fix(flow-chat): stabilize long-session turn navigation#1413

Merged
limityan merged 1 commit into
GCWing:mainfrom
limityan:yanzhn/fix-1381-flow-chat-scroll-ownership
Jul 4, 2026
Merged

fix(flow-chat): stabilize long-session turn navigation#1413
limityan merged 1 commit into
GCWing:mainfrom
limityan:yanzhn/fix-1381-flow-chat-scroll-ownership

Conversation

@limityan

@limityan limityan commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

This PR fixes the FlowChat scroll ownership issues reported in #1381 for long sessions and header turn navigation.

The root problem was that multiple layers were trying to own the same navigation outcome:

  • the header treated a user turn selection as UI state but could not tell whether the list accepted it
  • the container kept retrying header turn pins after the virtual list had already accepted responsibility
  • the virtual list returned only a boolean, so callers could not distinguish immediate settlement from deferred virtualized settling
  • explicit upward user intent could still be swallowed while an auto-follow arm was protected by the programmatic scroll guard

The updated behavior separates those responsibilities:

  • the header closes the turn list only when the selection is immediately settled; rejected or internally pending selections keep the chooser open instead of producing false success
  • the container sends a header turn pin intent once and stops retrying once the list owns a pending request
  • the virtual list exposes detailed turn-pin status while preserving the existing boolean API for older callers
  • explicit upward scroll intent cancels both active follow-output and armed auto-follow, so streaming/tool/background updates do not reclaim the viewport after the user starts reading history
  • the long-session interaction matrix now includes real turn-navigation coverage, and the release turn-navigation spec asserts prompt panel closure after accepted selection

Validation

  • vitest run src/flow_chat/components/modern/FlowChatHeader.test.tsx src/flow_chat/components/modern/ModernFlowChatContainer.history-state.test.tsx src/flow_chat/components/modern/useFlowChatFollowOutput.test.tsx src/flow_chat/components/modern/VirtualMessageList.session-boundary.test.tsx
  • tsc --noEmit in src/web-ui
  • node --test tests/e2e/scripts/perf-coverage-contract.test.mjs
  • node tests/e2e/scripts/run-long-session-interaction-matrix.mjs --dry-run --profile scroll
  • git diff --check

Fixes #1381

@limityan limityan merged commit 32e895d into GCWing:main Jul 4, 2026
4 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.

[Bug]: 长会话中手动向上滚动查看历史时,偶发自动跳回底部

1 participant