Skip to content

refactor(ui): Make FactorOne sub-cards prop-driven#8656

Draft
alexcarpenter wants to merge 3 commits into
improve-ui-testabilityfrom
prop-driven-factor-one
Draft

refactor(ui): Make FactorOne sub-cards prop-driven#8656
alexcarpenter wants to merge 3 commits into
improve-ui-testabilityfrom
prop-driven-factor-one

Conversation

@alexcarpenter
Copy link
Copy Markdown
Member

Summary

  • PasswordCard, CodeForm, and AlternativeChannelCodeForm no longer consume context hooks (useCoreSignIn, useRouter, useHandleFirstFactorResult). The parent SignInFactorOne container provides callbacks and data as props.
  • Parent owns all status routing (via shared hooks from PR refactor(ui): Shared sign-in hooks + snapshot test helper #8652) and error classification (pwned/compromised passwords).
  • useFetch stays in CodeForm but calls props.onPrepare(factor) instead of signIn.prepareFirstFactor(factor) directly.
  • Extracted factorKey() to utils.ts (was inline in SignInFactorOne).
  • Added 8 snapshot tests across PasswordCard (5) and CodeForm (3) using renderForSnapshot from PR refactor(ui): Shared sign-in hooks + snapshot test helper #8652.

Stacked on #8652.

Test plan

  • All 1894 UI package tests pass (0 failures)
  • All 241 SignIn-specific tests pass
  • New snapshot tests render every card variant without full Clerk runtime
  • TypeScript compilation clean
  • Manual smoke test: password + code sign-in flows in dev server

🤖 Generated with Claude Code

alexcarpenter and others added 2 commits May 26, 2026 18:31
…bility

PasswordCard, CodeForm, and AlternativeChannelCodeForm no longer read
context hooks (useCoreSignIn, useRouter, useHandleFirstFactorResult).
Parent container provides callbacks and data as props. Adds snapshot
tests for both card types.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@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:12am

Request Review

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 26, 2026

🦋 Changeset detected

Latest commit: 0cd0fcf

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

…s prop-driven

Container/view split for FactorOne: SignInFactorOne becomes a pure
container (context + state), SignInFactorOneView is a pure-props
component rendering the correct sub-card. EmailLinkCard, Passkey,
and EnterpriseConnections are now prop-driven. Adds 9 snapshot tests
for the view component covering all factor strategies.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
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