Skip to content

feat(mosaic): Connected accounts wire up - #9946

Merged
austincalvelage merged 41 commits into
mainfrom
austin/connected-accounts-wire-up
Oct 2, 2026
Merged

austincalvelage merged 41 commits into
mainfrom
austin/connected-accounts-wire-up

Conversation

@austincalvelage

@austincalvelage austincalvelage commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

Description

Wire the Mosaic connected accounts section to Clerk so users can connect social providers, reconnect or retry failed accounts, and remove accounts through the existing Confirmation dialog. Preserve enterprise account restrictions, OAuth redirects and popup flows, API error messages, and focus restoration after removal. Add a live connected accounts page in Swingset.

The model owns Clerk access and returns loading, hidden, or ready state. Provider choices use the canonical settings strategy order, including custom providers. A shared recovery decision determines both the row status and the action to run. Actions recheck the signed-in user and current account after redirect preparation, and report an unavailable error when recovery is no longer possible. One action wrapper translates errors while preserving internal error codes and causes.

Separate connected-account and connect-provider rows give each view its own data and actions. The profile panel accepts connected-account and wallet sections as ReactNode slots, with a shared title ref for focus restoration.

Session reverification UI is deferred. Requests that require reverification display the API error.

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:

@vercel

vercel Bot commented Sep 25, 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 Oct 2, 2026 4:23pm UTC
swingset Ready Ready Preview Oct 2, 2026 4:23pm UTC

Request Review

@changeset-bot

changeset-bot Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1a919ae

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

@coderabbitai

coderabbitai Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

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

ℹ️ Recent review info
⚙️ Run configuration

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

Review profile: ASSERTIVE

Plan: Team

Run ID: e57bfb59-904e-4600-8aa5-e7784e02cd25

📥 Commits

Reviewing files that changed from the base of the PR and between dbae7d7 and 9f44ed7.

📒 Files selected for processing (1)
  • packages/mosaic/src/features/user-profile/user-profile-connected-accounts-section/user-profile-connected-accounts-section.controller.ts
🔗 Linked repositories identified

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

Included review availability: This review used your included allowance. 8 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.


📝 Walkthrough

Walkthrough

The change adds connected-account projection, OAuth connect, reconnect, reauthorization, and removal actions. It adds pending-state and error handling, updates the profile panel to accept connected-account and Web3-wallet slots, and adds a live connected-accounts page. Tests and FAPI helpers cover account flows, error handling, and profile-panel behavior.

Priority: ➖ Normal

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

Merge Risk: 🔵 Low · up to 9f44e

The connected-accounts changes have a bounded issue in the profile-panel example: users copying it will encounter an invalid Hook call. Move the Hook into a component before considering that example ready.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 2.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 50 functions across 30 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly identifies the main change: wiring connected accounts into Mosaic.
Description check ✅ Passed The description directly explains the connected accounts integration, supported actions, restrictions, error handling, focus restoration, and the new Swingset page.
  • Fix all pre-merge checks with AI
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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

@austincalvelage austincalvelage changed the title feat(mosiac): Connected accounts wire up feat(mosaic): Connected accounts wire up Sep 25, 2026
@austincalvelage
austincalvelage force-pushed the austin/connected-accounts-wire-up branch from a56d1d6 to da472c4 Compare September 25, 2026 20:16
@vercel
vercel Bot temporarily deployed to Preview – clerk-js-sandbox September 25, 2026 20:16 Inactive
@austincalvelage
austincalvelage force-pushed the austin/connected-accounts-wire-up branch 2 times, most recently from 2a5df4c to a73729f Compare September 25, 2026 21:12
@austincalvelage
austincalvelage force-pushed the austin/connected-accounts-wire-up branch from a73729f to a0df666 Compare September 25, 2026 21:43
@vercel
vercel Bot temporarily deployed to Preview – clerk-js-sandbox September 28, 2026 19:29 Inactive
@vercel
vercel Bot temporarily deployed to Preview – clerk-js-sandbox September 28, 2026 19:37 Inactive
@austincalvelage
austincalvelage force-pushed the austin/connected-accounts-wire-up branch 2 times, most recently from 4fbd075 to 1deb57a Compare September 28, 2026 20:03
@vercel
vercel Bot temporarily deployed to Preview – clerk-js-sandbox September 28, 2026 20:03 Inactive
@vercel
vercel Bot temporarily deployed to Preview – clerk-js-sandbox September 28, 2026 20:14 Inactive
@austincalvelage
austincalvelage force-pushed the austin/connected-accounts-wire-up branch from 34e83f5 to 4d50c80 Compare September 28, 2026 20:32

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

A lot of the helper/util behavior here is straight up duplication (with small tweaks) from the existing feature. I wonder if we should move the helpers to the shared package and reuse them across both to make it easier to keep in sync? Or if that just complicates things and creates dependencies between the two we don't want?

This isn't so much about this PR specifically, just thinking out loud about our general approach.

Pinging @alexcarpenter for thoughts too.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Added a TODO. Similar thought in the Web3 wallet todos

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Only if you think it makes sense, and only the part you think makes sense. 😄 There's nothing wrong with a bit of duplication either for things that could drift.

Maybe a good guideline is, if it's business logic we try to de-duplicate it since we will want to keep that in sync, if it's UI-related (how we show data), it should stay duplicated even if it's similar today?

return;
}

await router.navigate(url.href);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Reading this makes me wonder.. Our framework hacks to make navigate awaitable are extremely ugly and I'm scared they might break in the future. setActive is by far the hardest place to tackle, but I wonder if we should stop relying on awaiting navigations in Mosaic to at least not make the problem worse? We could override the type from useMosaicRouter to not return a promise.

We would need to find a better pattern before we just go do that ofc, which probably hinges on the overall routing story, but I think it's a good goal.

WDYT @alexcarpenter?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The model+controller is honestly so much cleaner than I thought they would be, nice!

This branch was successfully deployed

2 active deployments
Preview – swingset — 1a919aea Deployed Oct 2, 2026 by vercel[bot]
Preview – clerk-js-sandbox — 1a919aea Deployed Oct 2, 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.

3 participants