Skip to content

fix(site/src/components): scroll menus that do not fit the viewport - #32385

Merged
jeremyruppel merged 2 commits into
mainfrom
fix-menu-scroll-at-zoom
Nov 18, 2026
Merged

jeremyruppel merged 2 commits into
mainfrom
fix-menu-scroll-at-zoom

Conversation

@chrifro

@chrifro chrifro commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator

At 200% browser zoom, dropdown menus that held more items than fit the viewport ran past the viewport edge, and overflow-hidden on 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 menuContentClass now caps menu height at Radix's --radix-popper-available-height and scrolls vertically, so every DropdownMenu and ContextMenu (including submenus) stays inside the viewport. menuMaxHeightClassName moves from FilterCombobox/primitives.tsx into menuClasses.ts so menus and FilterCombobox share one constant. A new OpenTallerThanViewport story covers the overflowing state for visual regression.

Menus that pass their own height cap (AgentRow, DownloadSelectedAgentLogsButton, MoveToProjectMenuItems) keep it, because cn lets 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.

Menu Before After
Admin settings (mobile nav), scrolled to the end Admin settings menu before: Healthcheck and later items cut off below the viewport Admin settings menu after: menu scrolls, last item Healthcheck visible
Agents account menu Account menu before: top items cut off above the viewport Account menu after: menu starts at the viewport top and scrolls
Agents filter menu Filter menu before: top items cut off above the viewport Filter menu after: menu starts at the viewport top and scrolls

Measured menu bounds (viewport height 384px):

Menu Before After
Admin settings top 73, bottom 501, overflow: hidden top 73, bottom 384, scrolls (311 of 427px visible)
Agents account top -161, bottom 332, overflow: hidden top 0, bottom 332, scrolls (330 of 491px visible)
Agents filter top -107, bottom 225, overflow: hidden top 0, bottom 225, scrolls (223 of 330px visible)
Decision log
  • Fix in the shared class, not per menu. Every reported menu renders through DropdownMenuContent, which uses menuContentClass. Fixing it there also covers submenus and ContextMenu, and future menus cannot regress one by one.
  • Use Radix's available height. --radix-popper-available-height is the space between the trigger and the viewport edge on the side Radix chose. Popover and FilterCombobox already cap height with it.
  • overflow-y-auto overflow-x-hidden instead of overflow-hidden. Vertical scrolling makes the clipped items reachable. Horizontal stays hidden, so the open and close zoom animation and long labels behave as before.
  • Reuse menuMaxHeightClassName. Review found that FilterCombobox/primitives.tsx already exported the same literal. It moves to menuClasses.ts, the shared menu styling module, instead of being duplicated. Importing it the other way would pull cmdk into every menu consumer.
  • Story, not a unit test. jsdom has no layout, so a Vitest test could only assert class names. The OpenTallerThanViewport story 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.
  • Validation. pnpm lint (biome, oxlint, tsc, circular deps, compiler, sentence case, knip), make pre-commit, make test-js (one flake in TemplatesFilter.test.tsx under 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.

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.
@linear-code

linear-code Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

DEQ-231

DEQ-467

@chrifro
chrifro marked this pull request as ready for review November 18, 2026 13:05

@jeremyruppel jeremyruppel left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@jeremyruppel
jeremyruppel merged commit 6e02a6a into main Nov 18, 2026
26 checks passed
@jeremyruppel
jeremyruppel deleted the fix-menu-scroll-at-zoom branch November 18, 2026 22:56
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 18, 2026

This branch had an error being deployed

1 failed and 1 inactive deployments
main — 576bb241 Deployed Nov 18, 2026 by jeremyruppel via cla #259951
docs-preview — 576bb241 Deployed Nov 18, 2026 by jeremyruppel via cleanup #234
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants