Skip to content

refactor(mosaic): keep the last reverification card in the component, not the controller - #10252

Merged
alexcarpenter merged 4 commits into
mainfrom
fredrik/reverification-tweaks
Oct 16, 2026
Merged

alexcarpenter merged 4 commits into
mainfrom
fredrik/reverification-tweaks

Conversation

@Ephem

@Ephem Ephem commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Description

The reverification needs to stay pending during the retry of the action. Previously this was modelled as an explicit settled state, and it didn't reset until the user manually did so, or an action restarted.

This was cumbersome both from an implementation perspective and a public API one. This PR refactors the settled state to live inside of the <Reverification> component instead.

First commit moves the component props to a <Reverification controller={controller}> shape instead of spreading to prepare for a memo we wanted in the second commit.

The important change:

  • No manual reset is now necessary
  • Reverification only stays visible until the action is no longer pending. Before, it stayed visible until reset. If work needs to be done after the API call, like a refresh, there are two options:
    • Bake it into the wrapped action, reverification is pending as long as that's pending (this is what feels like the cleaner API, easier to reason about)
    • Teach the consumer/controller to keep showing <Reverification> even after visible goes to false

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:

Stack created with GitHub Stacks CLI • Give Feedback 💬

@vercel

vercel Bot commented Oct 15, 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 16, 2026 8:16pm UTC
swingset Ready Ready Preview Oct 16, 2026 8:16pm UTC

Request Review

@changeset-bot

changeset-bot Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 61062aa

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

@Ephem
Ephem added this pull request to stack #10254 October 15, 2026 13:45
@coderabbitai

coderabbitai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Review in 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: ASSERTIVE
  • Plan: Team
  • Run ID: 813b8d55-84b6-460b-b1cd-cb322eaf4447
📥 Commits

Reviewing files that changed from the base of the PR and between fbc6378 and 61062aa.

📒 Files selected for processing: 1
  • packages/swingset/src/app/(clerk)/live/reverification/reverification/page.tsx
🔗 Linked repositories identified

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

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

📝 Walkthrough

The reverification flow no longer uses a settled state or exposes a reset callback. It returns to inactive after cancellation or when an invocation ends. The mounted Reverification component retains the last non-idle card and renders it as held when the current controller is idle. Call sites now pass the flow through the controller prop. Tests and the story reflect the updated lifecycle and confirmation-dialog behavior.

Priority: ➖ Normal

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

Possibly related PRs

  • clerk/javascript#9864: Introduced the Mosaic reverification controller and destructive-dialog integration that this PR refactors.
  • clerk/javascript#9650: Introduced the reverification APIs whose lifecycle and component contracts this PR changes.

Suggested reviewers: alexcarpenter, austincalvelage

Merge Risk: ⚪ Minimal · up to 61062

The two live-story integrations use the required reverification controller prop, and no actionable merge risk is identified. The PR is mergeable subject to normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 8.70% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 23 functions across 13 files. 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 clearly summarizes the main change: moving the last reverification card from the controller into the component.
Description check Passed The description directly explains the reverification state refactor, the new controller prop shape, visibility behavior, and removal of manual reset requirements.
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.
  • Fix all pre-merge checks with AI
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@pkg-pr-new

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

Copy link
Copy Markdown

Open in StackBlitz

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/electron

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

@clerk/electron-passkeys

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

@clerk/eslint-plugin

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

@clerk/expo

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

@clerk/expo-biometrics

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

@clerk/expo-google-signin

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

@clerk/expo-native-components

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

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/hono

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

@clerk/localizations

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

@clerk/mosaic

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

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/react

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

@clerk/react-router

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/ui

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

@clerk/upgrade

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

@clerk/vue

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

commit: 61062aa

@alexcarpenter
alexcarpenter force-pushed the fredrik/reverification-tweaks branch from fbc6378 to 61062aa Compare October 16, 2026 20:13
@alexcarpenter
alexcarpenter merged commit 9ade885 into main Oct 16, 2026
52 checks passed
@alexcarpenter
alexcarpenter deleted the fredrik/reverification-tweaks branch October 16, 2026 20:31

This branch was successfully deployed

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

2 participants