Repository navigation
perf(control-ui): defer remaining closed menu entries - #175011
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. |
fcfe9c5 to
8de0f0c
Compare
|
Codex review: needs changes before merge. What this changesThis PR defers panel, widget, and task-progress menu entries until opening and releases them after closing. Example: Reload a dashboard containing task progress while its options menu is closed.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 1 item remains Keep this PR open: the focused performance improvement is useful and maintainer-directed, but its lazy progress menu breaks an existing composer test. Priority: P2 Before merge
Findings
Tests
Agent review detailsHow this fits togetherControl UI menu consumers turn current panel definitions, widget capabilities, and progress actions into entries; the shared Menu owns opening, focus, selection, and dismissal. flowchart TD
A[Current UI properties] --> B[Menu trigger]
B --> C[Accepted open]
C --> D[Lazy keyed entries]
D --> E[Shared Menu]
E --> F[Existing action owners]
E --> G[Release rows after close]
Technical reviewBest possible solution: Keep the existing lazy Menu owner and update the composer admission test to exercise refresh after opening. Do we have a high-confidence way to reproduce the issue? Current-main source eagerly constructs these menu entries; the exact-head CI annotation independently confirms the composer test failure caused by deferring the refresh row. Is this the best way to solve the issue? The patch uses the established lazy-entry mechanism, preserves live action owners and shortcut slots, and removes the eager builders without adding a competing menu implementation. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 86ad4c4ec0bd. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceAcceptance criteria:
What I checked:
Likely related people:
PR surfaceSource +33, Tests +32. Total +65 across 5 files. Added test files: 0. View PR surface stats
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. 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 16, 2026, 11:27 PM ET / October 17, 2026, 03:27 UTC. |
8de0f0c to
25f00cc
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
…enu entries (openclaw#175011) A Team-scale census (L120) found closed menus constructing icons and keyboard shortcuts for every entry on each reload: the panel type menu built 397 icons to keep 1, the widget card menu 95, and the progress card refresh item 45. openclaw#174701 fixed the sharing and layout menus; these three still built their entries eagerly. Panel type, widget card and progress card menu entries now follow the openclaw#174701 idiom: lazy memos so a closed lazy Menu builds nothing, keyed mapArray entries with getters for live fields, so recomputes update instead of rebuilding. Constructed icons per menu fall to 1. Reload LoAF blocking, 22 interleaved AWS c7a.4xlarge pairs over two independent leases, decided by a rule fixed before the confirmatory run: candidate better in 16/22 pairs, pooled median paired delta -37 ms (run medians 280 -> 249 ms and 250 -> 240 ms). Runtime +33 LOC; sharing and the Menu primitive are unchanged. Focused tests and Chromium/WebKit menu coverage pass; full-UI failures all reproduce on baseline; the remaining CI red is an inherited snapshot type error already fixed on main (108185f).
What Problem This Solves
Closed panel-type, widget-action, and task-progress menus construct entry icons during a signed-in reload of a dashboard deep link, even though only their triggers are visible. The initial campaign evidence showed 14 visual states across roughly 15 seconds; the remaining work here is avoidable client-side construction during reload.
This change uses the existing lazy keyed-entry pattern in three menu owners and releases entries while closed. It preserves live labels, actions, keyboard behavior, and shortcut alignment. Sharing and the shared Menu primitive are unchanged.
Evidence
The decision rule was fixed before confirmation: pool the original 11 pairs and 11 fresh-box pairs; require at least 16/22 lower candidate blocking times and a negative pooled median paired delta. Passed: 16/22 wins, median paired delta −37 ms, IQR [−65, −1] ms. No further performance comparisons were run.
Both runs use AWS c7a.4xlarge, 16 CPUs / 31,378 MiB RAM, repository Chromium 156.0.8078.4, Node 24.19.0, pnpm 12.11.1, and the same canonical Team-scale warm reload (closed-menu members, five-second untraced capture, LoAF/RPC probes). No interaction/prewarm probe ran during timing. Baseline is pinned to 9c61a5c. Confirmation head cf34471 changes only test-fixture lint relative to the original measured head 25f00cc; runtime code is identical.
Original run: lease
cbx_0214024def68, run. Blocking median 280→249 ms; IQR [255.5, 293]→[219.5, 266.5]. Eight wins; paired median −42 ms.Confirmation: fresh lease
cbx_111caf8419dd, run. Blocking median 250→240 ms; IQR [239, 299]→[231.5, 256.5]. Eight wins; paired median −14 ms. FCP 416→400 ms, first transcript 372.3→361.7 ms, RPC count 82→82. IQRs overlap; acceptance is by the predeclared pooled rule.Delta is candidate minus baseline in milliseconds; AB means baseline first.
Original 11 pairs
Fresh confirmation, 11 pairs
Construction and Visual Proof
Separate instrumented census (constructed / connected): panel type 409/1→1/1; widget actions 83/1→1/1; progress refresh 38/2→1/1. Instrumentation was absent from the timed comparison.
Synthetic before/after captures, inspected for private data; visible layout is preserved:
Validation
Final head:
302322f5ad2a77f45cc14256be018b47ca1706d5. The only change after the measured confirmation head is a test adjustment for released closed-menu rows; runtime is identical. No further performance comparisons were run.AWS validation-only lease
cbx_c5098aca7bc0, run:pnpm test <file> --maxWorkers=1)pnpm test <file> --maxWorkers=1)pnpm test <file> --maxWorkers=1)pnpm test <file> --maxWorkers=1)The production menu probe passes keyboard opening, Home/End/Arrow navigation, Escape focus return, and release of closed rows for all three menus. Shared native Menu coverage proves typeahead; chat's existing printable-key routing still sends ordinary letters to the composer. The added panel regression fails on the old eager implementation at the intended assertion (three icon reads before opening), and passes on the candidate.
Type-aware lint of the adjusted E2E: zero warnings/errors. The full changed-file check on the runtime-identical confirmation head passed all ten test-type graphs, UI types, formatting, and changed-file lint. Its global suppression/unused-export ratchets fail identically on the pinned baseline: three existing max-lines suppressions and four existing unused exports. No baseline exceptions or skips were added. Isolated reviews of the runtime and both fixture corrections are clean through P2.
Full UI E2E and failure classification
Ran
node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --maxWorkers=4with JSON/default reporters on the final head. 813 files passed, 5 failed, 1 skipped; 3,524 tests passed, 12 failed, 1 skipped. Command wall time: 3,879.58 s. The touched progress-refresh file also passes inside the full run.All 12 failure names match an actual replay on the pinned baseline, with the entire tracked tree verified identical to that baseline before running:
ui/src/e2e/chat-pull-requests.e2e.test.ts2d4ca277a8cf.ui/src/e2e/chat-pr-publication-state.e2e.test.ts2d4ca277a8cf.ui/src/e2e/chat-retry-failure.e2e.test.ts2d4ca277a8cf.ui/src/e2e/chat-plugin-steering.e2e.test.ts7270ca0bc258.extensions/qa-lab/src/control-ui-automation-management.real-gateway.e2e.test.tsWith only the four upstream UI test snapshots applied temporarily, all 23 tests in those four files pass against this candidate's unchanged runtime. Those snapshots were then removed. The existing desktop-resize test requiring a configured worker carrier is the sole skipped case. Complete per-file results and raw JSON are retained with the run evidence.
Exact-head CI
CI run 39003966857, exact head above: UI unit shards, selected UI E2E, and lint pass, including the formerly failing
check-lint-core-2.The production-type job and five test-type jobs fail with the same unrelated
TS2554insrc/snapshot/local-repository.ts:1101: two arguments passed to a one-argument helper. A static probe of pre-fix main2238380446ac9054843237503db5084650e31deereproduces that exact diagnostic; main already fixes the call inc711c071ed51. The probe reused the installed toolchain and also reported missing workspace dependencies, so it is diagnostic evidence, not a clean whole-main typecheck. The CI gate inherits these semantic-job failures. Logs were fetched once; CI was not rerun to chase the upstream red.Runtime Size and Release Context
Production diff: +33 LOC, 118 insertions / 85 deletions across
chat-sidebar-region-header.tsx,widget-card-menu.tsx, andsession-progress-card-solid.tsx. The existing lazy-entry contract needs keyed row identity and live getters to preserve labels/actions while avoiding closed-menu construction. The eager mapping path is removed; no primitive, configuration, or schema changes are added.Four test files are touched: panel-region construction, progress refresh unit, composer progress, and progress-refresh E2E. The E2E observes the visible trigger while closed and opens the menu before checking its item.
Both comparison leases and the validation lease are released. No Gateway or deployment was started outside test fixtures. No merge was performed. Landing remains with the campaign lead; current main already carries the unrelated fixes cited above.