Skip to content

feat(ui): migrate organization profile members panel to mosaic#9109

Draft
kylemac wants to merge 6 commits into
mainfrom
carp/mosaic-members-panel
Draft

feat(ui): migrate organization profile members panel to mosaic#9109
kylemac wants to merge 6 commits into
mainfrom
carp/mosaic-members-panel

Conversation

@kylemac

@kylemac kylemac commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Stress-test PR — this migration was produced by the mosaic Claude Code skill to evaluate the skill's effectiveness. Based on carp/mosaic-skills (#9106) so the diff shows only the members-panel work. Likely to be closed after review.

What this does

Migrates the OrganizationProfile members panel into Mosaic using the skill's machine → controller → view workflow, wires it into the Members tab of the Mosaic OrganizationProfile, and documents it in swingset.

Members-list section (packages/ui/src/mosaic/sections/members-list.*)

  • .machine.ts — pure flow rules: search input-value vs. committed query (SEARCH_CHANGE/SEARCH_SUBMIT) + a removing state with an injected async remove invoke and error handling. No React, no Clerk.
  • .controller.tsx — the only Clerk layer: fetches memberships keyed off the machine's query, gates on org:sys_memberships:read/:manage, derives plain MemberRow[], injects the per-row remove effect (destroy() + fire-and-forget revalidate()).
  • .view.tsx — Clerk-free rendering: search form, members table, gated Remove button, Prev/Next pagination, loading/empty/error states. Built only from existing Mosaic components.
  • .tsx — thin wrapper; renders nothing until the controller is ready.

Panel + AIO wiring

  • New organization-profile-members panel (+ view) composes the section.
  • AIO organization-profile.tsx/view take a members prop, replacing the "Members content" placeholder.

Swingset docs

MembersList (Section) and OrganizationProfileMembers (Panel) story + mdx (archetype C), AIO page updated, registered in registry.ts + DocsViewer.

Verification

  • @clerk/ui type-check: 0 errors · swingset type-check: 0 errors
  • Mosaic suite: 302 passed (incl. 27 new machine/controller/view tests)
  • Empty changeset — mosaic isn't reachable through any published @clerk/ui entry point, so no user-facing impact.

Parity audit (deferred items to track)

Read + remove + search + paginate are fully migrated. Consciously deferred (each needs a Mosaic primitive that doesn't exist yet):

  • Role editing (RoleSelect + membership.update) — needs a Mosaic Select; role renders read-only.
  • Role-set-migration warning (hasRoleSetMigration) — needs a Mosaic Alert + useFetchRoles.
  • localizeCustomRole — shows roleName instead of the localized custom role.
  • Member avatar (UserPreview image) — needs a Mosaic Avatar.

Deliberate changes: ThreeDotsMenu → inline Remove button; awaited → fire-and-forget revalidate; full numbered pagination → Prev/Next. Consistent with existing mosaic sections (hardcoded English strings, error.message). Invitations/Requests sub-tabs and the seat-usage footer were out of scope for this pass.

alexcarpenter and others added 6 commits July 7, 2026 18:44
Merge the mosaic-machine and mosaic-migration skills into one `mosaic` skill
with per-layer references (machines, controllers, views), the migration
playbook, and the parity-audit prompt. Update the skills README table and the
mosaic-architecture migration pointer.
Add a three-layer testing reference (machine/controller/view) to the mosaic
skill with real snippets from the delete-organization tests. Collapse the
skill's machines.md into a pointer to the in-tree machine/README.md +
ADOPTION.md so the machine runtime has a single source of truth. Add the testing
row to the SKILL.md router and broaden the trigger to cover testing.
Add a styling how-to to the mosaic skill covering useRecipe with single-slot and
multi-slot recipes, slot registration, the variant-vs-state distinction,
compoundVariants/sx, and the useSlot/slot sugar, grounded in the real button and
tabs components. Add the styling row to the SKILL.md router and broaden the
trigger to cover styling.
Split the active-members list into a Mosaic machine/controller/view section
(search, pagination, per-row removal with revalidate + error handling), wire it
into the Members tab of the Mosaic OrganizationProfile via a new members panel,
and document the section and panel in swingset.
@changeset-bot

changeset-bot Bot commented Jul 8, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 3e125e7

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 8, 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, Comment Jul 8, 2026 8:04pm
swingset Ready Ready Preview, Comment Jul 8, 2026 8:04pm

Request Review

@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro Plus

Run ID: f7870a0c-4d01-4591-9ae0-a79d0d9d599c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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

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