Skip to content

improve(ui): speed up large Sessions tables with windowed rows - #189279

Merged
steipete merged 3 commits into
mainfrom
solid2/w-webkit-sessions-2-1031
Oct 31, 2026
Merged

steipete merged 3 commits into
mainfrom
solid2/w-webkit-sessions-2-1031

Conversation

@steipete

@steipete steipete commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Sorting a large Sessions page replaces the server page and creates every row. On the 100-row fixture, WebKit spent almost twice Chromium's application time on this action.

User Impact

Large Sessions pages mount only the rows near the viewport. Page-wide selection, grouped rows, native keyboard navigation, open menus, and expanded drafts retain their existing behavior. Pages of 25 entries or fewer keep the cheaper unwindowed path.

Why This Change Was Made

Reuse the existing TanStack virtualizer used by Cron in #189149. Estimated heights avoid synchronous first-paint measurement. Lightweight table-body slots stay stable so changing the visible range cannot detach a focused row; focus neighbors, first/last data rows, expanded details, and menu owners stay mounted. Collapsing an offscreen details panel retires its cached expanded height before the row unmounts.

No dependency, domain-owner, public API, or startup-import changes. The one-row-per-body table separator preserves the existing last-row border. Native ARIA row indexes/counts describe the complete logical page, including groups and expanded details.

Evidence

Performance

Same-machine production HTTP bundles, synthetic Gateway, desktop 1440×1000 and mobile 390×844. Twenty interleaved base/head/base triplets per action/engine/viewport: 1,200 observations, zero scenario failures. Application is first native input to last observed DOM commit; driver prefix and total wall time remain separate. Typing includes driver gaps between inputs. This does not measure real Gateway/provider latency or input-to-paint.

Acceptance: application median regression ≤5% and p95 no worse, or ten additional pairs to confirm; A/A, profiler phases, and structural counts distinguish host noise. An attributable >20% regression blocks. The shared 32-core Mac was loaded; host load is retained in each observation (1-minute load 15.3–42.0).

Base: 96ceb4856c20cccaa35060cf18f1eff7e1ae6c2a. Candidate source: b6c2004e3f3 (production source matches the measured final bundle).

Application milliseconds; parentheses contain p95:

Viewport/action Chromium ms base → head (p95) WebKit ms base → head (p95) W/C app W/C driver W/C wall A/A app C / W
desktop/sessions-sort 7.15 → 3.60 (7.90 → 4.10) 14.00 → 6.00 (16.00 → 8.00) 1.67× 1.11× 1.81× 1.007× / 1.000×
desktop/sessions-refresh 73.90 → 70.35 (110.50 → 81.70) 93.00 → 66.00 (144.00 → 77.00) 0.94× 1.17× 1.00× 0.994× / 1.032×
desktop/sessions-open 31.40 → 31.10 (33.30 → 32.60) 38.50 → 40.00 (41.00 → 42.00) 1.29× 1.08× 1.18× 1.000× / 0.987×
desktop/sessions-search 247.30 → 259.85 (269.10 → 278.40) 313.00 → 305.50 (322.00 → 319.00) 1.18× 1.08× 1.16× 1.002× / 0.997×
desktop/session-palette-filter 269.70 → 271.80 (295.10 → 308.90) 343.50 → 339.50 (390.00 → 346.00) 1.25× 1.11× 1.23× 1.004× / 0.993×
mobile/sessions-sort 7.50 → 3.90 (8.20 → 4.20) 14.00 → 6.00 (15.00 → 7.00) 1.54× 1.07× 1.57× 1.013× / 1.000×
mobile/sessions-refresh 64.85 → 67.10 (68.90 → 82.60) 62.00 → 56.00 (72.00 → 69.00) 0.83× 1.08× 0.91× 1.008× / 1.016×
mobile/sessions-open 23.65 → 24.60 (26.30 → 29.90) 65.00 → 66.00 (71.00 → 70.00) 2.68× 1.07× 1.24× 1.013× / 0.969×
mobile/sessions-search 254.15 → 258.45 (283.70 → 314.90) 321.00 → 313.00 (365.00 → 339.00) 1.21× 1.14× 1.18× 0.997× / 0.998×
mobile/session-palette-filter 266.60 → 267.00 (304.50 → 293.10) 335.00 → 330.50 (362.00 → 354.00) 1.24× 1.25× 1.23× 0.999× / 0.999×

Sort application time improves 57% in WebKit and 48–50% in Chromium. Chromium renderer task CPU falls 34.10→15.04 ms desktop and 31.66→13.85 ms mobile; style and layout both fall substantially. The remaining 1.67×/1.54× sort ratios miss the 1.3× target; final Timeline attribution follows below.

Confirmation and limits

Six flagged cells received ten further interleaved base/head/base triplets (180 more observations, zero failures). Every paired median change is within 5%; tails and work counters remain disclosed below.

Confirmation cell (10 pairs + A/A) Base app median (p95) Head A/A Median paired change
desktop / session-palette-filter / chromium 277.20 (345.20) 275.95 (297.70) 271.70 (302.70) -1.88%
desktop / sessions-open / webkit 41.00 (45.00) 41.50 (45.00) 42.00 (49.00) +0.00%
desktop / sessions-search / chromium 249.20 (304.60) 252.70 (363.30) 246.95 (295.70) +2.10%
mobile / sessions-open / chromium 24.20 (62.80) 25.75 (35.30) 23.10 (39.70) +0.42%
mobile / sessions-refresh / chromium 64.60 (75.50) 68.45 (82.70) 64.85 (70.60) +4.08%
mobile / sessions-search / chromium 246.60 (289.50) 248.40 (293.50) 244.15 (250.50) +1.45%

The desktop-search confirmation's 363.3 ms head outlier spent 156.3 ms delivering the input sequence, versus 53 ms in an ordinary 259.5 ms head sample. Last-input-to-commit stayed 207.0 vs 206.5 ms. Across all 30 pairs, search application p95 is 304.6→296.3 ms desktop; mobile post-input p95 is 210.5→210.4 ms. The mobile search headline tail remains 289.5→314.9 ms because it includes delivery gaps. These tails do not establish slower post-input rendering.

Mobile refresh's combined 30-pair p95 is 70.9→82.7 ms, with A/A 89.5 ms. Renderer task CPU falls 42.45→34.41 ms; its p95 falls 44.30→36.20 ms. The elapsed tail is noisy, not an observed increase in work. Mobile open's combined task median is 38.95→38.93 ms and its p95 is 45.82→41.47 ms; application p95 is 56.8→30.5 ms. Desktop search does add about 3.7 ms renderer task time (56.24→59.97 ms), chiefly layout from stable table sections, while its application median stays +2.4% and p95 improves. This small cost preserves native focus and is not presented as an all-metrics win.

The primary mobile-open WebKit/Chromium ratio is 2.68× (66 ms vs 24.6 ms), with WebKit already 65 ms on the base. The final profile below distinguishes that pre-existing engine/viewport floor from this change.

Final Timeline attribution

A separate traced base/head run covered sort and open in both viewports/engines (16 observations, all passed). WebKit Timeline ranges are clipped to native input→last commit; sample timestamps are restricted to that interval. These single profiles explain work, not the untraced improvement percentage.

Sort's remaining application interval is 8 ms desktop / 7 ms mobile, including about 6.5 ms script in each. Source maps identify the existing Sessions view/row creation, session-key parsing, native removal/insertion, and virtualizer publication. Almost all style/layout follows the last commit: the largest desktop style/layout events shrink 32.0/13.2→8.0/3.1 ms; mobile 37.0/19.5→7.7/3.1 ms. The remaining work creates the visible rows and maintains logical row slots/focus. The 1.67×/1.54× untraced ratios are a small absolute engine/DOM floor after removing the full-page row cost; this closes the requested Sessions sort pass rather than introducing another rendering architecture.

Opening retains the 25-row path in both builds. The mobile head trace includes route creation, focus (app-shell-chrome.ts), style/layout, and a later shared layout-frame callback; it spans 82 ms while that one base trace spans 40 ms. Untraced 20-pair medians are 65→66 ms, so that single trace is not evidence of a new regression or a fixed 82 ms cost. The high mobile cross-engine ratio remains an existing route/focus/layout/scheduling floor, not the former 100-row sort bottleneck. No WebKit cpuMs was used.

Commands use scripts/bench-control-ui-engines.ts --bundle-dir <base> --compare-bundle-dir <head> --control-bundle-dir <base> --steps sessions-sort,sessions-refresh,sessions-open,sessions-search,session-palette-filter --pairs 20 --viewport both; open and the other four actions ran serially in separate batches. Confirmations restrict that same command to the six cells above with --pairs 10. Profiles use --trace --pairs 1 --steps sessions-sort,sessions-open and omit the control. Checks use pnpm tsgo:ui, focused pnpm --dir ui test ... --maxWorkers=1, scoped formatter/lint/controller checks, production Knip, and pnpm ui:build plus the strict performance checker against the base bundle. Reports, raw observations, source maps, and traces remain in the lane's untracked .artifacts/sessions-window/.

CI follow-up

The first full run, 41191766134, passed 41 jobs and failed two jobs. The two failing session goals cases counted the hidden spacer as a data row. Commit cd5eb078117 updates those assertions to the real data/details row classes and also corrects a lifecycle test that otherwise observed the spacer instead of the retained session row. Both touched files pass: 12 tests. Independent review found no actionable P0–P2 findings. Production source and all performance measurements are unchanged.

The other failure was Browser sign-in recovery > recovers redirected images with interactive renewal and service workers allow: a 30-second wait for its popup timed out. It was not classified as inherited. The replacement full run 41192821518, attempt 1, passed all 44 executed jobs (24 skipped), including the sign-in recovery test and the corrected goal-detail tests. Auto-merge was cancelled through native recovery before the push; the reviewed replacement uses the native recovery path with this exact-head green result. No CI failures are waived.

Correctness and budgets

Proof Result
Sessions view tests 38 passed
Desktop/mobile native focus, grouping, draft retention, full-page selection 2 passed; fewer than 25 heavy rows for a 100-row page
Offscreen expanded-height regression Reproduced red in both viewports, fixed and green
UI typecheck; focused lint/format; controller guard Passed
Production Knip Passed
Full CI, exact replacement head 41192821518: 44 jobs passed; 24 skipped
Independent review No actionable P0–P2 findings after fixes
Build and strict same-machine base/head performance Passed: startup JS 89,087→89,081 B gzip, CSS 33,568→33,572 B gzip, 1 CSS request; zero strict-comparison violations

Standalone builds report the pre-existing total raw CSS ceiling warning. This change adds 11 raw CSS bytes / 4 gzip bytes, within build variance; the strict base/head comparison passes. No budget baseline was changed.

The existing native label-undo test also fails on the exact base: retains native label selection and undo without value writes during row metadata refreshes expects Original after Control+Z but gets Originalx on this Mac. The new native browser cases pass. This local failure remains disclosed; CI is the broad proof.

Production UI LOC across the page, row, and new window owner: 1,099→1,378 (+279). Native regression tests add 129 lines. The window owner contains the estimated geometry, range lifetime, and keyboard retention logic. The Solid refactor census is zero before/after for rendering controllers, direct effects/render effects, untrack, DOM queries, direct listeners, flush, owner APIs, and onCleanup. Reports/traces are not committed.

Inspected synthetic screenshots

Desktop, before:

Desktop before

Desktop, after:

Desktop after

Mobile, before:

Mobile before

Mobile, after:

Mobile after

@steipete steipete added the ci:full Keep ordinary native-locale CI selection on the next PR run. label Oct 31, 2026
@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 in progress

ClawSweeper is reviewing this revision. This supersedes any previous blocked status.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui scripts Repository scripts labels Oct 31, 2026
@steipete
steipete marked this pull request as ready for review October 31, 2026 10:11
@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-31T10:14:51.193193Z b6c2004 Draft marked ready
ℹ️ 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 10:18
@clawsweeper clawsweeper Bot added the clawsweeper:intake:feature Preliminary submission classification; full source review pending. label Oct 31, 2026
@steipete
steipete disabled auto-merge October 31, 2026 10:26
@steipete
steipete merged commit b959345 into main Oct 31, 2026
124 of 126 checks passed
@steipete
steipete deleted the solid2/w-webkit-sessions-2-1031 branch October 31, 2026 10:48
@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
…law#189279)

* perf: window large Sessions pages while preserving native focus

* perf: avoid redundant Sessions geometry and retire collapsed sizes

* test(ui): target logical Sessions rows in retained view checks
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. clawsweeper:intake:feature Preliminary submission classification; full source review pending. scripts Repository scripts size: L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant