Skip to content
TypeScript

fix(web): hide stash menu behind maximized panel (#18115)

Saikrishna Ambetifd6d9ddaab24
diff --git a/apps/web/src/components/chat/ChatComposer.tsx b/apps/web/src/components/chat/ChatComposer.tsx
index 6d672acec87..9162c4b67e0 100644
--- a/apps/web/src/components/chat/ChatComposer.tsx
+++ b/apps/web/src/components/chat/ChatComposer.tsx
@@ -1017,6 +1017,11 @@ function ComposerCommandMenuLayer(props: { anchor: HTMLElement | null; children:
window.getComputedStyle(form ?? anchor).getPropertyValue("--chat-composer-drawer-inset"),
);
const drawerInset = drawerInsetRem * rootFontSizePx;
+ const width = rect.width - drawerInset * 2;
+ if (width <= 0) {
+ setPosition(null);
+ return;
+ }
// One extra pixel prevents fractional layout coordinates from exposing
// the canvas between the drawer mask and the composer's foreground edge.
// Mirrors --chat-composer-attachment-overlap: calc(1rem + 1px).
@@ -1025,7 +1030,7 @@ function ComposerCommandMenuLayer(props: { anchor: HTMLElement | null; children:
bottom: window.innerHeight - rect.top - composerOverlap,
left: rect.left + drawerInset,
maxHeight: Math.max(96, rect.top - 24 + composerOverlap),
- width: Math.max(0, rect.width - drawerInset * 2),
+ width,
};
setPosition((current) =>
current && composerCommandMenuPositionsEqual(current, next) ? current : next,