Skip to content

refactor(ui): Make FactorTwo sub-cards prop-driven#8657

Draft
alexcarpenter wants to merge 3 commits into
prop-driven-factor-onefrom
prop-driven-factor-two
Draft

refactor(ui): Make FactorTwo sub-cards prop-driven#8657
alexcarpenter wants to merge 3 commits into
prop-driven-factor-onefrom
prop-driven-factor-two

Conversation

@alexcarpenter
Copy link
Copy Markdown
Member

Summary

  • CodeForm, BackupCodeCard, EmailCodeCard, and PhoneCodeCard no longer consume context hooks (useCoreSignIn, useEnvironment, useHandleSecondFactorResult). Parent containers provide callbacks and derived state as props.
  • SignInFactorTwo container now owns attempt callbacks (handleAttemptCode, handleAttemptBackupCode), prepare functions, and computes isResettingPassword + showNewDeviceVerificationNotice for all sub-cards.
  • SignInClientTrust gets the same treatment — provides callbacks to its sub-cards.
  • EmailLinkCard deferred (complex context dependencies, lower payoff — same as FactorOne EmailLink/Passkey).
  • Added 8 snapshot tests across CodeForm (6 variants) and BackupCodeCard (2 variants).

Stacked on #8656.

Test plan

  • All 1902 UI package tests pass (0 failures)
  • All 249 SignIn-specific tests pass (241 existing + 8 new)
  • New snapshot tests render every card variant without full Clerk runtime
  • TypeScript compilation clean
  • Manual smoke test: TOTP, phone code, backup code 2FA flows in dev server

🤖 Generated with Claude Code

@vercel
Copy link
Copy Markdown

vercel Bot commented May 26, 2026

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

Project Deployment Actions Updated (UTC)
clerk-js-sandbox Ready Ready Preview, Comment May 27, 2026 12:16am

Request Review

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 26, 2026

🦋 Changeset detected

Latest commit: 282455e

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

alexcarpenter and others added 3 commits May 26, 2026 20:12
…bility

CodeForm, BackupCodeCard, EmailCodeCard, and PhoneCodeCard no longer
read context hooks directly. Parent containers (SignInFactorTwo,
SignInClientTrust) provide attempt callbacks, prepare functions, and
derived state as props. Adds 8 snapshot tests across CodeForm and
BackupCodeCard.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…torTwoView

FactorTwoEmailLinkCard now receives signIn, callbacks, and data as props
instead of consuming context hooks. SignInFactorTwoView extracts the
rendering switch into a pure-props component. SignInClientTrust updated
to provide the new email link props. Adds 9 snapshot tests for the
FactorTwo view covering all strategies.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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