Repository navigation
perf(ui): window large automation job lists - #189149
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 changes before merge. What this changesThis PR windows large Automations lists while retaining inventory search, native controls, and accessible list positions. Example: A desktop user loads 500 automation jobs.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete 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 Before merge
Findings
Tests
Agent review detailsHow this fits togetherThe 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
Technical reviewBest 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:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against cd3e054c9a46. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceAcceptance criteria:
What I checked:
PR surfaceSource +177, Tests +67, Other +16. Total +260 across 6 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
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 31, 2026, 3:11 AM ET / 07:11 UTC. |
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. |
|
Merged via squash.
|
* 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
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 head401d84ccf6209b1192cbf6cd022e391c67eed8c9); 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.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.
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'smeasureElement), and the existing panel scroll incron-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.
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 failedControl UI mocked Gateway E2E > commits a streamed delta burst in frame-bound transcript batchesatchat-stream-runtime-budgets.e2e.test.ts:562; scheduled merge-base run41176844002fails 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-openand--steps cron-search,cron-open,cron-search-typing, with identical options: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: