Skip to content

fix(ui): avoid flashes when switching cold sessions - #134868

Merged
jesse-merhi merged 7 commits into
mainfrom
openclaw/improve-skeleton-loading-for-sessions
Sep 9, 2026
Merged

jesse-merhi merged 7 commits into
mainfrom
openclaw/improve-skeleton-loading-for-sessions

Conversation

@jesse-merhi

@jesse-merhi jesse-merhi commented Sep 1, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Avoids flashing a loading skeleton when conversation history loads quickly, and softens its appearance on slower loads.

Why This Change Was Made

Switch to the destination immediately. Delay the existing skeleton by 500 ms, then fade it in over 150 ms. If history arrives sooner, the skeleton disappears without flashing. Reduced-motion users keep the delay without a perceptible fade.

This replaces the earlier retained-conversation implementation. No retained old transcript, dimming, JavaScript timer, readiness API, or skeleton redesign. Main’s warm cache and loading/error behavior stay unchanged.

User Impact

  • Session selection and header update immediately.
  • Fast loads show the conversation directly.
  • Slow loads show the existing skeleton with a brief fade after 500 ms.
  • Cached sessions still switch instantly.

Evidence

Two files; one added browser journey. The former large transition patch is no longer part of this PR.

Scope Files Added Removed
Production CSS 1 17 0
Browser test 1 136 0
Total 2 153 0

Current fade recording, normal playback speed:

session-skeleton-fade.mp4

Matched main/PR comparison of the initial 500 ms delay (recorded before adding the fade; main left, PR right):

session-skeleton-delay.mp4
  • Fade regression failed before the CSS change; all six history journeys pass on the final revision.
  • Existing browser journey checks hidden state before 500 ms, partial opacity during the fade, full opacity afterward, reduced-motion delay without fade, removal of old content, fast completion, and cached return.
  • Independent focused review: no actionable findings, including the final test correction.
  • Current head: d6db656d0abdd7c95bcf2363ee2f9d831a255826. Fresh exact-head CI passed. Merge preparation exposed and repaired a wall-clock race in the test. The test now samples visibility and opacity on the existing CSS animation clock; production CSS is unchanged. Six history and eleven current-main catalog browser journeys pass locally. Type-aware lint passes after making the computed-style flush explicit.
  • Independent source/cascade review found no actionable issues; that reviewer did not independently rerun browser tests. No new merge-readiness review is claimed by this status update.
  • No live Gateway changes or deployment.

Worked on by:

Merge authorization

Jesse explicitly waived fresh code-review on 2026-09-09 and authorized merging. His +1 reaction is present. Fresh exact-head CI passed; the prior focused independent review reported no actionable findings. The native merge artifacts record the waiver rather than claiming a fresh native/cold review.

ClawSweeper’s remaining note was inability to access the recording, not a code finding. The implementation coordinator inspected the capture, and the merge coordinator re-inspected the extracted fade frames: destination header/composer remain present while the initially blank transcript gains the skeleton. Timing and reduced-motion are covered by the browser test. Maintainer authorization above accepts this evidence; no new feature or test changes are required.

@clawsweeper

clawsweeper Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: M maintainer Maintainer-authored PR labels Sep 1, 2026
@jesse-merhi
jesse-merhi marked this pull request as ready for review September 1, 2026 05:26
Copilot AI lite review requested due to automatic review settings September 1, 2026 05:26
@jesse-merhi

Copy link
Copy Markdown
Member Author

/clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Improves Control UI chat session switching by keeping the previously visible transcript stable while a cold (uncached) destination session mounts and renders behind it, then atomically revealing the destination (or a bounded-delay skeleton fallback) to avoid blank/skeleton flashes.

Changes:

  • Adds a cold-session transition flow in retained-session handling, driven by a new openclaw-chat-transcript-ready event from chat panes plus a 750ms bounded fallback reveal.
  • Adjusts split-view styling so virtualized transcript rows don’t get skipped during cold “preparing” paints.
  • Enhances the chat loading skeleton to be role-aware (user vs assistant geometry) and updates unit/E2E coverage accordingly.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
ui/src/styles/chat/split-view.css Forces virtual rows to paint during cold “preparing” transitions to prevent blank reveals.
ui/src/pages/chat/components/chat-session-rail.ts Uses the compact chat skeleton in the session rail while loading.
ui/src/pages/chat/chat-transcript-ready.ts Introduces a typed internal transcript-ready event contract.
ui/src/pages/chat/chat-pane-transcript-ready.test.ts Adds unit coverage for transcript-ready event emission.
ui/src/pages/chat/chat-pane-lifecycle.ts Emits transcript-ready once the transcript has a usable first render (or confirmed empty).
ui/src/pages/chat/chat-page.ts Threads retained-session presentation state into pane rendering.
ui/src/pages/chat/chat-page-retained-sessions.ts Implements cold-session prepaint + delayed reveal orchestration and ties it to transcript-ready events.
ui/src/pages/chat/chat-page-retained-sessions.test.ts Adds tests covering cold-session visibility retention, supersession, and bounded-delay reveal.
ui/src/pages/chat/chat-page-pane-render.ts Splits semantic selection vs visual presentation, adds “preparing” and inert/aria adjustments.
ui/src/e2e/chat-flow.history-issuance.e2e.test.ts Strengthens Playwright checks for the new role-aware skeleton geometry across viewports.
ui/src/components/panel-loading-skeleton.ts Reworks chat skeleton markup/styles for role-aware turns and responsive sizing.
ui/src/components/panel-loading-skeleton.test.ts Adds unit coverage for chat skeleton structure (user vs assistant turns).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@jesse-merhi

Copy link
Copy Markdown
Member Author

/clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 1, 2026
@clawsweeper

clawsweeper Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 9, 2026, 1:19 AM ET / 05:19 UTC (Revision 31).

ClawSweeper review

What this changes

Delays the chat-history skeleton by 500 ms, fades it in over 150 ms, and adds browser coverage for session switching and reduced motion.

Merge readiness

✅ Ready for maintainer review

Keep open: this remains a useful, narrowly scoped improvement absent from current main. No introduced correctness or security findings remain, and the related startup work does not supersede session-switch presentation.

Priority: P3
Reviewed head: d6db656d0abdd7c95bcf2363ee2f9d831a255826

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, maintainable patch with relevant browser coverage and no actionable findings; unavailable reviewer playback does not create a contributor defect.
Proof confidence 🌊 off-meta tidepool Not applicable: The contributor-proof gate is exempt for this MEMBER-authored, appearance-only PR. Supplied recordings target the changed transcript reveal and the body records their inspection; independent playback was unavailable because frame preparation lacked ffprobe and attachment fallback returned Cache miss.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The contributor-proof gate is exempt for this MEMBER-authored, appearance-only PR. Supplied recordings target the changed transcript reveal and the body records their inspection; independent playback was unavailable because frame preparation lacked ffprobe and attachment fallback returned Cache miss.
Evidence reviewed 9 items Verified patch boundary: The complete pinned merge-base-to-head delta changes only the transcript skeleton CSS and its browser journey. Host-verified test-merge parentage also confirms that main-only internal-event changes are preserved.
Existing rendering and accessibility boundary: The transcript renderer mounts the skeleton only while loading without rendered chat items or typing actors. History arrival removes it through the existing renderer. The global reduced-motion rule shortens animation duration to 0.01 ms without removing the delay; the patch changes neither routing nor stored state.
Current-main necessity: The corresponding current-main CSS has no delayed skeleton reveal. The existing renderer still mounts the loading placeholder immediately, so the proposed presentation change remains distinct.
Findings None None.
Security None None.

How this fits together

The Control UI displays conversation history returned by the Gateway. Its transcript renderer chooses between loaded messages and a loading skeleton; this change controls only when that skeleton becomes visible.

flowchart TD
  A[Select conversation] --> B[Destination pane]
  B --> C{History available?}
  C -->|Yes| D[Display messages]
  C -->|No| E[Hidden skeleton]
  E -->|Still loading after 500 ms| F[Reveal skeleton]
  E -->|History arrives| D
  F -->|History arrives| D
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +17, Tests +136. Total +153 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 17 0 +17
Tests 1 136 0 +136
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 153 0 +153

Review metrics

None.

Technical review

Best possible solution:

Keep loading ownership in the existing transcript renderer and use this bounded CSS reveal to avoid flashes while preserving immediate navigation and reduced-motion preferences.

Do we have a high-confidence way to reproduce the issue?

Yes, at the source level: loading an uncached conversation mounts an immediately visible skeleton on main, even when history arrives shortly afterward. I did not execute a browser reproduction.

Is this the best way to solve the issue?

Yes. Styling the existing skeleton is a narrow solution that avoids new timers, retained-transcript state, or readiness APIs and leaves history/error ownership unchanged.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against ec7464766fab.

Labels

Label justifications:

  • P3: This is a bounded visual-polish improvement to loading presentation without changing message delivery or session state.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The contributor-proof gate is exempt for this MEMBER-authored, appearance-only PR. Supplied recordings target the changed transcript reveal and the body records their inspection; independent playback was unavailable because frame preparation lacked ffprobe and attachment fallback returned Cache miss.
  • proof: 🎥 video: Contributor real behavior proof includes video or recording evidence. The contributor-proof gate is exempt for this MEMBER-authored, appearance-only PR. Supplied recordings target the changed transcript reveal and the body records their inspection; independent playback was unavailable because frame preparation lacked ffprobe and attachment fallback returned Cache miss.

Evidence

What I checked:

  • Verified patch boundary: The complete pinned merge-base-to-head delta changes only the transcript skeleton CSS and its browser journey. Host-verified test-merge parentage also confirms that main-only internal-event changes are preserved. (ui/src/styles/chat/message-layout.css:245, d6db656d0abd)
  • Existing rendering and accessibility boundary: The transcript renderer mounts the skeleton only while loading without rendered chat items or typing actors. History arrival removes it through the existing renderer. The global reduced-motion rule shortens animation duration to 0.01 ms without removing the delay; the patch changes neither routing nor stored state. (ui/src/pages/chat/components/chat-transcript-projection.ts:266, d6db656d0abd)
  • Current-main necessity: The corresponding current-main CSS has no delayed skeleton reveal. The existing renderer still mounts the loading placeholder immediately, so the proposed presentation change remains distinct. (ui/src/styles/chat/message-layout.css:241, ec7464766fab)
  • Latest-release comparison: The matching stylesheet retrieved at the supplied v2026.9.3 release SHA contains the existing transcript layout rules but no chat-skeleton-reveal rule. (ui/src/styles/chat/message-layout.css:193, 1391f7cd2d40)
  • Browser coverage and review continuity: Read the complete browser suite: the added journey samples hidden, intermediate, and completed animation states, exercises reduced-motion navigation, checks old-content removal, and returns to a cached conversation. Existing error/retry journeys remain intact. The prior completed review lists no findings; Copilot's older readiness-traversal concern targets implementation no longer introduced by this PR. Tests were not executed during this read-only review. (ui/src/e2e/chat-flow.history-issuance.e2e.test.ts:25, d6db656d0abd)
  • Recording evidence and inspection limitation: The captured PR body supplies a current fade recording and a before/after delay comparison, and records coordinator inspection of the destination header, composer, and skeleton transition. Both videos downloaded, but the media manifest reports 'ffprobe failed: spawnSync ffprobe ENOENT'; neither has a prepared contact sheet. Opening both attachment URLs also returned Cache miss. I could not independently inspect their frames. This is a reviewer tooling limitation, not missing contributor evidence.

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vyctor H. Brzezowski: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (30 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-06T16:33:38.258Z sha 0cf39de :: blocked before merge. :: none
  • reviewed 2026-09-06T16:51:40.217Z sha af439dc :: needs maintainer review before merge. :: none
  • reviewed 2026-09-06T17:00:59.985Z sha af439dc :: blocked before merge. :: none
  • reviewed 2026-09-07T10:22:31.949Z sha 6c120ba :: needs maintainer review before merge. :: none
  • reviewed 2026-09-07T10:38:57.012Z sha 6c120ba :: blocked before merge. :: none
  • reviewed 2026-09-08T01:12:12.705Z sha 5648960 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-08T01:27:03.130Z sha 5648960 :: blocked before merge. :: none
  • reviewed 2026-09-09T05:01:10.320Z sha 5648960 :: needs maintainer review before merge. :: none

@jesse-merhi
jesse-merhi marked this pull request as draft September 1, 2026 06:12
@jesse-merhi
jesse-merhi marked this pull request as ready for review September 1, 2026 06:12
@jesse-merhi

Copy link
Copy Markdown
Member Author

/clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@jesse-merhi
jesse-merhi marked this pull request as draft September 1, 2026 06:20
@jesse-merhi
jesse-merhi marked this pull request as ready for review September 1, 2026 06:20
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 1, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 5, 2026
@jesse-merhi

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 5, 2026
@jesse-merhi
jesse-merhi force-pushed the openclaw/improve-skeleton-loading-for-sessions branch from 0ace2fc to 67c6f79 Compare September 6, 2026 07:38
@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Sep 6, 2026
jesse-merhi and others added 7 commits September 9, 2026 15:07
Switch to the destination immediately and delay only the existing transcript
skeleton by 500 ms. Replace the previous retained-conversation implementation
with this appearance-only change and one browser regression journey.

Worked on by:
- @jesse-merhi

Co-authored-by: jesse-merhi <[email protected]>
@jesse-merhi

Copy link
Copy Markdown
Member Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: 🎥 video Contributor real behavior proof includes video or recording evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants