Skip to content

fix(chat): unblock history presentation after rollback and empty projection - #3773

Merged
bobleer merged 2 commits into
GCWing:mainfrom
bobleer:bob/fix-flowchat-rollback-loading
Nov 6, 2026
Merged

bobleer merged 2 commits into
GCWing:mainfrom
bobleer:bob/fix-flowchat-rollback-loading

Conversation

@bobleer

@bobleer bobleer commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Fix FlowChat remaining behind the history loading overlay after a Turn rollback or when a completed internal Turn deliberately has no visible rows. Retire expired reader bookmarks, clear restore status when presentation ownership changes, and retain history search/navigation for empty projections. Preserve viewport readiness and explicit retry for actual read failures.

Type and Areas

Type: bug fix

Areas: Web UI / FlowChat history presentation, localized empty-window copy, focused tests and existing viewport documentation.

Motivation / Impact

A rollback can shorten an eight-Turn session while its saved reading range still ends at Turn eight. Hydration starts restoring that expired range in a layout effect; range invalidation then advances the owner generation in a passive effect. The old reply is discarded correctly, but its loading state previously had no remaining owner to clear it. A new history navigation taking over a cold restore had the same failure.

The surviving tail or empty session now becomes presentable, expired bookmarks/snapshots do not return on another refresh, and late successes/failures cannot overwrite the new presentation. Valid reader restoration and the settled-viewport reveal gate remain active.

GenUI internal Turns can also intentionally omit their input and produce no model output. The modern store publishes the Session and rows atomically, so treating ready-with-zero-rows as unfinished hydration caused a second permanent loading state. The container now follows explicit load state, keeps the header/Turn Rail/list controller available for earlier-history navigation, and shows localized empty-window copy. A truly empty session still shows the welcome view.

This changes frontend presentation only; it requires no persisted-data or remote-protocol migration.

Verification

  • Reproduced both permanent loading failures with the production container/loading boundary before fixing them.
  • pnpm run check:web — passed.
  • pnpm run i18n:audit — passed, zero warnings.
  • pnpm --dir src/web-ui exec tsc --noEmit — passed.
  • ESLint for both changed production components and both regression fixtures (--no-ignore for fixtures) — passed.
  • pnpm --dir src/web-ui run test:run src/flow_chat/components/modern/ModernFlowChatContainer.history-restore.test.tsx src/flow_chat/components/modern/ModernFlowChatContainer.history-state.test.tsx src/flow_chat/components/modern/HistorySessionLoadingBoundary.test.tsx src/flow_chat/components/modern/VirtualMessageList.timeline-prepend.test.tsx — 73 passed, including 16 container restoration cases and real virtual-list navigation from an empty projection.
  • Focused SessionRollbackService, UserMessageEditService, EventHandlerModule, storeSync, sessionActivation, sessionSceneLifecycle, sceneStore, RelaySessionHistory, SessionRecordReplica and modernFlowChatStore suites — passed.
  • pnpm --dir src/web-ui run test:run src/flow_chat/store/FlowChatStore.test.ts -t 'rollback|rolled.back|retir|reader|expired.*range|bookmark|changed.*history|reload' — 15 passed.
  • git diff --check — passed.

Reviewer Notes

AI-assisted implementation, with focused automated verification. Container tests control history IO and viewport readiness on local and simulated Peer surfaces; virtual-list tests supply DOM geometry. They do not establish native WebView layout or live remote transport behavior. Native and two-device interaction checks remain manual under the owning directory's AGENTS.md. Remote-workspace and Detached Dispatch rollback restrictions remain in their existing owners. No mobile/bot UI or host mutation behavior changes.

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.

@bobleer bobleer changed the title fix(chat): prevent rollback from stranding history loading fix(chat): unblock history presentation after rollback and empty projection Nov 6, 2026
@bobleer
bobleer merged commit 10926c9 into GCWing:main Nov 6, 2026
9 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