Skip to content

Conversation

@alexcarpenter
Copy link
Member

@alexcarpenter alexcarpenter commented Oct 10, 2025

Description

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:

Summary by CodeRabbit

  • New Features

    • Added a success feedback message for the OTP input field, displayed when the code is accepted.
    • Introduced a new appearance option to customize the success text for the OTP field.
  • Chores

    • Prepared patch release updates.

@changeset-bot
Copy link

changeset-bot bot commented Oct 10, 2025

🦋 Changeset detected

Latest commit: 1cd6821

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 22 packages
Name Type
@clerk/clerk-js Patch
@clerk/types Patch
@clerk/chrome-extension Patch
@clerk/clerk-expo Patch
@clerk/agent-toolkit Patch
@clerk/astro Patch
@clerk/backend Patch
@clerk/elements Patch
@clerk/expo-passkeys Patch
@clerk/express Patch
@clerk/fastify Patch
@clerk/localizations Patch
@clerk/nextjs Patch
@clerk/nuxt Patch
@clerk/react-router Patch
@clerk/clerk-react Patch
@clerk/remix Patch
@clerk/shared Patch
@clerk/tanstack-react-start Patch
@clerk/testing Patch
@clerk/themes Patch
@clerk/vue Patch

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

@vercel
Copy link

vercel bot commented Oct 10, 2025

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

Project Deployment Preview Comments Updated (UTC)
clerk-js-sandbox Ready Ready Preview Comment Oct 10, 2025 4:59pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 10, 2025

Walkthrough

Adds a success text descriptor for the OTP input field. Updates appearance keys, elements configuration, and Form feedback mapping to include a success state. Includes a changeset for patch releases of @clerk/clerk-js and @clerk/types.

Changes

Cohort / File(s) Summary
Release changeset
\.changeset/new-banks-doubt.md
Adds patch changeset for @clerk/clerk-js and @clerk/types with note: "Add success text descriptor to otp input field."
Appearance descriptor keys
packages/clerk-js/src/ui/customizables/elementDescriptors.ts
Extends APPEARANCE_KEYS with otpCodeFieldSuccessText for descriptor generation.
UI feedback rendering
packages/clerk-js/src/ui/elements/Form.tsx
In OTPInput, maps Field.Feedback.success to descriptors.otpCodeFieldSuccessText.
Types: appearance config
packages/types/src/appearance.ts
Adds otpCodeFieldSuccessText: WithOptions to ElementsConfig.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant U as User
  participant OTP as OTPInput
  participant Desc as ElementDescriptors
  participant UI as Field.Feedback

  U->>OTP: Enter valid OTP
  OTP->>Desc: Resolve descriptors (error/success)
  Desc-->>OTP: { otpCodeFieldErrorText, otpCodeFieldSuccessText }
  OTP->>UI: Render success using otpCodeFieldSuccessText
  Note over UI: Success feedback text shown for OTP field
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

A twitch of whiskers, a code delight,
New success whispers in OTP’s light.
Keys now gleam, descriptors align,
Types nod back, “the config is fine.”
Patch hops shipped—so small, so neat,
Carrot commits make features complete. 🥕🐇

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title succinctly conveys the primary change—adding an OTP success text descriptor—and correctly scopes it to the relevant packages, making it clear and specific for other developers reviewing the history.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch alexcarpenter/add-otp-success-descriptor

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between a66357e and 1cd6821.

📒 Files selected for processing (4)
  • .changeset/new-banks-doubt.md (1 hunks)
  • packages/clerk-js/src/ui/customizables/elementDescriptors.ts (1 hunks)
  • packages/clerk-js/src/ui/elements/Form.tsx (1 hunks)
  • packages/types/src/appearance.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (12)
.changeset/**

📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)

Automated releases must use Changesets.

Files:

  • .changeset/new-banks-doubt.md
packages/clerk-js/src/ui/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/clerk-js-ui.mdc)

packages/clerk-js/src/ui/**/*.{ts,tsx}: Element descriptors should always be camelCase
Use element descriptors in UI components to enable consistent theming and styling via appearance.elements
Element descriptors should generate unique, stable CSS classes for theming
Element descriptors should handle state classes (e.g., cl-loading, cl-active, cl-error, cl-open) automatically based on component state
Do not render hard-coded values; all user-facing strings must be localized using provided localization methods
Use the useLocalizations hook and localizationKeys utility for all text and error messages
Use the styled system (sx prop, theme tokens, responsive values) for custom component styling
Use useCardState for card-level state, useFormState for form-level state, and useLoadingStatus for loading states
Always use handleError utility for API errors and use translateError for localized error messages
Use useFormControl for form field state, implement proper validation, and handle loading and error states in forms
Use localization keys for all form labels and placeholders
Use element descriptors for consistent styling and follow the theme token system
Use the Card and FormContainer patterns for consistent UI structure

Files:

  • packages/clerk-js/src/ui/customizables/elementDescriptors.ts
  • packages/clerk-js/src/ui/elements/Form.tsx
packages/clerk-js/src/ui/customizables/elementDescriptors.ts

📄 CodeRabbit inference engine (.cursor/rules/clerk-js-ui.mdc)

Append new element descriptors to APPEARANCE_KEYS in packages/clerk-js/src/ui/customizables/elementDescriptors.ts

Files:

  • packages/clerk-js/src/ui/customizables/elementDescriptors.ts
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

**/*.{js,jsx,ts,tsx}: All code must pass ESLint checks with the project's configuration
Follow established naming conventions (PascalCase for components, camelCase for variables)
Maintain comprehensive JSDoc comments for public APIs
Use dynamic imports for optional features
All public APIs must be documented with JSDoc
Provide meaningful error messages to developers
Include error recovery suggestions where applicable
Log errors appropriately for debugging
Lazy load components and features when possible
Implement proper caching strategies
Use efficient data structures and algorithms
Profile and optimize critical paths
Validate all inputs and sanitize outputs
Implement proper logging with different levels

Files:

  • packages/clerk-js/src/ui/customizables/elementDescriptors.ts
  • packages/types/src/appearance.ts
  • packages/clerk-js/src/ui/elements/Form.tsx
**/*.{js,jsx,ts,tsx,json,css,scss,md,yaml,yml}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Use Prettier for consistent code formatting

Files:

  • packages/clerk-js/src/ui/customizables/elementDescriptors.ts
  • packages/types/src/appearance.ts
  • packages/clerk-js/src/ui/elements/Form.tsx
packages/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

TypeScript is required for all packages

Files:

  • packages/clerk-js/src/ui/customizables/elementDescriptors.ts
  • packages/types/src/appearance.ts
  • packages/clerk-js/src/ui/elements/Form.tsx
packages/**/*.{ts,tsx,d.ts}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Packages should export TypeScript types alongside runtime code

Files:

  • packages/clerk-js/src/ui/customizables/elementDescriptors.ts
  • packages/types/src/appearance.ts
  • packages/clerk-js/src/ui/elements/Form.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

Use proper TypeScript error types

**/*.{ts,tsx}: Always define explicit return types for functions, especially public APIs
Use proper type annotations for variables and parameters where inference isn't clear
Avoid any type - prefer unknown when type is uncertain, then narrow with type guards
Use interface for object shapes that might be extended
Use type for unions, primitives, and computed types
Prefer readonly properties for immutable data structures
Use private for internal implementation details
Use protected for inheritance hierarchies
Use public explicitly for clarity in public APIs
Prefer readonly for properties that shouldn't change after construction
Prefer composition and interfaces over deep inheritance chains
Use mixins for shared behavior across unrelated classes
Implement dependency injection for loose coupling
Let TypeScript infer when types are obvious
Use const assertions for literal types: as const
Use satisfies operator for type checking without widening
Use mapped types for transforming object types
Use conditional types for type-level logic
Leverage template literal types for string manipulation
Use ES6 imports/exports consistently
Use default exports sparingly, prefer named exports
Use type-only imports: import type { ... } from ...
No any types without justification
Proper error handling with typed errors
Consistent use of readonly for immutable data
Proper generic constraints
No unused type parameters
Proper use of utility types instead of manual type construction
Type-only imports where possible
Proper tree-shaking friendly exports
No circular dependencies
Efficient type computations (avoid deep recursion)

Files:

  • packages/clerk-js/src/ui/customizables/elementDescriptors.ts
  • packages/types/src/appearance.ts
  • packages/clerk-js/src/ui/elements/Form.tsx
**/*.{js,ts,tsx,jsx}

📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)

Support multiple Clerk environment variables (CLERK_, NEXT_PUBLIC_CLERK_, etc.) for configuration.

Files:

  • packages/clerk-js/src/ui/customizables/elementDescriptors.ts
  • packages/types/src/appearance.ts
  • packages/clerk-js/src/ui/elements/Form.tsx
packages/types/src/appearance.ts

📄 CodeRabbit inference engine (.cursor/rules/clerk-js-ui.mdc)

Add new element descriptor types in packages/types/src/appearance.ts before using them elsewhere

Files:

  • packages/types/src/appearance.ts
**/*.{jsx,tsx}

📄 CodeRabbit inference engine (.cursor/rules/development.mdc)

**/*.{jsx,tsx}: Use error boundaries in React components
Minimize re-renders in React components

**/*.{jsx,tsx}: Always use functional components with hooks instead of class components
Follow PascalCase naming for components: UserProfile, NavigationMenu
Keep components focused on a single responsibility - split large components
Limit component size to 150-200 lines; extract logic into custom hooks
Use composition over inheritance - prefer smaller, composable components
Export components as named exports for better tree-shaking
One component per file with matching filename and component name
Use useState for simple state management
Use useReducer for complex state logic
Implement proper state initialization
Use proper state updates with callbacks
Implement proper state cleanup
Use Context API for theme/authentication
Implement proper state selectors
Use proper state normalization
Implement proper state persistence
Use React.memo for expensive components
Implement proper useCallback for handlers
Use proper useMemo for expensive computations
Implement proper virtualization for lists
Use proper code splitting with React.lazy
Implement proper cleanup in useEffect
Use proper refs for DOM access
Implement proper event listener cleanup
Use proper abort controllers for fetch
Implement proper subscription cleanup
Use proper HTML elements
Implement proper ARIA attributes
Use proper heading hierarchy
Implement proper form labels
Use proper button types
Implement proper focus management
Use proper keyboard shortcuts
Implement proper tab order
Use proper skip links
Implement proper focus traps
Implement proper error boundaries
Use proper error logging
Implement proper error recovery
Use proper error messages
Implement proper error fallbacks
Use proper form validation
Implement proper error states
Use proper error messages
Implement proper form submission
Use proper form reset
Use proper component naming
Implement proper file naming
Use proper prop naming
Implement proper...

Files:

  • packages/clerk-js/src/ui/elements/Form.tsx
**/*.tsx

📄 CodeRabbit inference engine (.cursor/rules/react.mdc)

**/*.tsx: Use proper type definitions for props and state
Leverage TypeScript's type inference where possible
Use proper event types for handlers
Implement proper generic types for reusable components
Use proper type guards for conditional rendering

Files:

  • packages/clerk-js/src/ui/elements/Form.tsx
🧬 Code graph analysis (1)
packages/clerk-js/src/ui/elements/Form.tsx (2)
packages/clerk-js/src/ui/customizables/elementDescriptors.ts (1)
  • descriptors (572-572)
packages/clerk-js/src/ui/customizables/index.ts (1)
  • descriptors (10-10)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (15)
  • GitHub Check: Integration Tests (react-router, chrome)
  • GitHub Check: Integration Tests (nextjs, chrome, 14)
  • GitHub Check: Integration Tests (astro, chrome)
  • GitHub Check: Integration Tests (localhost, chrome)
  • GitHub Check: Integration Tests (sessions, chrome)
  • GitHub Check: Integration Tests (express, chrome)
  • GitHub Check: Integration Tests (generic, chrome)
  • GitHub Check: Publish with pkg-pr-new
  • GitHub Check: Static analysis
  • GitHub Check: Unit Tests (18, --filter=@clerk/astro --filter=@clerk/backend --filter=@clerk/express --filter=@c...
  • GitHub Check: Unit Tests (22, **)
  • GitHub Check: Formatting | Dedupe | Changeset
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (4)
packages/types/src/appearance.ts (1)

233-233: LGTM!

The new otpCodeFieldSuccessText descriptor type is correctly placed within the OTP code field group, follows the camelCase naming convention, and matches the pattern of the existing otpCodeFieldErrorText descriptor. This follows the coding guideline to define element descriptor types here before using them elsewhere.

.changeset/new-banks-doubt.md (1)

1-6: LGTM!

The changeset correctly targets both affected packages (@clerk/types and @clerk/clerk-js) for patch releases, and the description accurately summarizes the change.

packages/clerk-js/src/ui/customizables/elementDescriptors.ts (1)

105-105: LGTM!

The 'otpCodeFieldSuccessText' key is correctly appended to the APPEARANCE_KEYS array in the appropriate location within the OTP code field section, following the established pattern and naming convention. As per coding guidelines, this ensures the descriptor is properly mapped and available for theming.

packages/clerk-js/src/ui/elements/Form.tsx (1)

294-300: Verify success feedback support in Field.Feedback

  • Ensure Field.Feedback renders the provided success descriptor, not only error.
  • Confirm otpControl.otpInputProps.feedbackType can be set to 'success' and drives the UI success state.

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

@pkg-pr-new
Copy link

pkg-pr-new bot commented Oct 10, 2025

Open in StackBlitz

@clerk/agent-toolkit

npm i https://pkg.pr.new/@clerk/agent-toolkit@6958

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/dev-cli

npm i https://pkg.pr.new/@clerk/dev-cli@6958

@clerk/elements

npm i https://pkg.pr.new/@clerk/elements@6958

@clerk/clerk-expo

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

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/localizations

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

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/clerk-react

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

@clerk/react-router

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

@clerk/remix

npm i https://pkg.pr.new/@clerk/remix@6958

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/themes

npm i https://pkg.pr.new/@clerk/themes@6958

@clerk/types

npm i https://pkg.pr.new/@clerk/types@6958

@clerk/upgrade

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

@clerk/vue

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

commit: 1cd6821

@alexcarpenter alexcarpenter merged commit 1a2eee6 into main Oct 10, 2025
41 checks passed
@alexcarpenter alexcarpenter deleted the alexcarpenter/add-otp-success-descriptor branch October 10, 2025 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants