fix(web-ui): keep long sessions visible after send#1340
Merged
Conversation
b70e399 to
946fe9d
Compare
946fe9d to
86e3a83
Compare
Closed
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
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
gcwing/mainat0f0f70d3and rechecked the full PR diff from that base.Validation
pnpm --dir src/web-ui run test:run(221 files / 1249 tests)pnpm run type-check:webpnpm run lint:webpnpm run build:webgit diff --check gcwing/main...HEADkeeps a generated long session visible after sending a new messagelong-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.jsoncollects warm-reopen timing for a generated long sessionlong-session-warm-reopen-2026-06-29T06-30-21-051Z.jsonThe 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