Skip to content

Commit 68576eb

Browse files
committed
fix(web): keep the slash menu above the composer when vertical space is short
The command menu layer is bottom-anchored with a maxHeight derived from the space above the composer, but nothing made its content respect that cap: the list carries a fixed max height, so with the bottom terminal open the composer sits high enough that the menu's content exceeds the layer and the excess sticks out below the anchor line into the prompt box. The layer is now a flex column and the surface and list shrink with it, so a short viewport scrolls the list instead of overflowing the composer. Fixes #9556
1 parent 5f878d2 commit 68576eb

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎apps/web/src/components/chat/ChatComposer.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -758,7 +758,7 @@ function ComposerCommandMenuLayer(props: { anchor: HTMLElement | null; children:
758758

759759
return createPortal(
760760
<div
761-
className="pointer-events-auto fixed z-40"
761+
className="pointer-events-auto fixed z-40 flex flex-col"
762762
data-composer-drawer-layer="true"
763763
style={{
764764
bottom: position.bottom,

‎apps/web/src/components/chat/ComposerCommandMenu.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,11 @@ export const ComposerCommandMenu = memo(function ComposerCommandMenu(props: {
9191
>
9292
<ComposerBanner.Surface
9393
ref={listRef}
94-
className="w-full overflow-hidden pb-(--chat-composer-attachment-overlap) **:data-[slot=scroll-area-scrollbar]:data-[orientation=vertical]:my-4"
94+
className="flex min-h-0 w-full flex-col overflow-hidden pb-(--chat-composer-attachment-overlap) **:data-[slot=scroll-area-scrollbar]:data-[orientation=vertical]:my-4"
9595
data-composer-command-drawer="true"
9696
>
9797
{props.items.length > 0 ? (
98-
<CommandList className="max-h-72 scroll-pb-6">
98+
<CommandList className="max-h-72 min-h-0 scroll-pb-6">
9999
<CommandGroup>
100100
{props.items.map((item) => (
101101
<ComposerCommandMenuItem

0 commit comments

Comments
 (0)