Skip to content

improve(ui): avoid redundant work when toggling mobile navigation - #190027

Merged
steipete merged 3 commits into
mainfrom
solid2/w-perf-sidebar-motion-1101
Nov 1, 2026
Merged

steipete merged 3 commits into
mainfrom
solid2/w-perf-sidebar-motion-1101

Conversation

@steipete

@steipete steipete commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Opening or closing mobile navigation rebuilds the full shell view and republishes unrelated sidebar properties. Delayed label measurements also rewrite the class of an already-stopped marquee.

User Impact

Mobile navigation retains its existing sheet animation, selected conversation, focus behavior, and layout while doing less work per toggle.

Why This Change Was Made

The reported compound sidebar regression crossed the intentional 441 ms sheet-spring change in #188162. The benchmark waits for closing motion before delivering its second input. History and traces ruled out the later desktop geometry changes as its cause; Chromium had zero layout passes through the measured cycle.

The existing shell owner now publishes drawer changes separately. Its existing view supplies reactive drawer bindings and the commit acknowledgement; a simultaneous full-shell invalidation still takes the full path. Stopped marquees use a forced class toggle, which leaves the class attribute untouched when the scrolling token is already absent. The benchmark gains independent mobile open/close cases alongside the retained compound cycle.

Evidence

Engine / action Base med / p95 [range], ms Head med / p95 [range], ms A/A control med / p95, ms
chromium open 446.95 / 449.30 [445.10–449.30] 12.25 / 14.00 [11.60–14.00] 447.45 / 449.20
webkit open 280.50 / 283.00 [264.00–283.00] 41.00 / 44.00 [39.00–44.00] 278.50 / 283.00
chromium close 92.75 / 94.10 [91.00–94.10] 13.25 / 14.00 [12.80–14.00] 92.20 / 93.10
webkit close 260.00 / 274.00 [257.00–274.00] 260.00 / 274.00 [258.00–274.00] 260.00 / 262.00
chromium toggle 940.80 / 943.10 [759.70–943.10] 506.75 / 509.00 [504.90–509.00] 940.10 / 942.90
webkit toggle 783.50 / 794.00 [774.00–794.00] 552.50 / 557.00 [549.00–557.00] 789.50 / 794.00

The retained spring keeps wall time essentially flat (all median movements within 0.21%; p95 movement below 0.1%). The compound target of 358 ms is not reached: its mandatory exit-animation wait remains. Single activations all meet 358 ms on the candidate. The reduction in the DOM span removes late no-op mutations; it is not a claim that the visible spring paints faster.

Chromium thread task CPU, median / p95 (ms):

Action Base Head A/A control
open 24.24 / 26.20 23.48 / 25.93 23.89 / 25.78
close 23.88 / 25.00 23.03 / 24.19 23.91 / 26.09
toggle 50.44 / 52.41 50.43 / 51.59 50.50 / 52.16

Total CPU is essentially flat for the compound action; atomic open/close medians improve about 3%. The open script-CPU decrease also appears in the A/A control, so it does not establish a broad CPU win. Final diagnostic traces show no per-frame layout loop: Chromium has zero layouts; WebKit retains 5/7/12 layouts for open/close/cycle, totaling under 1.5 ms each. The separate drawer commit path is exercised. WebKit close retains the existing composer-width measurement tail. Native mutations fall 34→31 for Chromium open/close and 70→63 for its cycle; WebKit falls 34→31, 46→43 and 81→75. Chromium has zero measured layout passes throughout. Host load was 6.35–17.58.

node --import ./scripts/tsx.mjs scripts/bench-control-ui-engines.ts \
  --bundle-dir <base> --compare-bundle-dir <head> --control-bundle-dir <base> \
  --steps sidebar-open,sidebar-close,sidebar-toggle \
  --viewport mobile --engines chromium,webkit --pairs 10 --output <proof-dir>

Controlled workload: production bundles, synthetic 1,000-session sidebar, 390×844, Chromium and WebKit, localhost, ten serial interleaved base/head/base-control triplets per action. Input-to-commit measures first native input to last observed DOM mutation, not paint latency. WebKit Inspector intervals are elapsed time; Chromium task/script counters are thread CPU. The current spring remains 441 ms.

Check Result
Shell regression Base advances the full-shell revision; fixed suite: 21 passed
Marquee regression Base emits 3 redundant class mutations; fixed suite: 8 passed, 0 redundant mutations
Typecheck pnpm tsgo:ui passed
Targeted lint/format Passed for changed source, test, and harness files; scripts typecheck also passed after the CI correction
Production build + strict budgets Base and head passed; startup 89,588 → 89,587 B gzip, one CSS request each
Independent review Codex P0–P2 autoreview: no actionable findings in the complete change and supplied lifecycle context
Production Knip Passed on final UI head; subsequent change is benchmark-only
Full PR CI Run 41269286555: 45 jobs passed, including all seven UI E2E and both real-Gateway shards
State Before After
Open Before: mobile drawer open After: mobile drawer open
Closed Before: mobile drawer closed After: mobile drawer closed

Synthetic data only. Both inspected before/after pairs are byte-for-byte identical.

Production LOC: 2,082 → 2,142. All touched files: 4,435 → 4,593 (+215/−57). The growth is the separate drawer publication/commit path, reactive getters, two regression cases, and single-action benchmark coverage. No added effects, native listeners, DOM queries, owner-restoration calls, or manual component loading.

The production bundle was built from the final UI source. All five changed production modules in its source maps match 2273c9a384050e3d5482de2fc5be763f310ea96e exactly and are unchanged at 6fb6dae1e2550741f8aa0e8498612f80674b09fe. The first CI run caught no-map-spread in the new benchmark cases; the correction uses a fresh Object.assign target with typed overrides, preserving scenario behavior. Targeted scripts lint, scripts typecheck, and incremental independent review passed before the correction push.

Keep drawer state synchronous but publish its own revision so a toggle updates drawer bindings without rebuilding the shell snapshot, republishing unrelated sidebar props, or replaying shell lifecycle work. Preserve focus, inertness, native scrim, and the current sheet spring. Add single-activation benchmark cases beside the compound cycle.
Force the scrolling token off with toggle so an already-stopped label does not rewrite its class attribute when drawer visibility changes. Keep active animation cancellation unchanged and cover repeated visibility and size notifications.
@steipete steipete added the ci:full Keep ordinary native-locale CI selection on the next PR run. label Nov 1, 2026
@clawsweeper

clawsweeper Bot commented Nov 1, 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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 1, 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-11-01T03:30:09.278614Z 6fb6dae 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.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui scripts Repository scripts size: M labels Nov 1, 2026
@steipete
steipete enabled auto-merge (squash) November 1, 2026 03:24
@steipete
steipete disabled auto-merge November 1, 2026 03:26
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Nov 1, 2026
@clawsweeper

clawsweeper Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR isolates mobile drawer updates from full-shell updates and prevents redundant class mutations on stopped marquee labels.

Example: Open mobile navigation at 390×844 with 1,000 sidebar sessions.

  • Before: The toggle rebuilds the shell snapshot and republishes unrelated sidebar properties.
  • After: Only drawer-dependent bindings and presentation properties update, retaining the same sidebar, conversation, and 441 ms spring.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, supported performance improvement with preserved lifecycle contracts, useful regressions, and successful current-head checks.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): Production Control UI bundles exercise native drawer open, close, and compound inputs in Chromium and WebKit at 390×844 with 1,000 synthetic sessions; recorded mutation counts improve, focus checks pass, and inspected screenshots preserve both layouts.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Performance · Worth it: Yes · Fix scope: Complete
User problem: Opening and closing mobile navigation performs unrelated shell work and emits late redundant DOM mutations.
Reason: The maintainer-authored direction has measured work-count improvements, preserves existing behavior, and accurately limits its performance claims.

Merge readiness

✅ Ready for maintainer review

This PR removes verified redundant UI work while preserving drawer behavior; no actionable correctness or security findings remain.

Priority: P3
Reviewed head: 6fb6dae1e2550741f8aa0e8498612f80674b09fe

Before merge

None.

Findings

None.

Agent review details

How this fits together

The Control UI shell consumes navigation and application state, renders the drawer and retained conversation, and acknowledges committed DOM before focus handling continues.

flowchart TD
  A[Navigation input] --> B[Shell presentation owner]
  B --> C[Navigation revision]
  C --> D[Reactive drawer bindings]
  D --> E[Committed presentation]
  E --> F[Sidebar and browser chrome]
  E --> G[Focus continuation]
Loading

Technical review

Best possible solution:

Retain the focused drawer publication path within the existing shell owner and the idempotent marquee class update.

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

Current-main source shows drawer writes invalidating the full shell and stopped marquees removing an already-absent class; supplied browser measurements corroborate the redundant mutations.

Is this the best way to solve the issue?

The change addresses both producers of redundant work using existing owners, preserves full invalidation when needed, and leaves animation and focus contracts intact.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Shell snapshots and retained sidebar keeps the original intent (7c06f39: The Solid shell migration preserved one live sidebar, retained routes, and existing interaction contracts.)
  • Rendered commit acknowledgement keeps the original intent (55d5c93: Rendered lifecycle settlement replaced detached scheduling while preserving completion and focus-restoration ordering.)
  • Mobile browser scrim keeps the original intent (0c262b4: Browser chrome must dim with the committed mobile drawer backdrop.)
  • Marquee stop lifecycle keeps the original intent (25037ce: The owned Solid marquee retained cancellation, visibility, focus, and reduced-motion behavior; the forced toggle preserves these while avoiding an unnecessary attribute write.)
  • Single-action benchmark coverage keeps the original intent (a54402e: Cross-engine production-bundle scenarios exercise native interactions and geometry costs; the additional cases reuse that boundary and retain the compound scenario.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

  • Introduced change and current main: The pinned introduction contains the drawer publication path, reactive getters, marquee correction, regressions, and benchmark cases. Fetched main retains the original behavior in the affected production modules. (ui/src/app/app-shell-presentation.ts:28, 6fb6dae1e255)
  • Commit ordering and existing owners: Full-shell invalidation takes precedence over navigation-only commits; both paths retain the existing completion promise and rendered-lifecycle acknowledgement. Drawer commits update sidebar visibility, collapse presentation, chat drawer state, and browser scrim. (ui/src/app/app-host.tsx:525, 6fb6dae1e255)
  • Production browser evidence: The PR records ten interleaved base/head/control triplets per action in Chromium and WebKit using production bundles. Chromium open/close mutations fall from 34 to 31; compound CPU and animation wall time remain essentially unchanged. Inspected open and closed screenshot pairs have identical SHA-256 hashes. (6fb6dae1e255)
  • Intentional animation preserved: improve(ui): mobile sheets move with iOS-style springs, flicks and swipe-to-dismiss #188162 intentionally introduced the shared sheet spring and immediate accessibility-state changes; this PR preserves that contract and distinguishes DOM-commit measurements from visible animation speed. (scripts/README.md:393, 6052fffac299)
  • Current-head validation: Live GitHub reads show the reviewed head is mergeable and clean, with successful ci-gate, UI suites, UI E2E suites, real-Gateway UI suites, production types, lint, and performance checks. (6fb6dae1e255)
  • Policy and inspection limits: Applied the complete root, UI, and scripts AGENTS files and the relevant review guidance; no maintainer-notes directory exists. The installed Solid cheatsheet is absent, so repository Solid guidance supplied the local contract context. No target code or tests were executed, and the checkout remains clean. (AGENTS.md:1, 6fb6dae1e255)

Likely related people:

  • Vyctor H. Brzezowski: Raw commit c6f1d3d adds ui/src/lib/hover-marquee.ts:18 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: c6f1d3df983d; files: ui/src/lib/hover-marquee.ts)

PR surface

Source +60, Tests +50, Docs +7, Other +41. Total +158 across 9 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 5 115 55 +60
Tests 2 50 0 +50
Docs 1 7 0 +7
Config 0 0 0 0
Generated 0 0 0 0
Other 1 43 2 +41
Total 9 215 57 +158

Review metrics

Metric Value Why it matters
Production versus regression-test growth UI production +115/−55; benchmark tooling +43/−2; tests +50/−0 Growth implements selective publication within existing owners and two distinct regressions without adding modules, effects, or production test hooks.

Labels

Label changes:

  • add P3: This is a bounded performance cleanup with preserved interaction behavior and modest work-count improvements.
  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P3: This is a bounded performance cleanup with preserved interaction behavior and modest work-count improvements.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

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, 11:42 PM ET / November 1, 2026, 03:42 UTC.

@steipete
steipete merged commit b1615fd into main Nov 1, 2026
140 of 142 checks passed
@steipete
steipete deleted the solid2/w-perf-sidebar-motion-1101 branch November 1, 2026 03:47
@steipete

steipete commented Nov 1, 2026

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
…enclaw#190027)

* perf(ui): isolate mobile sidebar toggle commits

Keep drawer state synchronous but publish its own revision so a toggle updates drawer bindings without rebuilding the shell snapshot, republishing unrelated sidebar props, or replaying shell lifecycle work. Preserve focus, inertness, native scrim, and the current sheet spring. Add single-activation benchmark cases beside the compound cycle.

* perf(ui): leave stopped marquee classes untouched

Force the scrolling token off with toggle so an already-stopped label does not rewrite its class attribute when drawer visibility changes. Keep active animation cancellation unchanged and cover repeated visibility and size notifications.

* fix(test): preserve typed sidebar benchmark overrides
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. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant