Skip to content

refactor(mosaic): let another card hold the organization task as one step - #10985

Open
austincalvelage wants to merge 6 commits into
mainfrom
austin/mosaic-embedded-org-task
Open

austincalvelage wants to merge 6 commits into
mainfrom
austin/mosaic-embedded-org-task

Conversation

@austincalvelage

@austincalvelage austincalvelage commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

Description

Lets another card hold the organization task as one step. Sign-up uses this in #10881. It's split out so the sign-up PR stays about sign-up.

The task stays a feature, with its own model, controller and copy. It's not a block. <TaskChooseOrganization /> is unchanged.

  • useTaskChooseOrganizationFlow(options) runs the task's model and controller and returns one controller.
  • TaskChooseOrganizationContent({ controller }) renders the task without its card and handles its own states: the steps, a card-less skeleton while organizations load, and sending the user on once the task is complete.
  • isTaskChooseOrganizationReady(controller) says when the task's data has loaded, so the parent can keep its current screen until then.
  • <TaskChooseOrganization /> is Card.Root around the same content. A new index.ts exports these.
  • enabled on the organization task, organization-list and create-organization models lets the task skip its fetches until the parent reaches it. It is not a public CreateOrganization prop.
  • views.md: "One flow per surface" becomes "One flow per feature". A feature's view renders one Flow.Root, and a feature mounted as a step of another keeps its own, as Reverification already does in the add-email dialog. This renames an existing rule to match the code.
  • views.md, "Who renders Card.Root": names the use<Feature>Flow hook and the content without the card that a mounted feature exports.

Nothing calls the new exports until #10881. The existing organization task, organization list and create-organization feature tests pass unchanged (53 tests).

Stacked on #10957.

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:

@changeset-bot

changeset-bot Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 6f584af

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 Nov 24, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
clerk-js-sandbox Ready Ready Preview Nov 25, 2026 2:34am UTC
mosaic-docs Ready Ready Preview Nov 25, 2026 2:34am UTC
swingset Ready Ready Preview Nov 25, 2026 2:34am UTC

Request Review

@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • Resume reviews
  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

Organization creation and list hooks now accept optional enabled settings, which the task model forwards to its dependent hooks. The task exposes a flow controller and separates step content from card wrappers. Its content renders loading, ready, or continuation states. Documentation describes the flow and embedding interfaces.

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

Possibly related PRs

Suggested reviewers: maxyinger

Merge Risk: Minimal · previous review 10dbf

This refactor lets another card host the organization task as one step, and TaskChooseOrganization keeps its card wrapper. No user-facing behavior change was identified, and nothing in the current code uses the new exports. Merge risk is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: the organization task's content is separated from its card so another card can host it as one step. It matches the changeset, which adds useTaskChooseOrganizationFlow,…
Description check Passed The description states that the change lets another card hold the organization task as one step. It lists the new exports, the enabled option on the models, the views.md updates, and the test results.…
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.
Full details: Title check

Explanation

The title names the main change: the organization task's content is separated from its card so another card can host it as one step. It matches the changeset, which adds useTaskChooseOrganizationFlow, a card-less TaskChooseOrganizationContent, and enabled options. The title is a single, concise sentence with a conventional refactor prefix, so it passes.

Full details: Description check

Explanation

The description states that the change lets another card hold the organization task as one step. It lists the new exports, the enabled option on the models, the views.md updates, and the test results. It relates directly to the changeset, so it passes.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Linked repositories: This review skipped 6 repositories. Cross-repository analysis may be incomplete. Check linked repository access and settings.

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between bba3b27 and 10dbf65.

Files selected for processing: 1

  • packages/mosaic/docs/views.md
Linked repositories identified

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

Included review availability: This review used your included allowance. 4 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 10 reviews per hour.

@blacksmith-sh

blacksmith-sh Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Matches Organization task renders inside another card

Tested on 6712519c — Fed the useTaskChooseOrganizationFlow controller, TaskChooseOrganizationContent showed the heading, Acme and Globex rows, create button and sign-out inside the parent card, with no second card.

Task inside parent card

Probe output

Also checked · 3 match

Matches Disabled task skips its organization fetches
Matches Ready check waits for organization data
Matches Standalone task still renders in its card

Proof on 6f584af9 (from 10dbf65d) · mocked: fake-fapi (MSW) (Mosaic's feature-test fake FAPI serves a pending session with organizations to r...) · Did Proof get it right? Yes · No

View full Proof report · React 👎 or comment @codesmith dismiss this proof to dismiss

@pkg-pr-new

pkg-pr-new Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/electron

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

@clerk/electron-passkeys

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

@clerk/eslint-plugin

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

@clerk/expo

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

@clerk/expo-biometrics

npm i https://pkg.pr.new/@clerk/expo-biometrics@10985

@clerk/expo-google-signin

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

@clerk/expo-native-components

npm i https://pkg.pr.new/@clerk/expo-native-components@10985

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/hono

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

@clerk/localizations

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

@clerk/mosaic

npm i https://pkg.pr.new/@clerk/mosaic@10985

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/react

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

@clerk/react-router

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/ui

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

@clerk/upgrade

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

@clerk/vue

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

commit: 6f584af

A whole feature embedded as one step keeps its own Flow.Root, so another
card can hold the organization task as one step. views.md records the
exception.
…is embedded

useTaskChooseOrganizationFlow runs the task's model and controller and returns
one controller. TaskChooseOrganizationContent takes it and renders the steps
without the card, or sends the user on once the task is complete, like
Reverification. TaskChooseOrganization uses the same hook. enabled stays off
the public CreateOrganization props.
Who renders Card.Root already says a feature another feature embeds exports its
steps. It now names the use<Feature>Flow hook and the two shapes it returns, and
One flow per surface points there for steps that keep their own Flow.Root.
… its own

Reverification already brings its own Flow.Root into the add-email dialog and
ConfirmShell, so one card can hold nested flows. The rule now names what it
limits, a feature's own view, and says the exported skeleton is not a surface.

This branch was successfully deployed

2 active deployments
Preview – swingset — 6f584af9 Deployed Nov 25, 2026 by vercel[bot]
Preview – clerk-js-sandbox — 6f584af9 Deployed Nov 25, 2026 by vercel[bot]
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.

1 participant