Repository navigation
fix(ui): Control UI freezes in WebKit when a picker replaces an opening menu - #198658
fuller-stack-dev merged 5 commits into
Conversation
WebKit never finished style resolution when an anchored overlay that was still opening got closed by another overlay in its exclusive group while the layout changed, for example opening the sidebar Agent menu, toggling Home, then opening a settings picker. The closing surface kept retrying its position-try fallbacks and the Control UI froze until reload. A closing overlay is only fading out, so it now drops position-try fallbacks. The new WebKit e2e suite replays the swap through the real Control UI and fails on the previous stylesheet. Refs openclaw#196820
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis PR disables anchor-position fallbacks during overlay closing and adds a WebKit regression to CI. Example: At 1440×900, open the Agent menu, toggle Home, and immediately open the Appearance font picker.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Partial Merge readiness✅ Ready for maintainer review This PR provides a focused, supported fix for a reproducible WebKit freeze, and I found no introduced correctness or security defect. Priority: P1 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherControl UI menus and pickers share an exclusive overlay lifecycle; accepted close transitions publish a phase that CSS uses while native surfaces finish their exit animations. flowchart TD
A[Agent menu opens] --> B[Home changes layout]
B --> C[Font picker opens]
C --> D[Shared lifecycle closes Agent menu]
D --> E[Closing CSS disables position fallbacks]
E --> F[WebKit completes style resolution]
Technical reviewBest possible solution: Land the focused closing-phase fix while keeping the broader linked freeze report open for its unresolved scenarios. Do we have a high-confidence way to reproduce the issue? The committed browser scenario and public before/after WebKit output establish a deterministic overlay-swap reproduction; this read-only review did not execute it independently. Is this the best way to solve the issue? Disabling fallbacks only during the existing closing phase is the smallest supported fix: it removes the demonstrated style-resolution trigger without adding state, replacing the lifecycle, or changing usable-menu placement. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 53afb9f9bfba. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +9, Tests +93, Config +1. Total +103 across 4 files. Added test files: 1. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes:
Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed November 14, 2026, 11:47 AM ET / 16:47 UTC (Revision 2). |
Select closing surfaces by data-phase alone. The rule only affects anchored elements, and the shorter selector keeps total CSS growth under the 64 B build-variance allowance.
|
Raw reproduction evidence, as ClawSweeper suggested. Playwright WebKit e2e, Same test with the fix, on merged head 2a3e9ba System WebKit (macOS 27.2, WebKit 22625.2.8.11.9) WKWebView harness, production Control UI build. Sequence: open Agent menu, then Home, then font picker in the menu's first frame Sample of a hung base run (WebContent main thread): |
overlay.css is also embedded as a string in the boot JS for shadow-hosted surfaces, so adding to it grew the boot bundles by ~320 B gzip under the performance ratchet. Move the rule to the document stylesheet: the light-DOM menus and pickers that reproduce the WebKit hang keep the fix, and the boot JS is unchanged.
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
…ng menu (openclaw#198658) * fix(ui): stop WebKit freezing when a picker replaces an opening menu WebKit never finished style resolution when an anchored overlay that was still opening got closed by another overlay in its exclusive group while the layout changed, for example opening the sidebar Agent menu, toggling Home, then opening a settings picker. The closing surface kept retrying its position-try fallbacks and the Control UI froze until reload. A closing overlay is only fading out, so it now drops position-try fallbacks. The new WebKit e2e suite replays the swap through the real Control UI and fails on the previous stylesheet. Refs openclaw#196820 * fix(ui): keep the closing-overlay rule within the CSS size ratchet Select closing surfaces by data-phase alone. The rule only affects anchored elements, and the shorter selector keeps total CSS growth under the 64 B build-variance allowance. * fix(ui): keep the closing-overlay rule out of the boot JS bundles overlay.css is also embedded as a string in the boot JS for shadow-hosted surfaces, so adding to it grew the boot bundles by ~320 B gzip under the performance ratchet. Move the rule to the document stylesheet: the light-DOM menus and pickers that reproduce the WebKit hang keep the fix, and the boot JS is unchanged.
Keep the exact upstream CSS repair and WebKit shard registration. Adapt the upstream scenario to actual 11.4 two-agent settings controls, preserving evaluation failures and checking the specific competing picker. This is positive integration coverage: the baseline probe passes, so no baseline-red freeze reproduction is claimed. Independent CSS, registration, and final test reviews found no remaining actionable findings. Local visual/runtime gaps defer to fresh FRV per operator instruction. (cherry picked from commit 01ecda4) Co-authored-by: Jason (Json) <[email protected]> Co-authored-by: RomneyDa <[email protected]> Co-authored-by: vincentkoc <[email protected]>
Port Telegram callbacks, hook session keys, private-topic approvals and interactive widgets with complete send/edit/route security companions. Include Feishu captioned media, iOS permission Sendable callbacks, WebKit animation/menu retirement and pending automations props handling. Keep Matrix malformed formatted-mention parsing linear-time. Adapt the 11.4 equivalents to the fixed beta baseline where available. Source PRs: #196217, #191585, #196822, #194027, #197519, #198038, #196991, #198380, #198658, #184432. Companion scope: #191647, #192162, #198022, #197271, #194146; #197670 is folded into #197519 equivalent. (cherry picked from commit 928c118) (cherry picked from commit 569ca48) (cherry picked from commit efa744e) (cherry picked from commit c301da9) (cherry picked from commit 641c4d5) (cherry picked from commit b9d3fb4) (cherry picked from commit a213a51) (cherry picked from commit ec46689) (cherry picked from commit 779d22e) (cherry picked from commit 129ccc3) (cherry picked from commit 849c050) (cherry picked from commit b22f35f) (cherry picked from commit 8b414e9) (cherry picked from commit 01ecda4) (cherry picked from commit f978e54) (cherry picked from commit 6e60479) (cherry picked from commit ec7b49a) (cherry picked from commit 1d72ad0) (cherry picked from commit 5e2c66f) (cherry picked from commit dfb6454) Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit f7c581c7f8bf0e57c7d8799e928a121b24462450) Co-authored-by: vincentkoc <[email protected]>
…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
…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]>
…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
Related: #196820
What Problem This Solves
Fixes: the Control UI freezes in Safari and the macOS app when one menu or picker opens while another anchored menu is still opening and the layout changes. One example is opening the sidebar Agent menu, then quickly toggling Home and opening a settings picker. Scrolling still works, but nothing else responds until the app reloads.
User Impact
User impact: switching quickly between overlays in WebKit no longer freezes the Control UI. The one visible difference: an overlay that had flipped to fit the viewport may return to its default side during its 100–200 ms fade-out.
Why This Change Was Made
When a surface in an exclusive group (here the opening Agent menu) closes because another one opens, WebKit keeps re-resolving the closing surface's
position-try-fallbacksand never finishes style resolution. Every later style flush hangs the page: ourgetAnimations()calls, and also WebKit's own rendering update. A closing surface is only fading out, so it no longer needs fallbacks. The document stylesheet (ui/src/styles/components.css) now setsposition-try-fallbacks: noneon any surface withdata-phase="closing". It uses!importantbecause several surfaces declare their own fallback lists with more specific selectors. It doesn't go inoverlay.css, because that file is also embedded as a string in the boot JS for shadow-hosted surfaces. Adding 59 bytes there grew the compressed boot bundles by about 320 B, which failed the performance ratchet.Chromium was unaffected. The rule applies in every engine to keep overlay behavior the same across browsers.
Evidence
ui/src/e2e/overlay-menu-swap-webkit.e2e.test.tsreplays the swap in Playwright WebKit through the real Control UI and mock Gateway, in the same frame the Agent menu reaches the top layer. Without the fix it fails both times with "WebKit stopped answering after the menu swap". With the fix it passes 4 of 4. It's registered in the CIwebkitSuiteslist and intest/scripts/ci-ui-browser-dependencies.test.ts, which passes 7 of 7.Element::getAnimations→Document::resolveStyle, withTreeResolver::resolverepeatinginvalidateForResumingAnchorPositionedElementResolution.node scripts/check-changed.mjspasses. I skipped the dead-export scan, because it fails on files this branch doesn't touch (scripts/perf/transcript-facts-backfill-stress-preload.mjs,extensions/workboard/src/store-evidence.ts).pnpm ui:check-performance:basepasses against main: boot JS +0 B, boot CSS gzip about +10 B, total CSS raw +59 B (allowance 64 B).scoped-cleanat P0.Screenshots (Playwright WebKit, mock data):
A frozen page can't paint a new frame, so "before" shows the frame it freezes on. In "after", the font picker's menu is open below the fold after the layout shift; the test asserts that state.
Gaps
getAnimations()call from the overlay close path in a microtask. I didn't reproduce that path separately.