Skip to content

perf(ui): window large automation job lists - #189149

Merged
steipete merged 7 commits into
mainfrom
solid2/w-webkit-cron-window-1030
Oct 31, 2026
Merged

steipete merged 7 commits into
mainfrom
solid2/w-webkit-cron-window-1030

Conversation

@steipete

@steipete steipete commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Large automation inventories keep every loaded job in the DOM, making search, opening menus, and opening Automations disproportionately slow in WebKit.

User Impact

Large lists retain only the visible window, nearby rows, and native keyboard entry targets. Job controls, search results, list position/size announcements, and menu focus return are preserved. Browser find searches materialized rows; the Automations search continues to search the inventory through its existing owner.

Why This Change Was Made

Use the existing TanStack virtual-core owner and page scroller, with measured heights and stable job keys. Filtering replaces the window's data source. Native Tab materializes the next row ahead, and focusing a distant row scrolls it into view as estimated heights settle. The existing menu's CSS anchors own positioning; no new synchronous menu measurement or per-row containment is introduced. Native focus synchronizes the virtualizer's scroll offset before pinning, so a scroll whose event has not arrived cannot trigger a second jump.

The 500-job structural probe falls from 500 rows / 22,008 elements to 20 rows / 889 elements on desktop and 8 rows / 361 elements on mobile. The whole-inventory Solid projection is removed; only materialized rows have keyed rendering lifetimes.

Evidence

Final head: 050531a08f7c4726af377831eaece5d6e235589b (test-only pagination repair; production measurement head 401d84ccf6209b1192cbf6cd022e391c67eed8c9); merge base: e1cd21501dd59366fefc3ff8263d97eeacdc799e. Production source was checked against the emitted source map before measurement. Headless, synthetic Gateway, same machine, 20 serial base/head/base pairs for every action/engine/viewport. Times are input-to-last-commit application elapsed milliseconds; paired changes compare the head against the geometric mean of its two controls. These are not CPU measurements.

Action View Engine N Base median / p95 Head median / p95 Paired change A/A change
cron-menu-open desktop chromium 20 56.2 / 139.3 52.6 / 62.2 -9.9% +3.4%
cron-menu-open desktop webkit 20 77.5 / 119.0 21.0 / 26.0 -68.4% +2.3%
cron-menu-open mobile chromium 20 58.3 / 130.9 48.6 / 117.7 -16.2% -1.6%
cron-menu-open mobile webkit 20 43.0 / 82.6 21.0 / 27.0 -63.2% +10.6%
cron-open desktop chromium 20 44.9 / 47.1 32.4 / 44.5 -27.9% -0.5%
cron-open desktop webkit 20 104.0 / 112.8 81.0 / 85.0 -21.5% +0.0%
cron-open mobile chromium 20 44.5 / 64.0 27.7 / 62.4 -37.4% +4.4%
cron-open mobile webkit 20 105.0 / 111.2 48.0 / 77.1 -54.4% -0.5%
cron-search desktop chromium 20 24.2 / 25.8 4.0 / 16.9 -83.4% -0.4%
cron-search desktop webkit 20 87.0 / 94.4 8.0 / 9.0 -89.5% -12.3%
cron-search mobile chromium 20 27.9 / 29.7 3.6 / 4.6 -87.5% +0.9%
cron-search mobile webkit 20 76.0 / 85.1 7.0 / 9.0 -91.0% +0.6%
cron-search-typing desktop chromium 20 73.3 / 113.1 55.9 / 96.1 -29.3% -0.8%
cron-search-typing desktop webkit 20 196.0 / 227.4 127.5 / 138.1 -34.9% -2.8%
cron-search-typing mobile chromium 20 66.6 / 70.1 39.9 / 47.4 -40.6% +0.5%
cron-search-typing mobile webkit 20 201.0 / 214.1 106.0 / 114.2 -47.9% +1.0%
Action View Head WebKit / Chromium
cron-menu-open desktop 0.40x
cron-menu-open mobile 0.43x
cron-open desktop 2.50x
cron-open mobile 1.73x
cron-search desktop 2.00x
cron-search mobile 1.94x
cron-search-typing desktop 2.28x
cron-search-typing mobile 2.65x

Observations: 960 failed: 0
Host load min / median / max: 19.1826171875 28.57861328125 41.38427734375

Every application median and p95 improves in both engines. The ≤1.3× engine-ratio target is met for menu opening. Search now takes 3.6–8 ms, while route opening and compound typing retain the ratios above; they are documented remaining costs, not a claim that the ratio target was universally reached. A/A control movement is disclosed above; no noisy cell is used to excuse a regression.

WebKit Timeline attribution

One separate traced base/head pair per action and viewport; tracing adds overhead, so these numbers explain work and do not replace the untraced timing table. Disjoint elapsed categories are clipped to the same input-to-commit interval. Script/native excludes nested style/layout/paint. Uncovered time is not labeled CPU or assumed to be application work.

Head trace Total Script/native Style Layout Paint Uncovered
Desktop menu 25.0 15.9 2.0 0.5 0.0 6.6
Mobile menu 25.0 15.2 2.1 0.6 1.0 6.1
Desktop search 10.0 7.4 0.9 0.7 0.0 1.0
Mobile search 8.0 5.5 0.9 1.3 0.0 0.3
Desktop open 106.0 31.5 36.2 9.6 1.5 27.2
Mobile open 77.0 30.9 29.2 11.7 0.0 5.3
Desktop typing 159.0 74.8 39.0 15.9 4.1 25.2
Mobile typing 143.0 63.0 33.0 19.5 2.6 24.9

Source-mapped Timeline stacks attribute the remaining open cost to the list's scroll-margin read (view-list.tsx:393), TanStack's first measured row height (view-list.tsx:439, virtual-core's measureElement), and the existing panel scroll in cron-page-state.ts:379. In the desktop trace the first two style flushes cost 22.5 and 13.7 ms; the visible window still needs initial geometry for variable-height rows. This is the remaining measured layout cost with windowing in place, not an asserted irreducible engine floor. No row containment or relational-selector workaround is added.

The desktop/mobile typing traces span 154/137 ms between first and last input; the last input commits in 5/6 ms. The headline intentionally retains the delivery gaps between the sequence's keystrokes. WebKit stack-sample timestamps are mostly zero in this build, so sample counts are used only to locate source, not for timed attribution; Timeline and ScriptProfiler intervals supply the elapsed breakdown.

Check Result
UI typecheck Pass on final production source
Cron view and reactivity tests 18 passed; final reactivity follow-up 8 passed
Controller guard, scoped lint, production Knip Pass
Native keyboard, menu return, row 500 visible Pass in both engines/viewports; WebKit uses native Option+Tab. Committed bundled E2E file: 3 passed (4.06 s test time, 19.64 s wrapper wall time) after repairing pagination fixtures
Production build and strict performance Pass; base/head startup JS 89,068 / 89,084 B gzip (+16 B, within 64 B variance); 3 JS requests; CSS 33,568 B and 1 request unchanged
Independent review and simplify Autoreview P0–P2: clean implementation review plus focused follow-ups; redundant speculative focus restoration removed

The first full CI run (41181290807) found two new Cron E2E setup failures: the fixture returned 500 jobs in a page declaring a limit of 50. The corrected fixture uses valid 50-job full/compact pages and exercises Load more through native Enter before keyboard assertions. No production code changed in that repair. Fresh full CI run 41182365388 passed on the replacement head; no inherited-failure exception is used. The same run also failed Control UI mocked Gateway E2E > commits a streamed delta burst in frame-bound transcript batches at chat-stream-runtime-budgets.e2e.test.ts:562; scheduled merge-base run 41176844002 fails the exact same test at the same 30-second menu-warmup wait.

The benchmark's pagination setup uses Enter on Load more: asynchronous row measurement can move the footer between pointer down/up in WebKit. Preparation remains outside the measured action and identical for both bundles. The native scroll synchronization prevents a stale offset from causing a second scroll when a row receives focus.

Production view LOC: 489 → 666 (+177). Tests: 504 → 589 (+85). Benchmark consumers: 3,189 → 3,205 (+16). New code owns virtual geometry and keyboard retention; no dependency or authoritative Cron-state change. Refactor checklist: effects, render effects, untrack, native listeners, DOM queries, flush, owner APIs, cleanup registrations all remain zero; whole-list projection 1 → 0, layout measurements 0 → 2.

Reproduction

Run the existing engines harness against separately built base and head bundles. The final workload was split into --steps cron-menu-open and --steps cron-search,cron-open,cron-search-typing, with identical options:

node --import ./scripts/tsx.mjs scripts/bench-control-ui-engines.ts \
  --bundle-dir <base-bundle> --compare-bundle-dir <head-bundle> \
  --control-bundle-dir <base-bundle> \
  --steps <selection-above> --viewport both --engines chromium,webkit --pairs 20

The attribution run uses both bundles, --engines webkit --pairs 1 --trace, and all four steps. Bundles and traces remain local artifacts, not committed source.

Synthetic desktop captures, inspected locally:

Before: Automations list

After: windowed Automations list

Before: mobile automation menu

After: windowed mobile automation menu

@clawsweeper

clawsweeper Bot commented Oct 31, 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 added the ci:full Keep ordinary native-locale CI selection on the next PR run. label Oct 31, 2026
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui scripts Repository scripts size: M labels Oct 31, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:feature 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:feature Preliminary submission classification; full source review pending. labels Oct 31, 2026
@clawsweeper

clawsweeper Bot commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR windows large Automations lists while retaining inventory search, native controls, and accessible list positions.

Example: A desktop user loads 500 automation jobs.

  • Before: All 500 job rows remain mounted.
  • After: The visible window, nearby rows, and keyboard entry targets remain mounted while search still covers the inventory.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) Useful, focused optimization with a concrete pointer-focus defect and unfinished performance qualification.
Proof confidence 🦪 silver shellfish (2/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🦪 silver shellfish (2/6) 1 actionable review finding remain.

Product

Kind: Performance · Worth it: Yes · Fix scope: Complete
User problem: Large loaded automation inventories make search, menu opening, and navigation expensive, especially in WebKit.
Reason: The direction is owner-approved and removes unnecessary mounted content; the body explicitly records the browser-find tradeoff while preserving inventory search.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep this PR open: it addresses a remaining rendering bottleneck, but the new focus handler can disrupt pointer activation of partially visible mobile rows.

Priority: P2
Reviewed head: 401d84ccf6209b1192cbf6cd022e391c67eed8c9

Before merge

  • Avoid scrolling the whole card during pointer-induced focus (P2) - With more than 20 jobs on mobile, scroll until a card's top is above the scrollport while its Run or toggle control remains visible, then click that control before this row has focus. focusin calls scrollToIndex synchronously; virtual-core's default auto alignment scrolls the entire card to its start because item.start precedes the current offset. The visible control moves between pointer down and mouseup, so the intended action can be lost or the row's open-task handler can receive the resulting click. Preserve focus pinning, but avoid whole-row reveal for an already-visible pointer target. Add a mobile pointer regression alongside the keyboard coverage.

Findings

  • [P2] Avoid scrolling the whole card during pointer-induced focus — ui/src/pages/cron/view-list.tsx:471-472

Tests

  • Missing end-to-end proof: Supply the completed paired performance results and browser evidence for native pointer activation during row measurement; a recorded base-failing/head-passing run of the added regression was not supplied.
Agent review details

How this fits together

The Control UI receives Cron-owned job snapshots and action callbacks; the changed renderer selects mounted rows and supplies their geometry without changing Gateway request or mutation ownership.

flowchart TD
  A[Gateway Cron inventory] --> B[Cron state and presentation]
  B --> C[Sorted job snapshot]
  C --> D[Virtual row window]
  E[Page scroll and focus] --> D
  D --> F[Native job controls]
  F --> B
Loading

Technical review

Best possible solution:

Keep the existing virtualizer and Cron owners, but preserve pointer targets during focus while retaining keyboard reveal and measured-height correction.

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

Source inspection establishes that current main mounts every loaded job and that the PR reveals an entire row during pointer-induced focus; the latter was not executed in a browser during this read-only review.

Is this the best way to solve the issue?

Windowing through the existing virtual-core and layout-measurement owners is appropriate, but whole-card reveal must not move an already-visible pointer target before its click completes.

Full review comments:

  • [P2] Avoid scrolling the whole card during pointer-induced focus — ui/src/pages/cron/view-list.tsx:471-472
    With more than 20 jobs on mobile, scroll until a card's top is above the scrollport while its Run or toggle control remains visible, then click that control before this row has focus. focusin calls scrollToIndex synchronously; virtual-core's default auto alignment scrolls the entire card to its start because item.start precedes the current offset. The visible control moves between pointer down and mouseup, so the intended action can be lost or the row's open-task handler can receive the resulting click. Preserve focus pinning, but avoid whole-row reveal for an already-visible pointer target. Add a mobile pointer regression alongside the keyboard coverage.
    Confidence: 0.88

Overall correctness: patch is incorrect
Overall confidence: 0.86

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Whole-inventory keyed projection changes intended behavior with a stated reason (60f9f3a: The Solid async reference retained keyed rows and kept Gateway request and mutation authority with the existing owner.)
  • Filter isolation and live action callbacks keeps the original intent (0d1d261: improve: keep large automation searches responsive #181599 prevents query publications from rescanning retained rows while preserving current callbacks.)
  • Accessible independent row controls keeps the original intent (7085604: fix(ui): make Automations task rows accessible #127252 removed unsupported table semantics and nested interactive row semantics; the PR retains independent buttons and adds a list owner for listitem roles.)
  • Benchmark inventory cardinality changes intended behavior with a stated reason (fdf6d47: Earlier performance scenarios asserted equal retained inventory and request work; the PR distinguishes loaded cardinality from mounted rows to retain comparable workloads.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

Acceptance criteria:

  • pnpm test:ui:e2e ui/src/e2e/cron-search.e2e.test.ts ui/src/e2e/cron-remove.e2e.test.ts
  • pnpm --dir ui test src/pages/cron/view-reactivity.test.tsx src/pages/cron/view.test.ts
  • pnpm tsgo:ui
  • git diff --check
  • Verify native pointer activation and keyboard traversal in Chromium and WebKit at mobile size.

What I checked:

  • Exact introduced change: The pinned introduction diff replaces full-inventory rendering with JobRows and adds unconditional row-level scrollToIndex on first focus within each row. (ui/src/pages/cron/view-list.tsx:472, 401d84ccf620)
  • Pointer focus reaches whole-row reveal: JobRow forwards every bubbling focusin event to the new focus handler; mobile CSS places action controls below the name and schedule, allowing visible controls in a card whose top is outside the viewport. (ui/src/pages/cron/view-list.tsx:544, 401d84ccf620)
  • Pinned dependency confirms reveal behavior: The target imports virtual-core 3.19.2. Its published source defaults scrollToIndex to auto alignment, aligns a row whose start precedes the current offset to the viewport start, and calls elementScroll synchronously. This confirms that focusing an already-visible control can move its entire card. (packages/virtual-core/src/index.ts:2058)
  • Current main and feature history: Fetched main retains the full-list projection and renderer. History through the earlier view-list.ts name identifies Peter Steinberger's Solid migration, keyed projection work, filter isolation, and recent row-rendering optimization. (ui/src/pages/cron/view-list.tsx:279, cd3e054c9a46)
  • Inspected proof and discussion: The full body and both comments were read. Both downloaded desktop screenshots preserve the visible layout; the body reports structural reductions and keyboard checks while explicitly leaving final paired performance qualification unfinished. (401d84ccf620)
  • Policy and inspection limits: Root, UI, and scripts policies were applied, including the simplification and test-value review. No maintainer-notes directory or installed Solid cheatsheet exists in this checkout; an older-history read reported lazy fetching disabled. No target code or tests were executed, and the checkout remains clean. (AGENTS.md, 401d84ccf620)

PR surface

Source +177, Tests +67, Other +16. Total +260 across 6 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 207 30 +177
Tests 3 73 6 +67
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 30 14 +16
Total 6 310 50 +260

Review metrics

Metric Value Why it matters
Production versus test growth Renderer net +177 lines; tests net +67 lines Measured geometry and keyboard retention explain the renderer growth; the full-inventory projection is removed rather than retained as a competing renderer.

Labels

Label changes:

  • add P2: The optimization has clear value for large inventories, and the introduced pointer defect affects a bounded mobile interaction.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish 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: The optimization has clear value for large inventories, and the introduced pointer defect affects a bounded mobile interaction.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish 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 31, 2026, 3:11 AM ET / 07:11 UTC.

@steipete
steipete marked this pull request as ready for review October 31, 2026 07:36
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 31, 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-31T07:55:52.437679Z 050531a 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 enabled auto-merge (squash) October 31, 2026 07:38
@steipete
steipete disabled auto-merge October 31, 2026 07:50
@steipete
steipete merged commit db59290 into main Oct 31, 2026
124 of 126 checks passed
@steipete
steipete deleted the solid2/w-webkit-cron-window-1030 branch October 31, 2026 08:06
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 1, 2026
* perf(ui): window the Cron job inventory

* test(ui): clarify loaded Cron count in benchmark

* fix(ui): retain focus across Cron window measurements

* refactor(ui): keep cron focus on native keyboard behavior

* test(ui): prepare Cron benchmarks with keyboard pagination

* fix(ui): synchronize native scroll before Cron focus

* test(ui): paginate Cron windowing fixtures
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. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. scripts Repository scripts 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