Repository navigation
refactor(ui): load sidebar renderers through native lazy components - #179247
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 SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 870c75d970
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| fallback={(_error, reset) => { | ||
| resets.add(reset); | ||
| // This registration belongs to the error fallback's reactive run. | ||
| onCleanup(() => resets.delete(reset)); | ||
| return null; |
There was a problem hiding this comment.
Preserve reporting for non-load renderer failures
When an imported sidebar component itself throws after its chunk has loaded—for example while rendering a menu or catalog row—this boundary catches the descendant error and returns null. Because createIdleImport's success callback has already fired, no later reset is scheduled, leaving the affected UI permanently blank while preventing the outer ShellLoader from showing its existing LazyViewError; restrict this fallback to import failures or surface/rethrow unexpected renderer errors.
AGENTS.md reference: AGENTS.md:L73-L75
Useful? React with 👍 / 👎.
|
Codex review: needs changes before merge. What this changesThis PR replaces three manual sidebar renderer-readiness paths with native Solid lazy components while retaining the existing loading scheduler. Example: A session menu chunk fails to download while the browser is offline.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 2 items remain Keep open: this maintainer-authored refactor removes redundant readiness state, but its new error boundary hides renderer failures and needs a focused correction. Priority: P3 Before merge
Findings
Tests
Agent review detailsHow this fits togetherThe Control UI sidebar consumes session and menu owners, lazily loads their renderers, and produces catalog rows, menus, and the Inbox popup. flowchart TD
A[Sidebar owners] --> B[Idle and online scheduler]
B --> C[Renderer imports]
C --> D[Native lazy components]
D --> E[Loading and error boundaries]
E --> F[Catalog rows and menus]
A --> G[Inbox preload and open checks]
G --> D
Technical reviewBest possible solution: Keep native lazy rendering and the existing scheduler, but preserve visible error recovery for failures outside the module load. Do we have a high-confidence way to reproduce the issue? Source inspection establishes that a descendant renderer exception reaches the null fallback after a successful import; no runtime reproduction was performed. Is this the best way to solve the issue? Native lazy components appropriately remove readiness duplication, and the shared adapter is justified by two owners, but it must distinguish import recovery from renderer-error reporting. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 7a0342f55f96. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceAcceptance criteria:
What I checked:
PR surfaceSource +24, Tests +83. Total +107 across 9 files. Added test files: 1. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 21, 2026, 4:34 AM ET / 08:34 UTC. |
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
…penclaw#179247) * refactor(ui): load sidebar renderers through native lazy components * refactor(ui): finalize lazy sidebar ownership integration * fix(ui): preload native sidebar menu components * test(ui): synchronize pane and diff interactions * test(ui): wait for update confirmation readiness * test(ui): remove retired heartbeat fixture defaults * test(ui): wait for settled dashboard menu actions
Whole-scope Solid 2 census
Exact current-main baseline
5a6b0183acf31317a6a3207d93c8fc85c81fb5a9→ PR head6d8bd552be5e86d91707591deeeacd424b0effb5. The head is a true merge with parentsce74baa290774498e2c870d2ece691c30a0029d7and that baseline. All counts use committed blobs from this pair, without overlays. This replaces the older loader branch/CI-context tables; it includes main’s extracted session-menu work, proxy and agent-creation dialog.Counts below are actionable sites in the whole COMP-A scope. The unmerged descriptor change in #179302 receives no credit.
The async/actions recipe is absent on both exact commits. The installed rc.16 cheatsheet, idioms, lessons and refactor checklist guided the work. Catalog onSettled preloading still covers both rows and refresh-error chrome; no readiness field remains. Attention still awaits module preload before its scope/generation admission. Menus retain main’s extracted work owner and new agent-dialog gate, and preload awaits both native lazy renderer entries.
Raw source sites were re-inspected, including the new main code. They are not actionable defects or mounted-instance counts.
The new agent-dialog runtime import already uses native lazy/Loading on the base. Its separate create-agent import delegates an imperative owner command and keeps no renderer transaction. These account for sidebar runtime imports rising from five in older evidence to seven here; this PR adds none. The agent dialog and attention/catalog boundaries activate independently, so their Loading sites do not require sibling Reveal. The new display-agent helper is a pure derived selection; help links are stateless extracted JSX; agent-switcher lists use memos; the native settings handler reads current parameters inside its callback. The hovercard’s added Gateway revision and subscription remain in its existing projectSource island.
Remaining exceptions are specific: the conditional rail binding uses immutable entry identity; memo/primitive/ref cleanup retains the exact registration it owns (the menuRef cleans its bound MenuHandle, and catalog-view binding is distinct from the foreign-DOM mount); the added fallback cleanup removes its reset registration; descriptor/image/repository reads retain admission, cancellation or permission ownership; actions/optimistic feedback and authoritative commands own mutations, except the explicit document-reload retry receipt; structured values hold atomic geometry, reload receipt, immutable target identity, mutable PlaceBrowser publication or the pending descriptor follow-up; null context defaults support standalone rows/previews; four explicit owner calls mount disposed foreign-DOM islands.
Import-aware AST counts: native lazy constructors 0→1 / 1→4 / 0→0, ordinary signals 3→3 / 15→14 / 25→25, action constructors 0/3/1, optimistic signals 0/2/1 (app-sidebar / sidebar / session). Refactor-checklist counts remain effects 3/0/4, render effects 0/0/0, untrack 3/1/0, direct TSX listeners 0/0/0, DOM queries 0/0/2, flush 0/2/0, handwritten createComponent 0/0/0. Catalog onSettled remains present; family counts are 11/10/23 on both sides.
Touched production LOC is 2,647→2,712 (+65) across seven files. The net growth is the 31-line retry boundary, 25 lines in menu activation/native renderer wiring, and the nine-line lazy component export. Keeping main’s catalog/error prewarm means the owner has no net LOC reduction in this pair. The old +26 figure describes an earlier source context and is not used here.
ui/src/components/sidebar-attention.test.tsui/src/components/sidebar-renderer-loader.test.tsxui/src/e2e/solo-widget-chrome.e2e.test.tsui/src/e2e/update-coalesced.e2e.test.tsFresh source-head proof reported by the coordinator: UI tsrs passes; three focused test files pass 19 tests once through the existing UI-package Node runner, with no
OPENCLAW_VITEST_RUNTIMEoverride; isolated P0–P2 autoreview is scoped-clean, exit 0. Production Knip session 71815 completed with exit 1 with three unused cron/Gateway files. One same-command run on exact new main base5a6b0183acf31317a6a3207d93c8fc85c81fb5a9also exited 1 with a byte-identical log (SHA-2567b33ba3e76dbbfc80f0b1b6bc57344b99d249fd6f801352cf9ad2098560eff1f). This qualifies the three findings as pre-existing local failures; no Knip pass or CI-failure attribution is claimed. The retainedstartup-audit-loader-5a6b-knip.jsonandstartup-audit-loader-5a6b-knip-comparison.jsonreceipts record the exact command, base, timing, hashes and comparison. These are separate checks; this source census supplies no additional test, CI or budget verdict. No pending PR is claimed merged, and the final exact-main census remains pending. The async/actions recipe landed as #179123 during publication; items3–4 are being re-audited against it before campaign completion.What Problem This Solves
Sidebar renderers duplicated module readiness into signals and gated rendering on those copies. Native lazy components now consume the existing idle/online schedule. A small boundary adapter registers error-boundary resets with the existing retry scheduler. Attention still awaits preload before scope/generation admission. The current-main session-menu owner, agent dialog, proxy and avatar projection keep their lazy boundaries. Host tags, markup, styles, routes and selectors have no intended change.
The final refresh is a true merge of current main. Catalog data/error prewarming remains in onSettled; menus preload both native renderer entries and preserve main’s plain session-work owner byte-for-byte. The helper invokes renderSidebarMenus within its component owner.
Evidence
node ../scripts/run-node-package-bin.mts vitest run …, with noOPENCLAW_VITEST_RUNTIMEoverride: sidebar-menus, sidebar-renderer-loader and app-sidebar.catalog-import passed 3 files / 19 tests once (69.77s). The log first line records Node; this is not pinned-Bun runtime proof. Strict-read messages from descendant components/effect callbacks remain; no warning-free claim.6d8bd552and exact new main base5a6b0183both exited 1 with exactlysrc/cron/heartbeat-monitor.ts,src/cron/system-monitor-jobs.tsandsrc/gateway/server-cron-system-jobs.tsunused. The one baseline run took 510.609s.loader-main-refresh-knip.logandstartup-audit-loader-5a6b-knip.logare byte-identical (SHA-2567b33ba3e76dbbfc80f0b1b6bc57344b99d249fd6f801352cf9ad2098560eff1f); provenance/comparison receipts:startup-audit-loader-5a6b-knip.json,startup-audit-loader-5a6b-knip-comparison.json. Qualified pre-existing local failure; no Knip pass or CI attribution.ci:fullrun 39645154203, attempt 1, completed on exact head6d8bd552. All three UI-unit and both real-Gateway shards, lint, types, performance and security-fast passed. Seven ordinary UI-E2E shards failed with 11 cases; every exact test name, primary error and waiting locator also fails on latest completed scheduled main 39644558400, attempt 1, headd5621d908488. Matching-name detail follows. The native inherited-failure route is used; this run is not claimed green.Touched production LOC is 2,647→2,712 (+65) across seven files; whole scope 37,360→37,425 (+65). The growth is 31 lines for retry boundary ownership, 25 for native menu activation/wiring and nine for the lazy component export. Four touched tests total 1,549→1,635 (+86). No remote lease.
The solo-widget readiness fix retains the existing data-phase="open" contract before clicking Remove. Its prior trace clicked during opening; it adds no production behavior and retains RPC, iframe-retention and menu assertions. The completed exact-head full CI passes the solo-widget shard and both real-Gateway shards; the repaired phase-readiness path is no longer among its failures.
Exact-name CI attribution
PR head
6d8bd552be5e86d91707591deeeacd424b0effb5, run 39645154203, attempt 1, tested mergee3276b1c9f0d32cf359c79d11c0293397ad67747(base3757bbb23ae4eb27513d0b9e01ae28e42f8ba2fa).Latest completed scheduled main at the 18:38 UTC observation: 39644558400, attempt 1, head
d5621d9084887432c7637774d85de692ba8c5445.All 11 failed PR cases across seven E2E shards match the exact test path/name, primary error and waiting locator on that scheduled main run. Every failed PR job yielded cases; no failure heading was unparsed. Main has one additional failure (
Gateway retry feedback > keeps automatic recovery stable at 140 percent text scale). The failedopenclaw/ci-gateis the aggregate of these jobs.ui/src/e2e/boot-module-boundaries.e2e.test.tsControl UI module boundaries > Gateway recovery while a module is unavailable > keeps recovery available after a sidebar download failure at 390px
ui/src/e2e/boot-module-boundaries.e2e.test.tsControl UI module boundaries > Gateway recovery while a module is unavailable > keeps recovery available after a sidebar download failure at 1280px
ui/src/e2e/session-management.sidebar-reconnect.e2e.test.tsControl UI session management mocked Gateway E2E > queues an offline sidebar rename and sends it once after same-scope reconnect
ui/src/e2e/session-management.sidebar-reconnect.e2e.test.tsControl UI session management mocked Gateway E2E > retains My sessions through transport and client replacement without exposing other owners
ui/src/e2e/sidebar-account-footer.e2e.test.tsControl UI sidebar account footer feature build E2E > labels the lifecycle status on the account icon and retries through its menu
ui/src/e2e/native-embed-settings.e2e.test.tsControl UI native embed settings E2E > keeps embedded Back and settings navigation usable while offline
ui/src/e2e/session-management.sidebar.e2e.test.tsControl UI session management mocked Gateway E2E > retains sidebar sessions through transport loss and reloads them after client replacement
ui/src/e2e/compact-identity-menu.e2e.test.tscompact identity menu > keeps common actions visible with nine native gateways and opens an unclipped keyboard switcher
ui/src/e2e/sidebar-outbox.e2e.test.tsControl UI mocked Gateway E2E > reviews an unconfirmed submission through System without sending or deleting its draft
ui/src/test-helpers/control-ui-e2e-readiness.e2e.test.tsInitial roster navigation readiness > catches up after boot, navigation, and terminal activation before its first read (offline: true)
ui/src/e2e/native-nav-sidebar-toggle.e2e.test.tsControl UI native-nav sidebar toggle E2E > hosts navigation, search, sessions, and history in web titlebar chrome
Supplementary proof:
loader-3757-two-status-cases-report.jsonreplays two footer cases on the exact CI base and reproduces both product assertions (local timeout 10s versus CI 30s). Source equality is recorded separately inloader-6d8-footer-failure-source-context.json; it is not the basis for inherited attribution.Logs were fetched once and reused; no test reruns were performed for this attribution. Full blocks, locators, job IDs and source-log hashes are in
loader-6d8-final-ci-attribution.json.Native evidence retains all seven failed job IDs, the aggregate gate, direct PR/main job logs, complete job inventory and artifact hashes. The tested merge has exactly the recorded base/head parents and reconstructs to the same tree; all nine failing test source blobs equal the tested base. The local Knip comparison is separate from this exact-name CI attribution.
Before / after screenshots
Inspected synthetic-only full frames, 1440×1000, captured locally against the reused production artifacts for CI base
3757bbband tested mergee3276b1(source head6d8bd552). No new build was run for media. Each side has one catalog read, ten session-menu actions and four catalog-menu actions, with zero browser page errors. Before/after PNGs are byte-identical for each state.