Skip to content

perf(control-ui): defer remaining closed menu entries - #175011

Merged
steipete merged 7 commits into
mainfrom
steipete/coldload-remaining-closed-menus
Oct 17, 2026
Merged

steipete merged 7 commits into
mainfrom
steipete/coldload-remaining-closed-menus

Conversation

@steipete

@steipete steipete commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

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

Pair Order Baseline Candidate Delta
1 AB 280 268 -12
2 BA 293 249 -44
3 AB 271 206 -65
4 BA 280 214 -66
5 AB 298 235 -63
6 BA 300 211 -89
7 AB 257 225 -32
8 BA 293 251 -42
9 AB 244 265 +21
10 BA 218 270 +52
11 AB 254 290 +36

Fresh confirmation, 11 pairs

Pair Order Baseline Candidate Delta
1 AB 295 230 -65
2 BA 450 256 -194
3 AB 238 263 +25
4 BA 230 230 +0
5 AB 230 240 +10
6 BA 297 212 -85
7 AB 250 241 -9
8 BA 330 257 -73
9 AB 247 233 -14
10 BA 240 236 -4
11 AB 301 259 -42

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:

Before: canonical synthetic dashboard reload

After: canonical synthetic dashboard reload

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:

Focused proof Result Command wall time
Panel region (pnpm test <file> --maxWorkers=1) 20 passed 9.82 s
Progress refresh unit (pnpm test <file> --maxWorkers=1) passed 3.75 s
Composer progress (pnpm test <file> --maxWorkers=1) passed 3.97 s
Widget MCP App (pnpm test <file> --maxWorkers=1) passed 4.77 s
Progress refresh native E2E, one worker 3 passed 23.97 s
Native menu lifecycle/navigation, Chromium 38 passed 8.73 s
Native menu lifecycle/navigation, WebKit 38 passed 8.48 s

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=4 with 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:

Failed file Cases Classification
ui/src/e2e/chat-pull-requests.e2e.test.ts 5 Stale compact PR expectations; main fixes them in 2d4ca277a8cf.
ui/src/e2e/chat-pr-publication-state.e2e.test.ts 1 Same upstream fixture correction, 2d4ca277a8cf.
ui/src/e2e/chat-retry-failure.e2e.test.ts 1 Recovery disclosure expectation; main fixes it in 2d4ca277a8cf.
ui/src/e2e/chat-plugin-steering.e2e.test.ts 4 System-event disclosure expectation; main fixes it in 7270ca0bc258.
extensions/qa-lab/src/control-ui-automation-management.real-gateway.e2e.test.ts 1 Crabline rejects a filesystem boundary writable by another POSIX principal, before the UI flow. Same error on baseline.

With 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 TS2554 in src/snapshot/local-repository.ts:1101: two arguments passed to a one-argument helper. A static probe of pre-fix main 2238380446ac9054843237503db5084650e31dee reproduces that exact diagnostic; main already fixes the call in c711c071ed51. 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, and session-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.

@clawsweeper

clawsweeper Bot commented Oct 17, 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 changed the title experiment(control-ui): defer three remaining closed menus [do not merge] perf(control-ui): defer remaining closed menu entries Oct 17, 2026
@steipete
steipete marked this pull request as ready for review October 17, 2026 03:00
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-17T04:51:52.730031Z 302322f New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@steipete
steipete force-pushed the steipete/coldload-remaining-closed-menus branch from fcfe9c5 to 8de0f0c Compare October 17, 2026 03:12
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 17, 2026
@clawsweeper

clawsweeper Bot commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This 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.

  • Before: The refresh entry and its icon are constructed during rendering.
  • After: Only the options trigger renders initially; opening it constructs the refresh entry.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) Useful and narrowly scoped, with credible prior-head browser evidence, but the exact-head UI suite has a directly attributable test failure.
Proof confidence 🦐 gold shrimp (3/6) Maintainer-authored PR outside the ordinary contributor proof gate: inspected browser screenshots show settled-layout parity, and recorded Chromium reload output supports the earlier candidate; current-head measurements and menu qualification are explicitly pending under the author's merge hold.
Patch quality 🦪 silver shellfish (2/6) 1 actionable review finding remain.

Product

Kind: Performance · Worth it: Yes · Fix scope: Complete
User problem: Dashboard reload spends rendering work on entries and icons for menus the user has not opened.
Reason: The feature-history owner authored this focused optimization, and the recorded browser comparison supports reducing unnecessary rendering while preserving controls.

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
Reviewed head: 8de0f0c82d6294e171ac265f9b01441101c724bd

Before merge

  • Update composer admission coverage for lazy refresh rows (P2) - Adding lazy="while-open" means the refresh row is absent until the options menu opens, but this consumer test queries it beforehand and expects it to exist for connected writable composers. Exact-head checks-ui fails at this assertion, and the saved null reference would also prevent its later click. Open and settle the options menu before querying refresh, then retain the writable/disconnected/read-only cases and the assertions that refresh sends no chat message.

Findings

  • [P2] Update composer admission coverage for lazy refresh rows — ui/src/pages/chat/chat-composer-progress-refresh.test.ts:38-41

Tests

  • Missing end-to-end proof: Final-head reload measurements and Chromium/WebKit menu qualification remain pending in the author's evidence; the new panel regression's base-fail/head-pass result is not supplied.
Agent review details

How this fits together

Control 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]
Loading

Technical review

Best 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:

  • [P2] Update composer admission coverage for lazy refresh rows — ui/src/pages/chat/chat-composer-progress-refresh.test.ts:38-41
    Adding lazy="while-open" means the refresh row is absent until the options menu opens, but this consumer test queries it beforehand and expects it to exist for connected writable composers. Exact-head checks-ui fails at this assertion, and the saved null reference would also prevent its later click. Open and settle the options menu before querying refresh, then retain the writable/disconnected/read-only cases and the assertions that refresh sends no chat message.
    Confidence: 1

Overall correctness: patch is incorrect
Overall confidence: 0.97

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Widget and panel menu entries keeps the original intent (84617ea: Replace Web Awesome menus with the shared native Menu while preserving actions, selectors, and widget disclosure ownership.)
  • Progress options and feedback keeps the original intent (b7abb0f: Consolidate secondary progress actions while retaining permissions, refresh feedback, and separate hide and clear behavior.)
  • Panel menu content retention changes intended behavior with a stated reason (dc61fee: Mount menu content on first accepted open and retain its DOM afterward; this PR explicitly releases transient rows to stop closed-menu rendering work.)
  • Panel shortcut alignment keeps the original intent (a1c98b7: Use shared icon, label, and details slots so keyboard shortcuts align consistently.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

Acceptance criteria:

  • pnpm --dir ui test src/pages/chat/chat-composer-progress-refresh.test.ts src/components/session-progress-card-refresh.test.ts src/pages/chat/components/chat-sidebar-region.test.ts src/pages/chat/components/chat-message.mcp-app.test.ts
  • git diff --check

What I checked:

Likely related people:

  • RoboClaw: Raw commit b7abb0f adds ui/src/components/session-progress-card-solid.tsx:182 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: b7abb0f161e6; files: ui/src/components/session-progress-card-solid.tsx)

PR surface

Source +33, Tests +32. Total +65 across 5 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 3 118 85 +33
Tests 2 32 0 +32
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 150 85 +65

Root-cause cluster

Relationship: canonical
Canonical: #175011
Summary: This PR is the author's narrower replacement for the closed experiment.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Labels

Label changes:

  • add P2: This is a bounded reload-performance improvement with a focused test regression and no established urgent production failure.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp and patch quality is 🦪 silver shellfish.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: This is a bounded reload-performance improvement with a focused test regression and no established urgent production failure.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 16, 2026, 11:27 PM ET / October 17, 2026, 03:27 UTC.

@steipete
steipete force-pushed the steipete/coldload-remaining-closed-menus branch from 8de0f0c to 25f00cc Compare October 17, 2026 03:30
@steipete steipete changed the title perf(control-ui): defer remaining closed menu entries experiment(control-ui): defer remaining closed menus [gate failed] Oct 17, 2026
@steipete steipete closed this Oct 17, 2026
@steipete steipete reopened this Oct 17, 2026
@steipete
steipete marked this pull request as draft October 17, 2026 03:47
@steipete steipete changed the title experiment(control-ui): defer remaining closed menus [gate failed] experiment(control-ui): defer remaining closed menus [do not merge] Oct 17, 2026
@steipete steipete changed the title experiment(control-ui): defer remaining closed menus [do not merge] perf(control-ui): defer remaining closed menu entries Oct 17, 2026
@steipete
steipete marked this pull request as ready for review October 17, 2026 04:03
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 17, 2026
@steipete
steipete merged commit 9d74023 into main Oct 17, 2026
93 of 101 checks passed
@steipete
steipete deleted the steipete/coldload-remaining-closed-menus branch October 17, 2026 06:14
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 18, 2026
…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).
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 clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: M status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant