Repository navigation
fix(ui): stop unrelated sidebar child refreshes - #146410
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. |
|
Codex review: needs maintainer review before merge. Reviewed September 12, 2026, 7:27 PM ET / 23:27 UTC (Revision 5). ClawSweeper reviewWhat this changesThe PR keeps sidebar child lists under the existing managed-query owner, preserves pagination and retry recovery, consolidates session projections, and loads website hints with their widget. Merge readiness✅ Ready for maintainer review This remains a useful sidebar-specific repair beyond the merged chat optimization. No actionable introduced defect was found, and the maintainer-authored PR is protected from cleanup closure. Priority: P2 Review scores
Verification
How this fits togetherThe Control UI sidebar displays session trees from Gateway lists and events. Its session-query owner reconciles incoming rows and refreshes affected child windows before publishing them to the sidebar. flowchart TD
A[Gateway lists and events] --> B[Session query owner]
B --> C{Affected child window?}
C -->|Yes| D[Refresh and complete pagination]
C -->|No| E[Retain current window]
D --> F[Reconcile current session facts]
E --> F
F --> G[Sidebar session tree]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +209, Tests +584, Other +10. Total +803 across 32 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep child membership and refresh scheduling with the existing managed-query owner while the sidebar owns expansion, presentation, and visible retry recovery. Do we have a high-confidence way to reproduce the issue? Yes, from source: expand a child list and publish unrelated canonical rosters; current main clears its loaded state and the navigation owner reloads it. Execution was not performed in this read-only review. Is this the best way to solve the issue? Yes. Reusing managed queries removes competing freshness handling while preserving event-driven membership updates, pagination, and explicit recovery. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 2dc783b784ae. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
0139d9f to
7eff2ea
Compare
Keep child windows under their managed query owner and target history invalidation to affected membership without refreshing the supplying query. Preserve descriptor freshness, complete pagination, retry errors, ancestry, and connection/disposal lifecycles while avoiding repeated sidebar reads. Related: #146122
Keep failed sidebar child observations dormant until explicit retry, including synchronous errors from queries retained by another view. Preserve incomplete pagination errors and retire their leases without reopening background reads. Align the mounted-sidebar regressions with managed child-event refresh and make scheduled event assertions deterministic. Share stale-row comparison, result projection, event parsing, and refresh lifecycle operations to keep the startup bundle within its existing budget. Validation: 1,598 session/sidebar/bootstrap tests, 10 Chromium scenarios, UI production and test types, UI lint, import-cycle checks, and controlled startup bundle check. Fresh review found no actionable P0-P2 findings.
Keep the shared Website label eager and register the three website-only hints synchronously with the widget. Compose the same canonical English catalog without mutating the runtime catalog; all 9,018 keys retain their text and order. Forward public session invalidation directly to its existing closure-owned scheduler without a redundant wrapper. The public zero-argument contract stays unchanged. Validation: 1,752 tests across 80 files, 12 Chromium scenarios, unchanged catalog bytes and key order, i18n verification, production/test types, lint, import-cycle checks, and the unchanged startup gzip gate. Fresh review found no actionable P0-P2 findings.
Use the existing result-identity owner for terminal updates, pending mutations, permission projection, confirmed archives, and Swarm presentation. Preserve mapper order, side effects, membership and metadata while removing repeated change tracking and result copies. Record model-catalog notice state, text and group in one E2E DOM snapshot while retaining the same empty-notice assertion and timing. The prior single CI failure remains unexplained; exact-source local checks pass and no race fix is claimed. Validation: 1,752 tests, 12 mocked Chromium scenarios, exact-source Node 24 real-Gateway diagnostic proof, UI types/lint, import-cycle checks, and unchanged startup bundle gate at 355052 bytes gzip. Fresh review has no actionable P0-P2 findings.
7eff2ea to
d11a85a
Compare
|
Merged via squash.
|
* fix(ui): stop unrelated sidebar child refreshes Keep child windows under their managed query owner and target history invalidation to affected membership without refreshing the supplying query. Preserve descriptor freshness, complete pagination, retry errors, ancestry, and connection/disposal lifecycles while avoiding repeated sidebar reads. Related: openclaw#146122 * fix(ui): preserve child query recovery and share refresh work Keep failed sidebar child observations dormant until explicit retry, including synchronous errors from queries retained by another view. Preserve incomplete pagination errors and retire their leases without reopening background reads. Align the mounted-sidebar regressions with managed child-event refresh and make scheduled event assertions deterministic. Share stale-row comparison, result projection, event parsing, and refresh lifecycle operations to keep the startup bundle within its existing budget. Validation: 1,598 session/sidebar/bootstrap tests, 10 Chromium scenarios, UI production and test types, UI lint, import-cycle checks, and controlled startup bundle check. Fresh review found no actionable P0-P2 findings. * perf(ui): load website hints with dashboard widgets Keep the shared Website label eager and register the three website-only hints synchronously with the widget. Compose the same canonical English catalog without mutating the runtime catalog; all 9,018 keys retain their text and order. Forward public session invalidation directly to its existing closure-owned scheduler without a redundant wrapper. The public zero-argument contract stays unchanged. Validation: 1,752 tests across 80 files, 12 Chromium scenarios, unchanged catalog bytes and key order, i18n verification, production/test types, lint, import-cycle checks, and the unchanged startup gzip gate. Fresh review found no actionable P0-P2 findings. * refactor(ui): share session result projections Use the existing result-identity owner for terminal updates, pending mutations, permission projection, confirmed archives, and Swarm presentation. Preserve mapper order, side effects, membership and metadata while removing repeated change tracking and result copies. Record model-catalog notice state, text and group in one E2E DOM snapshot while retaining the same empty-notice assertion and timing. The prior single CI failure remains unexplained; exact-source local checks pass and no race fix is claimed. Validation: 1,752 tests, 12 mocked Chromium scenarios, exact-source Node 24 real-Gateway diagnostic proof, UI types/lint, import-cycle checks, and unchanged startup bundle gate at 355052 bytes gzip. Fresh review has no actionable P0-P2 findings.
Related: #146122
What Problem This Solves
Fixes an issue where users keeping chats open would repeatedly reload expanded sidebar child lists when unrelated sessions refreshed. On busy Gateways, this adds background requests and rendering work long after the chat has loaded.
Why This Change Was Made
The sidebar now consumes the existing managed child query instead of clearing every child read on each canonical roster publication. Pagination updates that same query's complete window. History invalidation follows affected membership, while adopting a selected child excludes the query that supplied it. Held descriptors retain newer accepted facts when delayed child results arrive.
User Impact
Expanded and selected children remain current without unrelated chats causing repeated child-list reads. Relevant child changes still refresh, removed children leave the window, and failed or incomplete loads keep their visible error until the operator retries. Retry also recovers a query retained by another view. Teardown cannot reopen background observations.
Evidence
Red/green mounted-sidebar regression: three unchanged canonical publications previously grew one child read into four. The fixed sidebar keeps one read, and a 101-child window keeps its two initial page reads through unrelated history updates.
Red/green selected-child regression: without the supplying-query exclusion, a controlled update produced six requests instead of two as runtime fields changed. The corrected path retains two.
Red/green teardown, replacement-connection, ancestor-movement, and collapsed-refresh retirement regressions; moving-window recovery and exhaustion; unchanged ancestry, field-provenance, permission, and reconnect coverage.
1,752 tests across 80 session, sidebar, bootstrap, website, and chat-metadata files pass, including the full mounted-sidebar suite and unchanged ancestry, field-provenance, permission, and reconnect coverage. Failed, incomplete, and synchronously shared queries retain their errors through unrelated events and recover through explicit retry.
Twelve mocked-Gateway Chromium scenarios pass, including error retention and recovery alongside the sidebar stability scenarios.
Shared result projection, event parsing, and refresh lifecycle operations remove duplicated work. After rebasing onto main
d569fcdba8bd, the controlled startup bundle check passes at 355,045 bytes gzip against the inherited 355,719-byte enforcement limit (official baseline 355,143 bytes); this PR changes no baseline, cap, or allowance. Startup CSS stays unchanged. Website-only hints load with their widget while the shared label stays eager; all 9,018 translation keys retain identical text and canonical order.The full changed check, focused production/test types, UI lint, and import-cycle checks passed during preparation. P2 autoreview found no actionable P0–P2 findings. The rebase preserves the complete reviewed patch byte-for-byte; fresh validation on
d11a85a6cea5passes 463 focused sidebar, child-query, and bootstrap tests plus production UI types, UI test types, i18n verification, and the controlled bundle comparison.The prior
7eff2ea2CI run passed the real-Gateway model-catalog scenario and startup budget check. The notice assertion now records state, text, and group in the same DOM read without changing its assertion or timing; this improves diagnostics and does not claim to fix a race. That run failed the main-owned shard inventory guard, now repaired by merged fix: restore core test shard headroom #146538 and inherited in this rebase, and one unexplained authenticated-request profile-authorization timeout. The exact CI source passes locally in the original four-case order and the full two-worker Gateway shard (106 files, 2,905 tests). Required CI run 34725130762 now passes on refreshed headd11a85a6cea5, including the real-Gateway scenario, the shard inventory check, the previously timed-out Gateway shard, and the aggregate gate. The earlier timeout did not recur in Linux CI; its cause remains unexplained. No timeout, retry, or authorization-path change was added.The images show the candidate before and after an authoritative child update. They are synthetic behavior proof, not an old-build performance comparison. Live latency depends on concurrent Gateway load and is verified separately after deployment.
Candidate before the authoritative child update:
Candidate after the authoritative child update: