Repository navigation
Studio: keep menus and popovers below the desktop titlebar - #12348
Conversation
The desktop titlebar paints over body-portaled surfaces, but Radix sizes and places menus against the window edge. A menu opening upward in a short window was capped to the full height above its trigger, so its top rows sat behind the titlebar. The floating primitives (dropdown, context menu, menubar, popover, select, hover card, combobox) now add --studio-window-chrome-top to their top collision padding, so Radix caps, flips and shifts against the titlebar's bottom edge. The value is read once and refreshed when the desktop chrome or macOS zoom changes. It is 0 in a browser. Also lets more-menu-separator-gap.test.ts match the More flyout now that it carries a ref (#12339).
|
@codex review |
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. |
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
The message action bar's More menu is assistant-ui's own Radix content, not DropdownMenuContent, so it missed the titlebar padding. Its height was also uncapped: when neither side has room, a menu that flips up keeps its full height and still runs under the titlebar, since padding only moves it sideways. Give it the titlebar collision padding and cap it at Radix's available height, so it stops at the titlebar and scrolls.
|
Pushed 2495705 to cover the message action bar's More menu. That menu is It now uses Checked at 900x380 with a 34px titlebar simulated and the More trigger at y=205:
With no titlebar the menu is unchanged (top 11px, 190px). The composer Also checked the rest of the primitives while here: the Windows titlebar is
|
|
@codex review |
Radix's collision padding moves a popover but doesn't shrink it, so a tall one (like the Agents model picker) could cover its trigger or run under the desktop titlebar. Cap PopoverContent at the available height and scroll. Callers that set their own max-h or overflow keep them.
|
@codex review |
DropdownMenuSubContent had no max height, so a long submenu (projects, the composer More list) could run past the window or under the titlebar with its rows out of reach. Cap it and scroll an inner viewport, like the top-level menu.
|
@codex review |
ContextMenuSubContent had no max height of its own. The sidebar's Move to and Section submenus already pass one, so cap and scroll the primitive like ContextMenuContent for any other caller. Those two render the same.
|
@codex review |
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
…top-titlebar # Conflicts: # studio/frontend/tests/more-menu-separator-gap.test.ts
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
In the desktop app, a dropdown that opens upward in a short window can end up with its top rows hidden behind the titlebar. The composer's
+menu is the easiest way to see it.The titlebar paints over body-portaled surfaces. Dialogs, toasts and the settings window already stay clear of it with
--studio-window-chrome-top, but Radix sizes and places menus against the window edge. So a menu capped to "the space above the trigger" was allowed to reach y=0, and the part under the titlebar could not be seen or clicked.The shared floating primitives now add the titlebar height to the top of their collision padding:
DropdownMenuContentandDropdownMenuSubContentContextMenuContentandContextMenuSubContentMenubarContentandMenubarSubContentPopoverContent,SelectContent,HoverCardContentDropdownMenuContent. It also gets a max height of Radix's available height: padding only moves a menu sideways, so without a cap a menu that flips up with no room on either side keeps its full height and still runs under the titlebar.PopoverContentalso gets that cap, with vertical scrolling, as popovers are often tall (the Agents model picker is a search box plus a 288px list). Callers that set their ownmax-horoverflowkeep them.DropdownMenuSubContentgets the same cap asDropdownMenuContent, with an inner scrolling viewport, so a long submenu (projects, the composer More list) stays reachable.ContextMenuSubContentis capped and scrolls the same way asContextMenuContent. The sidebar's Move to and Section submenus already set this themselves, so they render the same; this covers any other caller.Radix then caps, flips and shifts against the titlebar's bottom edge instead of the window edge, so every menu built on these gets the fix. A caller's own
collisionPaddingis kept and added to.The height comes from a small store in
src/lib/window-chrome.ts. It reads--studio-window-chrome-toponce, is refreshed byDesktopChromeVarsEffectwhen the chrome variables change, and follows interface zoom on macOS, where the titlebar inset is divided by the zoom. It is 0 in a browser, so the web UI is unchanged.Validation
tsc -band the test tsconfig pass.window-chrome-collision.test.tscovers the padding math and checks that each primitive, the message More menu and the refresh paths use it.+menu:Message More menu at 900x380, trigger at y=205 so the menu flips up:
Agents model picker at 900x460, trigger at y=313 so the popover opens up:
Composer
+> More submenu at 900x200: