Skip to content

fix(mosaic): coordinate pending identifier actions - #10481

Open
austincalvelage wants to merge 13 commits into
mainfrom
austin/core-4051-identifier-action-lock
Open

austincalvelage wants to merge 13 commits into
mainfrom
austin/core-4051-identifier-action-lock

Conversation

@austincalvelage

@austincalvelage austincalvelage commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

Description

Setting an email address, phone number, or wallet as primary now keeps its menu open with a pending indicator, then updates the Primary badge without moving rows. If the change needs session verification, the menu closes when the verification dialog opens. A shared section lock prevents primary changes and removal from running at the same time. Failed removals keep their confirmation dialog open with the error.

Each section controller owns the lock. usePendingAction.guard runs the removal confirmation under it, and the rows the controller returns carry their own pending state, so views no longer compare pending keys.

Fixes CORE-4051.

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 Oct 28, 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 29, 2026 3:50am UTC
swingset Ready Ready Preview Oct 29, 2026 3:50am UTC

Request Review

@changeset-bot

changeset-bot Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ee99bc2

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 Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between cb8638a and ee99bc2.

Files selected for processing: 28
  • .changeset/friendly-identifier-lock.md
  • packages/mosaic/AGENTS.md
  • packages/mosaic/docs/controllers.md
  • packages/mosaic/src/blocks/confirm/__tests__/confirm.controller.test.ts
  • packages/mosaic/src/blocks/confirm/confirm-shell.tsx
  • packages/mosaic/src/blocks/confirm/confirm.controller.ts
  • packages/mosaic/src/blocks/confirmation/__tests__/confirmation.feature.test.tsx
  • packages/mosaic/src/features/user-profile/user-profile-active-devices-section/user-profile-active-devices-section.controller.ts
  • packages/mosaic/src/features/user-profile/user-profile-contact-list-row.view.tsx
  • packages/mosaic/src/features/user-profile/user-profile-contact.types.ts
  • packages/mosaic/src/features/user-profile/user-profile-email-section/__tests__/user-profile-email-section.feature.test.tsx
  • packages/mosaic/src/features/user-profile/user-profile-email-section/user-profile-email-section.controller.ts
  • packages/mosaic/src/features/user-profile/user-profile-email-section/user-profile-email-section.types.ts
  • packages/mosaic/src/features/user-profile/user-profile-email-section/user-profile-email-section.view.tsx
  • packages/mosaic/src/features/user-profile/user-profile-phone-section/__tests__/user-profile-phone-section.feature.test.tsx
  • packages/mosaic/src/features/user-profile/user-profile-phone-section/user-profile-phone-section.controller.ts
  • packages/mosaic/src/features/user-profile/user-profile-phone-section/user-profile-phone-section.types.ts
  • packages/mosaic/src/features/user-profile/user-profile-phone-section/user-profile-phone-section.view.tsx
  • packages/mosaic/src/features/user-profile/user-profile-web3-wallets-section/__tests__/user-profile-web3-wallets-section.controller.test.tsx
  • packages/mosaic/src/features/user-profile/user-profile-web3-wallets-section/__tests__/user-profile-web3-wallets-section.feature.test.tsx
  • packages/mosaic/src/features/user-profile/user-profile-web3-wallets-section/user-profile-web3-wallet-row.view.tsx
  • packages/mosaic/src/features/user-profile/user-profile-web3-wallets-section/user-profile-web3-wallets-section.controller.ts
  • packages/mosaic/src/features/user-profile/user-profile-web3-wallets-section/user-profile-web3-wallets-section.tsx
  • packages/mosaic/src/features/user-profile/user-profile-web3-wallets-section/user-profile-web3-wallets-section.types.ts
  • packages/mosaic/src/features/user-profile/user-profile-web3-wallets-section/user-profile-web3-wallets-section.view.tsx
  • packages/mosaic/src/hooks/__tests__/use-pending-action.test.tsx
  • packages/mosaic/src/hooks/use-list-removal-focus.ts
  • packages/mosaic/src/hooks/use-pending-action.ts
Linked repositories identified

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

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

Walkthrough

The change adds boolean results to confirmation actions and a shared pending lock for direct actions and guarded confirmations. Email, phone, and wallet sections now expose per-row pending states, disable controls while actions run, and preserve their initial row order. Tests and documentation cover the updated action and confirmation behavior.

Priority: Normal

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

Possibly related PRs

  • clerk/javascript#10436: Adds pending action status to menus, which connects to the pending menu states in this change.
  • clerk/javascript#10446: Adds verification pending state in email and phone sections, which this change restructures into per-row state.
  • clerk/javascript#10406: Exposes verification pending state through email and phone section controllers, which this change updates.

Suggested reviewers: ephem

Merge Risk: Minimal · up to ee99b

The identifier-action changes appear mergeable after normal checks; no concrete behavior requiring a pre-merge fix was established.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 15.38% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title "fix(mosaic): coordinate pending identifier actions" matches the main change. The changeset adds a shared pending-action lock per section (email, phone, web3 wallets). It keeps menus open wi…
Description check Passed The description states that setting an email, phone, or wallet as primary keeps the menu open with a pending indicator. It also describes the shared section lock, the guarded removal confirmation, and…
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 "fix(mosaic): coordinate pending identifier actions" matches the main change. The changeset adds a shared pending-action lock per section (email, phone, web3 wallets). It keeps menus open with pending indicators during primary changes and guards removal. The title is concise, follows a conventional-commit style, and names the affected package.

Full details: Description check

Explanation

The description states that setting an email, phone, or wallet as primary keeps the menu open with a pending indicator. It also describes the shared section lock, the guarded removal confirmation, and the per-row pending state. These points match the raw summary's changes to the user-profile sections, the usePendingAction hook, and the controllers. The description is directly related to the changeset.

Full details: Docstring Coverage

Explanation

Docstring coverage is 15.38% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 13 functions across 25 files. (3 skipped: 3 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

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

Warning

Linked repositories: Some configured repositories could not be included in this review. Cross-repository analysis may be incomplete. Please check linked-repository access and settings.

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

@pkg-pr-new

pkg-pr-new Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/electron

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

@clerk/electron-passkeys

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

@clerk/eslint-plugin

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

@clerk/expo

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

@clerk/expo-biometrics

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

@clerk/expo-google-signin

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

@clerk/expo-native-components

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

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/hono

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

@clerk/localizations

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

@clerk/mosaic

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

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/react

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

@clerk/react-router

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/ui

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

@clerk/upgrade

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

@clerk/vue

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

commit: ee99bc2

usePendingAction gains guard(), which runs a confirmation's confirm under
the section lock, replacing runExternal and the wrapper each section
copied. Section controllers put verify and primary pending flags on the
rows they return, so views no longer compare pending keys. Confirmation
drops the disabled prop, which no reachable state could set.
Set as primary stayed pending while the session verification dialog was
open, so its menu stayed open with a spinner behind the dialog. The
pending status now ends when the dialog appears, as ActionMenu expects.
Email, phone and web3 wallet rows list the primary first when the
section loads, then keep their positions when a new primary is set, so
only the Primary badge moves. The new primary leads on the next load.

This branch was successfully deployed

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