Skip to content

fix(ui): Compose the Mosaic Menu popup out of the shared ScrollArea - #9596

Merged
alexcarpenter merged 3 commits into
mainfrom
carp/mosaic-menu-fixes
Aug 27, 2026
Merged

fix(ui): Compose the Mosaic Menu popup out of the shared ScrollArea#9596
alexcarpenter merged 3 commits into
mainfrom
carp/mosaic-menu-fixes

Conversation

@alexcarpenter

@alexcarpenter alexcarpenter commented Aug 27, 2026

Copy link
Copy Markdown
Member

Description

The Mosaic Menu popup already scrolled — overflowY: auto under a max-height: var(--cl-available-height) cap — but it did so with a bare browser scrollbar, rather than the ScrollArea treatment every other overflowing Mosaic surface gets. This composes it out of the shared utilities, plus two small style fixes that started the branch.

  • Menu.Popup is now chrome + a scroll region, the same split the Dialog panel makes. The popup keeps the background, shadow, radius and the height cap and takes scrollAreaRoot; a new menu-viewport inside it takes scrollAreaViewport() and does the scrolling. They can't be one element: the edge fade is a mask-image, and a mask clips the element's whole rendering — on the popup it would eat the background and the drop shadow along with the overflowing rows.
  • The inline padding moved from the popup onto the viewport. Menu.Separator cancels that padding with a negative margin to go full-bleed; from inside a viewport that clips its inline axis, a bleed past the popup's padding would be clipped instead. Geometry is unchanged.
  • Menu.Item height was space['7'] (1.75rem). Bumped to space['8'] (2rem).
  • Rows no longer squash instead of scrolling. Menu.Item and Menu.Separator sat in the height-capped flex column at flex's default shrink: 1, so a full menu compressed its rows to fit the cap rather than overflowing it — rows rendered at 26px instead of the 32px above, and the popup did not scroll at all until the rows bottomed out at min-content height. Both are now flexShrink: 0.
  • Dropped an inert overflow-x. The popup set overflowX: 'visible' alongside overflowY: 'auto'. CSS computes visible to auto when the other axis isn't visible, so the declaration never did anything — it just read as though the popup allowed horizontal overflow.

A Menu / Overflowing swingset story renders more rows than fit, so the fade and the themed thumb are visible.

Checklist

  • pnpm test runs as expected.
  • pnpm build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

Menu items were `space['7']` (1.75rem) tall; bump to `space['8']` (2rem).

`overflowX: 'visible'` on the popup was inert — CSS computes `visible` to
`auto` when the other axis is `auto`, so it only read as if it did something.
@changeset-bot

changeset-bot Bot commented Aug 27, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 2ba5a29

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 0 packages

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercel Bot commented Aug 27, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
clerk-js-sandbox Ready Ready Preview Aug 27, 2026 7:20pm
swingset Ready Ready Preview Aug 27, 2026 7:20pm

Request Review

@pkg-pr-new

pkg-pr-new Bot commented Aug 27, 2026

Copy link
Copy Markdown

Open in StackBlitz

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@9596

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@9596

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@9596

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@9596

@clerk/electron

npm i https://pkg.pr.new/@clerk/electron@9596

@clerk/electron-passkeys

npm i https://pkg.pr.new/@clerk/electron-passkeys@9596

@clerk/eslint-plugin

npm i https://pkg.pr.new/@clerk/eslint-plugin@9596

@clerk/expo

npm i https://pkg.pr.new/@clerk/expo@9596

@clerk/expo-google-signin

npm i https://pkg.pr.new/@clerk/expo-google-signin@9596

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@9596

@clerk/express

npm i https://pkg.pr.new/@clerk/express@9596

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@9596

@clerk/hono

npm i https://pkg.pr.new/@clerk/hono@9596

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@9596

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@9596

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@9596

@clerk/react

npm i https://pkg.pr.new/@clerk/react@9596

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@9596

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@9596

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@9596

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@9596

@clerk/ui

npm i https://pkg.pr.new/@clerk/ui@9596

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@9596

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@9596

commit: 2ba5a29

@github-actions

github-actions Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

API Changes Report

Generated by Break Check on 2026-08-27T19:21:21.832Z

Summary

Metric Count
Packages analyzed 19
Packages with changes 0
🔴 Breaking changes 0
🟡 Non-breaking changes 0
🟢 Additions 0

No API Changes Detected

All packages have stable APIs with no detected changes.


Report generated by Break Check

Last ran on 2ba5a29.

@coderabbitai

coderabbitai Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 804a1b78-3a6c-4bdb-8741-0b7da4a6421c

📥 Commits

Reviewing files that changed from the base of the PR and between 79e6fe2 and 2ba5a29.

📒 Files selected for processing (3)
  • packages/swingset/src/stories/menu.component.stories.tsx
  • packages/ui/src/mosaic/components/menu/menu.styles.ts
  • packages/ui/src/mosaic/components/menu/menu.test.tsx
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • clerk/clerk_go (manual)
  • clerk/dashboard (manual)
  • clerk/accounts (manual)
  • clerk/backoffice (manual)
  • clerk/clerk (manual)
  • clerk/clerk-docs (manual)
  • clerk/cloudflare-workers (manual)
  • clerk/cli (auto-detected)
  • clerk/clerk-ios (auto-detected)
  • clerk/clerk-android (auto-detected)

Included review availability: 5 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 8 reviews per hour.


📝 Walkthrough

Walkthrough

The Mosaic menu now renders its content inside a dedicated scrolling viewport. Popup styles remain separate from viewport spacing and layout styles. Menu items and separators prevent flex shrinking. Menu item height increases from space['7'] to space['8']. Tests and SwingSet documentation cover overflowing menus.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to 2ba5a

This PR updates the Mosaic menu to use the shared scrolling treatment and corrects row sizing and overflow behavior. No actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely identifies the main change: composing the Mosaic Menu popup with the shared ScrollArea.
Description check ✅ Passed The description accurately explains the ScrollArea composition, flex-shrink fixes, padding changes, and added scrolling story. It is directly related to the changeset.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI

Comment @coderabbitai help to get the list of available commands.

The popup already scrolled — `overflowY: auto` under a `--cl-available-height`
cap — but with a bare scrollbar instead of the ScrollArea treatment every other
overflowing Mosaic surface gets.

Split `Menu.Popup` the way the Dialog panel is split: the popup keeps the chrome
and the height cap, and a new `menu-viewport` inside it carries
`scrollAreaViewport()`. They cannot be one element, because the fade is a
`mask-image` and a mask clips the element's whole rendering — on the popup it
would eat the background and the drop shadow along with the overflowing rows.

The inline padding moves onto the viewport so `Menu.Separator`'s negative-margin
bleed still reaches a padding-box edge rather than being clipped.

Adds an `Overflowing` swingset story so the scroll styling is visible.
@alexcarpenter alexcarpenter changed the title fix(ui): Correct Mosaic menu item height and drop no-op overflow-x fix(ui): Compose the Mosaic Menu popup out of the shared ScrollArea Aug 27, 2026
`Menu.Item` and `Menu.Separator` sat in a height-capped flex column at flex's
default `shrink: 1`, so a full menu compressed its rows to fit the cap rather
than overflowing it. Rows rendered at 26px instead of the 32px they ask for, and
the popup never scrolled at all until the rows hit their min-content height.

Pin both to `flexShrink: 0`. This is what made the row-height fix in this branch
observable, and what makes the ScrollArea treatment reachable.

Widens the `Overflowing` swingset fixture to 60 rows so it overflows on tall
displays too; at 36 it only just cleared the cap on a 1323px viewport.
@alexcarpenter
alexcarpenter merged commit dc7fab3 into main Aug 27, 2026
81 of 86 checks passed
@alexcarpenter
alexcarpenter deleted the carp/mosaic-menu-fixes branch August 27, 2026 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants