Skip to content

perf(ui): bound model picker work and isolate Cron input painting - #184856

Merged
steipete merged 7 commits into
mainfrom
solid2/w-perf-interaction-6
Oct 26, 2026
Merged

steipete merged 7 commits into
mainfrom
solid2/w-perf-interaction-6

Conversation

@steipete

@steipete steipete commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

What problem this solves

Large Model Providers catalogs render every option when opening/searching a picker, and Cron input edits repaint a large jobs table. This makes routine controls expensive on slower CPUs.

Result and implementation

Large flat Model Providers pickers use a lazy virtual window over matching rows. The existing menu machine still owns full-catalog keyboard selection; virtual-core owns geometry. An inert, bounded sizing layer preserves max-content width for offscreen labels/details. Catalogs above 32 distinct sizing groups retain ordinary rendering to preserve the actual label/detail layout.

Cron observes model suggestions only while the editor needs them and scopes row/search painting. Catalog, request and mutation owners stay unchanged. No new dependency, route, host tag, existing class rename or startup import boundary change.

The proposed chat property-copy optimization was removed: integrated task gains were about 2%, and its desktop-navigation script p95 remained uncertain. Both chat files now exactly match the pinned main base, preserving main's independently landed lean search presentation. The final diff contains no chat source changes.

Performance evidence

Twenty serial counterbalanced base/head/base triples per workload/viewport, actual renderer thread CPU and identical-build A/A controls. Host load 14.97–43.95. The table is the retained provider/Cron subset of the original 720/720 passing combined-candidate cells at base 91fa755. Those runtime owners are unchanged by the later integration and chat removal; no discarded chat improvement is claimed.

Workload Viewport Task before median/p95 ms Task after median/p95 ms Median change Script median before → after ms
Provider warm open desktop 77.76 / 80.64 17.00 / 18.45 -78.1% 42.91 → 6.68
Provider warm open mobile 77.37 / 81.18 17.49 / 18.39 -77.4% 42.78 → 6.87
Provider open/search desktop 302.30 / 310.88 99.72 / 104.11 -67.0% 215.45 → 35.06
Provider open/search mobile 292.55 / 308.38 100.14 / 112.65 -65.8% 209.10 → 34.74
Provider selection desktop 34.85 / 38.22 27.35 / 30.25 -21.5% 16.71 → 12.33
Provider selection mobile 34.80 / 37.27 27.19 / 28.85 -21.9% 16.92 → 12.55
Cron typing (20 characters) desktop 122.32 / 134.52 101.00 / 113.61 -17.4% 32.20 → 29.48
Cron typing (20 characters) mobile 108.46 / 123.72 88.07 / 96.02 -18.8% 32.04 → 28.97
Cron typing, request pending desktop 88.93 / 101.28 71.63 / 76.37 -19.4% 14.48 → 12.02
Cron typing, request pending mobile 97.54 / 114.83 77.34 / 84.11 -20.7% 15.84 → 12.86

Exact-width sizing adds layout CPU (~14→27 ms combined) while reducing total provider open/search CPU (~300→100 ms). Cron pending desktop style CPU rises about 0.12 ms while total CPU improves. The ≤60 ms Cron native input-task target was already met by baseline: all 24 retained base/candidate/control typing traces stayed below 31.2 ms per renderer task. Candidate input-owning tasks peaked at 3.765 ms CPU / 3.825 ms elapsed, versus 30.529 / 30.606 ms across baseline traces. This is native task occupancy, not per-key async settlement or INP; the full 20-character query improvement is separate. These synthetic renderer workloads use 1,000 models, 1,000 sessions, 400-message transcripts and 500 Cron jobs; 20-character typing totals are not per-keystroke latency, INP, or live-provider timing.

Integration confirmation used exact clean base a4b60a5/head fd2250e bundles: 600/600 untraced cells plus 3/3 diagnostic profiles passed their behavior assertions. Desktop Cron task 121.740/146.134→103.082/112.761 ms and script 33.064/35.846→30.089/32.371 ms. Request-count outliers remain in all roles. Mobile sidebar returned within band; mobile 4× scroll/search/palette small tail shifts and A/A variation are retained in the task report, not flattened into a blanket no-regression claim.

The discarded chat candidate's desktop 4× navigation script median/p95 73.467/82.597→75.515/95.687 ms remains unresolved for that candidate. Profiles show the same 20 key handlers, 80 delegated events and 22 Solid flushes, with no execution in any retained changed owner. The two chat source changes were removed instead of adding timing runs. The prepared 30-cell extension never started. Full 26-scenario census coverage is 156/156 at 1× and 156/156 at 4×; those screening samples are not stable timing estimates.

Correctness and checks

  • Picker browser proof: 41/41, including exact desktop/mobile long-label widths, filtered/empty states, selected row 750, disabled skipping, Home/End/typeahead and one selection.
  • Final chat runtime tests 10/10 and UI typecheck passed. Script typecheck, targeted formatting/lint, controller guard and production Knip passed; unchanged-input proof reused where the final simplification only restores main's chat files.
  • Independent integrated P0–P2 review and full-context reviews of reconnect setup and chat removal are clean.
  • Reconnect benchmark warmup previously failed because it lacked the observer required by the shared preload check. The real --smoke failed before transport drop; registering the existing observer before navigation makes the same smoke complete restoration and preserve the unsent draft.
  • Final clean production build 02825d3: startup 271,136→270,958 B gzip, 5 JS requests and 1 CSS request unchanged; CSS 31,981 B unchanged; strict check has zero violations. Raw startup JS is 840,102 B on both sides, so the gzip difference includes hash/compression effects.
  • ci:full remains enabled; the final head's CI is pending. Prior e40994c CI is prior-head evidence. Earlier fd2250e CI failed only the exact PDF preview/download test also failing scheduled main 40380874869; no failed run is labeled green.

Change size

16 files versus pinned integration base: total LOC 10,684→11,403 (+719); production TS/TSX 2,867→3,224 (+357). Growth implements the lazy window, exact sizing, complete keyboard navigation and proof. Effects 1→1; memos 50→53; signals 9→10; settled callbacks 6→7. Render effects, direct listeners, DOM queries, flush and owner APIs remain 0 in changed production code. One existing untrack remains.

Visual proof

State Before After
Desktop long label Desktop before Desktop after
Mobile long label Mobile before Mobile after
Desktop Cron action menu Cron desktop before Cron desktop after
Mobile Cron pending search Cron mobile before Cron mobile after

@steipete steipete added the ci:full Keep ordinary native-locale CI selection on the next PR run. label Oct 26, 2026
@clawsweeper

clawsweeper Bot commented Oct 26, 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 scripts Repository scripts size: XL labels Oct 26, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 26, 2026
@clawsweeper

clawsweeper Bot commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR bounds large model-picker rendering, reduces Chat search copying, and isolates Cron input and row painting.

Example: Open Models settings with 1,000 available models.

  • Before: The picker mounts the full catalog; reported desktop warm-open task median is 77.76 ms.
  • After: Eligible catalogs mount a virtual window; reported desktop warm-open task median is 17.00 ms.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful measured improvements and inspected visual proof support the change, but the introduced lazy-import recovery defect prevents a clean correctness verdict.
Proof confidence 🐚 platinum hermit (4/6) ✨ media proof bonus Sufficient (screenshot): Inspected production-renderer screenshots show desktop/mobile picker sizing, unclipped Cron actions, and retained pending-search rows; the body supplies paired CPU results for the changed picker, Chat, and Cron paths using synthetic Gateway fixtures, with broader timing confirmation explicitly pending.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Product

Kind: Performance · Worth it: Yes · Fix scope: Complete
User problem: Large model catalogs make picker interaction expensive, and Cron typing repaints unrelated content.
Reason: The maintainer-authored direction has measured renderer benefits while preserving existing configuration and selection ownership.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep this useful maintainer-authored performance PR open; fix the new lazy-import failure path before merging and retain the author's draft gate.

Priority: P2
Reviewed head: e6641f40b237fa39fecef2b2a0c1dd90fe3acb0d

Before merge

  • Handle failures of the lazy picker-window import (P2) - For a windowed catalog, a rejected request for the new chunk has no local error or retry consumer. This is reachable after a Gateway update removes an old hashed chunk, particularly while a dirty config draft or outstanding write prevents automatic document reload. MenuNavigationError only observes the separate menu-runtime import, so it cannot explain or recover this failure. Add a local Errored recovery surface around PickerWindow and reuse the existing import/guarded-reload helpers while retaining the trigger and draft.

Findings

  • [P2] Handle failures of the lazy picker-window import — ui/src/components/select-picker-view.tsx:28
Agent review details

How this fits together

The Control UI turns model catalogs and Cron snapshots into searchable controls and tables; existing owners still validate selections, issue requests, and persist configuration.

flowchart LR
  Catalog[Model catalog] --> Picker[Shared picker]
  Picker --> Window[Lazy virtual window]
  Picker --> Menu[Menu navigation owner]
  Menu --> Commit[Existing selection and config owners]
  Cron[Cron state owner] --> Presentation[Cron presentation]
  Presentation --> Paint[Search and table painting]
Loading

Technical review

Best possible solution:

Keep the bounded rendering design and give its lazy window a local recovery surface using the existing import and guarded-reload owners.

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

Current-main source mounts the complete flat catalog, and the supplied production-renderer measurements exercise that cost; this read-only review ran no target code.

Is this the best way to solve the issue?

The design reuses existing selection, navigation, geometry, and persistence owners, but the added lazy rendering boundary needs the same visible recovery contract as other lazy UI surfaces.

Full review comments:

  • [P2] Handle failures of the lazy picker-window import — ui/src/components/select-picker-view.tsx:28
    For a windowed catalog, a rejected request for the new chunk has no local error or retry consumer. This is reachable after a Gateway update removes an old hashed chunk, particularly while a dirty config draft or outstanding write prevents automatic document reload. MenuNavigationError only observes the separate menu-runtime import, so it cannot explain or recover this failure. Add a local Errored recovery surface around PickerWindow and reuse the existing import/guarded-reload helpers while retaining the trigger and draft.
    Confidence: 0.91

Overall correctness: patch is incorrect
Overall confidence: 0.9

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: shipped entry point.

Security

None.

Evidence

Acceptance criteria:

  • pnpm --dir ui test src/components/select-picker.behavior.browser.test.ts src/components/select-picker.browser.test.tsx
  • pnpm tsgo:ui
  • Through the built Models page, reject the picker-window chunk with a config reload guard active; verify visible recovery, preserved draft, and successful subsequent selection.
  • Run the normal full PR CI after the author resolves the existing draft gate.

What I checked:

  • Pinned introduced change: Reviewed the merge-base-to-head hunks, including the virtual window, complete-catalog navigation, sizing fallback, Chat argument change, Cron presentation, CSS, browser tests, and benchmark scenarios. (e6641f40b237)
  • Uncovered lazy import: PickerWindow uses a bare lazy import without a local error/retry surface; MenuNavigationError observes the separate menu-runtime loader. (ui/src/components/select-picker-view.tsx:28, e6641f40b237)
  • Document recovery is conditional: Automatic stale-chunk reload stops when a reload guard rejects it, and runtime configuration registers guards for dirty or outstanding writes. (ui/src/lib/config/runtime-config-editor.ts:46, e6641f40b237)
  • Supplied production-renderer evidence: Read the full PR body and discussion and inspected all four before/after screenshot pairs: desktop/mobile picker widths, desktop Cron action menu, and mobile pending search remain visually consistent. The body reports counterbalanced production-renderer measurements with synthetic catalogs and explicitly leaves timing confirmation pending. Captured body identity: 0431722b29ef02fe0518d4eab524789f71e4361c90181646f261a51598d8670c. (e6641f40b237)
  • Existing intent and ownership: Feature history identifies Peter Steinberger's Solid migration, lazy menu runtime, and recent picker/Cron optimizations, plus Ayaan Zaidi's searchable-menu contribution at feat(ui): search long model menus #141894. The Chat virtualizer in perf(ui): virtualize large model picker catalogs #181190 addresses a separate picker. One historical creation-blob read was unavailable in the partial clone; current source and merged PR context remained readable. (ui/src/components/solid/menu-runtime.ts:1, e923309c2978)
  • Draft and CI state: The reviewed head is draft and reported mergeable. Its broad UI, real-Gateway, performance, and CI-gate checks were skipped; cancelled automation checks establish no diff-caused failure. (e6641f40b237)

Likely related people:

  • Peter Steinberger: Raw commit 69740ce adds ui/src/components/solid/menu-runtime.ts:1 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 69740ceee584; files: ui/src/components/solid/menu-runtime.ts)
  • Ayaan Zaidi: Raw commit 932ae87 adds ui/src/components/select-picker.browser.test.ts:6 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 932ae87ede92; files: ui/src/components/select-picker.browser.test.ts)

PR surface

Source +378, Tests +140, Other +127. Total +645 across 16 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 13 505 127 +378
Tests 2 140 0 +140
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 199 72 +127
Total 16 844 199 +645

Review metrics

Metric Value Why it matters
Production versus test growth Production +378 LOC; browser tests +140 LOC Production growth supplies virtual geometry, intrinsic sizing, and full-catalog navigation; the browser additions cover distinct width and keyboard contracts.

Labels

Label changes:

  • add P2: Large-catalog interaction improvements have clear value, with a bounded picker recovery defect to repair.
  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: Large-catalog interaction improvements have clear value, with a bounded picker recovery defect to repair.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.
  • proof: sufficient: Contributor real behavior proof is sufficient.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

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 26, 2026, 2:05 PM ET / 18:05 UTC.

@steipete
steipete marked this pull request as ready for review October 26, 2026 18:13
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 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-26T20:10:13.403963Z 02825d3 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fd2250e8fe

ℹ️ 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".

Install the shared preload observer before navigating every reconnect fixture page. The real reconnect smoke fails during warmup before this change and completes transport drop/recovery afterward, retaining the unsent draft.
Keep the strong provider-picker and Cron wins while preserving main’s existing lean chat search. Integrated chat task gains were about two percent, with an unresolved navigation tail in the candidate. Restoring the two chat files removes that low-value scope instead of expanding timing runs.
@steipete
steipete enabled auto-merge (squash) October 26, 2026 20:15
@steipete
steipete merged commit f6ec9f8 into main Oct 26, 2026
122 of 126 checks passed
@steipete
steipete deleted the solid2/w-perf-interaction-6 branch October 26, 2026 20:28
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash auto-merge.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 27, 2026
…enclaw#184856)

* perf(ui): bound model picker rendering and defer idle cron work

* test(ui): settle background work before sidebar timing

* test(ui): settle navigation preloads before interaction timing

* style(ui): format integrated picker search helper

* fix(ui): initialize reconnect benchmark preload observer

Install the shared preload observer before navigating every reconnect fixture page. The real reconnect smoke fails during warmup before this change and completes transport drop/recovery afterward, retaining the unsent draft.

* perf(ui): drop marginal chat search allocation change

Keep the strong provider-picker and Cron wins while preserving main’s existing lean chat search. Integrated chat task gains were about two percent, with an unresolved navigation tail in the candidate. Restoring the two chat files removes that low-value scope instead of expanding timing runs.
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 ci:full Keep ordinary native-locale CI selection on the next PR run. P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: XL 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