Repository navigation
fix(ui): fit side menus before clipping - #179647
Conversation
Use viewport height when sizing side overlays so native placement can flip them before clipping. Keep a centered side fallback for menus too tall for either anchored region, preserving bounded keyboard scrolling. Cover low submenu triggers and tall middle-of-screen menus in both text directions. This restores the nine-gateway switcher after the navigation rail menu placement change.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review in progressClawSweeper is reviewing this revision. This supersedes any previous blocked status. |
Codex Review SummaryThis 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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fb7153861b
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| --oc-overlay-right-center, | ||
| --oc-overlay-left-center; |
There was a problem hiding this comment.
Prefer the left-centered fallback for left placements
When a left, left-start, or left-end overlay is too tall for the aligned, above, and below options, and the anchor is centered enough that both side-centered positions fit, this ordering selects --oc-overlay-right-center first. Consequently, RTL submenus—which request left-start by default—open on the opposite side even though the requested left side has room. Reverse these two centered fallbacks for the left-placement block.
Useful? React with 👍 / 👎.
Keep the shared side-overlay height rule below consumer panel styles in specificity, including when lazy primitive CSS is inserted after layout CSS. This restores all agent rows at enlarged text without changing submenu viewport limits or positioning fallbacks. Cover an earlier-loaded consumer height budget and keyboard access in both browser engines. The original PR head reproduced the sidebar clipping in three bundled runs; its merge base passed all three. Also measure the current roster-menu icon inside its retained row. Reactive menu updates can replace an SVG between child-locator resolution and style evaluation; atomic sampling preserves the exact width assertion.
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Codex review: needs changes before merge. What this changesThis PR lets side menus use available viewport height before clipping and preserves consumer-specific height limits. Example: Open the gateway submenu with nine saved gateways in a 1280×900 viewport.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Regression provenancePossible regression — probable (reviewed change; failure trace). No predecessor PR is attributed. Merge readiness⛔ Needs changes before merge - 2 items remain Keep this PR open: it fixes demonstrated menu clipping, but the centered fallback ordering and a newly failing WebKit assertion need repair. Priority: P2 Before merge
Findings
Tests
Agent review detailsHow this fits togetherControl UI menus pass their anchor and requested placement to the shared overlay; CSS selects a fitting position and bounds scrolling. flowchart LR
A[Navigation rail control] --> B[Shared Menu]
B --> C[Overlay anchor]
C --> D[CSS placement and height]
D --> E[Visible menu actions]
Technical reviewBest possible solution: Keep placement in shared CSS, prefer the requested side when centered placement fits, and make the height regression independent of fractional rendered geometry. Do we have a high-confidence way to reproduce the issue? Current-main CSS exposes the reported sizing path, supplied before/after screenshots demonstrate clipping, and exact-head CI records the new assertion failure; no target code was executed during this read-only review. Is this the best way to solve the issue? The shared CSS owner is the smallest appropriate repair: side menus must try fitting placements before scrolling while consumer height budgets remain authoritative; the added cases cover distinct layout boundaries without new production state. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against eb07b2a38e26. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceAcceptance criteria:
What I checked:
PR surfaceSource +41, Tests +70. Total +111 across 3 files. Added test files: 0. View PR surface stats
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 October 21, 2026, 1:26 PM ET / 17:26 UTC. |
* fix(ui): fit side menus before clipping Use viewport height when sizing side overlays so native placement can flip them before clipping. Keep a centered side fallback for menus too tall for either anchored region, preserving bounded keyboard scrolling. Cover low submenu triggers and tall middle-of-screen menus in both text directions. This restores the nine-gateway switcher after the navigation rail menu placement change. * fix(ui): preserve consumer side-menu height budgets Keep the shared side-overlay height rule below consumer panel styles in specificity, including when lazy primitive CSS is inserted after layout CSS. This restores all agent rows at enlarged text without changing submenu viewport limits or positioning fallbacks. Cover an earlier-loaded consumer height budget and keyboard access in both browser engines. The original PR head reproduced the sidebar clipping in three bundled runs; its merge base passed all three. Also measure the current roster-menu icon inside its retained row. Reactive menu updates can replace an SVG between child-locator resolution and style evaluation; atomic sampling preserves the exact width assertion.
What Problem This Solves
With nine saved native gateways, the gateway submenu from the navigation rail clips its last gateway and Gateway Settings even though there is room above the trigger. The rail placement change in #179218 exposed a shared overlay issue: the height cap shrinks a menu into its initial anchor region before native positioning can detect overflow and flip it.
Measure side overlays against the viewport, allow the opposite vertical alignment, and retain bounded scrolling beside the trigger when neither anchored region fits. Keep the shared height default less specific than consumer panel styles. Otherwise lazy primitive CSS can override the agent menu's viewport budget with 420px, hiding 107px of agent rows at enlarged text. Placement remains owned by CSS; no JavaScript positioning or additional state is introduced.
Evidence
f960ba73bb16, its parent, and main. Reversing only fix: open navigation rail menus beside their controls #179218's rail placement makes the complete scenario pass. Gateway 9 originally extended to y=912 in a 900px viewport while the menu ended at y=884.fb7153861be9:sidebar-interactionsreports 107px clipped at enlarged text. The unchanged complete file passes 3/3 at merge base7f26958c4d65(8 cases each).popover.browser.test.tsx, line 159, expects the Outside button to retain focus but receivesbody; this same failure was independently reproduced with unchanged base CSS. Its bottom-start placement is outside the side-placement change.isConnected: falseand zero bounds: reactive menu refreshes retained the row but replaced its icon between locator resolution and evaluation. Query and measure the current SVG synchronously inside the retained row; keep the exact 16px, keyboard, and content assertions. The complete pinned-agent file then passed 3/3 runs, 18/18 tests, including all four widths. No wait or retry was added.Original compact gateway menu:
Follow-up enlarged agent menu: