Skip to content

Studio: open the sidebar More menu on hover again - #12339

Merged
shimmyshimmer merged 2 commits into
mainfrom
fix/sidebar-more-hover
Sep 30, 2026
Merged

shimmyshimmer merged 2 commits into
mainfrom
fix/sidebar-more-hover

Conversation

@shimmyshimmer

@shimmyshimmer shimmyshimmer commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

#12216 made the sidebar More menu click-only to stop its tooltip covering the open menu. The tooltip problem came from the old press handler (onPointerDownCapture with stopPropagation), not from hover itself, so this brings hover back without that handler and keeps the #12216 tooltip fixes.

Behavior:

  • Mouse hover on the row opens the menu, and it stays open while the pointer moves into it. Leaving both closes it after a 180ms grace period.
  • A press pins the menu open, and a second press closes it. The trigger's own press is not treated as an outside press.
  • Hover reacts to mouse pointers only. Touch and keyboard open it through the trigger as before.
  • The tooltip stays hidden while the menu is open.
  • A hover preview no longer moves focus. Before Fix sidebar More menu hover and collapsed border hover #12216, passing over More pulled the caret out of the composer. Focus now moves only when the menu is opened with a press, tap or keyboard, including a press that pins an open preview, so arrow keys reach the menu and Escape returns focus to the row.

sidebar-more-menu-interaction.test.ts is rewritten to cover hover, press to pin, the #12216 tooltip behavior and focus handling. The hover rationale in nonmodal-menu-dismiss-guard.test.ts is restored.

Validation

  • Full frontend suite: 9,499 tests passed.
  • tsc -b and the test tsconfig pass.
  • Checked in the browser: hover opens, moving into the menu keeps it open, leaving closes it, a press pins it, a second press closes it, an outside click closes it, and the composer keeps focus during a hover preview. After pinning a preview, ArrowDown moves to the first item and Escape returns focus to More.

#12216 made the More menu click-only to stop its tooltip covering the
open menu. That came from the old press handler swallowing the event,
not from hover, so hover is restored without it.

Mouse hover previews the menu and a 180ms grace period covers the gap
to it. A press pins or unpins it. Touch and keyboard open it through
the trigger as usual. A hover preview leaves focus where it was, so
passing over More no longer pulls the caret out of the composer.
@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex review

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-30T06:29:36.607101Z 30f9b59 Manual request
ℹ️ 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.

A press on More while the hover preview is open pinned the menu, but the
content was already mounted, so Radix never moved focus and it stayed in
the composer. Focus the menu content on that press, as a click-open does,
so arrow keys reach the menu and Escape returns focus to the row.
@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: 30f9b592a9

ℹ️ 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".

@shimmyshimmer
shimmyshimmer merged commit 9c903ab into main Sep 30, 2026
31 of 39 checks passed
@shimmyshimmer
shimmyshimmer deleted the fix/sidebar-more-hover branch September 30, 2026 06:30
shimmyshimmer added a commit that referenced this pull request Sep 30, 2026
* Studio: keep menus and popovers below the desktop titlebar

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

* Studio: keep the message More menu below the desktop titlebar

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.

* Studio: cap popovers at the height below the titlebar

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.

* Studio: cap dropdown submenus at the available height

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.

* Studio: cap context submenus at the available height

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant