| … | … | @@ -145,9 +158,21 @@ export const ComposerCommandMenu = memo(function ComposerCommandMenu(props: { | |
| 166 | + | onScroll={updateScrollFade} | |
| 167 | + | // LegendList sizes its first window from this element before its rows give it height; | |
| 168 | + | // reserving the rows' minimum height (1.75rem each, plus p-2) fills the first frame. | |
| 169 | + | style={{ minHeight: `min(${props.items.length * 1.75 + 1}rem, 18rem)` }} | |
🟡 Medium chat/ComposerCommandMenu.tsx:169
In short windows or with an expanded composer, long inventories leave the scroller at an 18rem minimum even when the drawer is shorter, clipping the bottom rows so wheel scrolling cannot reach them. ComposerCommandMenuLayer can cap the drawer below that size, and this minHeight prevents the list from shrinking; use a shrinkable height or flex basis for the initial sizing instead.
| 1 | style={{ height: `min(${props.items.length * 1.75 + 1}rem, 18rem)` }} |
🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
| 1 | In file @apps/web/src/components/chat/ComposerCommandMenu.tsx around line 169: |
| 2 | |
| 3 | In short windows or with an expanded composer, long inventories leave the scroller at an 18rem minimum even when the drawer is shorter, clipping the bottom rows so wheel scrolling cannot reach them. `ComposerCommandMenuLayer` can cap the drawer below that size, and this `minHeight` prevents the list from shrinking; use a shrinkable height or flex basis for the initial sizing instead. |
This clipping already happens on main, so this PR doesn't introduce it. On main, the menu list is max-h-72 min-h-0 and its rows push it to 288 px. Two browser probes of main's ComposerCommandMenu measured a 288 px list inside a 150 px and a 190 px layer: the bottom rows were clipped and the wheel couldn't reach them. With this branch the list measures the same in both cases. The reserve only takes over part of the height the rows already set, capped at the same 18rem, so it can't make the list taller than main's.
The suggested fixed height would break short lists. The reserve counts 1.75rem (28 px) per row, but skill rows are 30 px tall at 1440 px wide and 34 px at 390 px. With 3 skill rows that gives 100 px for 106 px of content (130 px at 390 px), so short lists would gain a scrollbar and lose their last row.
Fitting the menu into a drawer shorter than 18rem is a separate, pre-existing layout bug in ComposerCommandMenuLayer, so I've left it out of this fix.