Skip to content

fix(ui): keep retained dashboards warm - #126339

Merged
steipete merged 1 commit into
mainfrom
steipete/dashboard-switching-latency-2cbdf0
Aug 19, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/dashboard-switching-latency-2cbdf0

Conversation

@steipete

Copy link
Copy Markdown
Contributor
Additional instructions

MUST: Keep Allow edits from maintainers enabled for this PR so maintainers
can help update the branch when needed.

AI-assisted change. The implementation, lifecycle ownership, regression proof, and final diff were reviewed by the maintainer; no agent transcript or session links are included.

What Problem This Solves

Fixes an issue where switching between retained team-server dashboard sessions painted chat first and then waited seconds for the dashboard to reload, even when that dashboard had already been warmed in the same pane.

Why This Change Was Made

Retained chat panes released their dashboard provider and snapshot when they became hidden, even though the pane itself remained retained. The fix makes the board provider lease follow the bounded retained-pane lifetime, while a separate visual-presentation signal gates board activity so hidden widgets and commands remain suspended.

This is the owner-boundary fix: the retained pane owns the provider lifetime, while the visible presentation owns activity. It avoids a second board cache or prefetch path and keeps the existing inactive board/widget suspension contract.

Provenance: the release-on-hide behavior was carried forward by #121625, authored and merged by @steipete on August 10, 2026. No bot merge or automerge trigger was involved.

User Impact

Revisiting a warmed dashboard is immediate instead of showing chat first and waiting for a dashboard reload. Hidden retained dashboards remain inactive, so this does not keep their widgets or commands running in the background.

Evidence

Before

Alpha is selected 500 ms after returning, but only chat is visible because the retained dashboard was torn down.

Before: Alpha selected while its dashboard is missing

After

The warmed Alpha dashboard is visible immediately while its board.get refresh remains deliberately stalled.

After: warmed Alpha dashboard retained during stalled refresh

Video

Alpha → Beta → retained Alpha:

dashboard-session-retention.webm

Focused verification

The deterministic Playwright/Vitest flow uses a real Chromium page and an isolated mocked Gateway. It warms Alpha, visits Beta, stalls the next Alpha board.get, then requires the original Alpha DOM node to become visible within one second while verifying that only the visible dashboard is active.

node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/dashboard-session-retention.e2e.test.ts
PASS

node scripts/run-vitest.mjs ui/src/pages/chat/chat-pane-board.test.ts ui/src/pages/chat/chat-pane-retained-presentation.test.ts ui/src/pages/chat/chat-page-retained-sessions.test.ts
PASS

node scripts/check-changed.mjs -- ui/src/pages/chat/chat-page-pane-render.ts ui/src/pages/chat/chat-page-retained-sessions.ts ui/src/pages/chat/chat-pane-base.ts ui/src/pages/chat/chat-pane-board.ts ui/src/pages/chat/chat-pane-lifecycle.ts ui/src/pages/chat/chat-pane-retained-presentation.ts ui/src/pages/chat/route-draft-focus-handoff.ts ui/src/e2e/dashboard-session-retention.e2e.test.ts
PASS

Pre-fix A/B proof: reversing only the seven production changes makes the E2E fail because alpha-main does not become visible within one second while board.get is stalled. The fixed code passes and preserves the same runtime element identity.

Final code-aware autoreview completed with no accepted or actionable findings; patch correctness was rated 0.98.

Production LOC: +13/-7 (net +6), justified by separating retained provider lifetime from visual activity ownership. Test LOC: +131/-0.

Proof gap: the signed-in team-server Chrome relay was unavailable. This evidence is an isolated mocked-Gateway/real-Playwright-browser flow, not a live team-server test, and no operator Gateway or state was touched.

@clawsweeper

clawsweeper Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added the app: web-ui App: web-ui label Aug 19, 2026
@steipete
steipete marked this pull request as ready for review August 19, 2026 15:45
@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Aug 19, 2026
@steipete

steipete commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor Author

Land-ready proof for exact head 7acb51136ec0af672721aae7e10bb5304354e758.

Root cause: retained presentation teardown owned the dashboard provider lease, so hiding a still-retained pane discarded its warmed board snapshot and widget runtime. The fix aligns the provider lease with the bounded retained-pane lifecycle and uses the separate visual-presentation signal to keep hidden boards, widgets, and commands inactive.

Focused proof:

node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/dashboard-session-retention.e2e.test.ts
PASS

node scripts/run-vitest.mjs ui/src/pages/chat/chat-pane-board.test.ts ui/src/pages/chat/chat-pane-retained-presentation.test.ts ui/src/pages/chat/chat-page-retained-sessions.test.ts
PASS

node scripts/check-changed.mjs -- ui/src/pages/chat/chat-page-pane-render.ts ui/src/pages/chat/chat-page-retained-sessions.ts ui/src/pages/chat/chat-pane-base.ts ui/src/pages/chat/chat-pane-board.ts ui/src/pages/chat/chat-pane-lifecycle.ts ui/src/pages/chat/chat-pane-retained-presentation.ts ui/src/pages/chat/route-draft-focus-handoff.ts ui/src/e2e/dashboard-session-retention.e2e.test.ts
PASS

The pre-fix A/B reverses only the seven production changes and fails because alpha-main does not become visible within one second while board.get is stalled. The fixed flow passes, preserves the original Alpha DOM/runtime identity, and verifies that only the visually presented dashboard is active.

Exact-head CI: run 32271983185 completed successfully on attempt 1 for this SHA: 108 jobs succeeded, 11 scope-disabled jobs skipped, and zero jobs failed.

Visual proof:

Final code-aware autoreview completed with no accepted or actionable findings (correctness 0.98). Production LOC is +13/-7 (net +6); regression-test LOC is +131/-0.

Native prepare/Testbox gate: OPENCLAW_TESTBOX=1 scripts/pr prepare-run 126339 completed successfully at 2026-08-19T16:15:46Z without changing the head. Gate mode was hosted_exact_or_recent_parent; the repository reused the fresh exact-head hosted CI result for 7acb511, so no separate Testbox lease or remote run URL was created. The prepare flow verified that the remote PR head tree exactly matches the local prepared head.

Proof gap: the signed-in team-server Chrome relay was unavailable. This is deterministic isolated mocked-Gateway proof in a real Playwright Chromium browser, not a live team-server run, and no operator Gateway or state was touched.

@steipete
steipete merged commit 543b4a8 into main Aug 19, 2026
190 checks passed
@steipete
steipete deleted the steipete/dashboard-switching-latency-2cbdf0 branch August 19, 2026 16:31
@steipete

Copy link
Copy Markdown
Contributor 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 size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant