Repository navigation
fix(ui): avoid flashes when switching cold sessions - #134868
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
/clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
There was a problem hiding this comment.
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-readyevent 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.
|
/clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Codex review: needs maintainer review before merge. Reviewed September 9, 2026, 1:19 AM ET / 05:19 UTC (Revision 31). ClawSweeper reviewWhat this changesDelays 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 Review scores
Verification
How this fits togetherThe 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
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +17, Tests +136. Total +153 across 2 files. View PR surface stats
Review metricsNone. Technical reviewBest 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. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (30 earlier review cycles; latest 8 shown)
|
|
/clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
0ace2fc to
67c6f79
Compare
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]>
Worked on by: - @jesse-merhi Co-authored-by: jesse-merhi <[email protected]>
|
Merged via squash.
|
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
Evidence
Two files; one added browser journey. The former large transition patch is no longer part of this PR.
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
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.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.