Repository navigation
perf(control-ui): stop sidebar artwork churn during live updates - #173282
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. What this changesThis PR retains settled sidebar artwork, defers closed picker options, and extends the performance benchmark. Example: An avatar resource resolves to /avatar/settled and later republishes that same URL.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open as a useful maintainer-owned experiment and honor its explicit “Do not merge” hold; no definite introduced defect was found. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherGateway session and presence publications reach existing Control UI projections, whose sidebar, picker, and avatar renderers produce browser DOM. flowchart LR
A[Gateway publications] --> B[Existing UI projections]
B --> C[Sidebar rendering]
B --> D[Picker rendering]
C --> E[Shared avatar binding]
C --> F[Browser DOM]
D --> F
E --> F
Technical reviewBest possible solution: Retain the existing rendering owners and use the controlled comparison to decide whether this candidate merits landing. Do we have a high-confidence way to reproduce the issue? Source establishes redundant same-URL image writes and eagerly mounted closed-picker options; the body reports base-failing regressions, but this read-only review did not execute them or verify the reported mutation totals. Is this the best way to solve the issue? The implementation targets unnecessary work inside existing rendering owners and preserves avatar resource custody, making it a reasonable candidate pending the experiment’s measured outcome. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b5f7f3521235. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource -2, Tests +328, Other +82. Total +408 across 34 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
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 15, 2026, 12:50 PM ET / 16:50 UTC. |
bb6c62e to
4128157
Compare
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. |
96b0d74 to
db070bf
Compare
db070bf to
cd255b7
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cd255b7d75
ℹ️ 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".
| .poll(async () => { | ||
| await openPicker(picker); | ||
| return picker.locator('[role="option"][data-value="fixture/published"]').count(); |
There was a problem hiding this comment.
Keep publication proof independent of picker refresh
When the picker is closed after selecting fixture/selected, this poll opens it only after publish("published"). The Agents picker wires onOpen to ensureModelCatalog({ refresh: true }) in agents-page-state.ts, so the new option can arrive from that foreground read even if the background catalog-publication path named by this test is broken. Open the picker before publishing, or inspect state without invoking onOpen, so this remains independent proof of publication-driven refresh.
AGENTS.md reference: AGENTS.md:L85-L85
Useful? React with 👍 / 👎.
77f727c to
8dbc027
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8dbc027872
ℹ️ 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".
| ["mutattr.init.js", "loaf-mutation.init.js", "ws-rpc-census.init.js"].map((filename) => | ||
| readFile(path.resolve(values["probe-dir"]!, filename), "utf8"), |
There was a problem hiding this comment.
Keep
--probe-dir compatible with its documented contents
When someone follows scripts/bench-control-ui-cold-load.md:45-48 and supplies the two documented probe files, this new mandatory read of mutattr.init.js fails with ENOENT before browser setup. Either make the attribution probe optional or update/provide the documented probe bundle so the existing warm-reload benchmark remains runnable.
AGENTS.md reference: AGENTS.md:L128-L128
Useful? React with 👍 / 👎.
Keep session glyphs, owner avatars, row actions, and color styles stable when live events republish equivalent facts. Defer closed picker options until opening, and preserve image settlement across repeated URLs and reconnects. Release-note context: settled sidebar artwork remains in place during live presence and session updates. Regression tests cover unchanged DOM, current menu choices, and avatar resource lifetimes; the Team-scale fixture now reproduces late live traffic.
Avoid retiring already-hidden empty overlays after unrelated DOM changes, while retaining root cleanup and open/closing invalidation. Preserve the existing empty-menu reopen regression and add the no-write boundary. Extend the sidebar live fixture through a measured quiet window. Seven interleaved pairs on one c7a.4xlarge reduce late sidebar mutations from 9030 to 665 and equivalent-only mutations from 36 to zero (medians).
Keep lazy picker coverage on the visible owner, preserve catalog and menu lifecycle assertions, and fix benchmark lint and test typing found by broad CI. Runtime sidebar owners remain unchanged from the measured candidate.
Wait for refreshed options through the actual open picker. Catalog retirement briefly disables and closes the same element, so opening before publication settles cannot guarantee mounted options. Preserve draft, recovery, and config assertions.
8dbc027 to
9ecc71a
Compare
…ed pickers on live events (openclaw#173282) On live Team the sidebar kept rewriting its DOM after load: a closed select picker re-rendered its option avatars, avatar images reassigned src and flipped pending/fallback state, session glyph content and owner chips were rebuilt from render helpers on every publication, and row styles/actions were rewritten. Closed pickers now render options only while open, avatar images keep their element/src/state when unchanged, session icons/attention/owner chips are components switched by memoized facts, row action/archive icons update in place, and hidden overlays skip validity checks. Visible behaviour is unchanged (glyph visibility rule and owner-chip defaults preserved). Seven interleaved AWS pairs with a Team-like live event stream: late sidebar mutations 8,384 -> 665 (-92%), quiet-window mutations 36 -> 0, LoAF 4,861 -> 3,695 ms (-24%); rebased re-check 665 / 0. Runtime +6 LOC. Exact-head CI green.
What Problem This Solves
Fixes repeated sidebar artwork replacement after a signed-in reload of a dashboard deep link, while live presence and session updates continue. Campaign evidence recorded 3,805–5,116 sidebar mutations after five seconds on a settled page.
User Impact
Avatars, glyphs, and row actions stay mounted when their visible facts are unchanged. Closed picker options render when opened, with current choices and keyboard selection. Genuine identity, membership, run-state, and selection changes still appear. The existing image-cache and keyed facepile owners remain in place.
Why This Change Was Made
Retain components instead of rebuilding JSX from whole-row snapshots; preserve settled image state for an unchanged URL; bind row style properties individually; leave closed picker options unmounted. The document overlay observer also stops repeatedly retiring menus that are already hidden and empty, while retaining root cleanup and open/closing invalidation.
Runtime production code is net +6 lines across five owners (+88/−82). The small growth preserves the existing glyph visibility and bare-glyph layout contracts while retaining mounted presentation components and guarding settled avatar/overlay updates. The requested
git diff --stat origin/main...HEAD -- ':!*.test.ts' ':!*test-support*' ':!docs/*'reports 26 files, +565/−199 (net +366), because its exclusions retain TSX tests, benchmark/fixture code, and test helpers. The larger proof diff updates tests that inspected hidden picker options to open the actual picker, adds mutation/lifecycle regressions, and extends the synthetic Team-scale fixture and benchmark probes. No server schema, durable shape, configuration, or compatibility path changes.Evidence
Current-head lead follow-up
Rebased onto main
cf7311c1048266d63c2fe34ba4480ba84777b449; current head is9ecc71a593496ca30bb857e105274c0ef83ad788. Main's model-picker first-open fix (#173275), workbench layout/overlay selectors (#173333), and subsequent native avatar/picker cutovers are retained. The five runtime owners and benchmark are byte-identical to the reviewed glyph-parity repair after the final rebase.Restored the literal original glyph-visibility rule while keeping the mounted component/Switch structure.
hasOwneralready excludes child rows, so an idle child without a channel avatar does not gain an owner chip. Owner-chip defaults remainparticipants ?? []andparticipantCount ?? participants?.length ?? 0; an explicit zero remains zero. The regression also preserves the bare glyph when an explicitfalseicon masks a fallback session icon;null/undefinedkeep the fallback. No additional visual change is intended.The first rebased CI run exposed a palette test querying a picker option while closed and retaining it across reopen. The test now queries the visible option after each open and keeps all eight palette checks. Independent review of the complete repair and the subsequent one-line test correction is clean through P2. Exact-head CI run 38844733562 is green, with zero pending checks.
Fresh AWS
c7a.4xlargeproof used leasecbx_15b79ad1a643, runrun_0eed414208ff3ad10f7bda8b5765e3e3, on this exact head. The lease is released and cleanup verified complete. All 49 focused files passed (493 assertions, zero failures/skips), including all 37 changed tests and the native picker/overlay/workbench boundaries; the explicit WebKit model-picker pass adds five passing assertions (3.327 s). Targeted UI/script lint, format, eight UI/scripts type graphs, and diff checks passed. The bare-glyph negative control failed only the explicit-false case on the pre-repair owner and passed null/undefined; the final owner then passed the complete regression file. All 62 tracked source hashes match this Git head, all three probes match the reviewed payload, and all 65 final/restored hash checks and pristine checks passed.The requested single live capture reports 1,027 total sidebar mutation records, 665 late (5–20 s), and zero quiet (15–20 s). The census received all 125 events (84 presence / 41 session changes); live RPCs remain 13 / 611,162 request+response bytes. Late weighted attribution remains zero for closed-picker leading content, glyph replacement, row styles and actions; avatar state/class/source counts are 38/48/9, and keyed facepile changes are 76 from genuine membership changes. Every tracked quiet-window target is zero. LoAF and RPC probes were included; this is a candidate-only count/delivery recheck, not a new timing comparison. The non-live warm-reload smoke also passed.
The composer-accessory focus whole file now passes (24.724 s), superseding its historical inherited failure below. The 807-file full-suite run and seven-pair performance comparison below remain explicitly labeled by their prior
77f727c4c886head; this rebase follow-up reran the focused files and requested capture, rather than the entire UI suite.Current-head focused file wall times (49 files, all passed)
Command per file:
corepack pnpm test <file> --maxWorkers=1, on the AWS lease above. These wall times exclude the separate negative control.ui/src/app/app-shell-view.test.tsui/src/components/app-sidebar-session-row-render.test.tsxui/src/components/channel-picker.test.tsui/src/components/control-theme.browser.test.tsxui/src/components/identity-avatar-view.test.tsxui/src/components/model-picker.browser.test.tsxui/src/components/overlay-anchor.browser.test.tsui/src/components/overlay-lifecycle.browser.test.tsui/src/components/select-picker.behavior.browser.test.tsui/src/components/select-picker.browser.test.tsxui/src/components/session-owner-chip.test.tsxui/src/components/solid/identity-avatar.test.tsxui/src/components/solid/menu-lifecycle.browser.test.tsxui/src/components/solid/model-picker.browser.test.tsxui/src/e2e/agent-file-lifecycle.real-gateway.e2e.test.tsui/src/e2e/chat-composer-accessory-focus.e2e.test.tsui/src/e2e/cron-agent-ownership.e2e.test.tsui/src/e2e/cron-duration-save.real-gateway.e2e.test.tsui/src/e2e/decision-model-settings.e2e.test.tsui/src/e2e/model-alias-display.e2e.test.tsui/src/e2e/model-picker-search.real-gateway.e2e.test.tsui/src/e2e/model-providers-help.e2e.test.tsui/src/e2e/model-providers-layout.e2e.test.tsui/src/e2e/native-session-sidebar.e2e.test.tsui/src/e2e/session-color.e2e.test.tsui/src/e2e/session-observer-model-catalog-recovery.e2e.test.tsui/src/e2e/sidebar-settings.e2e.test.tsui/src/e2e/theme-muted-contrast.e2e.test.tsui/src/pages/agents/panels-overview.test.tsui/src/pages/agents/view.test.tsxui/src/pages/channels/view.pairing.test.tsxui/src/pages/chat/components/chat-effort-picker.browser.test.tsxui/src/pages/chat/components/chat-model-picker.browser.test.tsxui/src/pages/chat/components/chat-model-picker.test.tsxui/src/pages/chat/components/chat-picker-overlay.test.tsui/src/pages/config/memory-dreaming.test.tsxui/src/pages/config/session-observer-settings.test.tsxui/src/pages/config/talk-render.test.tsui/src/pages/config/view-appearance.browser.test.tsxui/src/pages/config/view.themes.browser.test.tsui/src/pages/cron/view.test.tsui/src/pages/model-providers/model-providers-page.catalog.test.tsui/src/pages/model-providers/model-providers-page.login-refresh.test.tsui/src/pages/model-providers/model-providers-page.test.tsui/src/pages/model-providers/view.test.tsui/src/pages/profile/model-accounts.test.tsxui/src/pages/profile/profile-page.test.tsxui/src/pages/workboard/workboard-native-bundle.e2e.test.tsui/src/pages/workboard/workboard.e2e.test.tsPrior-head quiet AWS comparison (
77f727c4c886)One AWS
c7a.4xlargelease (cbx_62858257607f), headless repository Chromium, production bundles, seven interleaved baseline/candidate pairs; smoke runs excluded. Values are medians with IQR widths in parentheses. The fixture has 300 sessions, 120 people, mixed successful/failed/slow avatar responses, and 125 live events over 20 seconds. One viewer and one run genuinely change through 14 seconds; 14–15 seconds settle; 15–20 seconds publish equivalent heartbeat/receipt facts.Late sidebar mutation records fall 92.1%; live LoAF duration falls 24.0%. Every candidate quiet window has zero sidebar mutations. Live RPC volume matches in all fourteen measured runs: 13 calls / 611,162 request+response bytes, including eleven
sessions.listreads. All fourteen runs delivered all 125 planned events with matching event-kind counts. The candidate does not reduce request volume.Late attribution below uses the rig's weighted counts (records plus added/removed nodes), distinct from the record totals above. All listed attribution IQRs are zero.
The fixture reproduces the picker/avatar/glyph hotspots. It does not reproduce the reported row-style/action volume; focused row regressions cover stable nodes, unchanged styles/actions, and real updates. The existing keyed facepile needed no runtime change.
Comparison base:
012bb1ccaf0b63696b2608599b1cf4ea869a4245; candidate77f727c4c886515bdccf062d66c932d21f012556. Both bundles use the candidate build identity and identical benchmark/fixture/probe inputs. The baseline swaps only the five presentation owners to the pinned main versions; both retain main's session-title placeholder. All ten baseline/candidate runtime SHA-256 checks and all five shared-input checks passed and the checkout was restored pristine. The benchmark uses--live-events --sidebar-live-churn --untraced --probe-dir, with the mutation-attribution, LoAF/mutation, and WS/RPC rig probes.Prior-head validation (
77f727c4c886)Historical proof head:
77f727c4c886515bdccf062d66c932d21f012556, based on012bb1ccaf0b63696b2608599b1cf4ea869a4245. Detached independent review of the complete candidate is clean through P2. Exact-head CI run 38827194427 completed successfully. The native watcher reports GREEN, zero pending checks, and nine superseded older contexts; GitHub's raw aggregate retains those older entries.The valid review finding is addressed: the Agents test observes published and recovered catalog choices before opening the picker can trigger foreground refresh. Main's native Solid picker, chat rendering, and streaming benchmark changes are preserved. Previous-head CI caught an initial-mount assumption in the new disabled-provider-group test; the existing
openPickerhelper fixes it. On that prior head, the whole Agents real-Gateway file passed (195.847 s), Agents view passed all 22 cases (8.400 s), and Cron-duration passed all six cases (111.188 s). Native model picker passed five cases in each engine (Chromium 4.377 s / WebKit 7.614 s); select-picker behavior passed 21 in each (3.895 s / 3.050 s). Targeted lint, format, UI-e2e and scripts type graphs, and diff checks passed.The required full UI e2e suite completed on prior head
77f727c4c886on the same AWS lease: 807 files: 806 passed, one inherited failure; 3,509 assertions passed, one failed, one skipped, in 105 min 33.014 s. Command:node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --maxWorkers=2. The sole failure ischat-composer-accessory-focus.e2e.test.ts, “routes focus by composer accessory purpose”:expected false to be trueat line 116, checking the accessory menu before the model-picker section. The pinned main base independently reproduces that same assertion and source line (26.222 s). Full-suite exit 1 is retained as inherited-failure evidence; no retry was used to chase green.The one skipped assertion is the configured desktop-worker carrier case in
desktop-resize.real-gateway.e2e.test.ts(“matches a real desktop through the configured worker carrier and preserves controller ownership”). Whole-file QA automation management passed both real-Gateway cases; native Workboard, tooltip activation, Agents lifecycle, Cron-duration, and affected sidebar flows passed. Historical candidate/base pristine checks and all 13 source SHA-256 checks passed. The complete 807-file status list is below; earlier focused passes for all 36 changed test files remain labeled by their actual proof heads.Focused timing commands were
corepack pnpm test <file> --maxWorkers=1on AWS. Proof-head/lease mapping:412815785cf0→cbx_05e194e79931;4c1a0934f719→cbx_e4488e8242e9;96b0d74ee74d→cbx_8c9793be6eee;db070bf52057→cbx_7afdca494fe3;cd255b7d7545→cbx_733c0ca50e33;77f727c4c886→cbx_62858257607f. Earlier heads are labeled explicitly; the full UI suite above covers only the historical77f727c4c886head.Focused file wall times (36 changed test files)
ui/src/components/app-sidebar-session-row-render.test.tsx412815785cf0ui/src/components/channel-picker.test.ts412815785cf0ui/src/components/identity-avatar-view.test.ts412815785cf0ui/src/components/model-picker.browser.test.tsx77f727c4c886ui/src/components/select-picker.behavior.browser.test.ts77f727c4c886ui/src/components/solid/identity-avatar.test.tsx412815785cf0ui/src/components/solid/menu-lifecycle.browser.test.tsx412815785cf0ui/src/components/solid/model-picker.browser.test.tsx4c1a0934f719ui/src/e2e/agent-file-lifecycle.real-gateway.e2e.test.ts77f727c4c886ui/src/e2e/cron-agent-ownership.e2e.test.ts4c1a0934f719ui/src/e2e/cron-duration-save.real-gateway.e2e.test.ts77f727c4c886ui/src/e2e/decision-model-settings.e2e.test.ts412815785cf0ui/src/e2e/model-alias-display.e2e.test.ts412815785cf0ui/src/e2e/model-picker-search.real-gateway.e2e.test.ts412815785cf0ui/src/e2e/model-providers-help.e2e.test.ts412815785cf0ui/src/e2e/model-providers-layout.e2e.test.ts4c1a0934f719ui/src/e2e/native-session-sidebar.e2e.test.ts4c1a0934f719ui/src/e2e/session-color.e2e.test.ts4c1a0934f719ui/src/e2e/session-observer-model-catalog-recovery.e2e.test.ts412815785cf0ui/src/e2e/sidebar-settings.e2e.test.ts412815785cf0ui/src/e2e/theme-muted-contrast.e2e.test.ts4c1a0934f719ui/src/pages/agents/view.test.tsx77f727c4c886ui/src/pages/channels/view.pairing.test.tsx412815785cf0ui/src/pages/config/memory-dreaming.test.tsx412815785cf0ui/src/pages/config/session-observer-settings.test.tsx412815785cf0ui/src/pages/config/talk-render.test.ts412815785cf0ui/src/pages/config/view-appearance.browser.test.tsx412815785cf0ui/src/pages/config/view.themes.browser.test.ts4c1a0934f719ui/src/pages/cron/view.test.ts412815785cf0ui/src/pages/model-providers/model-providers-page.catalog.test.ts4c1a0934f719ui/src/pages/model-providers/model-providers-page.login-refresh.test.ts4c1a0934f719ui/src/pages/model-providers/model-providers-page.test.ts4c1a0934f719ui/src/pages/model-providers/view.test.ts412815785cf0ui/src/pages/profile/model-accounts.test.tsx4c1a0934f719ui/src/pages/profile/profile-page.test.tsx4c1a0934f719ui/src/pages/workboard/workboard.e2e.test.tscd255b7d7545Prior-head full UI file pass/fail list (`77f727c4c886`, 807 files)
Paths are relative to
ui/src/, except paths beginning withextensions/. These are the complete historical77f727c4c886results; the single conditional skipped assertion is disclosed above.Failed (1 file):
Passed (806 files):
Synthetic before / after
Inspected synthetic-only captures from the measured
77f727c4c886comparison and its pinned main baseline; no private campaign captures or real account data.Before:
After: