Skip to content

perf(ui): narrow sibling spacing invalidation - #180964

Merged
steipete merged 4 commits into
mainfrom
solid2/w-perf-shell-viewport
Oct 22, 2026
Merged

steipete merged 4 commits into
mainfrom
solid2/w-perf-shell-viewport

Conversation

@steipete

@steipete steipete commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Opening a Cron row menu in a 500-job inventory inserts/removes body-level tooltip and menu nodes. Chromium's invalidation trace names the universal adjacent-sibling spacing rules as the reason the whole body subtree is restyled twice.

Candidate: preserve the same element-child spacing and specificity using :where(:not(:first-child)). Keep rendering, overlay ownership, and all class names unchanged.

Before accepting: production renderer, synthetic Gateway with the existing session-list owner, 500 loaded jobs, desktop 1440×1000 and mobile 390×844. At least 10 serial interleaved baseline/candidate pairs for cron-menu-open; review script/task/layout/style/automation-to-assertion median, p95, min, max. Any >20% regression rejects the candidate. Record zero interval RPCs, source-mapped diagnostic traces, and inspected before/after screenshots. Compare exact-source builds on this host; no boot-surface increase beyond 64 B build variance. Follow with a report-only probe in the existing Cron E2E file if accepted.

The benchmark correction removes bogus dashboard pages, honors session filters and pagination, and loads the sidebar's 1,000-row inventory through its existing Load more control. Earlier route-opening census figures are superseded, not performance wins.

Results

Ten serial interleaved pairs per viewport (40/40 visible outcomes pass), Chromium 156, macOS arm64. Zero interval RPCs. Values are median / p95 / min–max, milliseconds; all 40 time-statistic comparisons satisfy the 20% rule. No trace/profiler overhead in these pairs.

Viewport / metric Base Candidate
desktop / scriptMs 12.60 / 13.38 / 10.41–13.38 12.01 / 13.63 / 9.74–13.63
desktop / taskMs 329.28 / 360.30 / 302.92–360.30 120.63 / 131.86 / 111.34–131.86
desktop / layoutMs 4.65 / 6.84 / 3.51–6.84 4.80 / 5.32 / 4.15–5.32
desktop / styleMs 212.72 / 227.14 / 204.34–227.14 10.52 / 11.59 / 9.37–11.59
desktop / wallMs 388.53 / 418.09 / 349.10–418.09 183.33 / 215.17 / 170.93–215.17
mobile / scriptMs 12.17 / 13.32 / 10.62–13.32 11.30 / 12.57 / 9.78–12.57
mobile / taskMs 219.23 / 229.64 / 204.78–229.64 101.85 / 113.05 / 93.55–113.05
mobile / layoutMs 4.81 / 5.71 / 4.36–5.71 4.28 / 5.02 / 3.21–5.02
mobile / styleMs 126.32 / 129.14 / 118.04–129.14 9.09 / 10.31 / 7.63–10.31
mobile / wallMs 284.62 / 294.32 / 260.75–294.32 161.81 / 179.11 / 146.21–179.11

The universal adjacent-sibling rules produced body-wide invalidations; two span-sibling rules retained broad span invalidations. Child-position selectors keep spacing while eliminating those false dependencies. The two span rules rely on current span-only renderer children; their type specificity drops by one and has no competing declaration. No host, class, rendering, or overlay-ownership change.

Strict immutable-bundle comparison: startup JS 316,237 → 316,246 B (+9 B), CSS 41,124 → 41,128 B (+4 B). Startup remains 7 JS requests and 1 CSS request. All boot-surface deltas remain within 64 B; the final merged-base build check is recorded below.

Four inspected synthetic-only screenshots show unchanged desktop/mobile spacing and menu placement. Existing Cron E2E gains a report-only menu-open probe with visible open/close assertions. The harness reuses the paginated session-list owner rather than returning ordinary chats as dashboard pages, and makes detailed invalidation tracing opt-in. Production code adds only two explanatory CSS comments; no new runtime state or abstraction.

Corrected ranked census

28/28 production-renderer outcomes passed. One diagnostic sample per cell after the first three spacing-selector changes, before the final two span-selector changes; CDP trace plus 1 ms CPU profiling overhead included. Nested intervals overlap. The 10-pair untraced distributions above decide acceptance, not this ranking. Desktop 1440×1000; mobile 390×844. Session list owner now honors dashboard and pagination queries. Route opening uses its default window, while sort/search uses the explicitly expanded 1,000-row result.

Viewport / step Busy ms Script ms Layout ms Style ms Long tasks Longest ms
mobile / cron-search-typing 959.7 621.2 26.4 19.8 4 139.8
desktop / cron-search-typing 911.6 553.5 27.7 62.5 4 123.8
desktop / sidebar-toggle 442.5 330.9 109.7 74.5 0 37.6
desktop / model-picker-open-search 377.9 164.9 31.0 118.8 2 102.6
mobile / model-picker-open-search 349.2 152.3 28.1 127.1 2 97.7
mobile / session-switch 293.9 183.6 1.4 70.2 0 44.3
mobile / settings-sections 256.1 69.6 12.6 75.4 0 41.3
desktop / cron-menu-open 249.5 72.0 21.4 98.2 1 75.3
desktop / cron-search 220.2 145.5 10.6 45.9 1 70.7
desktop / session-switch 201.3 153.8 25.4 24.3 0 49.4
mobile / cron-menu-open 172.1 73.8 12.3 58.8 1 80.1
desktop / session-palette-filter 160.5 92.0 16.6 15.0 0 32.6
mobile / session-palette-filter 157.5 96.7 14.9 14.1 0 28.8
mobile / cron-search 140.8 87.6 2.9 1.5 1 64.6
desktop / settings-sections 139.2 47.4 4.9 37.5 0 41.4
desktop / settings-open 130.6 54.7 9.0 24.9 1 52.4
mobile / settings-open 124.6 70.8 6.5 38.8 1 72.1
mobile / cron-open 101.3 48.9 6.4 22.3 0 27.6
mobile / sidebar-toggle 97.9 45.6 0.0 29.0 0 29.0
mobile / transcript-scroll-top 91.6 41.7 0.6 9.6 1 65.4
desktop / transcript-scroll-top 89.1 41.9 0.8 8.0 1 64.3
desktop / cron-open 86.2 41.3 4.3 15.7 0 25.5
desktop / sessions-search 61.6 16.1 9.6 8.2 0 6.4
mobile / sessions-search 58.9 16.6 8.9 9.2 0 7.3
mobile / sessions-open 55.1 27.8 2.8 13.2 0 19.8
desktop / sessions-sort 50.5 17.3 3.6 10.0 0 31.8
desktop / sessions-open 48.5 27.2 2.3 8.3 0 15.4
mobile / sessions-sort 46.9 16.7 3.4 10.3 0 31.3

Sessions/Cron opening has no remaining long task with the corrected fixture. Desktop sidebar layout work comes from 59 layouts during its existing grid-width animation; the trace reports no forced synchronous layout. Session switching has no long task in either viewport in this census. Cron typing remains the next rendering owner to investigate, separately from variable request coalescing.

Evidence

Integrated #180889 and current main (fdf6d47e645) with Git merge. Source changes remain eight focused files; no baseline, dependency, route, tag, or class-name changes.

Check Result
Production builds on merge base and candidate, same Mac / Node 26.12.1 Pass
Strict performance check on both builds Pass; no violations
Startup JS gzip / requests 316,030 → 316,029 B; 7 → 7
Startup CSS gzip / requests 41,141 → 41,145 B; 1 → 1
Chat boot JS gzip / requests 1,422,063 → 1,421,995 B; 25 → 25
New Session JS gzip / requests 963,275 → 963,261 B; 20 → 20
UI and scripts typechecks Pass
CSS lint, changed-file format, diff check Pass
Independent Codex autoreview, P0–P2 No actionable findings
Existing Cron E2E report-only menu probe Broad proof delegated to ci:full; no local E2E suite

Production LOC across the five CSS files: 8,805 → 8,807 (+2 explanatory comments). All changed files: 9,962 → 10,009 (+47); +91/−44 diff lines. Existing renderers supply the spacing contract; no new owner or runtime state.

Reproduction: build both revisions with pnpm ui:build; run scripts/bench-control-ui-interactions.ts --bundle-dir <base> --compare-bundle-dir <head> --steps cron-menu-open --pairs 10. Diagnostic attribution additionally uses --trace --invalidation-tracking; those overhead-bearing intervals do not decide acceptance. Both strict reports use scripts/check-control-ui-performance.mts --dist <bundle>, adding --base-dist <base> for the head.

Inspected synthetic before/after screenshots are embedded in the linked proof comment.

Production Knip reports 13 unused-export groups and 11 exported-type groups. The exact same command on merge base fdf6d47e645 produces byte-identical output, including resolveConfiguredCronModelSuggestions and the approval presentation exports. No ignores or out-of-scope removals were added. This is retained as an investigated local failure.

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

clawsweeper Bot commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 22, 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-22T20:40:54.584838Z 7862972 PR opened
ℹ️ 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.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui scripts Repository scripts size: S labels Oct 22, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

Synthetic before/after proof for the Cron menu spacing change. Desktop and mobile pairs have identical pixels; timings are in the PR body.

desktop-cron-menu-open-1-0

desktop-cron-menu-open-1-1

mobile-cron-menu-open-1-0

mobile-cron-menu-open-1-1

@steipete
steipete enabled auto-merge (squash) October 22, 2026 20:44
@steipete
steipete merged commit 60c9291 into main Oct 22, 2026
136 of 143 checks passed
@steipete
steipete deleted the solid2/w-perf-shell-viewport branch October 22, 2026 20:54
@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 23, 2026
* perf(ui): limit sibling spacing style invalidation

* perf(ui): narrow key and sharing span invalidation

* test(ui): correct warm interaction session 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. scripts Repository scripts size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant