Skip to content

fix(ui): reduce sidebar work and preserve fast menu selection - #154285

Merged
steipete merged 6 commits into
mainfrom
codex/ui-background-render-performance
Sep 21, 2026
Merged

steipete merged 6 commits into
mainfrom
codex/ui-background-render-performance

Conversation

@steipete

@steipete steipete commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes redundant sidebar/chat work during background activity and menu opening that overwrites a fast keyboard selection.

User Impact

Sidebar hover and foreground chat spend less time measuring stationary content or redrawing unchanged progress and PR information. Overflowing titles, touch menus, reduced motion, current-session updates, errors, and reconnects retain their contracts. Fast menu navigation keeps the chosen item through opening and rapid reopening. No settings or migration are required. The existing Web Awesome 3.12.0 patch is updated with explicit maintainer approval; the dependency version is unchanged.

Why This Change Was Made

This follows the panel-layout repair in #154179. Remaining work was being triggered too broadly: every sidebar title remeasured after an unchanged render, every scroll repositioned a stationary hovercard, and shared progress/PR notifications redrew unrelated panes.

Marquee measurements now follow actual content, size, direction, motion, and intent changes, with all reads batched before writes. Hovercards only reposition for anchor-ancestor scrolling and viewport changes, coalesced per frame. Existing stores suppress irrelevant notifications; existing presentation owners suppress unchanged per-session projections.

Evidence

  • Red-before-green operation budgets: 100 titles across five unchanged renders previously caused 500 geometry reads and 500 overflow-update calls; both are now zero. Necessary initial measurements read the entire batch before writing.
  • 100 unrelated scroll events previously caused 100 hovercard-anchor reads; now zero. Repeated relevant scroll/resize events coalesce to one read per frame and pending work is cancelled on reset. The real Chrome mock UI also reported zero reads for 100 conversation scroll events while the sidebar card remained open.
  • Foreign PR/progress events no longer notify or redraw unaffected views. Matching content, errors, refresh pending/completion, target selection, and reconnect cases pass.
  • 136 focused tests pass, including Chromium hovercard placement and marquee lifecycle. The existing bundled sidebar-name and hovercard-navigation E2E suites pass all 11 cases, including long/emoji/RTL names, keyboard focus, touch, reduced motion, and navigation. The bundled production UI build passes. After rebasing over the concurrent reduced-motion hovercard cleanup, all 16 combined hovercard unit/browser cases passed (6.62 s); both test additions are retained.
  • New/changed test cost: marquee unit 2.11 s wall / 316 ms tests; hovercard unit 1.31 s wall / 28 ms tests and seven Chromium placement cases in 0.71 s; progress controller final rerun 3.65 s invocation with a 15 ms regression; PR pane plus store/controller siblings 23.92 s invocation with a 129 ms regression. The two bundled E2E files take 38.12 s including build/setup. Hosted UI shard job wall times: 361 s, 304 s, and 316 s; the Control UI performance job passed in 108 s. These are full jobs including setup and sibling tests.
  • Independent P0–P2 review, changed-scope typechecks, architecture/format/dead-code guards, and targeted lint/style checks pass. Local validation caught and fixed a test cleanup type and explicit optional returns in the batched callback. Production was inspected through the shared DevTools relay; these operation budgets are synthetic contract proof, not post-deployment timing claims. No live Gateway was deployed or restarted.

Inspected presentation-parity screenshots use the same synthetic scenario. The before image is the retained baseline after #154179; the after image is freshly captured from this candidate.

Before:

Before: retained baseline after the panel repair

After:

After: sidebar hover with background-work fixes

Dropdown regressions uncovered by CI

Web Awesome reset focus to Camera after a fast keyboard selection of Photo. The shared dropdown now initializes focus after popup activation during the first rendered animation frame, preserves accepted focus through rapid reopening and grouped content, and respects selected-row autofocus. Provider, agent, environment-mode and sidebar agent pickers declare their initial selection instead of resetting focus after animation completion. Existing pointer/hover focus restoration retains its separate contract.

Controlled browser regressions demonstrated the original late selection reset, initial-open focus failure, rapid-reopen window, provider/agent End-navigation reset, and grouped item/input autofocus loss. All repaired paths pass. The final caller cutover passes 17 bundled model-setup/group-default/agent-layout E2E cases (27.34 s), 44 caller/sidebar unit and browser cases (3.86 s), plus the shared dropdown lifecycle/ownership and identity suite. The two real selected-picker cases replace synthetic after-show unit tests and prove both focus and visibility in a long menu; their browser file plus sidebar layout ran in 1.79 s. UI typecheck, patch guard, formatting and fresh independent P0–P2 review pass. The rebase changed only surrounding lockfile context; the reviewed UI sources and patch bytes are identical.

No timeout increases, retries, weaker assertions or baseline changes were introduced. The existing Web Awesome patch update was explicitly approved; its version is unchanged.

CI and bounded stress investigation

The prior head 164111d9909 passed three Linux replays of the original attachment-picker shard configuration (5/12 despite the CI job label 5/13). Ten standalone picker-file runs passed; one additional run stalled while pressing Enter on the already-resolved Add attachment trigger in the new-conversation iPhone Safari fixture. Its renderer diagnostic also timed out while the browser remained connected. The campaign stopped with nine runs unstarted. This is distinct from the reproduced Photo-to-Camera selection defect.

A bounded instrumented follow-up at that exact source ran 48 viewport/Enter interactions across 12 fresh contexts, all passing in 30–311 ms (median 70.5 ms), with CPU profiles and Playwright traces retained locally. It did not recreate the original three-concurrent-run load and preceding case history. No safe root cause or fix was established; these successful interactions are non-reproduction evidence, not proof that the stall is fixed. The Blacksmith Testbox lease was stopped. Original failure and diagnostic source: Testbox run.

Two failures outside the UI changes have owning fixes incorporated from main: duplicate database-worker inventory (f76d38a4ac5e5f4e6c5a5320436db169e33d5c8a) and Discord audio-worker fixture compilation (6319111df2121b72478de3be5691360ecb6d7e5c). The older full run also reported Codex process-inspection read-error timing as deadline instead of unavailable in transport-process-snapshot.test.ts:219; source inspection and owner coordination found no established cause or repair. A bounded replay of the original 12-file Codex group passed all 176 cases locally (59.36 s); this does not establish a fix or reproduce the original Windows/Linux runner load. This remains documented uncertainty. Original full CI run. Final CI is attached to the repaired revision; historical passing replays are not described as fixes for unexplained failures.

The complete UI portion of revision 7ee7dcf7de3a passed all three UI test jobs and all 13 bundled UI E2E jobs. CI then required the two assertion-count budgets to shrink from 3 to 2 after deletion of the old focus callbacks; those exact reductions pass the ratchet and independent review. The same full run reported a Windows test-helper cleanup failure that cascaded through 42 cases after an indeterminate child/output closure. Bounded source/history inspection found that the first replacement Gateway had an empty Windows Job but unconfirmed leader or output closure; the retained indeterminate instance then caused the remaining cleanup failures. The test restores its mocked clock before this shutdown, so clock freezing was not established as the cause. The log does not distinguish the missing closure condition; existing ownership fixes are already present, and no safe repair was established. No passing replay is claimed as its repair. UI-green run and original Windows evidence.

@clawsweeper

clawsweeper Bot commented Sep 21, 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.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: L maintainer Maintainer-authored PR labels Sep 21, 2026
@steipete
steipete marked this pull request as ready for review September 21, 2026 02:11
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 21, 2026
@clawsweeper

clawsweeper Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 21, 2026, 2:45 AM ET / 06:45 UTC (Revision 9).

ClawSweeper review

What this changes

The PR reduces unnecessary sidebar measurements and chat redraws, and preserves keyboard selection while dropdown menus open or reopen.

Merge readiness

✅ Ready for maintainer review

This remains a useful repair absent from current main. The current revision addresses the earlier popup-focus finding, and the review found no new blocking correctness or security defect.

Priority: P2
Reviewed head: 51cec98fe23d03447aea86d54c35b485f446e9c3

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A sound owner-level repair with focused regressions, inspected presentation evidence, and clearly documented validation limits.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: The external-contributor proof gate does not apply to this maintainer PR, and no material authority change triggers an exception. Inspected screenshots establish presentation parity; the reported browser regressions and operation measurements support the changed behavior without claiming deployed performance proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The external-contributor proof gate does not apply to this maintainer PR, and no material authority change triggers an exception. Inspected screenshots establish presentation parity; the reported browser regressions and operation measurements support the changed behavior without claiming deployed performance proof.
Evidence reviewed 9 items Pinned scope and review continuity: Reviewed the merge-base-to-head introduced changes. Comparing the previous reviewed revision with HEAD shows only two assertion budgets shrinking from 3 to 2; production and test code are unchanged. The stale test merge was not used to attribute base-branch changes to this PR.
Repair remains necessary on main: Current main still schedules marquee measurement on every directive update. Its Web Awesome patch also waits for the opening animation before resetting focus to the first item. These are the mechanisms addressed by this branch; no implemented-on-main or shipped-fix claim is supported.
Earlier focus finding addressed: Initial focus now waits for popup rendering and its activation frame, preserves already accepted menu focus, and runs before animation completion. Agent, provider, environment-mode, and sidebar callers replace their late selection resets with declarative autofocus. Browser regressions cover fast selection, rapid reopening, grouped content, initial opening, and selected-row visibility.
Findings None None.
Security None None.

How this fits together

The Control UI turns Gateway session updates and browser interactions into sidebar previews, progress cards, and chat information. Its shared dropdown component controls initial focus and keyboard selection across agent, provider, and environment pickers.

flowchart LR
  A[Gateway session updates] --> B[Session stores]
  B --> C[Changed view presentation]
  C --> D[Chat and sidebar]
  E[Content and viewport changes] --> F[Batched layout measurements]
  F --> D
  G[Pointer and keyboard input] --> H[Shared dropdown focus]
  H --> D
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +70, Tests +573, Other +40. Total +683 across 22 files.

View PR surface stats
Area Files Added Removed Net
Source 10 236 166 +70
Tests 9 630 57 +573
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 3 77 37 +40
Total 22 943 260 +683

Review metrics

Metric Value Why it matters
Production versus regression coverage Production +110 net lines including dependency patch; tests +573 net lines Production growth implements shared batching, invalidation, and focus preservation; regression coverage checks operation budgets and interaction lifecycles.

Technical review

Best possible solution:

Keep layout invalidation and initial menu focus with their existing shared owners while preserving session-scoped presentation and accepted keyboard input.

Do we have a high-confidence way to reproduce the issue?

Yes, from source: unchanged marquee renders schedule measurements, and dropdown opening resets focus after animation completion on current main. The supplied regressions exercise those triggers; this review did not execute them.

Is this the best way to solve the issue?

Yes. The patch repairs existing presentation and dropdown owners, removes competing late focus callbacks, and preserves connection, selection, and cleanup contracts without new settings.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 71d0ee197a8b.

Labels

Label justifications:

  • P2: This repairs bounded Control UI performance and keyboard-selection defects without evidence of a release-wide outage.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The external-contributor proof gate does not apply to this maintainer PR, and no material authority change triggers an exception. Inspected screenshots establish presentation parity; the reported browser regressions and operation measurements support the changed behavior without claiming deployed performance proof.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The external-contributor proof gate does not apply to this maintainer PR, and no material authority change triggers an exception. Inspected screenshots establish presentation parity; the reported browser regressions and operation measurements support the changed behavior without claiming deployed performance proof.

Evidence

What I checked:

  • Pinned scope and review continuity: Reviewed the merge-base-to-head introduced changes. Comparing the previous reviewed revision with HEAD shows only two assertion budgets shrinking from 3 to 2; production and test code are unchanged. The stale test merge was not used to attribute base-branch changes to this PR. (config/assertion-safety-baseline.txt:3531, 51cec98fe23d)
  • Repair remains necessary on main: Current main still schedules marquee measurement on every directive update. Its Web Awesome patch also waits for the opening animation before resetting focus to the first item. These are the mechanisms addressed by this branch; no implemented-on-main or shipped-fix claim is supported. (ui/src/lib/hover-marquee.ts:28, 71d0ee197a8b)
  • Earlier focus finding addressed: Initial focus now waits for popup rendering and its activation frame, preserves already accepted menu focus, and runs before animation completion. Agent, provider, environment-mode, and sidebar callers replace their late selection resets with declarative autofocus. Browser regressions cover fast selection, rapid reopening, grouped content, initial opening, and selected-row visibility. (patches/@[email protected]:1035, 51cec98fe23d)
  • Scoped notification and layout ownership: The existing marquee owner batches geometry reads before writes, hovercards filter unrelated scrolling and cancel pending positioning on cleanup, and session presentation comparisons retain card, error, refresh, and connection changes. Store request-generation and session-routing guards remain intact. (ui/src/components/session-progress-card-controller.ts:86, 51cec98fe23d)
  • Dependency contract inspected: The patch directly changes Web Awesome dropdown behavior. npm metadata identifies shoelace-style/webawesome as its repository; the published 3.12.0 dropdown implementation was read from the package tarball, including slot ownership, item enumeration, keyboard dispatch, and animation-delayed initial focus. No dependency code was executed.
  • Proof and validation boundaries: Inspected both prepared before/after screenshots; they show preserved sidebar hovercard and panel presentation, not timing or keyboard behavior. The captured PR body reports controlled browser regressions, operation budgets, measured test costs, and passing UI jobs at the preceding revision. It explicitly distinguishes unresolved stress failures from proven fixes. No tests were executed during this read-only review. (ui/src/components/web-awesome-dropdown.browser.test.ts:461, 51cec98fe23d)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vyctor H. Brzezowski: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (8 earlier review cycles)
  • reviewed 2026-09-21T02:17:57.961Z sha 233ef9ad550af75c3b47045f3a1f4b40335a41c9 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-21T02:33:53.603Z sha 167eac5 :: needs changes before merge. :: none
  • reviewed 2026-09-21T03:10:09.585Z sha 167eac5 :: blocked before merge. :: none
  • reviewed 2026-09-21T03:41:39.225Z sha 48182430bf435ae7b29396188e107999c4ee6a0a :: needs changes before merge. :: none
  • reviewed 2026-09-21T04:21:36.875Z sha e67446216bdb45af5ccaf5985d1f550e4587193a :: blocked before merge. :: [P1] Wait for popup activation before assigning initial menu focus
  • reviewed 2026-09-21T04:54:37.429Z sha 491774af63532b67ef8be2613897b1da7e817a29 :: needs changes before merge. :: none
  • reviewed 2026-09-21T05:07:45.165Z sha 164111d99099440015640b521d2ac52de441e138 :: needs changes before merge. :: none
  • reviewed 2026-09-21T06:19:36.894Z sha 7ee7dcf :: needs maintainer review before merge. :: none

@steipete
steipete force-pushed the codex/ui-background-render-performance branch from 233ef9a to 167eac5 Compare September 21, 2026 02:22
@clawsweeper clawsweeper Bot removed the proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. label Sep 21, 2026
@github-actions github-actions Bot added the dependencies-changed PR changes dependency-related files label Sep 21, 2026
@github-actions

github-actions Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Dependency graph changes

This maintainer PR changes the dependency graph. This comment is informational because the PR author has repository Maintain or Admin access.

  • Current SHA: 51cec98fe23d03447aea86d54c35b485f446e9c3
  • Maintainer: @steipete
  • Repository role: admin

These dependency graph changes were made:

Carefully review these changes before merging.

@clawsweeper clawsweeper Bot added the proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. label Sep 21, 2026
@steipete steipete changed the title fix(ui): stop redundant sidebar and background session work fix(ui): reduce sidebar work and preserve fast menu selection Sep 21, 2026
@steipete
steipete force-pushed the codex/ui-background-render-performance branch from 491774a to 164111d Compare September 21, 2026 04:58
@steipete
steipete force-pushed the codex/ui-background-render-performance branch from 164111d to 7ee7dcf Compare September 21, 2026 06:07
@steipete
steipete merged commit 8734609 into main Sep 21, 2026
207 of 208 checks passed
@steipete
steipete deleted the codex/ui-background-render-performance branch September 21, 2026 06:58
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 22, 2026
…aw#154285)

* fix(ui): stop redundant sidebar and background session work

* fix(ui): preserve keyboard selection while dropdowns open

* fix(ui): retain menu selection during rapid reopen

* fix(ui): wait for popup activation before initial menu focus

* fix(ui): keep picker focus during fast keyboard navigation

* chore(ui): shrink removed focus assertion budgets
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 dependencies-changed PR changes dependency-related files maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant