Skip to content

Web UI: load chat transcript off-DOM with loading skeleton (Phase 2)#284

Merged
edwin-zvs merged 1 commit into
mainfrom
webui-phase2-transcript-offdom
May 30, 2026
Merged

Web UI: load chat transcript off-DOM with loading skeleton (Phase 2)#284
edwin-zvs merged 1 commit into
mainfrom
webui-phase2-transcript-offdom

Conversation

@edwin-zvs

Copy link
Copy Markdown
Contributor

Phase 2 — fixes the blank-flash / jump when opening a chat session.

Problem

loadTranscript revealed an empty transcript pane, then awaited the session.transcript round-trip. During that wait the user saw a blank void (pronounced over the cloudflared tunnel), then content popped in.

Change

  • Delayed shimmer skeleton (~150ms) during the fetch instead of a blank pane. Fast local loads resolve before the timer, so there's no skeleton flash.
  • Off-DOM build + atomic reveal: the whole transcript is rendered into a detached element (renderEvent retargeted at the builder via activeTranscriptEl), then swapped into the pane and pinned to the bottom in one synchronous step — the user only ever sees the finished transcript already at the latest message; no blank fill, no top-anchored flash that then jumps.
  • Session-switch guard: if you click away during the await, the late response no longer clobbers the session you're now viewing.
  • Re-selecting an already-loaded session is still instant (cached, no refetch).

Scope / compatibility

Chat-mode only; the terminal pty_replay path is unchanged. No e2e test drives loadTranscript (transcript tests call renderEvent directly, which is untouched), so web_smoke is unaffected. Tail-windowing / lazy-load-older-on-scroll is a deliberate follow-up.

🤖 Generated with Claude Code

Opening a chat session revealed an empty transcript pane and then
awaited the session.transcript round-trip, so the user saw a blank void
(pronounced over the tunnel) before content popped in.

loadTranscript now:
- shows a delayed (~150ms) shimmer skeleton during the fetch instead of
  a blank pane (fast local loads skip it, so no flash);
- builds the whole transcript off-DOM (renderEvent into a detached
  element) and swaps it in already scrolled to the bottom in one
  synchronous step — no blank fill, no top-anchored flash that jumps;
- guards against a session switch during the await so a late response
  can't clobber the session now being viewed.

Re-selecting an already-loaded session is still instant (cached).
Chat-mode only; terminal pty_replay is unchanged. Tail-windowing /
lazy-load-older-on-scroll is a deliberate follow-up.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@edwin-zvs
edwin-zvs merged commit dd1bc4b into main May 30, 2026
1 check passed
@edwin-zvs
edwin-zvs deleted the webui-phase2-transcript-offdom branch May 30, 2026 23:26
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