Repository navigation
improve(ui): speed up large Sessions tables with windowed rows - #189279
Merged
Merged
Conversation
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review in progressClawSweeper is reviewing this revision. This supersedes any previous blocked status. |
Contributor
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. |
steipete
enabled auto-merge (squash)
October 31, 2026 10:18
steipete
disabled auto-merge
October 31, 2026 10:26
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
This was referenced Nov 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
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.
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 WebKitcpuMswas 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-openand omit the control. Checks usepnpm tsgo:ui, focusedpnpm --dir ui test ... --maxWorkers=1, scoped formatter/lint/controller checks, production Knip, andpnpm ui:buildplus 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 goalscases counted the hidden spacer as a data row. Commitcd5eb078117updates 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
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 refreshesexpectsOriginalafter Control+Z but getsOriginalxon 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, after:
Mobile, before:
Mobile, after: