Skip to content

fix(ui): keep sidebar child rows visible during roster refreshes - #141428

Merged
steipete merged 2 commits into
mainfrom
ui/sidebar-child-snapshot-churn
Sep 7, 2026
Merged

steipete merged 2 commits into
mainfrom
ui/sidebar-child-snapshot-churn

Conversation

@steipete

@steipete steipete commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where expanded parent sessions in the Control UI sidebar showed a grey loading skeleton instead of their child session rows, for several parents at once and for long stretches while any session was active. The row shifts that came with it also left Chromium's hover state stuck on rows and on the collapse chevron, which then looked permanently highlighted.

Why This Change Was Made

Every canonical session-list refresh discarded all successfully loaded child snapshots except the routed lineage and cleared the loaded flags, so expanded parents refetched their children and re-rendered the skeleton once per refresh. During activity the roster refreshes about once a second, so the skeleton was effectively permanent. Child snapshots now stay visible while expanded or selected parents revalidate them: the generation counter still fences in-flight results, expanded parents still refetch, and the loading skeleton only appears when a parent has no snapshot yet. Because snapshots persist, the merge that applies a refreshed child list is now lineage-scoped: server rows replace the snapshot, and only the routed lineage survives when the server omits it, which is the same set the old reset used to preserve. Navigation identifies the parents that revalidate, including the hidden main row; the controller retires other stale snapshots while preserving routed ancestry and operator-owned child-load errors.

User Impact

Expanded child sessions stay visible and update in place during background refreshes. Collapsed, unselected parents drop stale snapshots on refresh and reload when reopened, so finished children no longer leave their disclosure marked running. The loading placeholder appears when no snapshot is available. Removed or archived children disappear with the next refresh as before. Hover and chevron highlights no longer stick because rows stop jumping.

Evidence

  • New ui/src/components/app-sidebar.child-snapshot-freshness.test.ts: children remain rendered with no skeleton during a deferred refresh, an updated row replaces the stale label without duplication, an omitted sibling is removed, and a response from before the refresh is discarded. The loaded-children case failed on the previous code (0 children instead of 2 during revalidation).
  • node scripts/run-vitest.mjs over the new file plus app-sidebar.test.ts, app-sidebar.lineage-freshness.test.ts, app-sidebar-session-navigation-logic.test.ts, session-data-controller.event-refresh.test.ts: 5 files, 400 tests passed, including the existing child-load error retention cases.
  • Playwright ui/src/e2e/sidebar-session-stability.e2e.test.ts (extended with a roster-refresh scenario across all seven variants) and child-session-load-errors.e2e.test.ts: 9 tests passed; the refresh scenario failed on the previous code with one skeleton instead of zero.
  • pnpm check:changed: passed.
  • Independent pre-publication review of the collapsed-parent fix: clean at P2 after checking routed-lineage ownership and retirement idempotence.
  • Added a collapsed-parent regression: a cached running child no longer keeps its collapsed parent marked running after a canonical refresh, with no background child-list request. It failed before the fix and passes after; updated totals are 400 focused tests and 9 browser E2E tests.

Known Gaps

CSS, hover-marquee, and chevron reveal rules are unchanged; legitimate roster changes can still move rows under a stationary cursor.

Expanded sidebar parents repeatedly replaced loaded child rows with loading placeholders during canonical roster refreshes. Refresh invalidation discarded successful snapshots, causing visible row churn during session activity. Preserve snapshots while revalidating, retain generation fencing, and replace refreshed children while preserving only omitted routed lineage. Regression coverage verifies stable rows, refreshed labels, removed siblings, and stale-response rejection.
@clawsweeper

clawsweeper Bot commented Sep 7, 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.

@steipete
steipete marked this pull request as ready for review September 7, 2026 18:09
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui size: S maintainer Maintainer-authored PR labels Sep 7, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. 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 7, 2026
@clawsweeper

clawsweeper Bot commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 7, 2026, 2:58 PM ET / 18:58 UTC.

ClawSweeper review

What this changes

The PR keeps loaded sidebar child sessions visible during refreshes, retires stale collapsed-parent snapshots, and adds regression coverage and documentation.

Merge readiness

✅ Ready for maintainer review

The prior collapsed-parent finding is resolved, and no remaining blocking defect was found. Current main still has the refresh behavior this PR repairs, so the contribution remains useful.

Priority: P2
Reviewed head: 4b0f849833db69222d4d78d2fbaef87e9dee544c

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-level repair with meaningful regression coverage and the earlier blocker addressed.
Proof confidence 🌊 off-meta tidepool Not applicable: The supplied repository state identifies a MEMBER-authored PR, so the external-contributor proof gate does not apply. Reported browser tests exercise sidebar refresh and replacement through a mocked Gateway; no independent live run or inspected before/after capture is claimed.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The supplied repository state identifies a MEMBER-authored PR, so the external-contributor proof gate does not apply. Reported browser tests exercise sidebar refresh and replacement through a mocked Gateway; no independent live run or inspected before/after capture is claimed.
Evidence reviewed 7 items Current main still needs the repair: At the supplied current-main revision, resetChildSessionState(true) still replaces child snapshots with only the active lineage before expanded parents reload. The existing renderer shows a skeleton when loading has no child rows.
Prior finding addressed: The current helper retires invalidated snapshots outside loaded, loading, errored, or revalidating parents, retaining only selected ancestry otherwise. Navigation supplies the revalidating set, including the hidden main row. This addresses the collapsed-parent finding recorded at #141428 (comment).
Refresh ownership and response fencing: Child requests retain generation and session-source checks. Successful responses replace the parent's snapshot while preserving omitted routed ancestry; failures remain parent-scoped and require explicit retry. These are component-memory changes, with no persisted schema, settings, plugin API, or authorization changes.
Findings None None.
Security None None.

How this fits together

The Control UI sidebar combines the Gateway’s session roster with separately loaded child sessions. Its refresh controller and navigation tree determine which conversation rows and activity indicators remain visible.

flowchart TD
  A[Gateway roster refresh] --> B[Invalidate child load generation]
  B --> C{Parent expanded or selected?}
  C -->|Yes| D[Keep rows while fetching children]
  C -->|No| E[Retire stale rows except selected ancestry]
  D --> F[Replace rows with current response]
  F --> G[Sidebar rows and activity indicators]
  E --> G
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +50, Tests +162, Docs +2. Total +214 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 3 78 28 +50
Tests 2 163 1 +162
Docs 1 2 0 +2
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 243 29 +214

Review metrics

Metric Value Why it matters
Production versus test growth production +50 net lines; tests +162 net lines Production growth implements snapshot retirement and replacement in the existing owner; test growth protects refresh ordering and visible browser behavior.

Technical review

Best possible solution:

Keep refresh ownership in the existing controller, preserving visible rows until replacement while retiring hidden stale state and retaining explicit error recovery.

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

Yes, from source: load and expand a non-selected parent, then publish a canonical roster refresh while delaying its child response; current main discards the rows and renders the loading placeholder. No runtime reproduction was executed during this read-only review.

Is this the best way to solve the issue?

Yes. Retaining snapshots only through relevant refreshes, replacing server-owned rows, and preserving existing generation fencing addresses the cause without adding another cache or changing settings.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: Repeated sidebar loading placeholders and misleading child activity are bounded usability defects without evidence of lost conversations or blocked core operation.
  • 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 supplied repository state identifies a MEMBER-authored PR, so the external-contributor proof gate does not apply. Reported browser tests exercise sidebar refresh and replacement through a mocked Gateway; no independent live run or inspected before/after capture is claimed.

Evidence

What I checked:

  • Current main still needs the repair: At the supplied current-main revision, resetChildSessionState(true) still replaces child snapshots with only the active lineage before expanded parents reload. The existing renderer shows a skeleton when loading has no child rows. (ui/src/components/session-data-controller.ts:379, c574f43f2b46)
  • Prior finding addressed: The current helper retires invalidated snapshots outside loaded, loading, errored, or revalidating parents, retaining only selected ancestry otherwise. Navigation supplies the revalidating set, including the hidden main row. This addresses the collapsed-parent finding recorded at fix(ui): keep sidebar child rows visible during roster refreshes #141428 (comment). (ui/src/components/app-sidebar-child-session-data.ts:137, 4b0f849833db)
  • Refresh ownership and response fencing: Child requests retain generation and session-source checks. Successful responses replace the parent's snapshot while preserving omitted routed ancestry; failures remain parent-scoped and require explicit retry. These are component-memory changes, with no persisted schema, settings, plugin API, or authorization changes. (ui/src/components/session-data-controller.ts:566, 4b0f849833db)
  • Behavioral regression coverage: Read all three new tests: collapsed running-state retirement, visible rows during delayed refresh with removal of an omitted sibling, and rejection of an older response. The browser extension exercises refresh through sessions.changed across seven variants. The supplied complete PR body reports 400 focused tests and nine browser tests passing, with relevant failures before the fixes; these results were not independently executed. (ui/src/components/app-sidebar.child-snapshot-freshness.test.ts:53, 4b0f849833db)
  • Existing error-recovery contract: Existing tests require parent-scoped errors to survive canonical refresh without additional requests, followed by explicit Retry recovery. Current-main history records related child-error work by Ayaan Zaidi and recent controller work by Peter Steinberger. (ui/src/test-helpers/app-sidebar-cases/child-session-errors.ts:27, 4b0f849833db)
  • Feature-history routing: Current-main path history identifies Peter Steinberger’s session rendering work and Josh Lehman’s archived-lineage work. These support routing suggestions, not verified source-line introduction claims. (ui/src/components/app-sidebar-child-session-data.ts, 215de48bd51ad465aa75406dd61dd9a3ecbe5ed12ab4d8e11ba873c2f11161202b945)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Ayaan Zaidi: 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 (1 earlier review cycle)
  • reviewed 2026-09-07T18:16:40.412Z sha 3e586e3 :: blocked before merge. :: [P2] Retire or revalidate snapshots for collapsed parents

Retire stale child snapshots for collapsed, unselected parents after canonical roster refreshes while preserving revalidating parents, routed ancestry, and operator-owned load errors. Reuse the existing child-session data module for retention and refresh merging, add the collapsed-parent regression, and document the refresh behavior.
@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: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 7, 2026
@steipete
steipete merged commit f88f091 into main Sep 7, 2026
135 of 137 checks passed
@steipete
steipete deleted the ui/sidebar-child-snapshot-churn branch September 7, 2026 19:07
@steipete

steipete commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 8, 2026
…nclaw#141428)

* fix(ui): keep sidebar child rows visible during roster refreshes

Expanded sidebar parents repeatedly replaced loaded child rows with loading placeholders during canonical roster refreshes. Refresh invalidation discarded successful snapshots, causing visible row churn during session activity. Preserve snapshots while revalidating, retain generation fencing, and replace refreshed children while preserving only omitted routed lineage. Regression coverage verifies stable rows, refreshed labels, removed siblings, and stale-response rejection.

* fix(ui): drop stale child snapshots for collapsed parents

Retire stale child snapshots for collapsed, unselected parents after canonical roster refreshes while preserving revalidating parents, routed ancestry, and operator-owned load errors. Reuse the existing child-session data module for retention and refresh merging, add the collapsed-parent regression, and document the refresh behavior.
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 docs Improvements or additions to documentation maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. 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.

1 participant