Skip to content

feat(ui): split the Mosaic popover from its surface- #9295 - #9296

Merged
alexcarpenter merged 16 commits into
mainfrom
max/mosaic-popover
Jul 31, 2026
Merged

feat(ui): split the Mosaic popover from its surface- #9295#9296
alexcarpenter merged 16 commits into
mainfrom
max/mosaic-popover

Conversation

@maxyinger

Copy link
Copy Markdown
Collaborator

Description

Continues carp/mosaic-popover — that branch's two commits (the original Mosaic Popover and the StyleX data-attribute docs) are included in this diff.

Mosaic Popover now owns only what it means to float — trigger, ARIA, positioning, stacking, viewport clamps, transition. It paints no surface: the content inside it (usually a Card) supplies background, border, radius and shadow, so only one element draws a border.

  • Removes Popover.Content / Popover.Footer, which duplicated Card.Content / Card.Footer, and the unused Popover.Arrow.
  • Adds size (sm / md / lg, reflected as data-size); md matches the legacy PopoverCard width so migrating popovers keep their footprint.
  • Adds aria-label / aria-labelledby. The positioner is always role="dialog" but had no accessible name unless a Popover.Title was rendered; a dev-only check now warns when neither is present.
  • Adds Mosaic Menu on the @clerk/headless menu primitive — role="menu", roving focus, typeahead, and submenus via Menu.SubTrigger. Unlike the popover, a menu's popup is its surface.
  • Hoists the shared floating box (stacking, clamps, enter/exit transition) into floating.styles.ts. Motion uses --cl-duration-base, linear for the fade and --cl-ease-default for the scale; reduced motion drops only transform.
  • Adds swingset pages for both components.

Known limitation: the popup caps its height at min(80dvh, 36rem) but clips rather than scrolls. The scroll region belongs to Card.Content, which gains it in austin/mosaic-card-component.

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:

alexcarpenter and others added 7 commits July 28, 2026 20:33
Reusable StyleX-styled popover built on the @clerk/headless popover
primitive: a flexible popup card with content + footer slots, enter/exit
transition driven off self data-attributes, and swingset docs.
# Conflicts:
#	packages/swingset/src/lib/registry.ts
# Conflicts:
#	packages/ui/src/mosaic/styles/index.ts
The popover now owns only what it means to float: trigger wiring, ARIA,
focus management, positioning, stacking, viewport clamps, and the
enter/exit transition. It paints no surface of its own, so the content
inside it — usually a Card — supplies the background, border, radius,
shadow and padding, and only one element ever draws a border.

Popover.Content and Popover.Footer are removed; they duplicated
Card.Content and Card.Footer. Popover.Arrow is removed as unused.

The popup gains a `size` variant (sm/md/lg), reflected as `data-size`.
`md` reproduces the width the legacy PopoverCard uses (theme.sizes.$94)
so popovers migrating onto Mosaic keep their footprint. It also wraps
long unbroken strings, which would otherwise push past that width.

The positioner is always role="dialog" but only gains aria-labelledby
once a Popover.Title mounts, so a popover with neither a Title nor a
label was an unnamed dialog. PopoverProps now accepts aria-label and
aria-labelledby, and a dev-only check warns when the rendered dialog has
neither. Both are spread conditionally: an explicit `undefined` would
delete the Title's aria-labelledby through the primitive's mergeProps.

Motion moves onto the theme tokens — `--cl-duration-base`, with
`linear` for the fade and `--cl-ease-default` for the scale. Under
prefers-reduced-motion only `transform` leaves the transition; the fade
still runs, since the movement is the concern.
The examples now compose a Card inside the popover, making that the
canonical shape so the docs supply the consistency the component no
longer enforces on its own. Adds placement and alignment demos, a
section on naming the dialog, and drops the removed Content, Footer,
and Arrow parts from the parts table.

The placement demos reserve vertical room around the trigger: without
it the flip middleware bounces a `top` popover back below the trigger
inside the short preview frame, so the demo would contradict its label.

The story moves onto the remapped Button API. The trigger render prop is
typed as Omit<React.HTMLAttributes<HTMLElement>, 'color'> — the native
`color` is a string and collides with Button's narrowed variant, which
is the same omission props.ts makes for the same reason.
@changeset-bot

changeset-bot Bot commented Jul 30, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: cc1336a

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 Jul 30, 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 Jul 31, 2026 1:03pm
swingset Ready Ready Preview Jul 31, 2026 1:03pm

Request Review

@github-actions github-actions Bot added the ui label Jul 30, 2026
@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

API Changes Report

Generated by Break Check on 2026-07-31T13:03:53.850Z

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 cc1336a.

@coderabbitai

coderabbitai Bot commented Jul 30, 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: 9523ff67-c20f-48c5-a61b-3d092dc2c770

📥 Commits

Reviewing files that changed from the base of the PR and between 65af7f7 and cc1336a.

📒 Files selected for processing (11)
  • .claude/skills/mosaic/references/stylex.md
  • packages/swingset/src/components/DocsViewer.tsx
  • packages/swingset/src/lib/registry.ts
  • packages/swingset/src/stories/popover.component.mdx
  • packages/swingset/src/stories/popover.component.stories.tsx
  • packages/ui/src/mosaic/components/popover/index.ts
  • packages/ui/src/mosaic/components/popover/popover.test.tsx
  • packages/ui/src/mosaic/components/popover/popover.tsx
  • packages/ui/src/mosaic/props.ts
  • packages/ui/src/mosaic/styles/index.ts
  • packages/ui/src/mosaic/tokens.stylex.ts
🔗 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)
🚧 Files skipped from review as they are similar to previous changes (8)
  • packages/ui/src/mosaic/components/popover/index.ts
  • packages/swingset/src/lib/registry.ts
  • .claude/skills/mosaic/references/stylex.md
  • packages/ui/src/mosaic/tokens.stylex.ts
  • packages/swingset/src/components/DocsViewer.tsx
  • packages/swingset/src/stories/popover.component.stories.tsx
  • packages/swingset/src/stories/popover.component.mdx
  • packages/ui/src/mosaic/components/popover/popover.test.tsx

📝 Walkthrough

Walkthrough

Adds a Mosaic Popover component built on headless primitives. Adds typed compound parts, StyleX styling, sizing, transitions, accessibility checks, and interaction tests. Exports the component and shared prop types. Adds Storybook stories and MDX documentation. Registers the stories and documentation in Swingset. Updates floating-origin CSS variables, motion tokens, StyleX guidance, open-button states, and release metadata.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

Suggested reviewers: austincalvelage, alexcarpenter

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. 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 summarizes the primary change: separating Mosaic Popover behavior from its surface styling.
Description check ✅ Passed The description directly explains the Popover API changes, styling separation, accessibility updates, motion behavior, and related additions.
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.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.changeset/mosaic-popover.md:
- Around line 1-2: Replace the empty changeset front matter with an appropriate
`@clerk/ui` package bump and add a concise release summary describing the public
Mosaic Popover addition. Use a breaking version bump if the removed Popover
parts were already public; otherwise select the appropriate non-breaking bump.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro Plus

Run ID: caea9f8d-0ab3-4fa1-abea-3fbd0d804db2

📥 Commits

Reviewing files that changed from the base of the PR and between b0519d2 and 9ef5efc.

📒 Files selected for processing (11)
  • .changeset/mosaic-popover.md
  • .claude/skills/mosaic/references/stylex.md
  • packages/swingset/src/components/DocsViewer.tsx
  • packages/swingset/src/lib/registry.ts
  • packages/swingset/src/stories/popover.component.mdx
  • packages/swingset/src/stories/popover.component.stories.tsx
  • packages/ui/src/mosaic/components/popover/index.ts
  • packages/ui/src/mosaic/components/popover/popover.styles.ts
  • packages/ui/src/mosaic/components/popover/popover.test.tsx
  • packages/ui/src/mosaic/components/popover/popover.tsx
  • packages/ui/src/mosaic/styles/index.ts
🔗 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)

Comment thread .changeset/mosaic-popover.md
@pkg-pr-new

pkg-pr-new Bot commented Jul 30, 2026

Copy link
Copy Markdown

Open in StackBlitz

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/electron

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

@clerk/electron-passkeys

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

@clerk/eslint-plugin

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

@clerk/expo

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

@clerk/expo-google-signin

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

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/hono

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

@clerk/localizations

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

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/react

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

@clerk/react-router

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/ui

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

@clerk/upgrade

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

@clerk/vue

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

commit: cc1336a

maxyinger and others added 5 commits July 30, 2026 17:17
The `cssVars` middleware already computed the anchor's center to derive
`--cl-transform-origin`, then discarded one axis: for top/bottom it pins Y to the
floating element's own edge, and for left/right it pins X. That makes it a hybrid
point rather than the anchor's center, so scaling about it grows the element from
its own edge instead of out of the trigger.

Emit the unmodified center as a second variable rather than changing the first.
`--cl-transform-origin` is consumed elsewhere with its edge semantics, so
redefining it would silently retarget those animations.

Unlike `--cl-transform-origin`, this one ignores the arrow: the goal is the
anchor's bounding box, not the visual connector.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`--cl-ease-default` is Swift Out: front-loaded, carrying its endpoint ~2% past
target before settling. That is an arrival curve, and reusing it for an exit fails
in three ways. It spends 90% of its travel in the first three frames and then
crawls, so most of the run is perceptually static — reported as choppy or dropped
frames, though a profile correctly shows none. Its overshoot inverts into a wobble
past the target, with nothing left to settle into. And a departure has no reason to
decelerate.

In Quad is deliberately the gentlest of the in-family. An exit covers a small
distance over few frames, so a sharper curve (In Quart, In Circ) leaves half of
them below the threshold of visible change and reproduces the same stall.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The popup had no transform-origin, so it grew from its own center and read as
appearing beside the trigger rather than out of it. It now scales about
`--cl-anchor-origin`, the trigger's bounding-box center. A pixel-precise point is
what makes this hold: keyword origins anchor to the popup's own box, so they drift
off the trigger as soon as `shift()` or `flip()` moves it.

Start scale goes 0.98 -> 0.94. Travel is `(1 - startScale) x distance(origin, popup
center)`, so origin and start scale only work as a pair — at 0.98 the effect is
about 2px and invisible.

The enter and exit now differ in duration and curve. The exit is shorter, because
an arrival earns a moment to settle and a dismissal should get out of the way, and
takes `--cl-ease-exit`. Entering, opacity is given the shorter duration so it lands
opaque as the scale reaches full size, leaving the settle to play at full strength
instead of through a fade; leaving, both share one duration so the shape does not
finish ahead of the fade and leave a motionless rectangle behind.

Reduced motion drops the scale itself, not just its transition. Removing
`transform` from `transitionProperty` stops it animating but not changing, so the
0.94 was still applied — instantly. Entering that is invisible (it happens at
`opacity: 0`), but exiting it snapped to 94% at full opacity and then faded. The
override is restated inside the media query rather than added as a sibling key:
both would otherwise compile to the same specificity and the tiebreak would be
source order, which `@stylexjs/sort-keys` reorders on autofix.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
A button that opens a popover returned to its resting fill the moment the pointer
left, so nothing on the trigger showed that the surface it controls is still open.
`[data-open]` now takes the same pressed fill as `:active` across every
filled/outline/ghost cell. `link` opts out — it reads as text, not a control.

Styling only: the disclosure primitives already set `data-open` on the trigger, and
a plain button never carries it.

`[data-open]` is excluded from hover for the same reason `:active` is. StyleX gives
at-rules extra priority, so a `@media (hover: hover)` `:hover` outranks it, and
moving the pointer over an open trigger would otherwise lift it back to the lighter
hover step.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Adds `references/motion.md`, covering the rules that came out of the popover
enter/exit work: curves have a direction and an arrival curve must not be reused
for a departure, the three axes of enter/exit asymmetry, the dead-frame test for
choosing a curve against a given delta and duration, the two transform-origin
variables and the geometry that decides how far an element travels, and the
reduced-motion trap where gating `transitionProperty` alone leaves the value change
behind. Includes the measurements each rule came from, plus a rAF sampler for
checking a transition — reading the CSS will not tell you that one stalls.

`stylex.md` gains a pointer to it, a DON'T against reusing `--cl-ease-default` for
exits, and the disclosure-trigger pattern beside the `:hover`/`:active` cascade
rule it extends. Its worked example was refreshed: it still showed a literal
`150ms`, the pre-0.94 start scale, and a reduced-motion branch that killed the fade
rather than the transform, contradicting the house rule a section above it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.claude/skills/mosaic/references/motion.md:
- Around line 32-45: Add the text language tag to the fenced code block
containing the motion measurement table, changing its opening fence to a
text-marked fence while leaving the block contents unchanged.

In `@packages/ui/src/mosaic/components/popover/popover.styles.ts`:
- Around line 30-33: Shorten the comments explaining reduced-motion behavior in
popover.styles.ts (lines 30-33) and exit easing in tokens.stylex.ts (lines
208-216) to one terse sentence each, retaining only the non-obvious rationale
and removing detailed implementation or timing descriptions.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro Plus

Run ID: 870a0a8e-7d97-4c7a-9953-d1f3443722a9

📥 Commits

Reviewing files that changed from the base of the PR and between 9ef5efc and 12f4a87.

📒 Files selected for processing (8)
  • .claude/skills/mosaic/SKILL.md
  • .claude/skills/mosaic/references/motion.md
  • .claude/skills/mosaic/references/stylex.md
  • packages/headless/src/utils/css-vars.test.ts
  • packages/headless/src/utils/css-vars.ts
  • packages/ui/src/mosaic/components/button/button.styles.ts
  • packages/ui/src/mosaic/components/popover/popover.styles.ts
  • packages/ui/src/mosaic/tokens.stylex.ts
🔗 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)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .claude/skills/mosaic/references/stylex.md

Comment on lines +32 to +45
```
ms scale opacity Δscale/frame
0 1.0000 1.000 —
33.2 0.9718 0.889 -0.0282 ┐ 90% of the shrink, 3 frames
50.7 0.9552 0.778 -0.0166 │
66.7 0.9465 0.667 -0.0087 ┘
83.4 0.9419 0.555 -0.0046
100.2 0.9397 0.445 -0.0022
117.4 0.9388 0.333 -0.0009 ← dipped BELOW the 0.94 target
133.4 0.9387 0.222 -0.0001
150.5 0.9392 0.111 +0.0005 ← and came back up
167.4 0.9400 0.000 +0.0008
186.0 REMOVED
```

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Add a language tag to the fenced code block.

Markdownlint reports MD040 for the measurement block beginning at Line 32. Mark it as text (or another appropriate language) so documentation checks pass.

Suggested fix
-```
+```text
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
```
ms scale opacity Δscale/frame
0 1.0000 1.000 —
33.2 0.9718 0.889 -0.0282 ┐ 90% of the shrink, 3 frames
50.7 0.9552 0.778 -0.0166 │
66.7 0.9465 0.667 -0.0087 ┘
83.4 0.9419 0.555 -0.0046
100.2 0.9397 0.445 -0.0022
117.4 0.9388 0.333 -0.0009 ← dipped BELOW the 0.94 target
133.4 0.9387 0.222 -0.0001
150.5 0.9392 0.111 +0.0005 ← and came back up
167.4 0.9400 0.000 +0.0008
186.0 REMOVED
```
🧰 Tools
🪛 markdownlint-cli2 (0.23.1)

[warning] 32-32: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.claude/skills/mosaic/references/motion.md around lines 32 - 45, Add the
text language tag to the fenced code block containing the motion measurement
table, changing its opening fence to a text-marked fence while leaving the block
contents unchanged.

Source: Linters/SAST tools

Comment on lines +30 to +33
// Reduced motion has to drop the scale itself, not just its transition. Dropping it
// from `transitionProperty` alone leaves the value change, which then applies
// instantly — invisible entering (it happens at `opacity: 0`) but a hard snap to 94%
// before the fade on the way out.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Apply the terse-comment rule consistently to new motion code. Keep only the non-obvious rationale in source; the current prose is too detailed and likely to drift.

  • packages/ui/src/mosaic/components/popover/popover.styles.ts#L30-L33: reduce the reduced-motion explanation to one terse rationale.
  • packages/ui/src/mosaic/tokens.stylex.ts#L208-L216: reduce the exit-easing explanation to one terse rationale.
📍 Affects 2 files
  • packages/ui/src/mosaic/components/popover/popover.styles.ts#L30-L33 (this comment)
  • packages/ui/src/mosaic/tokens.stylex.ts#L208-L216
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/ui/src/mosaic/components/popover/popover.styles.ts` around lines 30
- 33, Shorten the comments explaining reduced-motion behavior in
popover.styles.ts (lines 30-33) and exit easing in tokens.stylex.ts (lines
208-216) to one terse sentence each, retaining only the non-obvious rationale
and removing detailed implementation or timing descriptions.

Source: Coding guidelines

Records ~6px as the house target for how far an anchored surface travels as it
opens, and the rule for hitting it: travel is `(1 - s) x distance(origin, center)`,
so a taller surface pushes its own center further from the trigger and the same
start scale overshoots. Solve for the scale rather than fixing it.

Notes the three limits — a floor around 0.90 so a surface close to its origin does
not get an attention-drawing zoom to manufacture the target, that travel is
measured at the center by convention since points move in proportion to their own
distance from the origin, and that content-driven height makes any static scale an
estimate for a typical size rather than an exact normalization.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
MosaicComponentProps omitted the non-standard HTML `color` attribute from a
part's props but not from the `render` callback's argument, so every consumer
spreading those props into a Mosaic component with a `color` variant had to
strip it by hand.
Replaces the single `<Popover trigger={…}>` component with the dot-syntax parts
every other Mosaic component uses. `Popover.Popup` renders the portal and the
floating positioner itself, so neither is a part consumers compose.
# Conflicts:
#	packages/swingset/src/components/DocsViewer.tsx
#	packages/swingset/src/lib/registry.ts
@alexcarpenter
alexcarpenter merged commit 4e0a1c2 into main Jul 31, 2026
52 checks passed
@alexcarpenter
alexcarpenter deleted the max/mosaic-popover branch July 31, 2026 13:13
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