Skip to content

Conversation

iagodahlem
Copy link
Member

@iagodahlem iagodahlem commented Sep 26, 2025

Description

The TaskChooseOrganization component was missing the root selector we infer from the flow routes.

Before:

CleanShot 2025-09-26 at 11 00 15@2x

After:

CleanShot 2025-09-26 at 13 03 32@2x

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

  • Bug Fixes

    • Fixed task appearance/selectors so organization options display correctly during onboarding/tasks (visible in Sign In/Sign Up flows).
  • Refactor

    • Consolidated session task screens under a unified "tasks" flow and added dedicated task parts for organization selection to improve consistency and customization. No behavioral changes beyond the bug fix.
  • Chores

    • Bumped dependency metadata for a patch release.

Copy link

changeset-bot bot commented Sep 26, 2025

🦋 Changeset detected

Latest commit: 1e44746

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

This PR includes changesets to release 3 packages
Name Type
@clerk/clerk-js Patch
@clerk/chrome-extension Patch
@clerk/clerk-expo 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

Copy link

vercel bot commented Sep 26, 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 1, 2025 7:09pm

Copy link
Contributor

coderabbitai bot commented Sep 26, 2025

Walkthrough

Wraps SessionTasks UI with Flow wrappers (adds Flow.Part(part='start') and Flow.Root(flow='tasks')), nests TaskChooseOrganization inside Flow.Part(part='chooseOrganization'), extends FlowMetadata unions to include 'tasks' and 'chooseOrganization', and adds a changeset bumping @clerk/clerk-js with a selector-fix note.

Changes

Cohort / File(s) Summary
Changeset / release note
.changeset/shy-times-wash.md
Adds a changeset bumping @clerk/clerk-js (patch) with a note about improving appearance selectors for tasks (mentions SignIn/SignUp). No code/API changes.
SessionTasks Flow wrappers
packages/clerk-js/src/ui/components/SessionTasks/index.tsx
Wraps SessionTasks start segment in Flow.Part(part='start') and wraps routes in Flow.Root(flow='tasks'). No routing or behavioral changes.
TaskChooseOrganization part
packages/clerk-js/src/ui/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx
Wraps existing Card UI and its loading/footer logic inside a Flow.Part with part='chooseOrganization' (dynamic behavior preserved).
Flow metadata types
packages/clerk-js/src/ui/elements/contexts/index.tsx
Adds 'tasks' to FlowMetadata.flow and adds 'chooseOrganization' to FlowMetadata.part; removes duplicate subscriptionDetails entry.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant SessionTasks
  participant FlowRoot as Flow.Root(flow="tasks")
  participant Router as Router/Switch
  participant Start as Flow.Part(part="start")
  participant ChooseOrg as Flow.Part(part="chooseOrganization")

  User->>SessionTasks: open tasks UI
  SessionTasks->>FlowRoot: initialize flow="tasks"
  FlowRoot->>Router: render task routes
  Router->>Start: render start part
  Start-->>User: show start UI

  alt navigate to choose organization
    Router->>ChooseOrg: render TaskChooseOrganization
    ChooseOrg-->>User: show Card within Flow.Part
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

I hop through roots and labeled parts,
I tuck a card into tidy arts.
sessionTasks hums, tasks now bloom,
chooseOrganization finds its room.
A little hop — selectors groom. 🥕

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title succinctly and accurately summarizes the main change by indicating a bug fix in the clerk-js package to improve the appearance selectors for task components, making it clear and specific without unnecessary detail.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch iago/orgs-924

📜 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 e12415e and 1e44746.

📒 Files selected for processing (4)
  • .changeset/shy-times-wash.md (1 hunks)
  • packages/clerk-js/src/ui/components/SessionTasks/index.tsx (2 hunks)
  • packages/clerk-js/src/ui/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx (1 hunks)
  • packages/clerk-js/src/ui/elements/contexts/index.tsx (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • packages/clerk-js/src/ui/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx
  • packages/clerk-js/src/ui/elements/contexts/index.tsx
  • .changeset/shy-times-wash.md
🧰 Additional context used
📓 Path-based instructions (9)
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/components/SessionTasks/index.tsx
**/*.{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/components/SessionTasks/index.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/components/SessionTasks/index.tsx
packages/**/*.{ts,tsx}

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

TypeScript is required for all packages

Files:

  • packages/clerk-js/src/ui/components/SessionTasks/index.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/components/SessionTasks/index.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/components/SessionTasks/index.tsx
**/*.{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/components/SessionTasks/index.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/components/SessionTasks/index.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/components/SessionTasks/index.tsx
🧬 Code graph analysis (1)
packages/clerk-js/src/ui/components/SessionTasks/index.tsx (4)
packages/clerk-js/src/ui/customizables/Flow.tsx (1)
  • Flow (41-44)
packages/clerk-js/src/ui/contexts/components/SessionTasks.ts (2)
  • useSessionTasksContext (7-15)
  • TaskChooseOrganizationContext (17-17)
packages/clerk-js/src/core/sessionTasks.ts (1)
  • INTERNAL_SESSION_TASK_ROUTE_BY_KEY (9-11)
packages/clerk-js/src/ui/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx (1)
  • TaskChooseOrganization (107-109)
⏰ 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). (3)
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (4)
packages/clerk-js/src/ui/components/SessionTasks/index.tsx (4)

6-6: LGTM! Flow import is correct.

The import is necessary for the Flow.Root and Flow.Part wrappers added below.


39-46: LGTM! Flow.Part wrapper correctly adds the start part selector.

The wrapping ensures the SessionTasksStart component receives the appropriate part selector for theming within the tasks flow.


54-54: LGTM! Flow.Root correctly establishes the tasks flow context.

The Flow.Root wrapper with flow='tasks' provides the root selector for all child routes in the SessionTasks flow.


63-65: LGTM! Index route correctly renders SessionTasksStart.

The index route properly renders the SessionTasksStart component, which is already wrapped in its own Flow.Part.


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

@iagodahlem iagodahlem changed the title fix: update Flow parts for TaskChooseOrganization fix(clerk-js): Update selectors for TaskChooseOrganization Sep 26, 2025
@iagodahlem iagodahlem requested a review from a team September 26, 2025 14:03
Copy link

pkg-pr-new bot commented Sep 26, 2025

Open in StackBlitz

@clerk/agent-toolkit

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

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/dev-cli

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

@clerk/elements

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

@clerk/clerk-expo

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

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/localizations

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

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/clerk-react

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

@clerk/react-router

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

@clerk/remix

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/themes

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

@clerk/types

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

@clerk/upgrade

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

@clerk/vue

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

commit: 1e44746

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

🧹 Nitpick comments (1)
packages/clerk-js/src/ui/components/SessionTasks/index.tsx (1)

54-67: Wrap routes in Flow.Root is correct; consider consistency for fallback branch

The tasks flow now exposes a root selector across routed screens. Consider also wrapping the “no current task” loading fallback in a Flow.Root(flow='tasks') so the root selector remains stable across all code paths (useful for theming/appearance rules). Optional.

As per coding guidelines

📜 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 97965d8 and 07cd8f7.

📒 Files selected for processing (4)
  • .changeset/shy-times-wash.md (1 hunks)
  • packages/clerk-js/src/ui/components/SessionTasks/index.tsx (2 hunks)
  • packages/clerk-js/src/ui/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx (1 hunks)
  • packages/clerk-js/src/ui/elements/contexts/index.tsx (2 hunks)
🧰 Additional context used
📓 Path-based instructions (10)
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/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx
  • packages/clerk-js/src/ui/elements/contexts/index.tsx
  • packages/clerk-js/src/ui/components/SessionTasks/index.tsx
**/*.{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/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx
  • packages/clerk-js/src/ui/elements/contexts/index.tsx
  • packages/clerk-js/src/ui/components/SessionTasks/index.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/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx
  • packages/clerk-js/src/ui/elements/contexts/index.tsx
  • packages/clerk-js/src/ui/components/SessionTasks/index.tsx
packages/**/*.{ts,tsx}

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

TypeScript is required for all packages

Files:

  • packages/clerk-js/src/ui/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx
  • packages/clerk-js/src/ui/elements/contexts/index.tsx
  • packages/clerk-js/src/ui/components/SessionTasks/index.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/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx
  • packages/clerk-js/src/ui/elements/contexts/index.tsx
  • packages/clerk-js/src/ui/components/SessionTasks/index.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/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx
  • packages/clerk-js/src/ui/elements/contexts/index.tsx
  • packages/clerk-js/src/ui/components/SessionTasks/index.tsx
**/*.{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/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx
  • packages/clerk-js/src/ui/elements/contexts/index.tsx
  • packages/clerk-js/src/ui/components/SessionTasks/index.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/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx
  • packages/clerk-js/src/ui/elements/contexts/index.tsx
  • packages/clerk-js/src/ui/components/SessionTasks/index.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/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx
  • packages/clerk-js/src/ui/elements/contexts/index.tsx
  • packages/clerk-js/src/ui/components/SessionTasks/index.tsx
.changeset/**

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

Automated releases must use Changesets.

Files:

  • .changeset/shy-times-wash.md
🧬 Code graph analysis (2)
packages/clerk-js/src/ui/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx (2)
packages/clerk-js/src/ui/customizables/Flow.tsx (1)
  • Flow (41-44)
packages/clerk-js/src/ui/customizables/elementDescriptors.ts (1)
  • descriptors (571-571)
packages/clerk-js/src/ui/components/SessionTasks/index.tsx (3)
packages/clerk-js/src/ui/customizables/Flow.tsx (1)
  • Flow (41-44)
packages/clerk-js/src/ui/contexts/components/SessionTasks.ts (2)
  • useSessionTasksContext (7-15)
  • TaskChooseOrganizationContext (17-17)
packages/clerk-js/src/core/sessionTasks.ts (1)
  • INTERNAL_SESSION_TASK_ROUTE_BY_KEY (9-11)
⏰ 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). (7)
  • GitHub Check: Integration Tests (generic, chrome)
  • GitHub Check: Static analysis
  • GitHub Check: Publish with pkg-pr-new
  • GitHub Check: Unit Tests (18, --filter=@clerk/astro --filter=@clerk/backend --filter=@clerk/express --filter=@c...
  • GitHub Check: Formatting | Dedupe | Changeset
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (6)
.changeset/shy-times-wash.md (1)

1-5: Changeset LGTM

Patch bump and clear note about selector fix look good.

packages/clerk-js/src/ui/components/SessionTasks/index.tsx (2)

6-6: Import Flow aligns with new wrappers

Matches usage below.


39-46: Good: Mark start step with a Flow.Part

This ensures stable part-level selectors for the start view.

packages/clerk-js/src/ui/elements/contexts/index.tsx (2)

104-105: Add 'tasks' to Flow metadata

This aligns with the new Flow.Root usage in SessionTasks.


126-129: Parts added look right; confirm 'accountSwitcher' inclusion

Adding chooseOrganization/createOrganization matches component usage. Please confirm if 'accountSwitcher' was intentionally added in this PR.

packages/clerk-js/src/ui/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx (1)

38-61: Correctly tags screen part based on resources

Dynamic Flow.Part ('chooseOrganization' | 'createOrganization') provides the needed selectors without altering behavior.

| 'subscriptionDetails'
| 'subscriptionDetails'
| 'taskChooseOrganization';
| 'sessionTasks';
Copy link
Member

Choose a reason for hiding this comment

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

@iagodahlem
What does the html of a standalone <TaskChooseOrganization/> component look like now ?

Copy link
Member Author

@iagodahlem iagodahlem Sep 29, 2025

Choose a reason for hiding this comment

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

Good question @panteliselef, I was thinking we were actually exposing the standalone <SessionTasks /> component, but we actually expose the single task <TaskChooseOrganization /> component.

Previously, the TaskChooseOrganization was already setting the root selector correctly to cl-taskChooseOrganization-root, so I updated it not to change that and just added the flow parts:

Here's the standalone <TaskChooseOrganization /> before/after:

Before After
CleanShot 2025-09-29 at 10 14 34@2x CleanShot 2025-09-29 at 10 13 48@2x

And within the <SignIn /> component:

Before After
CleanShot 2025-09-29 at 10 16 05@2x CleanShot 2025-09-29 at 10 16 42@2x

Copy link
Member

Choose a reason for hiding this comment

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

Why is the bottom right (after): different from the one that exists in the description ?
image

Copy link
Member Author

Choose a reason for hiding this comment

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

The ones mentioned in the description are now outdated. I initially had the changed the root to be sessionTasks, but that would break the existing root selector when using the standalone version of that component.

Copy link
Member

Choose a reason for hiding this comment

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

was thinking we were actually exposing the standalone component

We discussed about it before, it might happen in the future when we introduce N+1 tasks, so this fix here to introduce the Flow component came in the right time.

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

🧹 Nitpick comments (2)
packages/clerk-js/src/ui/components/SessionTasks/index.tsx (1)

101-111: Keep selectors consistent in the fallback screen.

Wrap the “no current task” fallback with Flow.Root + Flow.Part('start') to avoid a brief FOUC and keep theming selectors stable during redirects.

Apply this diff:

   if (!clerk.session?.currentTask) {
     return (
-      <Card.Root
+      <Flow.Root flow='sessionTasks'>
+        <Flow.Part part='start'>
+      <Card.Root
         sx={() => ({
           minHeight: currentTaskContainer ? currentTaskContainer.current?.offsetHeight : undefined,
         })}
       >
         <Card.Content sx={() => ({ flex: 1 })}>
           <LoadingCardContainer />
         </Card.Content>
         <Card.Footer />
       </Card.Root>
+        </Flow.Part>
+      </Flow.Root>
     );
   }
packages/clerk-js/src/ui/elements/contexts/index.tsx (1)

103-103: FlowMetadata unions updated — OK.

  • Added flow 'sessionTasks' and parts 'taskChooseOrganization' (and 'accountSwitcher'). This unblocks Flow.Root/Part usage without type casts.

Optional polish:

  • Add brief JSDoc on new union members for API clarity (e.g., where they’re used).
  • Consider alphabetical sorting to reduce future diff churn.

Also applies to: 124-126

📜 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 d566824 and e011ca8.

📒 Files selected for processing (4)
  • .changeset/shy-times-wash.md (1 hunks)
  • packages/clerk-js/src/ui/components/SessionTasks/index.tsx (2 hunks)
  • packages/clerk-js/src/ui/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx (2 hunks)
  • packages/clerk-js/src/ui/elements/contexts/index.tsx (2 hunks)
✅ Files skipped from review due to trivial changes (1)
  • .changeset/shy-times-wash.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/clerk-js/src/ui/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx
🧰 Additional context used
📓 Path-based instructions (9)
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/components/SessionTasks/index.tsx
  • packages/clerk-js/src/ui/elements/contexts/index.tsx
**/*.{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/components/SessionTasks/index.tsx
  • packages/clerk-js/src/ui/elements/contexts/index.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/components/SessionTasks/index.tsx
  • packages/clerk-js/src/ui/elements/contexts/index.tsx
packages/**/*.{ts,tsx}

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

TypeScript is required for all packages

Files:

  • packages/clerk-js/src/ui/components/SessionTasks/index.tsx
  • packages/clerk-js/src/ui/elements/contexts/index.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/components/SessionTasks/index.tsx
  • packages/clerk-js/src/ui/elements/contexts/index.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/components/SessionTasks/index.tsx
  • packages/clerk-js/src/ui/elements/contexts/index.tsx
**/*.{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/components/SessionTasks/index.tsx
  • packages/clerk-js/src/ui/elements/contexts/index.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/components/SessionTasks/index.tsx
  • packages/clerk-js/src/ui/elements/contexts/index.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/components/SessionTasks/index.tsx
  • packages/clerk-js/src/ui/elements/contexts/index.tsx
🧬 Code graph analysis (1)
packages/clerk-js/src/ui/components/SessionTasks/index.tsx (3)
packages/clerk-js/src/ui/customizables/Flow.tsx (1)
  • Flow (41-44)
packages/clerk-js/src/ui/contexts/components/SessionTasks.ts (2)
  • useSessionTasksContext (7-15)
  • TaskChooseOrganizationContext (17-17)
packages/clerk-js/src/core/sessionTasks.ts (1)
  • INTERNAL_SESSION_TASK_ROUTE_BY_KEY (9-11)
⏰ 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). (4)
  • GitHub Check: semgrep/ci
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (2)
packages/clerk-js/src/ui/components/SessionTasks/index.tsx (2)

6-6: Import of Flow looks correct.

Matches usage below; no issues.


39-46: Good: adding Flow.Part('start) provides the part selector for the Start/loading screen.

This aligns selectors with other flows.

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

🧹 Nitpick comments (3)
packages/clerk-js/src/ui/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx (3)

41-55: Add ARIA affordances to the loading region

For better a11y, consider annotating the loading container and/or Spinner:

<Flex role="status" aria-live="polite" aria-busy={true} ...>
  <Spinner
    /* if Spinner doesn't set it internally */
    aria-label={localizationKeys('general.loading')}
    ...
  />
</Flex>

If Spinner already handles these, ignore.


66-79: Avoid recreating sx lambdas where static styles suffice

These styles don’t use theme tokens; use object form to reduce function churn:

- sx={() => ({ width: '100%' })}
+ sx={{ width: '100%' }}

- sx={() => ({ flexShrink: 0 })}
+ sx={{ flexShrink: 0 }}

Micro-optimization that helps minimize re-renders.


37-57: Synchronize Flow.Part.part with the active sub-flow
Lift the sub-flow state into TaskChooseOrganizationInternal, initialize it from hasExistingResources, and drive Flow.Part from that state so the wrapper updates as users switch screens:

-      <Flow.Part part={hasExistingResources ? 'chooseOrganization' : 'createOrganization'}>
+      <Flow.Part part={flowPart === 'create' ? 'createOrganization' : 'chooseOrganization'}>
         <Card.Root>
           …
-              <TaskChooseOrganizationFlows initialFlow={hasExistingResources ? 'choose' : 'create'} />
+              <TaskChooseOrganizationFlows initialFlow={flowPart} onFlowChange={setFlowPart} />

Above the return, add:

const [flowPart, setFlowPart] = useState<'create' | 'choose'>(hasExistingResources ? 'choose' : 'create');

In TaskChooseOrganizationFlows, emit changes back to the parent (e.g. via a useEffect calling props.onFlowChange(currentFlow)). This ensures the DOM selector stays in sync when switching between “choose” and “create.”

📜 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 e011ca8 and 481648e.

📒 Files selected for processing (2)
  • packages/clerk-js/src/ui/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx (1 hunks)
  • packages/clerk-js/src/ui/elements/contexts/index.tsx (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/clerk-js/src/ui/elements/contexts/index.tsx
🧰 Additional context used
📓 Path-based instructions (9)
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/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx
**/*.{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/components/SessionTasks/tasks/TaskChooseOrganization/index.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/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx
packages/**/*.{ts,tsx}

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

TypeScript is required for all packages

Files:

  • packages/clerk-js/src/ui/components/SessionTasks/tasks/TaskChooseOrganization/index.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/components/SessionTasks/tasks/TaskChooseOrganization/index.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/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx
**/*.{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/components/SessionTasks/tasks/TaskChooseOrganization/index.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/components/SessionTasks/tasks/TaskChooseOrganization/index.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/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx
🧬 Code graph analysis (1)
packages/clerk-js/src/ui/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx (3)
packages/clerk-js/src/ui/customizables/Flow.tsx (1)
  • Flow (41-44)
packages/clerk-js/src/ui/customizables/index.ts (1)
  • Flex (16-16)
packages/clerk-js/src/ui/customizables/elementDescriptors.ts (1)
  • descriptors (571-571)
⏰ 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). (5)
  • GitHub Check: Formatting | Dedupe | Changeset
  • GitHub Check: semgrep/ci
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (1)
packages/clerk-js/src/ui/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx (1)

37-39: LGTM: Flow.Part adds the missing selectors

Wrapping the Card with Flow.Part under Flow.Root is the right move to expose stable root+part selectors for theming/E2E. This aligns with the PR goal.

@LauraBeatris LauraBeatris changed the title fix(clerk-js): Update selectors for TaskChooseOrganization fix(clerk-js): Improve appearance selectors for tasks Oct 1, 2025
@iagodahlem iagodahlem merged commit 6ea39ae into main Oct 1, 2025
43 checks passed
@iagodahlem iagodahlem deleted the iago/orgs-924 branch October 1, 2025 19:29
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.

6 participants