🪁 fix: Keep Tool Flyouts in View (#15404)

* fix: keep tools menu submenus within the viewport

* fix: let the viewport cap override the submenu min-width
This commit is contained in:
alexsr1 2026-08-31 15:42:52 +02:00 • committed by GitHub
parent 26887bc5a9
commit 7b0b145159
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 2 deletions

View file

@ -89,8 +89,11 @@ const ArtifactsSubMenu = React.forwardRef<HTMLButtonElement, ArtifactsSubMenuPro
<Ariakit.Menu
portal={true}
unmountOnHide={true}
gutter={12}
shift={24}
flip="left bottom-end top-end"
className={cn(
'animate-popover-left z-40 ml-3 mt-6 flex min-w-[250px] flex-col rounded-xl',
'animate-popover-left z-40 flex min-w-[min(250px,calc(100vw-1rem))] max-w-[calc(100vw-1rem)] flex-col rounded-xl',
'border border-border-light bg-surface-secondary shadow-lg',
)}
>

View file

@ -89,9 +89,11 @@ const MCPSubMenu = React.forwardRef<HTMLButtonElement, MCPSubMenuProps>(
<Ariakit.Menu
portal={true}
unmountOnHide={true}
gutter={12}
flip="left bottom-end top-end"
aria-label={localize('com_ui_mcp_servers')}
className={cn(
'animate-popover-left z-40 ml-3 flex min-w-[260px] max-w-[320px] flex-col rounded-xl',
'animate-popover-left z-40 flex min-w-[min(260px,calc(100vw-1rem))] max-w-[min(320px,calc(100vw-1rem))] flex-col rounded-xl',
'border border-border-light bg-presentation p-1.5 shadow-lg',
)}
>