Skip to content

perf(ui): skip anchor fallbacks for hidden overlays - #199177

Merged
steipete merged 1 commit into
mainfrom
solid2/w-webkit-style-cost-1114
Nov 14, 2026
Merged

steipete merged 1 commit into
mainfrom
solid2/w-webkit-style-cost-1114

Conversation

@steipete

@steipete steipete commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Hidden menus retained their CSS anchor fallback lists, making WebKit spend style time on popovers that were not visible. This extends the existing closing-state fallback retirement rule to the hidden phase. The overlay lifecycle sets opening before showing the surface, so its original placement and flip rules return before it appears.

The change is one added selector in the existing document stylesheet. It preserves the closing workaround, the deliberate document/shadow boundary, all markup and lazy boundaries, and adds no JavaScript or state. Production LOC: 4,147 → 4,148. No changelog edit; release-note context is the faster heavy Secrets inventory with unchanged menu behavior.

Evidence

The production builds ran 20 rotated base/head/identical-base triplets for each of four flows in WebKit 27.2, Chromium 156, and Firefox 157, with fresh headless browser processes and contexts. All 720/720 timing observations passed correctness. A single 10-triplet Firefox Secrets extension investigated its 2 ms p95 movement; 30/30 additional observations passed. Metrics are browser-local application completion, not driver wall time or CPU. Host one-minute load across the main run was 2.59–14.43.

WebKit Secrets improves 17.81% in paired median, with median/p95 306.5/325 → 249.5/265 ms. Relative to the mean of both base arms the paired median improves 16.86%, beyond the 4.77% median absolute A/A variation. The final-head Timeline diagnostic isolates style 162.24 → 94.65 ms (identical-base control 172.65 ms; one traced observation per arm, not acceptance timing). 201 hidden overlays with nonempty fallback lists become zero. The existing opening lifecycle restores their original lists before display.

The Firefox extension retains the small movement transparently: across 30 triplets the paired median is +1.15%, p95 144 → 146 ms, and median absolute A/A variation is 4.67%. That is within measured variation; it is not reported as a Firefox speedup or exact zero change. The other tested surfaces show no material regression; the win is specific to the hidden-menu workload.

Complete application timing table
Flow Engine Base median / p95 ms Head median / p95 ms Control median / p95 ms Paired head/base A/A
Warm boot webkit 377 / 389 376 / 395 382 / 444 -0.52% +2.34%
Warm boot chromium 184.05 / 191.4 182.4 / 191.3 186.25 / 201.5 -0.43% +0.93%
Warm boot firefox 335 / 389 339 / 374 343 / 381 -0.57% +1.07%
Secrets webkit 306.5 / 325 249.5 / 265 305 / 319 -17.81% -2.02%
Secrets chromium 110.7 / 121.8 111.15 / 122.4 111.2 / 122.3 +0.36% +0.39%
Secrets firefox 133 / 144 137.5 / 146 130.5 / 144 +1.15% -0.37%
Skills settings webkit 324 / 341 321.5 / 334 320.5 / 351 -0.61% +0.00%
Skills settings chromium 144.45 / 153.2 144.2 / 156.4 145 / 157.5 -0.07% +0.73%
Skills settings firefox 196.5 / 212 194.5 / 211 201.5 / 211 +2.39% +2.27%
Plugin Settings webkit 430 / 454 422.5 / 443 418.5 / 445 -1.20% -0.48%
Plugin Settings chromium 148.05 / 160.6 146.25 / 158.8 148.35 / 158.7 +0.07% -0.72%
Plugin Settings firefox 216.5 / 234 216 / 225 215.5 / 241 -3.54% -1.17%
Proof Result
UI typecheck pnpm tsgo:ui passed
Native menu proof 41/41 tests passed in the three focused WebKit menu contract files; one worker
Styles and format Targeted Stylelint and oxfmt passed
Production Knip Passed
Production builds Base and head passed
Strict performance comparison Zero new violations, no cap changes
Startup JS 90,945 → 90,945 B normalized gzip; CSS 40,781 → 40,789 B; 3 JS and 1 CSS requests unchanged
Chat / New Session JS 1,314,920 / 818,388 B normalized gzip unchanged
Independent review Codex P0–P2 scoped-clean; lifecycle and cascade context included
Visual / behavior Light/dark Plugins, Secrets, and Skills content is pixel-identical; sampled visible computed styles match. The Secrets menu retains its exact open geometry through close/reopen.

The copied-bundle ablation was diagnostic, not a proposed redesign: removing the shared sheet reduced Secrets style time, then rule and property bisection isolated position-try-fallbacks. Removing position-area alone did not produce that gain. Broad selector, color and motion trials did not establish a universal CSS-matching cause for all heavy pages; no WebKit floor is claimed.

Before — light theme

After — light theme

Before — dark theme

After — dark theme

CI attribution

Run43637122534, attempt3 is complete. UI unit shards, lint, performance, selected Node checks, and both real-Gateway shards passed. Two browser jobs initially hit the 20-minute step deadline; each received one diagnosed infrastructure retry. The second passed, and the first completed with only the inherited model-picker assertion.

The three remaining assertion failures match the exact names and assertions in scheduled main run43637458849, at this PR's tested merge base bb905f76e55de2934e868434ea23c345893cdc6c:

  • Control UI terminal file upload > uploads picked and dropped files, then pastes staged paths without Enter: waits for “Couldn’t upload the file. Try again.”; main changed it to “Couldn’t add the file.”
  • Control UI WhatsApp logout mocked Gateway E2E > completes direct setup as the selected channel: expects the exact accessible name “Set up”; main added “Set up Slack.”
  • Control UI new-session page mocked Gateway E2E > keeps the empty model picker beside Dictate at 390 pixels: the same 46px gap exceeds the test's 32px expectation.

The failing tests and their production inputs are unchanged in the tested merge. Native inherited-failure admission retains the failed CI result, the matching evidence, and the complete job inventory. No failing check is described as passing.

Hidden menu surfaces retained anchor fallback lists during heavy page restyles. Extend the existing fallback retirement rule to the hidden lifecycle phase; opening restores each surface's authored placement before it becomes visible. Keep the existing closing behavior and document-only stylesheet owner.
@steipete steipete added the ci:full Keep ordinary native-locale CI selection on the next PR run. label Nov 14, 2026
@clawsweeper

clawsweeper Bot commented Nov 14, 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 14, 2026 •

Copy link
Copy Markdown
Contributor
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-14T20:23:57.076755Z 5241eda 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.

@steipete
steipete enabled auto-merge (squash) November 14, 2026 20:28
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. 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-repro Preliminary submission classification; full source review pending. labels Nov 14, 2026
@clawsweeper

clawsweeper Bot commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR disables CSS anchor fallback searches for hidden overlays until their existing opening lifecycle restores normal placement.

Example: Open the heavy Secrets inventory in WebKit 27.2.

  • Before: The author reports 201 hidden overlays retaining fallback lists and median completion of 306.5 ms.
  • After: The author reports zero hidden overlays retaining fallback lists and median completion of 249.5 ms, with matching visible menu geometry.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A minimal, coherent optimization supported by browser measurements and inspected visual evidence, with no actionable findings.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The supplied production-build browser results exercise the hidden-menu workload across WebKit, Chromium, and Firefox, report fallback-list retirement and WebKit improvement, and corroborate preserved visible geometry with inspected screenshots; raw timing traces are not linked.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Performance · Worth it: Yes · Fix scope: Complete
User problem: Heavy Secrets inventories spend unnecessary WebKit style time on menus that are hidden.
Reason: The maintainer-authored direction removes measured browser work with one selector and preserves visible menu behavior.

Merge readiness

✅ Ready for maintainer review

This PR provides a useful, focused WebKit performance improvement without an identified correctness or security defect; the CI gate remains unresolved.

Priority: P2
Reviewed head: 5241edaef30f4302ef18f2aa0e97e045beb54100

Before merge

None.

Findings

None.

Agent review details

How this fits together

Control UI overlay lifecycle phases drive document CSS, which controls browser anchor placement for light-DOM menus and pickers.

flowchart TD
  A[Secrets inventory renders] --> B[Overlay lifecycle marks hidden surfaces]
  B --> C[Document CSS disables fallback searches]
  C --> D[Browser resolves page styles]
  E[User opens a menu] --> F[Lifecycle sets opening before display]
  F --> G[Authored anchor fallbacks resume]
Loading

Technical review

Best possible solution:

Extend the existing document-level phase rule while preserving opening placement, closing behavior, and the intentional shadow-root boundary.

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

Source confirms that hidden surfaces retain authored fallback lists on main, and the supplied browser measurements demonstrate the associated workload; this read-only review did not execute the application.

Is this the best way to solve the issue?

Adding one selector at the existing CSS owner is the smallest complete optimization and restores normal fallbacks through the unchanged opening lifecycle.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Overlay fallback retirement keeps the original intent (01ecda4: Prevent closing anchored surfaces from freezing WebKit while preserving boot-bundle size through a document-only override.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

  • Focused introduced change: The pinned introduction adds the hidden-phase selector to the existing closing-phase override and updates its explanatory comment; it adds no JavaScript, state, or alternate owner. (ui/src/styles/components.css:4146, 5241edaef30f)
  • Opening restores placement before display: The lifecycle sets opening before calling setNativeOpen(true), removing the hidden selector before the native surface is shown; existing CSS already excludes hidden overlays from display. (ui/src/components/overlay-lifecycle.ts:315, 5241edaef30f)
  • Existing workaround and boundary preserved: fix(ui): Control UI freezes in WebKit when a picker replaces an opening menu #198658 introduced closing-phase retirement to prevent WebKit style-resolution freezes and deliberately kept it in document CSS to avoid growing shadow-inlined boot JavaScript; this PR preserves both decisions. (ui/src/styles/components.css:4140, 01ecda445b7e)
  • Supplied browser evidence inspected: The complete fetched body reports interleaved production-build browser measurements, reduced hidden-overlay work, unchanged close/reopen geometry, and cross-engine controls; all four downloaded light/dark before/after screenshots were inspected and show matching Secrets menu placement. (5241edaef30f)
  • Current main still retains hidden fallback work: Fetched main contains only the closing-phase override, so the hidden-phase optimization remains distinct work. (ui/src/styles/components.css, c509b9dd44c1)
  • CI failure concerns PR context: The failed PR-context check requests authored problem and evidence sections, both present in the fetched body; its annotations establish no CSS defect, while the overall CI gate remains pending. (.github/workflows/real-behavior-proof.yml:62, 5241edaef30f)

Likely related people:

  • Jason (Json): Raw commit 01ecda4 adds ui/src/styles/components.css:4146 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 01ecda445b7e; files: ui/src/styles/components.css)

PR surface

Source +1. Total +1 across 1 file. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 7 6 +1
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 7 6 +1

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add P2: This is a measured performance improvement for a heavy WebKit workload with limited blast radius.
  • 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 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: This is a measured performance improvement for a heavy WebKit workload with limited blast radius.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • 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 November 14, 2026, 3:40 PM ET / 20:40 UTC.

@steipete
steipete disabled auto-merge November 14, 2026 20:48
@steipete
steipete merged commit fdecc19 into main Nov 14, 2026
212 of 230 checks passed
@steipete
steipete deleted the solid2/w-webkit-style-cost-1114 branch November 14, 2026 21:42
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 15, 2026
Hidden menu surfaces retained anchor fallback lists during heavy page restyles. Extend the existing fallback retirement rule to the hidden lifecycle phase; opening restores each surface's authored placement before it becomes visible. Keep the existing closing behavior and document-only stylesheet owner.
fuller-stack-dev added a commit that referenced this pull request Nov 24, 2026
…ss the sidebar rail

* fix(ui): Control UI freezes in WebKit when a sidebar rail tooltip hands off to a pinned page

Shadow-hosted overlay surfaces never received the document rule that stops
closing and hidden surfaces from trying position fallbacks (#198658, #199177).
A rail tooltip closing as a pinned page's tooltip opens then left the top layer
with its fallbacks, and WebKit's anchor-positioned style resolution never
finished. Mirror the rule in the shadow-only overlay reset.

The agent-menu swap test no longer reproduces its freeze without the document
rule on current main, so it is replaced by the rail tooltip hand-off.

Related: #196820

* fix: Control UI freezes in Safari and the Mac app when you hover across the sidebar rail

OpenClaw-Publication: 9ab2f67f-a9cd-8176-9264-18486a27bf36
tideclaw-bot pushed a commit that referenced this pull request Nov 25, 2026
…ss the sidebar rail

* fix(ui): Control UI freezes in WebKit when a sidebar rail tooltip hands off to a pinned page

Shadow-hosted overlay surfaces never received the document rule that stops
closing and hidden surfaces from trying position fallbacks (#198658, #199177).
A rail tooltip closing as a pinned page's tooltip opens then left the top layer
with its fallbacks, and WebKit's anchor-positioned style resolution never
finished. Mirror the rule in the shadow-only overlay reset.

The agent-menu swap test no longer reproduces its freeze without the document
rule on current main, so it is replaced by the rail tooltip hand-off.

Related: #196820

* fix: Control UI freezes in Safari and the Mac app when you hover across the sidebar rail

OpenClaw-Publication: 9ab2f67f-a9cd-8176-9264-18486a27bf36
(cherry picked from commit 0aa27dd)
Co-authored-by: RomneyDa <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 25, 2026
…ss the sidebar rail

* fix(ui): Control UI freezes in WebKit when a sidebar rail tooltip hands off to a pinned page

Shadow-hosted overlay surfaces never received the document rule that stops
closing and hidden surfaces from trying position fallbacks (openclaw#198658, openclaw#199177).
A rail tooltip closing as a pinned page's tooltip opens then left the top layer
with its fallbacks, and WebKit's anchor-positioned style resolution never
finished. Mirror the rule in the shadow-only overlay reset.

The agent-menu swap test no longer reproduces its freeze without the document
rule on current main, so it is replaced by the rail tooltip hand-off.

Related: openclaw#196820

* fix: Control UI freezes in Safari and the Mac app when you hover across the sidebar rail

OpenClaw-Publication: 9ab2f67f-a9cd-8176-9264-18486a27bf36
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. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS 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