Skip to content

fix(web-ui): keep long sessions visible after send#1340

Merged
limityan merged 1 commit into
GCWing:mainfrom
limityan:yanzhn/issue-1321-debug-e2e
Jun 29, 2026
Merged

fix(web-ui): keep long sessions visible after send#1340
limityan merged 1 commit into
GCWing:mainfrom
limityan:yanzhn/issue-1321-debug-e2e

Conversation

@limityan

@limityan limityan commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Keep the previous visible Flow Chat tail mounted during same-session initial-history transitions after sending from a historical session.
  • Avoid treating layout/programmatic scrolls near a partial-history boundary as user full-history intent.
  • Split follow-output ownership from sticky-latest pin permission so restored streaming sessions keep follow-output behavior while user-only in-flight turns do not get sticky-pinned before model output exists.
  • Add generated long-session E2E coverage for the send-after-open blank/reload regression.

Root cause

This was not a single loading-state issue. In debug mode with long historical sessions, sending a new message can change the latest turn and initial-history render window while the same session is still moving between partial tail, context restore, and full projection states. The existing projection handoff protected session switches, but not this same-session initial-history transition, so the message DOM could briefly collapse to a blank/reloaded surface.

Two adjacent contributors made the blank easier to hit: passive scroll events from layout changes could schedule full-history projection as if the user had scrolled upward, and sticky-latest pinning was applied to a user-only processing turn before model output existed.

A follow-up adversarial review found that the first sticky-pin guard was too broad: it also made the container treat restored processing sessions as completed history and broke the existing follow-output handoff test. The fix now keeps two separate policies: follow-output owns active user turns, while sticky-latest pin starts only after model output exists.

Latest adversarial review

  • Rebased onto gcwing/main at 0f0f70d3 and rechecked the full PR diff from that base.
  • No additional source changes were required after the latest review.
  • Performance risk review: the added static-history bottom guard is bounded to a short 2.5s window, cancels on real upward user intent, and does not request full-history projection from passive layout scrolls. Latest debug reports show no post-send full-history projection requests.

Validation

  • pnpm --dir src/web-ui run test:run (221 files / 1249 tests)
  • pnpm run type-check:web
  • pnpm run lint:web
  • pnpm run build:web
  • git diff --check gcwing/main...HEAD
  • Generated clean long-session fixture: 20 sessions, target session 60 turns, 1500 assistant chars, 6000 tool-result chars, 2 tool items.
  • Debug E2E send-after-open, clean fixture, repeated 3x: keeps a generated long session visible after sending a new message
    • reports: long-session-send-after-open-2026-06-29T06-25-36-819Z.json, long-session-send-after-open-2026-06-29T06-28-44-604Z.json, long-session-send-after-open-2026-06-29T06-28-59-073Z.json
    • each run: post-user blank events 0, post-latest blank/loading events 0, loading / overlay / placeholder visual toggles 0 / 0 / 0, full-history projection after send 0
  • Debug E2E warm-reopen, clean fixture: collects warm-reopen timing for a generated long session
    • report: long-session-warm-reopen-2026-06-29T06-30-21-051Z.json
    • latest content and model round visible: true / true
    • loading / overlay / placeholder visual toggles: 0 / 0 / 0

The local debug E2E environment has no primary model configured, so the test turn eventually fails server-side and is restored to the pending queue by existing error handling. The regression assertion covers the UI staying visible through send, failure, and restoration.

Fixes #1321

@limityan limityan force-pushed the yanzhn/issue-1321-debug-e2e branch from b70e399 to 946fe9d Compare June 29, 2026 05:15
@limityan limityan marked this pull request as ready for review June 29, 2026 06:06
@limityan limityan force-pushed the yanzhn/issue-1321-debug-e2e branch from 946fe9d to 86e3a83 Compare June 29, 2026 06:31
@limityan limityan merged commit bb1a959 into GCWing:main Jun 29, 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.

发送新消息后会话界面短暂空白/重新加载

1 participant