Repository navigation
perf(ui): skip anchor fallbacks for hidden overlays - #199177
Conversation
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.
|
🦞👀 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 Summary: ✅ CompletedThis 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. |
|
Codex review: needs maintainer review before merge. What this changesThis 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.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete 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 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherControl 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]
Technical reviewBest 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
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +1. Total +1 across 1 file. Added test files: 0. 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 Reviewed November 14, 2026, 3:40 PM ET / 20:40 UTC. |
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
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.
…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
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
openingbefore 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
pnpm tsgo:uipassedThe 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. Removingposition-areaalone 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.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.