Skip to content

Conversation

@LauraBeatris
Copy link
Member

@LauraBeatris LauraBeatris commented Dec 12, 2025

Description

We're changing our Dashboard UI (https://github.com/clerk/dashboard/pull/7802) to have two options:

  • Require organization membership
  • Allow personal accounts

This change should also be applied to the enablement prompt here. It replaces the toggle with a radio group.

CleanShot 2025-12-12 at 11 32 47

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

    • Replaced the previous toggle with a radio button group to choose organization access mode (require organization membership or allow personal accounts). Improved accessibility, descriptions, and layout for clearer selection and smoother enable flow.
  • Chores

    • Added a patch release entry for the UI package to include this change in the next release.

✏️ Tip: You can customize this high-level summary in your review settings.

@LauraBeatris LauraBeatris self-assigned this Dec 12, 2025
@changeset-bot
Copy link

changeset-bot bot commented Dec 12, 2025

🦋 Changeset detected

Latest commit: 7e7646e

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

This PR includes changesets to release 2 packages
Name Type
@clerk/ui Patch
@clerk/chrome-extension 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 Dec 12, 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 Dec 12, 2025 4:24pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 12, 2025

Walkthrough

Replaces the Switch-based UI in EnableOrganizationsPrompt with a controlled RadioGroup (two options) and adds a changeset patch entry for @clerk/ui. Imports, layout, and accessibility attributes were updated to support radio options while preserving the existing enable/flow logic.

Changes

Cohort / File(s) Summary
Changeset Entry
.changeset/tasty-coats-tickle.md
Adds a changeset entry indicating a patch release for @clerk/ui and notes the EnableOrganizationsPrompt now uses a RadioGroup.
Component Refactor
packages/ui/src/components/devPrompts/EnableOrganizationsPrompt/index.tsx
Replaces the Switch control with a controlled RadioGroup and RadioGroupItem options, introduces a RadioGroup context via createContextAndHook, updates imports and layout, adds aria-describedby linkage for descriptions, removes switch-specific logic, and retains the enable flow and environment handling.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Focus areas:
    • Verify RadioGroup and RadioGroupItem context and controlled value/onChange behavior
    • Confirm accessibility attributes (aria-describedby, roles, labels) for radio options
    • Review styling, focus, and active states for radio items
    • Ensure enable/disable logic and environment parameter handling remained unchanged

Poem

🐇 I hopped in to swap a switch for two rings,
Little circles ready to sing.
One says "organization", one says "me",
A tidy choice beneath the tree.

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 clearly and specifically describes the main change: introducing a radio group component to the EnableOrganizationsPrompt.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ 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 laura/orgs-1033-update-enableorganizationsprompt-component-to-display-new

📜 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 53279ca and 7e7646e.

📒 Files selected for processing (2)
  • .changeset/tasty-coats-tickle.md (1 hunks)
  • packages/ui/src/components/devPrompts/EnableOrganizationsPrompt/index.tsx (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .changeset/tasty-coats-tickle.md
🧰 Additional context used
📓 Path-based instructions (12)
**/*.{js,jsx,ts,tsx}

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

All code must pass ESLint checks with the project's configuration

Files:

  • packages/ui/src/components/devPrompts/EnableOrganizationsPrompt/index.tsx
**/*.{js,jsx,ts,tsx,json,md,yml,yaml}

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

Use Prettier for consistent code formatting

Files:

  • packages/ui/src/components/devPrompts/EnableOrganizationsPrompt/index.tsx
packages/**/src/**/*.{ts,tsx}

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

TypeScript is required for all packages

Files:

  • packages/ui/src/components/devPrompts/EnableOrganizationsPrompt/index.tsx
**/*.{ts,tsx,js,jsx}

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

Follow established naming conventions (PascalCase for components, camelCase for variables)

Files:

  • packages/ui/src/components/devPrompts/EnableOrganizationsPrompt/index.tsx
packages/**/src/**/*.{ts,tsx,js,jsx}

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

packages/**/src/**/*.{ts,tsx,js,jsx}: Maintain comprehensive JSDoc comments for public APIs
Use tree-shaking friendly exports
Validate all inputs and sanitize outputs
All public APIs must be documented with JSDoc
Use dynamic imports for optional features
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
Implement proper logging with different levels

Files:

  • packages/ui/src/components/devPrompts/EnableOrganizationsPrompt/index.tsx
**/*.ts?(x)

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

Use proper TypeScript error types

Files:

  • packages/ui/src/components/devPrompts/EnableOrganizationsPrompt/index.tsx
**/*.tsx

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

**/*.tsx: Use error boundaries in React components
Minimize re-renders in React components

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

Files:

  • packages/ui/src/components/devPrompts/EnableOrganizationsPrompt/index.tsx
**/*.{md,tsx}

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

Update documentation for API changes

Files:

  • packages/ui/src/components/devPrompts/EnableOrganizationsPrompt/index.tsx
**/*.{jsx,tsx}

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

**/*.{jsx,tsx}: Always use functional components with hooks instead of class components
Follow PascalCase naming for components (e.g., 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
Separate UI components from business logic components
Use useState for simple state management in React components
Use useReducer for complex state logic in React components
Implement proper state initialization in React components
Use proper state updates with callbacks in React components
Implement proper state cleanup in React components
Use Context API for theme/authentication state management
Implement proper state persistence in React applications
Use React.memo for expensive components
Implement proper useCallback for handlers in React components
Use proper useMemo for expensive computations in React components
Implement proper virtualization for lists in React components
Use proper code splitting with React.lazy in React applications
Implement proper cleanup in useEffect hooks
Use proper refs for DOM access in React components
Implement proper event listener cleanup in React components
Use proper abort controllers for fetch in React components
Implement proper subscription cleanup in React components
Use proper HTML elements for semantic HTML in React components
Implement proper ARIA attributes for accessibility in React components
Use proper heading hierarchy in React components
Implement proper form labels in React components
Use proper button types in React components
Implement proper focus management for keyboard navigation in React components
Use proper keyboard shortcuts in React components
Implement proper tab order in React components
Use proper ...

Files:

  • packages/ui/src/components/devPrompts/EnableOrganizationsPrompt/index.tsx
**/*.{ts,tsx}

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

**/*.{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
Implement type guards for unknown types using the pattern function isType(value: unknown): value is Type
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 in classes
Use protected for inheritance hierarchies
Use public explicitly for clarity in public APIs
Use mixins for shared behavior across unrelated classes in TypeScript
Use generic constraints with bounded type parameters like <T extends { id: string }>
Use utility types like Omit, Partial, and Pick for data transformation instead of manual type construction
Use discriminated unions instead of boolean flags for state management and API responses
Use mapped types for transforming object types
Use conditional types for type-level logic
Leverage template literal types for string manipulation at the type level
Use ES6 imports/exports consistently
Use default exports sparingly, prefer named exports
Document functions with JSDoc comments including @param, @returns, @throws, and @example tags
Create custom error classes that extend Error for specific error types
Use the Result pattern for error handling instead of throwing exceptions
Use optional chaining (?.) and nullish coalescing (??) operators for safe property access
Let TypeScript infer obvious types to reduce verbosity
Use const assertions with as const for literal types
Use satisfies operator for type checking without widening types
Declare readonly arrays and objects for immutable data structures
Use spread operator and array spread for immutable updates instead of mutations
Use lazy loading for large types...

Files:

  • packages/ui/src/components/devPrompts/EnableOrganizationsPrompt/index.tsx
**/*.{js,ts,jsx,tsx}

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

Use ESLint with custom configurations tailored for different package types

Files:

  • packages/ui/src/components/devPrompts/EnableOrganizationsPrompt/index.tsx
**/*.{js,ts,jsx,tsx,json,md,yml,yaml}

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

Use Prettier for code formatting across all packages

Files:

  • packages/ui/src/components/devPrompts/EnableOrganizationsPrompt/index.tsx
⏰ 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). (27)
  • GitHub Check: Integration Tests (machine, chrome, RQ)
  • GitHub Check: Integration Tests (quickstart, chrome, 16)
  • GitHub Check: Integration Tests (quickstart, chrome, 15)
  • GitHub Check: Integration Tests (nextjs, chrome, 16)
  • GitHub Check: Integration Tests (custom, chrome)
  • GitHub Check: Integration Tests (nextjs, chrome, 15)
  • GitHub Check: Integration Tests (nextjs, chrome, 16, RQ)
  • GitHub Check: Integration Tests (billing, chrome, RQ)
  • GitHub Check: Integration Tests (nuxt, chrome)
  • GitHub Check: Integration Tests (billing, chrome)
  • GitHub Check: Integration Tests (machine, chrome)
  • GitHub Check: Integration Tests (astro, chrome)
  • GitHub Check: Integration Tests (vue, chrome)
  • GitHub Check: Integration Tests (sessions:staging, chrome)
  • GitHub Check: Integration Tests (tanstack-react-start, chrome)
  • GitHub Check: Integration Tests (ap-flows, chrome)
  • GitHub Check: Integration Tests (handshake, chrome)
  • GitHub Check: Integration Tests (localhost, chrome)
  • GitHub Check: Integration Tests (react-router, chrome)
  • GitHub Check: Integration Tests (generic, chrome)
  • GitHub Check: Integration Tests (handshake:staging, chrome)
  • GitHub Check: Integration Tests (sessions, chrome)
  • GitHub Check: Integration Tests (express, chrome)
  • GitHub Check: Formatting | Dedupe | Changeset
  • GitHub Check: Build Packages
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (2)
packages/ui/src/components/devPrompts/EnableOrganizationsPrompt/index.tsx (2)

199-215: Controlled RadioGroup wiring looks consistent with the intended flow.

Mapping allowPersonalAccount'allow' | 'require' is clear and keeps the enable-settings payload logic straightforward.


394-409: The Provider value shape is correct and will not cause runtime issues. The createContextAndHook<RadioGroupContextValue> utility defines Context as React.Context<{ value: CtxVal } | undefined> (line 33 of createContextAndHook.ts), and the hook extracts the value via (ctx as any).value (line 39). The current code provides { value: { name, value, onChange } } to the Provider, which matches this expected shape exactly. When useRadioGroup() is called, it correctly extracts the inner object and allows destructuring of name, value, and onChange in RadioGroupItem. The implementation is functioning as intended.

Likely an incorrect or invalid review comment.


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

@LauraBeatris LauraBeatris force-pushed the laura/orgs-1033-update-enableorganizationsprompt-component-to-display-new branch from 26e4a13 to 98202ad Compare December 12, 2025 14:33
@LauraBeatris LauraBeatris force-pushed the laura/orgs-1033-update-enableorganizationsprompt-component-to-display-new branch from 98202ad to 469bcc1 Compare December 12, 2025 14:39
@LauraBeatris LauraBeatris force-pushed the laura/orgs-1033-update-enableorganizationsprompt-component-to-display-new branch from 469bcc1 to bd96ed0 Compare December 12, 2025 14:42
@LauraBeatris LauraBeatris requested review from a team and alexcarpenter December 12, 2025 14:44
@LauraBeatris LauraBeatris marked this pull request as ready for review December 12, 2025 14:44
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 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 cfd0cba and bd96ed0.

📒 Files selected for processing (2)
  • .changeset/tasty-coats-tickle.md (1 hunks)
  • packages/ui/src/components/devPrompts/EnableOrganizationsPrompt/index.tsx (3 hunks)
🧰 Additional context used
📓 Path-based instructions (12)
**/*.{js,jsx,ts,tsx}

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

All code must pass ESLint checks with the project's configuration

Files:

  • packages/ui/src/components/devPrompts/EnableOrganizationsPrompt/index.tsx
**/*.{js,jsx,ts,tsx,json,md,yml,yaml}

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

Use Prettier for consistent code formatting

Files:

  • packages/ui/src/components/devPrompts/EnableOrganizationsPrompt/index.tsx
packages/**/src/**/*.{ts,tsx}

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

TypeScript is required for all packages

Files:

  • packages/ui/src/components/devPrompts/EnableOrganizationsPrompt/index.tsx
**/*.{ts,tsx,js,jsx}

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

Follow established naming conventions (PascalCase for components, camelCase for variables)

Files:

  • packages/ui/src/components/devPrompts/EnableOrganizationsPrompt/index.tsx
packages/**/src/**/*.{ts,tsx,js,jsx}

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

packages/**/src/**/*.{ts,tsx,js,jsx}: Maintain comprehensive JSDoc comments for public APIs
Use tree-shaking friendly exports
Validate all inputs and sanitize outputs
All public APIs must be documented with JSDoc
Use dynamic imports for optional features
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
Implement proper logging with different levels

Files:

  • packages/ui/src/components/devPrompts/EnableOrganizationsPrompt/index.tsx
**/*.ts?(x)

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

Use proper TypeScript error types

Files:

  • packages/ui/src/components/devPrompts/EnableOrganizationsPrompt/index.tsx
**/*.tsx

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

**/*.tsx: Use error boundaries in React components
Minimize re-renders in React components

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

Files:

  • packages/ui/src/components/devPrompts/EnableOrganizationsPrompt/index.tsx
**/*.{md,tsx}

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

Update documentation for API changes

Files:

  • packages/ui/src/components/devPrompts/EnableOrganizationsPrompt/index.tsx
**/*.{jsx,tsx}

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

**/*.{jsx,tsx}: Always use functional components with hooks instead of class components
Follow PascalCase naming for components (e.g., 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
Separate UI components from business logic components
Use useState for simple state management in React components
Use useReducer for complex state logic in React components
Implement proper state initialization in React components
Use proper state updates with callbacks in React components
Implement proper state cleanup in React components
Use Context API for theme/authentication state management
Implement proper state persistence in React applications
Use React.memo for expensive components
Implement proper useCallback for handlers in React components
Use proper useMemo for expensive computations in React components
Implement proper virtualization for lists in React components
Use proper code splitting with React.lazy in React applications
Implement proper cleanup in useEffect hooks
Use proper refs for DOM access in React components
Implement proper event listener cleanup in React components
Use proper abort controllers for fetch in React components
Implement proper subscription cleanup in React components
Use proper HTML elements for semantic HTML in React components
Implement proper ARIA attributes for accessibility in React components
Use proper heading hierarchy in React components
Implement proper form labels in React components
Use proper button types in React components
Implement proper focus management for keyboard navigation in React components
Use proper keyboard shortcuts in React components
Implement proper tab order in React components
Use proper ...

Files:

  • packages/ui/src/components/devPrompts/EnableOrganizationsPrompt/index.tsx
**/*.{ts,tsx}

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

**/*.{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
Implement type guards for unknown types using the pattern function isType(value: unknown): value is Type
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 in classes
Use protected for inheritance hierarchies
Use public explicitly for clarity in public APIs
Use mixins for shared behavior across unrelated classes in TypeScript
Use generic constraints with bounded type parameters like <T extends { id: string }>
Use utility types like Omit, Partial, and Pick for data transformation instead of manual type construction
Use discriminated unions instead of boolean flags for state management and API responses
Use mapped types for transforming object types
Use conditional types for type-level logic
Leverage template literal types for string manipulation at the type level
Use ES6 imports/exports consistently
Use default exports sparingly, prefer named exports
Document functions with JSDoc comments including @param, @returns, @throws, and @example tags
Create custom error classes that extend Error for specific error types
Use the Result pattern for error handling instead of throwing exceptions
Use optional chaining (?.) and nullish coalescing (??) operators for safe property access
Let TypeScript infer obvious types to reduce verbosity
Use const assertions with as const for literal types
Use satisfies operator for type checking without widening types
Declare readonly arrays and objects for immutable data structures
Use spread operator and array spread for immutable updates instead of mutations
Use lazy loading for large types...

Files:

  • packages/ui/src/components/devPrompts/EnableOrganizationsPrompt/index.tsx
**/*.{js,ts,jsx,tsx}

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

Use ESLint with custom configurations tailored for different package types

Files:

  • packages/ui/src/components/devPrompts/EnableOrganizationsPrompt/index.tsx
**/*.{js,ts,jsx,tsx,json,md,yml,yaml}

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

Use Prettier for code formatting across all packages

Files:

  • packages/ui/src/components/devPrompts/EnableOrganizationsPrompt/index.tsx
⏰ 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). (1)
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (2)
.changeset/tasty-coats-tickle.md (1)

1-5: Changeset looks correct and matches the UI refactor.
Patch bump for @clerk/ui and the note text are consistent with the PR scope.

packages/ui/src/components/devPrompts/EnableOrganizationsPrompt/index.tsx (1)

200-214: RadioGroup wiring to allowPersonalAccount state is clear and matches the two-option UX.
The boolean ↔︎ string mapping reads cleanly and is hard to misinterpret.

@LauraBeatris
Copy link
Member Author

I'm still unsure about the color of the radio group here - purple doesn't have a good contrast with the dark background

CleanShot 2025-12-12 at 11 46 57

@LauraBeatris LauraBeatris force-pushed the laura/orgs-1033-update-enableorganizationsprompt-component-to-display-new branch from bd96ed0 to 0392e42 Compare December 12, 2025 15:04
@LauraBeatris LauraBeatris force-pushed the laura/orgs-1033-update-enableorganizationsprompt-component-to-display-new branch from 0392e42 to 53279ca Compare December 12, 2025 15:06
@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 12, 2025

Open in StackBlitz

@clerk/agent-toolkit

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

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/dev-cli

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

@clerk/expo

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

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/localizations

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

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/react

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

@clerk/react-router

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/ui

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

@clerk/upgrade

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

@clerk/vue

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

commit: 7e7646e

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

♻️ Duplicate comments (1)
packages/ui/src/components/devPrompts/EnableOrganizationsPrompt/index.tsx (1)

394-408: Add aria-label to complete the radiogroup accessibility.

While role='radiogroup' was added (addressing part of the previous review), the group still lacks an accessible label. Screen reader users won't know what these radio options control.

Apply this diff to add an accessible label:

  return (
    <RadioGroupContext.Provider value={contextValue}>
      <Flex
        role='radiogroup'
+       aria-label='Organization access settings'
        direction='col'
        gap={3}
      >
        {children}
      </Flex>
    </RadioGroupContext.Provider>
  );
🧹 Nitpick comments (3)
packages/ui/src/components/devPrompts/EnableOrganizationsPrompt/index.tsx (3)

200-214: Wrap the onChange handler in useCallback to prevent unnecessary re-renders.

The inline onChange handler creates a new function on every render, which invalidates the useMemo in the RadioGroup component (line 396) and causes unnecessary re-renders of context consumers.

Apply this diff to memoize the handler:

+ const handleRadioGroupChange = React.useCallback(
+   (value: string) => setAllowPersonalAccount(value === 'allow'),
+   []
+ );
+
  <RadioGroup
    value={allowPersonalAccount ? 'allow' : 'require'}
-   onChange={value => setAllowPersonalAccount(value === 'allow')}
+   onChange={handleRadioGroupChange}
  >

380-409: Add JSDoc documentation for the RadioGroup component and its types.

Per coding guidelines, all components should have comprehensive JSDoc comments documenting their purpose, parameters, and usage.

+/**
+ * Context value for RadioGroup components
+ * @internal
+ */
 type RadioGroupContextValue = {
+  /** Unique name for the radio group */
   name: string;
+  /** Currently selected value */
   value: string;
+  /** Callback fired when selection changes */
   onChange: (value: string) => void;
 };

 const [RadioGroupContext, useRadioGroup] = createContextAndHook<RadioGroupContextValue>('RadioGroupContext');

+/**
+ * Props for RadioGroup component
+ * @internal
+ */
 type RadioGroupProps = {
+  /** Currently selected value */
   value: string;
+  /** Callback fired when selection changes */
   onChange: (value: string) => void;
+  /** RadioGroupItem children */
   children: React.ReactNode;
 };

+/**
+ * RadioGroup component for mutually exclusive options
+ * @internal
+ */
 const RadioGroup = ({ value, onChange, children }: RadioGroupProps) => {

411-506: Add JSDoc documentation for RadioGroupItem.

The component and its props should be documented per coding guidelines for maintainability.

+/**
+ * Props for RadioGroupItem component
+ * @internal
+ */
 type RadioGroupItemProps = {
+  /** Value for this radio option */
   value: string;
+  /** Label text for the radio option */
   label: string;
+  /** Optional description text */
   description?: string;
 };

+/**
+ * Individual radio option within a RadioGroup
+ * @internal
+ */
 const RadioGroupItem = ({ value, label, description }: RadioGroupItemProps) => {
📜 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 bd96ed0 and 53279ca.

📒 Files selected for processing (2)
  • .changeset/tasty-coats-tickle.md (1 hunks)
  • packages/ui/src/components/devPrompts/EnableOrganizationsPrompt/index.tsx (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .changeset/tasty-coats-tickle.md
🧰 Additional context used
📓 Path-based instructions (12)
**/*.{js,jsx,ts,tsx}

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

All code must pass ESLint checks with the project's configuration

Files:

  • packages/ui/src/components/devPrompts/EnableOrganizationsPrompt/index.tsx
**/*.{js,jsx,ts,tsx,json,md,yml,yaml}

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

Use Prettier for consistent code formatting

Files:

  • packages/ui/src/components/devPrompts/EnableOrganizationsPrompt/index.tsx
packages/**/src/**/*.{ts,tsx}

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

TypeScript is required for all packages

Files:

  • packages/ui/src/components/devPrompts/EnableOrganizationsPrompt/index.tsx
**/*.{ts,tsx,js,jsx}

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

Follow established naming conventions (PascalCase for components, camelCase for variables)

Files:

  • packages/ui/src/components/devPrompts/EnableOrganizationsPrompt/index.tsx
packages/**/src/**/*.{ts,tsx,js,jsx}

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

packages/**/src/**/*.{ts,tsx,js,jsx}: Maintain comprehensive JSDoc comments for public APIs
Use tree-shaking friendly exports
Validate all inputs and sanitize outputs
All public APIs must be documented with JSDoc
Use dynamic imports for optional features
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
Implement proper logging with different levels

Files:

  • packages/ui/src/components/devPrompts/EnableOrganizationsPrompt/index.tsx
**/*.ts?(x)

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

Use proper TypeScript error types

Files:

  • packages/ui/src/components/devPrompts/EnableOrganizationsPrompt/index.tsx
**/*.tsx

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

**/*.tsx: Use error boundaries in React components
Minimize re-renders in React components

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

Files:

  • packages/ui/src/components/devPrompts/EnableOrganizationsPrompt/index.tsx
**/*.{md,tsx}

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

Update documentation for API changes

Files:

  • packages/ui/src/components/devPrompts/EnableOrganizationsPrompt/index.tsx
**/*.{jsx,tsx}

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

**/*.{jsx,tsx}: Always use functional components with hooks instead of class components
Follow PascalCase naming for components (e.g., 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
Separate UI components from business logic components
Use useState for simple state management in React components
Use useReducer for complex state logic in React components
Implement proper state initialization in React components
Use proper state updates with callbacks in React components
Implement proper state cleanup in React components
Use Context API for theme/authentication state management
Implement proper state persistence in React applications
Use React.memo for expensive components
Implement proper useCallback for handlers in React components
Use proper useMemo for expensive computations in React components
Implement proper virtualization for lists in React components
Use proper code splitting with React.lazy in React applications
Implement proper cleanup in useEffect hooks
Use proper refs for DOM access in React components
Implement proper event listener cleanup in React components
Use proper abort controllers for fetch in React components
Implement proper subscription cleanup in React components
Use proper HTML elements for semantic HTML in React components
Implement proper ARIA attributes for accessibility in React components
Use proper heading hierarchy in React components
Implement proper form labels in React components
Use proper button types in React components
Implement proper focus management for keyboard navigation in React components
Use proper keyboard shortcuts in React components
Implement proper tab order in React components
Use proper ...

Files:

  • packages/ui/src/components/devPrompts/EnableOrganizationsPrompt/index.tsx
**/*.{ts,tsx}

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

**/*.{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
Implement type guards for unknown types using the pattern function isType(value: unknown): value is Type
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 in classes
Use protected for inheritance hierarchies
Use public explicitly for clarity in public APIs
Use mixins for shared behavior across unrelated classes in TypeScript
Use generic constraints with bounded type parameters like <T extends { id: string }>
Use utility types like Omit, Partial, and Pick for data transformation instead of manual type construction
Use discriminated unions instead of boolean flags for state management and API responses
Use mapped types for transforming object types
Use conditional types for type-level logic
Leverage template literal types for string manipulation at the type level
Use ES6 imports/exports consistently
Use default exports sparingly, prefer named exports
Document functions with JSDoc comments including @param, @returns, @throws, and @example tags
Create custom error classes that extend Error for specific error types
Use the Result pattern for error handling instead of throwing exceptions
Use optional chaining (?.) and nullish coalescing (??) operators for safe property access
Let TypeScript infer obvious types to reduce verbosity
Use const assertions with as const for literal types
Use satisfies operator for type checking without widening types
Declare readonly arrays and objects for immutable data structures
Use spread operator and array spread for immutable updates instead of mutations
Use lazy loading for large types...

Files:

  • packages/ui/src/components/devPrompts/EnableOrganizationsPrompt/index.tsx
**/*.{js,ts,jsx,tsx}

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

Use ESLint with custom configurations tailored for different package types

Files:

  • packages/ui/src/components/devPrompts/EnableOrganizationsPrompt/index.tsx
**/*.{js,ts,jsx,tsx,json,md,yml,yaml}

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

Use Prettier for code formatting across all packages

Files:

  • packages/ui/src/components/devPrompts/EnableOrganizationsPrompt/index.tsx
⏰ 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). (27)
  • GitHub Check: Integration Tests (nextjs, chrome, 16, RQ)
  • GitHub Check: Integration Tests (nextjs, chrome, 15)
  • GitHub Check: Integration Tests (machine, chrome)
  • GitHub Check: Integration Tests (machine, chrome, RQ)
  • GitHub Check: Integration Tests (quickstart, chrome, 16)
  • GitHub Check: Integration Tests (quickstart, chrome, 15)
  • GitHub Check: Integration Tests (nextjs, chrome, 16)
  • GitHub Check: Integration Tests (react-router, chrome)
  • GitHub Check: Integration Tests (nuxt, chrome)
  • GitHub Check: Integration Tests (billing, chrome, RQ)
  • GitHub Check: Integration Tests (custom, chrome)
  • GitHub Check: Integration Tests (tanstack-react-start, chrome)
  • GitHub Check: Integration Tests (billing, chrome)
  • GitHub Check: Integration Tests (vue, chrome)
  • GitHub Check: Integration Tests (handshake, chrome)
  • GitHub Check: Integration Tests (localhost, chrome)
  • GitHub Check: Integration Tests (handshake:staging, chrome)
  • GitHub Check: Integration Tests (express, chrome)
  • GitHub Check: Integration Tests (astro, chrome)
  • GitHub Check: Integration Tests (ap-flows, chrome)
  • GitHub Check: Integration Tests (generic, chrome)
  • GitHub Check: Integration Tests (sessions:staging, chrome)
  • GitHub Check: Integration Tests (sessions, chrome)
  • GitHub Check: Build Packages
  • GitHub Check: Formatting | Dedupe | Changeset
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (1)
packages/ui/src/components/devPrompts/EnableOrganizationsPrompt/index.tsx (1)

432-506: The color contrast for both the description text (#c3c3c6) and label text (#ffffff) on the dark background (#1f1f1f) exceeds WCAG standards. Description text achieves 9.37:1 contrast (exceeding WCAG AAA's 7.0:1 requirement for normal text), and label text achieves 16.48:1 contrast. No accessibility issues exist with the current color choices.

Likely an incorrect or invalid review comment.

@LauraBeatris LauraBeatris force-pushed the laura/orgs-1033-update-enableorganizationsprompt-component-to-display-new branch from 53279ca to 7e7646e Compare December 12, 2025 16:23
@LauraBeatris LauraBeatris marked this pull request as draft December 12, 2025 20:48
@LauraBeatris
Copy link
Member Author

We made some changes on the Figma prototype so I'll update this PR with it and open for review again

@panteliselef
Copy link
Contributor

fyi a RadioGroup exists in case it can be reused or consolidated with the new one.

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.

3 participants