Repository navigation
fix(site/src/components): scroll menus that do not fit the viewport - #32385
Conversation
At 200% browser zoom the Admin settings, user, and Agents filter and account menus grew past the viewport edge, and overflow-hidden made the clipped items unreachable (WCAG 1.4.4). Cap menu content at Radix's available height and scroll vertically. Move menuMaxHeightClassName into menuClasses.ts so the menus and FilterCombobox share one constant.
jeremyruppel
left a comment
There was a problem hiding this comment.
Reviewed at 576bb24. Moving the height cap and vertical scrolling into the shared menuContentClass fixes the reported menus (Admin settings, user menu, Agents filter and account menus, and their submenus) at 200% zoom. I checked this in Storybook at 683x384: each menu ends at the viewport edge and scrolls, and End scrolls the last item into view. At 1366x768 nothing scrolls. Callers that set their own height or overflow still override the defaults through cn.
Nits (optional): shorten the moved menuMaxHeightClassName JSDoc so it doesn't describe FilterCombobox from inside the DropdownMenu module; give OpenTallerThanViewport the existing desktopZoom200 viewport; consider overscroll-contain on the menu content.
Follow-ups filed (pre-existing): DEQ-640 menus with a fixed max height can still overflow at 200% zoom; DEQ-641 the Proxy menu's proxy list collapses and nests a second scrollbar on short viewports.
🤖 Generated by Coder Agents on behalf of @jeremyruppel.
At 200% browser zoom, dropdown menus that held more items than fit the viewport ran past the viewport edge, and
overflow-hiddenon the menu content left the clipped items unreachable (WCAG 1.4.4, Resize text). This hit the Admin settings menu, the user menu, and the Agents sidebar filter and account menus.The shared
menuContentClassnow caps menu height at Radix's--radix-popper-available-heightand scrolls vertically, so everyDropdownMenuandContextMenu(including submenus) stays inside the viewport.menuMaxHeightClassNamemoves fromFilterCombobox/primitives.tsxintomenuClasses.tsso menus andFilterComboboxshare one constant. A newOpenTallerThanViewportstory covers the overflowing state for visual regression.Menus that pass their own height cap (
AgentRow,DownloadSelectedAgentLogsButton,MoveToProjectMenuItems) keep it, becausecnlets the caller's class win.Fixes DEQ-467, DEQ-231
Proof
Captured from the real app (
./scripts/develop.sh) with Playwright at a 683×384 CSS viewport, which is a 1366×768 screen at 200% zoom.Measured menu bounds (viewport height 384px):
overflow: hiddenoverflow: hiddenoverflow: hiddenDecision log
DropdownMenuContent, which usesmenuContentClass. Fixing it there also covers submenus andContextMenu, and future menus cannot regress one by one.--radix-popper-available-heightis the space between the trigger and the viewport edge on the side Radix chose.PopoverandFilterComboboxalready cap height with it.overflow-y-auto overflow-x-hiddeninstead ofoverflow-hidden. Vertical scrolling makes the clipped items reachable. Horizontal stays hidden, so the open and close zoom animation and long labels behave as before.menuMaxHeightClassName. Review found thatFilterCombobox/primitives.tsxalready exported the same literal. It moves tomenuClasses.ts, the shared menu styling module, instead of being duplicated. Importing it the other way would pull cmdk into every menu consumer.OpenTallerThanViewportstory gives Pixel a snapshot of the capped, scrollable state. With the fix reverted, the story's menu measures 1456px in a 384px frame; with it, 322px.pnpm lint(biome, oxlint, tsc, circular deps, compiler, sentence case, knip),make pre-commit,make test-js(one flake inTemplatesFilter.test.tsxunder full-suite load, which then passed 8 of 8 targeted runs), the DropdownMenu Storybook tests, and the frontend-deep-review roles, whose one should-fix (reuse the existing constant) is applied.Generated by Coder Agents on behalf of @chrifro.