Skip to content

fix(ui): fit side menus before clipping - #179647

Merged
steipete merged 2 commits into
mainfrom
fix8/sidebar-submenu-viewport
Oct 21, 2026
Merged

steipete merged 2 commits into
mainfrom
fix8/sidebar-submenu-viewport

Conversation

@steipete

@steipete steipete commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

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

  • Original compact failure reproduced on hourly head 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.
  • Follow-up CI regression reproduced 3/3 on fb7153861be9: sidebar-interactions reports 107px clipped at enlarged text. The unchanged complete file passes 3/3 at merge base 7f26958c4d65 (8 cases each).
  • New consumer-height browser regression fails before the follow-up in both Chromium and WebKit (420px instead of its 500px budget), and passes afterward. The complete overlay presentation suite passes 26/26, covering LTR/RTL, low and middle triggers, enlarged text, viewport bounds, and keyboard access to the last item.
  • Repaired bundled sidebar and compact identity files pass 10/10. The agent menu computes its intended 884px maximum, renders at 526.5px, and shows all five agent rows. Existing assertions and timeouts are unchanged.
  • Direct overlay/menu/sidebar/tooltip browser suites: 452 passed, 1 inherited failure across 40 Chromium/WebKit file runs. WebKit popover.browser.test.tsx, line 159, expects the Outside button to retain focus but receives body; this same failure was independently reproduced with unchanged base CSS. Its bottom-start placement is outside the side-placement change.
  • All 72 requested side-menu/submenu E2E files ran through their native bundled or dedicated-server projects: 417 passed, 3 failed. Two failures are the known agent-page position and native-titlebar hover assertions covered by the peer fix below. The remaining failure exposed an independent pinned-menu fixture race. The exact empty-width failure reproduced in 1/3 runs on both the merge base and repaired head; this bottom-end menu is outside the changed CSS selectors. Diagnostics caught a detached SVG with isConnected: false and 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.
  • Component, UI E2E, and extension test typechecks, scoped oxlint, stylelint, formatting, and whitespace checks pass. Independent P0–P2 review of both the original fix and the follow-up found no actionable issues.
  • No CI dispatch or rerun. The agent-page scope and Inbox expectation changes are covered by fix(ui): align navigation tests with rail design #179574. The lead owns landing.

Original compact gateway menu:

Before: the last gateway and Gateway Settings are clipped

After: all gateways and Gateway Settings fit above the trigger

Follow-up enlarged agent menu:

Before: the shared height default hides Forge and Support

After: the consumer height budget keeps all agent rows visible

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.
@steipete steipete added the ci:full Keep ordinary native-locale CI selection on the next PR run. label Oct 21, 2026
@steipete
steipete marked this pull request as ready for review October 21, 2026 15:39
@clawsweeper

clawsweeper Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review in progress

ClawSweeper is reviewing this revision. This supersedes any previous blocked status.

View the workflow run.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 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 🔄 Running since 2026-10-21T16:50:03.633670Z 6ff07fc 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +123 to +124
--oc-overlay-right-center,
--oc-overlay-left-center;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@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. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 21, 2026
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.
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Oct 21, 2026
@clawsweeper

clawsweeper Bot commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This 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.

  • Before: The submenu extends downward and hides Gateway Settings.
  • After: The submenu fits above the trigger with all nine gateways and Gateway Settings visible.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Strong visual evidence supports the useful repair, but a directional fallback defect and a diff-caused CI failure remain.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Inspected Control UI screenshots exercise the shared overlay through the nine-gateway submenu and enlarged agent selector, showing Gateway Settings and previously hidden agent rows after repair.
Patch quality 🦐 gold shrimp (3/6) 2 actionable review findings remain.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Gateway settings and agent rows can disappear from side menus despite available viewport space.
Reason: The inspected screenshots demonstrate user value, and the maintainer-authored direction preserves the existing CSS positioning architecture.

Regression provenance

Possible 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
Reviewed head: 6ff07fce4171f3d736838455ece138d79ce6ce2b

Before merge

  • Prefer the left-centered fallback for left placements (P2) - For a left-start submenu near the vertical middle of the viewport, a tall menu can exceed both anchored vertical regions while fitting centered on either side. This list tries right-center before left-center, so an RTL submenu opens opposite its requested direction even when the left has room. Reverse these two fallbacks in the left-placement block and cover an anchor with enough horizontal room on both sides.
  • Assert the height budget without exact rendered-pixel equality (P2) - The new assertion already fails on the reviewed head in WebKit: checks-ui (1/3) measures 499.980712890625 rather than exactly 500. A fractional rendered rectangle does not establish that the consumer's 500px budget was overridden, so this introduces a CI failure for an otherwise correctly sized menu. Assert the computed max-height contract directly and retain viewport and last-item visibility checks, or explicitly settle presentation before using a justified geometry tolerance.

Findings

  • [P2] Prefer the left-centered fallback for left placements — ui/src/components/solid/overlay.css:125-126
  • [P2] Assert the height budget without exact rendered-pixel equality — ui/src/components/solid/overlay-style.browser.test.tsx:198

Tests

  • Missing end-to-end proof: The supplied visual scenarios are covered, but the centered RTL fallback needs a direction assertion when both sides fit.
Agent review details

How this fits together

Control 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]
Loading

Technical review

Best 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:

  • [P2] Prefer the left-centered fallback for left placements — ui/src/components/solid/overlay.css:125-126
    For a left-start submenu near the vertical middle of the viewport, a tall menu can exceed both anchored vertical regions while fitting centered on either side. This list tries right-center before left-center, so an RTL submenu opens opposite its requested direction even when the left has room. Reverse these two fallbacks in the left-placement block and cover an anchor with enough horizontal room on both sides.
    Confidence: 0.96
    Late finding: first raised on code an earlier review cycle already covered.
  • [P2] Assert the height budget without exact rendered-pixel equality — ui/src/components/solid/overlay-style.browser.test.tsx:198
    The new assertion already fails on the reviewed head in WebKit: checks-ui (1/3) measures 499.980712890625 rather than exactly 500. A fractional rendered rectangle does not establish that the consumer's 500px budget was overridden, so this introduces a CI failure for an otherwise correctly sized menu. Assert the computed max-height contract directly and retain viewport and last-item visibility checks, or explicitly settle presentation before using a justified geometry tolerance.
    Confidence: 1

Overall correctness: patch is incorrect
Overall confidence: 0.97

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Shared native overlay sizing and positioning keeps the original intent (b68c44c: The native overlay migration deliberately assigns positioning, flipping, and bounded scrolling to CSS while preserving consumer appearance.)
  • Pinned-agent icon measurement keeps the original intent (cef02ca: The earlier test consolidation preserves distinct sidebar behavior; this PR retains the exact icon-width assertion while avoiding evaluation of a detached child.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

Acceptance criteria:

  • pnpm --dir ui test src/components/solid/overlay-style.browser.test.tsx
  • git diff --check

What I checked:

PR surface

Source +41, Tests +70. Total +111 across 3 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 43 2 +41
Tests 2 74 4 +70
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 117 6 +111

Labels

Label changes:

  • add P2: Menu clipping affects gateway and agent selection in specific layouts; the remaining repairs are focused UI and test defects.
  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: Menu clipping affects gateway and agent selection in specific layouts; the remaining repairs are focused UI and test defects.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.
  • proof: sufficient: Contributor real behavior proof is sufficient.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

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 21, 2026, 1:26 PM ET / 17:26 UTC.

@steipete
steipete merged commit f481daa into main Oct 21, 2026
98 of 104 checks passed
@steipete
steipete deleted the fix8/sidebar-submenu-viewport branch October 21, 2026 18:19
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 22, 2026
* 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.
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: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant