| ... | @@ -1017,6 +1017,11 @@ function ComposerCommandMenuLayer(props: { anchor: HTMLElement | null; children: | ... | @@ -1017,6 +1017,11 @@ function ComposerCommandMenuLayer(props: { anchor: HTMLElement | null; children: |
| 1017 | window.getComputedStyle(form ?? anchor).getPropertyValue("--chat-composer-drawer-inset"), | 1017 | window.getComputedStyle(form ?? anchor).getPropertyValue("--chat-composer-drawer-inset"), |
| 1018 | ); | 1018 | ); |
| 1019 | const drawerInset = drawerInsetRem * rootFontSizePx; | 1019 | const drawerInset = drawerInsetRem * rootFontSizePx; |
| | 1020 | const width = rect.width - drawerInset * 2; |
| | 1021 | if (width <= 0) { |
| | 1022 | setPosition(null); |
| | 1023 | return; |
| | 1024 | } |
| 1020 | // One extra pixel prevents fractional layout coordinates from exposing | 1025 | // One extra pixel prevents fractional layout coordinates from exposing |
| 1021 | // the canvas between the drawer mask and the composer's foreground edge. | 1026 | // the canvas between the drawer mask and the composer's foreground edge. |
| 1022 | // Mirrors --chat-composer-attachment-overlap: calc(1rem + 1px). | 1027 | // Mirrors --chat-composer-attachment-overlap: calc(1rem + 1px). |
| ... | @@ -1025,7 +1030,7 @@ function ComposerCommandMenuLayer(props: { anchor: HTMLElement | null; children: | ... | @@ -1025,7 +1030,7 @@ function ComposerCommandMenuLayer(props: { anchor: HTMLElement | null; children: |
| 1025 | bottom: window.innerHeight - rect.top - composerOverlap, | 1030 | bottom: window.innerHeight - rect.top - composerOverlap, |
| 1026 | left: rect.left + drawerInset, | 1031 | left: rect.left + drawerInset, |
| 1027 | maxHeight: Math.max(96, rect.top - 24 + composerOverlap), | 1032 | maxHeight: Math.max(96, rect.top - 24 + composerOverlap), |
| 1028 | width: Math.max(0, rect.width - drawerInset * 2), | 1033 | width, |
| 1029 | }; | 1034 | }; |
| 1030 | setPosition((current) => | 1035 | setPosition((current) => |
| 1031 | current && composerCommandMenuPositionsEqual(current, next) ? current : next, | 1036 | current && composerCommandMenuPositionsEqual(current, next) ? current : next, |