Repository navigation
fix(ui): keep sidebar child rows visible during roster refreshes - #141428
Conversation
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.
|
🦞👀 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. |
|
Codex review: needs maintainer review before merge. Reviewed September 7, 2026, 2:58 PM ET / 18:58 UTC. ClawSweeper reviewWhat this changesThe 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 Review scores
Verification
How this fits togetherThe 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
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +50, Tests +162, Docs +2. Total +214 across 6 files. View PR surface stats
Review metrics
Technical reviewBest 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. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
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.
|
Merged via squash.
|
…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.
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
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.mjsover the new file plusapp-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.ui/src/e2e/sidebar-session-stability.e2e.test.ts(extended with a roster-refresh scenario across all seven variants) andchild-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.Known Gaps
CSS, hover-marquee, and chevron reveal rules are unchanged; legitimate roster changes can still move rows under a stationary cursor.