Skip to content

Conversation

@LauraBeatris
Copy link
Member

@LauraBeatris LauraBeatris commented Dec 17, 2025

Description

Resolves ORGS-1027, ORGS-1136

Introduce organization creation defaults to TaskChooseOrganization component - this is based new "Require organization membership" options from the Clerk Dashboard, where C1s can define default organization naming rules

We're also now detecting a default logo based on the user's email domain.

CleanShot.2025-12-19.at.12.32.42.mp4

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
    • Prefilled organization creation form (name, slug, logo), avatar uploader with default-logo auto-upload and loading spinner, advisory warning when an organization already exists, and public API to fetch creation defaults (gated by environment).
  • Documentation
    • Added localization string for existing-organization notification.
  • Tests
    • Added tests for enabled/disabled creation-defaults behavior.
  • Chores
    • Added types, fixture helper, and organization-settings flag to support these features.

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

@vercel
Copy link

vercel bot commented Dec 17, 2025

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

Project Deployment Review Updated (UTC)
clerk-js-sandbox Ready Ready Preview, Comment Jan 12, 2026 3:43pm

@LauraBeatris LauraBeatris changed the title feat(ui,clerk-js,shared): Add organization creation defaults to components feat(ui,clerk-js,shared): Surface organization creation defaults to components Dec 17, 2025
@changeset-bot
Copy link

changeset-bot bot commented Dec 17, 2025

🦋 Changeset detected

Latest commit: 437ada9

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

This PR includes changesets to release 20 packages
Name Type
@clerk/localizations Minor
@clerk/clerk-js Minor
@clerk/shared Minor
@clerk/ui Minor
@clerk/react Patch
@clerk/chrome-extension Patch
@clerk/expo Patch
@clerk/agent-toolkit Patch
@clerk/astro Patch
@clerk/backend Patch
@clerk/expo-passkeys Patch
@clerk/express Patch
@clerk/fastify Patch
@clerk/msw Patch
@clerk/nextjs Patch
@clerk/nuxt Patch
@clerk/react-router Patch
@clerk/tanstack-react-start Patch
@clerk/testing Patch
@clerk/vue Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@LauraBeatris LauraBeatris force-pushed the laura/orgs-1136-update-taskchooseorganization-to-show-warning-when branch from 81ea1f2 to 12005fb Compare December 17, 2025 19:18
@LauraBeatris LauraBeatris force-pushed the laura/orgs-1136-update-taskchooseorganization-to-show-warning-when branch from 21f7045 to 7093f4b Compare December 19, 2025 13:52
@LauraBeatris LauraBeatris force-pushed the laura/orgs-1136-update-taskchooseorganization-to-show-warning-when branch 2 times, most recently from 5393111 to 97c7605 Compare December 19, 2025 14:25
@LauraBeatris LauraBeatris force-pushed the laura/orgs-1136-update-taskchooseorganization-to-show-warning-when branch from 97c7605 to c5fcb39 Compare December 19, 2025 14:49
@LauraBeatris LauraBeatris requested a review from a team December 19, 2025 15:27
@LauraBeatris LauraBeatris force-pushed the laura/orgs-1136-update-taskchooseorganization-to-show-warning-when branch from 13af5ff to 22edba6 Compare December 19, 2025 15:31
@LauraBeatris LauraBeatris marked this pull request as ready for review December 19, 2025 15:34
>
{ImgOrFallback}

{isLoading && (
Copy link
Member Author

Choose a reason for hiding this comment

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

CleanShot.2026-01-07.at.17.55.29.mp4

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: 2

🤖 Fix all issues with AI agents
In
@packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx:
- Around line 67-74: Wrap the default logo download logic in a try-catch and
guard HTTP errors: when defaultLogoUrl is used, fetch it and check response.ok
before calling response.blob(), then create the File and call
organization.setLogo({ file: logoFile }); on success; on any fetch/blob/File
error catch it, log the error (but do not rethrow) and allow organization
creation to continue without a logo. Ensure the code path that calls
organization.setLogo remains unchanged for the successful case and that failures
only result in a non-blocking log message.

In @packages/ui/src/elements/Avatar.tsx:
- Around line 63-73: handleImageLoad uses setTimeout to delay setLoaded(true)
which can fire after the component unmounts or imageUrl changes; store the timer
id in a ref (e.g., timeoutRef) instead of relying on useCallback cleanup, assign
the result of setTimeout to timeoutRef.current inside handleImageLoad, and add a
useEffect that watches imageUrl (and on mount/unmount) to
clearTimeout(timeoutRef.current) and reset timeoutRef.current to null so no
stale setLoaded runs after unmount or when imageUrl changes; keep
spinnerShownAtRef and SPINNER_MIN_DURATION_MS logic but ensure timeouts are
cleared before starting a new one.
📜 Review details

Configuration used: Repository YAML (base), Organization UI (inherited)

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 dbdb206 and 0532a91.

📒 Files selected for processing (20)
  • .changeset/calm-maps-work.md
  • packages/clerk-js/src/core/resources/OrganizationCreationDefaults.ts
  • packages/clerk-js/src/core/resources/OrganizationSettings.ts
  • packages/clerk-js/src/core/resources/User.ts
  • packages/clerk-js/src/test/fixture-helpers.ts
  • packages/localizations/src/en-US.ts
  • packages/shared/src/types/index.ts
  • packages/shared/src/types/localization.ts
  • packages/shared/src/types/organizationCreationDefaults.ts
  • packages/shared/src/types/organizationSettings.ts
  • packages/shared/src/types/snapshots.ts
  • packages/shared/src/types/user.ts
  • packages/ui/src/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/OrganizationCreationDefaultsAlert.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/__tests__/TaskChooseOrganization.test.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx
  • packages/ui/src/elements/Avatar.tsx
  • packages/ui/src/elements/AvatarUploader.tsx
  • packages/ui/src/elements/OrganizationAvatar.tsx
🚧 Files skipped from review as they are similar to previous changes (12)
  • packages/ui/src/elements/AvatarUploader.tsx
  • packages/shared/src/types/organizationSettings.ts
  • packages/shared/src/types/snapshots.ts
  • packages/shared/src/types/localization.ts
  • packages/shared/src/types/organizationCreationDefaults.ts
  • packages/clerk-js/src/core/resources/User.ts
  • packages/shared/src/types/user.ts
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/tests/TaskChooseOrganization.test.tsx
  • packages/clerk-js/src/core/resources/OrganizationCreationDefaults.ts
  • packages/localizations/src/en-US.ts
  • packages/shared/src/types/index.ts
  • .changeset/calm-maps-work.md
🧰 Additional context used
📓 Path-based instructions (13)
**/*.{js,jsx,ts,tsx}

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

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

Files:

  • packages/clerk-js/src/test/fixture-helpers.ts
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx
  • packages/ui/src/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx
  • packages/clerk-js/src/core/resources/OrganizationSettings.ts
  • packages/ui/src/elements/Avatar.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/OrganizationCreationDefaultsAlert.tsx
  • packages/ui/src/elements/OrganizationAvatar.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/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/clerk-js/src/test/fixture-helpers.ts
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx
  • packages/ui/src/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx
  • packages/clerk-js/src/core/resources/OrganizationSettings.ts
  • packages/ui/src/elements/Avatar.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/OrganizationCreationDefaultsAlert.tsx
  • packages/ui/src/elements/OrganizationAvatar.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx
packages/**/src/**/*.{ts,tsx}

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

TypeScript is required for all packages

Files:

  • packages/clerk-js/src/test/fixture-helpers.ts
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx
  • packages/ui/src/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx
  • packages/clerk-js/src/core/resources/OrganizationSettings.ts
  • packages/ui/src/elements/Avatar.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/OrganizationCreationDefaultsAlert.tsx
  • packages/ui/src/elements/OrganizationAvatar.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/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/clerk-js/src/test/fixture-helpers.ts
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx
  • packages/ui/src/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx
  • packages/clerk-js/src/core/resources/OrganizationSettings.ts
  • packages/ui/src/elements/Avatar.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/OrganizationCreationDefaultsAlert.tsx
  • packages/ui/src/elements/OrganizationAvatar.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/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/clerk-js/src/test/fixture-helpers.ts
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx
  • packages/ui/src/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx
  • packages/clerk-js/src/core/resources/OrganizationSettings.ts
  • packages/ui/src/elements/Avatar.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/OrganizationCreationDefaultsAlert.tsx
  • packages/ui/src/elements/OrganizationAvatar.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx
**/*.ts?(x)

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

Use proper TypeScript error types

Files:

  • packages/clerk-js/src/test/fixture-helpers.ts
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx
  • packages/ui/src/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx
  • packages/clerk-js/src/core/resources/OrganizationSettings.ts
  • packages/ui/src/elements/Avatar.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/OrganizationCreationDefaultsAlert.tsx
  • packages/ui/src/elements/OrganizationAvatar.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/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/clerk-js/src/test/fixture-helpers.ts
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx
  • packages/ui/src/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx
  • packages/clerk-js/src/core/resources/OrganizationSettings.ts
  • packages/ui/src/elements/Avatar.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/OrganizationCreationDefaultsAlert.tsx
  • packages/ui/src/elements/OrganizationAvatar.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/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/clerk-js/src/test/fixture-helpers.ts
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx
  • packages/ui/src/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx
  • packages/clerk-js/src/core/resources/OrganizationSettings.ts
  • packages/ui/src/elements/Avatar.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/OrganizationCreationDefaultsAlert.tsx
  • packages/ui/src/elements/OrganizationAvatar.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/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/clerk-js/src/test/fixture-helpers.ts
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx
  • packages/ui/src/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx
  • packages/clerk-js/src/core/resources/OrganizationSettings.ts
  • packages/ui/src/elements/Avatar.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/OrganizationCreationDefaultsAlert.tsx
  • packages/ui/src/elements/OrganizationAvatar.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx
**/*

⚙️ CodeRabbit configuration file

If there are no tests added or modified as part of the PR, please suggest that tests be added to cover the changes.

**/*: Only comment on issues that would block merging, ignore minor or stylistic concerns.
Restrict feedback to errors, security risks, or functionality-breaking problems.
Do not post comments on code style, formatting, or non-critical improvements.
Keep reviews short: flag only issues that make the PR unsafe to merge.
Group similar issues into a single comment instead of posting multiple notes.
Skip repetition: if a pattern repeats, mention it once at a summary level only.
Do not add general suggestions, focus strictly on merge-blocking concerns.
If there are no critical problems, respond with minimal approval (e.g., 'Looks good'). Do not add additional review.
Avoid line-by-line commentary unless it highlights a critical bug or security hole.
Highlight only issues that could cause runtime errors, data loss, or severe maintainability issues.
Ignore minor optimization opportunities, focus solely on correctness and safety.
Provide a top-level summary of critical blockers rather than detailed per-line notes.
Comment only when the issue must be resolved before merge, otherwise remain silent.
When in doubt, err on the side of fewer comments, brevity and blocking issues only.
Avoid posting any refactoring issues.

Files:

  • packages/clerk-js/src/test/fixture-helpers.ts
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx
  • packages/ui/src/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx
  • packages/clerk-js/src/core/resources/OrganizationSettings.ts
  • packages/ui/src/elements/Avatar.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/OrganizationCreationDefaultsAlert.tsx
  • packages/ui/src/elements/OrganizationAvatar.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/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/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx
  • packages/ui/src/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx
  • packages/ui/src/elements/Avatar.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/OrganizationCreationDefaultsAlert.tsx
  • packages/ui/src/elements/OrganizationAvatar.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx
**/*.{md,tsx}

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

Update documentation for API changes

Files:

  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx
  • packages/ui/src/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx
  • packages/ui/src/elements/Avatar.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/OrganizationCreationDefaultsAlert.tsx
  • packages/ui/src/elements/OrganizationAvatar.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/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/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx
  • packages/ui/src/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx
  • packages/ui/src/elements/Avatar.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/OrganizationCreationDefaultsAlert.tsx
  • packages/ui/src/elements/OrganizationAvatar.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx
🧬 Code graph analysis (4)
packages/ui/src/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx (2)
packages/ui/src/elements/AvatarUploader.tsx (1)
  • AvatarUploaderProps (17-23)
packages/shared/src/types/organization.ts (1)
  • OrganizationResource (38-69)
packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/OrganizationCreationDefaultsAlert.tsx (3)
packages/shared/src/types/organizationCreationDefaults.ts (1)
  • OrganizationCreationDefaultsResource (22-34)
packages/ui/src/elements/Alert.tsx (1)
  • Alert (13-65)
packages/ui/src/primitives/Text.tsx (1)
  • Text (46-57)
packages/ui/src/elements/OrganizationAvatar.tsx (2)
packages/shared/src/types/organization.ts (1)
  • OrganizationResource (38-69)
packages/ui/src/elements/Avatar.tsx (1)
  • Avatar (25-170)
packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx (2)
packages/react/src/isomorphicClerk.ts (1)
  • user (730-736)
packages/shared/src/types/organizationCreationDefaults.ts (1)
  • OrganizationCreationDefaultsResource (22-34)
⏰ 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). (29)
  • GitHub Check: Unit Tests (**)
  • GitHub Check: Unit Tests (shared, clerk-js, RQ)
  • GitHub Check: Publish with pkg-pr-new
  • GitHub Check: Static analysis
  • GitHub Check: Integration Tests (billing, chrome, RQ)
  • GitHub Check: Integration Tests (machine, chrome, RQ)
  • GitHub Check: Integration Tests (quickstart, chrome, 16)
  • GitHub Check: Integration Tests (custom, chrome)
  • GitHub Check: Integration Tests (quickstart, chrome, 15)
  • GitHub Check: Integration Tests (react-router, chrome)
  • GitHub Check: Integration Tests (nextjs, chrome, 16)
  • GitHub Check: Integration Tests (nextjs, chrome, 15)
  • GitHub Check: Integration Tests (billing, chrome)
  • GitHub Check: Integration Tests (nextjs, chrome, 16, RQ)
  • GitHub Check: Integration Tests (vue, chrome)
  • GitHub Check: Integration Tests (handshake, chrome)
  • GitHub Check: Integration Tests (sessions, chrome)
  • GitHub Check: Integration Tests (sessions:staging, chrome)
  • GitHub Check: Integration Tests (astro, chrome)
  • GitHub Check: Integration Tests (localhost, chrome)
  • GitHub Check: Integration Tests (handshake:staging, chrome)
  • GitHub Check: Integration Tests (nuxt, chrome)
  • GitHub Check: Integration Tests (tanstack-react-start, chrome)
  • GitHub Check: Integration Tests (ap-flows, chrome)
  • GitHub Check: Integration Tests (machine, chrome)
  • GitHub Check: Integration Tests (generic, chrome)
  • GitHub Check: Integration Tests (express, chrome)
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (2)
packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/OrganizationCreationDefaultsAlert.tsx (1)

1-40: No blocking issues found.

The component correctly handles null/undefined advisory data and unknown advisory codes. Type usage aligns with shared definitions.

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

22-59: No blocking issues found.

The conditional fetch logic and prop threading for organization creation defaults are implemented correctly. Loading states are properly aggregated.

@LauraBeatris LauraBeatris force-pushed the laura/orgs-1136-update-taskchooseorganization-to-show-warning-when branch from 0532a91 to 3f86a35 Compare January 7, 2026 21:43
@LauraBeatris LauraBeatris force-pushed the laura/orgs-1136-update-taskchooseorganization-to-show-warning-when branch from 3f86a35 to 5611bb5 Compare January 8, 2026 16:47
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: 2

🤖 Fix all issues with AI agents
In
@packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx:
- Around line 67-74: The defaultLogoUrl fetch in CreateOrganizationScreen blocks
form submission with no timeout; add an AbortController-based timeout around the
fetch(defaultLogoUrl) and handle abort errors so the submit flow won’t hang, and
introduce a loading state (e.g., setLogoUploading / logoUploading) toggled
before/after the fetch and organization.setLogo call so the UI can show
feedback; alternatively, move the logo upload off the critical path by creating
the organization first and then calling organization.setLogo({ file: logoFile })
in a fire-and-forget async task and gracefully handle failures (use symbols:
CreateOrganizationScreen, organization.setLogo, defaultLogoUrl).

In @packages/ui/src/elements/Avatar.tsx:
- Around line 63-73: The handleImageLoad event handler creates a setTimeout and
returns a cleanup function that never runs; replace that pattern by storing the
timer id in a ref (e.g., spinnerTimerRef) inside handleImageLoad, clear any
existing timer before assigning a new one, and expose a useEffect cleanup
(and/or clear timers when imageUrl changes and on unmount) that calls
clearTimeout(spinnerTimerRef.current) to avoid setLoaded running after unmount
or image change; update references in handleImageLoad, spinnerShownAtRef, and
any effect watching imageUrl to ensure timers are cleared correctly.
📜 Review details

Configuration used: Repository YAML (base), Organization UI (inherited)

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 3f86a35 and 5611bb5.

📒 Files selected for processing (20)
  • .changeset/calm-maps-work.md
  • packages/clerk-js/src/core/resources/OrganizationCreationDefaults.ts
  • packages/clerk-js/src/core/resources/OrganizationSettings.ts
  • packages/clerk-js/src/core/resources/User.ts
  • packages/clerk-js/src/test/fixture-helpers.ts
  • packages/localizations/src/en-US.ts
  • packages/shared/src/types/index.ts
  • packages/shared/src/types/localization.ts
  • packages/shared/src/types/organizationCreationDefaults.ts
  • packages/shared/src/types/organizationSettings.ts
  • packages/shared/src/types/snapshots.ts
  • packages/shared/src/types/user.ts
  • packages/ui/src/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/OrganizationCreationDefaultsAlert.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/__tests__/TaskChooseOrganization.test.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx
  • packages/ui/src/elements/Avatar.tsx
  • packages/ui/src/elements/AvatarUploader.tsx
  • packages/ui/src/elements/OrganizationAvatar.tsx
✅ Files skipped from review due to trivial changes (1)
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/tests/TaskChooseOrganization.test.tsx
🚧 Files skipped from review as they are similar to previous changes (14)
  • packages/ui/src/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx
  • packages/shared/src/types/snapshots.ts
  • .changeset/calm-maps-work.md
  • packages/shared/src/types/organizationSettings.ts
  • packages/ui/src/elements/AvatarUploader.tsx
  • packages/clerk-js/src/core/resources/OrganizationCreationDefaults.ts
  • packages/clerk-js/src/core/resources/OrganizationSettings.ts
  • packages/clerk-js/src/test/fixture-helpers.ts
  • packages/localizations/src/en-US.ts
  • packages/shared/src/types/user.ts
  • packages/ui/src/elements/OrganizationAvatar.tsx
  • packages/shared/src/types/localization.ts
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/OrganizationCreationDefaultsAlert.tsx
  • packages/shared/src/types/organizationCreationDefaults.ts
🧰 Additional context used
📓 Path-based instructions (14)
**/*.{js,jsx,ts,tsx}

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

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

Files:

  • packages/clerk-js/src/core/resources/User.ts
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx
  • packages/shared/src/types/index.ts
  • packages/ui/src/elements/Avatar.tsx
**/*.{js,jsx,ts,tsx,json,md,yml,yaml}

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

Use Prettier for consistent code formatting

Files:

  • packages/clerk-js/src/core/resources/User.ts
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx
  • packages/shared/src/types/index.ts
  • packages/ui/src/elements/Avatar.tsx
packages/**/src/**/*.{ts,tsx}

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

TypeScript is required for all packages

Files:

  • packages/clerk-js/src/core/resources/User.ts
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx
  • packages/shared/src/types/index.ts
  • packages/ui/src/elements/Avatar.tsx
**/*.{ts,tsx,js,jsx}

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

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

Files:

  • packages/clerk-js/src/core/resources/User.ts
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx
  • packages/shared/src/types/index.ts
  • packages/ui/src/elements/Avatar.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/clerk-js/src/core/resources/User.ts
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx
  • packages/shared/src/types/index.ts
  • packages/ui/src/elements/Avatar.tsx
**/*.ts?(x)

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

Use proper TypeScript error types

Files:

  • packages/clerk-js/src/core/resources/User.ts
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx
  • packages/shared/src/types/index.ts
  • packages/ui/src/elements/Avatar.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/clerk-js/src/core/resources/User.ts
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx
  • packages/shared/src/types/index.ts
  • packages/ui/src/elements/Avatar.tsx
**/*.{js,ts,jsx,tsx}

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

Use ESLint with custom configurations tailored for different package types

Files:

  • packages/clerk-js/src/core/resources/User.ts
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx
  • packages/shared/src/types/index.ts
  • packages/ui/src/elements/Avatar.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/clerk-js/src/core/resources/User.ts
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx
  • packages/shared/src/types/index.ts
  • packages/ui/src/elements/Avatar.tsx
**/*

⚙️ CodeRabbit configuration file

If there are no tests added or modified as part of the PR, please suggest that tests be added to cover the changes.

**/*: Only comment on issues that would block merging, ignore minor or stylistic concerns.
Restrict feedback to errors, security risks, or functionality-breaking problems.
Do not post comments on code style, formatting, or non-critical improvements.
Keep reviews short: flag only issues that make the PR unsafe to merge.
Group similar issues into a single comment instead of posting multiple notes.
Skip repetition: if a pattern repeats, mention it once at a summary level only.
Do not add general suggestions, focus strictly on merge-blocking concerns.
If there are no critical problems, respond with minimal approval (e.g., 'Looks good'). Do not add additional review.
Avoid line-by-line commentary unless it highlights a critical bug or security hole.
Highlight only issues that could cause runtime errors, data loss, or severe maintainability issues.
Ignore minor optimization opportunities, focus solely on correctness and safety.
Provide a top-level summary of critical blockers rather than detailed per-line notes.
Comment only when the issue must be resolved before merge, otherwise remain silent.
When in doubt, err on the side of fewer comments, brevity and blocking issues only.
Avoid posting any refactoring issues.

Files:

  • packages/clerk-js/src/core/resources/User.ts
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx
  • packages/shared/src/types/index.ts
  • packages/ui/src/elements/Avatar.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/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx
  • packages/ui/src/elements/Avatar.tsx
**/*.{md,tsx}

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

Update documentation for API changes

Files:

  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx
  • packages/ui/src/elements/Avatar.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/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx
  • packages/ui/src/elements/Avatar.tsx
**/index.ts

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

Avoid barrel files (index.ts re-exports) as they can cause circular dependencies

Files:

  • packages/shared/src/types/index.ts
🧬 Code graph analysis (3)
packages/clerk-js/src/core/resources/User.ts (1)
packages/clerk-js/src/core/resources/OrganizationCreationDefaults.ts (1)
  • OrganizationCreationDefaults (11-74)
packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx (3)
packages/shared/src/types/organizationCreationDefaults.ts (1)
  • OrganizationCreationDefaultsResource (22-34)
packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/OrganizationCreationDefaultsAlert.tsx (1)
  • OrganizationCreationDefaultsAlert (6-25)
packages/ui/src/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx (1)
  • OrganizationProfileAvatarUploader (10-42)
packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx (2)
packages/react/src/isomorphicClerk.ts (1)
  • user (730-736)
packages/shared/src/types/organizationCreationDefaults.ts (1)
  • OrganizationCreationDefaultsResource (22-34)
⏰ 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). (25)
  • GitHub Check: Integration Tests (quickstart, chrome, 16)
  • GitHub Check: Integration Tests (nextjs, chrome, 16)
  • GitHub Check: Integration Tests (quickstart, chrome, 15)
  • GitHub Check: Integration Tests (machine, chrome, RQ)
  • GitHub Check: Integration Tests (custom, chrome)
  • GitHub Check: Integration Tests (react-router, chrome)
  • GitHub Check: Integration Tests (nuxt, chrome)
  • GitHub Check: Integration Tests (sessions, chrome)
  • GitHub Check: Integration Tests (generic, chrome)
  • 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 (tanstack-react-start, chrome)
  • GitHub Check: Integration Tests (billing, chrome, RQ)
  • GitHub Check: Integration Tests (billing, chrome)
  • GitHub Check: Integration Tests (ap-flows, chrome)
  • GitHub Check: Integration Tests (vue, chrome)
  • GitHub Check: Integration Tests (express, chrome)
  • GitHub Check: Integration Tests (handshake:staging, chrome)
  • GitHub Check: Integration Tests (astro, chrome)
  • GitHub Check: Integration Tests (localhost, chrome)
  • GitHub Check: Integration Tests (sessions:staging, chrome)
  • GitHub Check: Integration Tests (handshake, chrome)
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (3)
packages/clerk-js/src/core/resources/User.ts (1)

56-56: LGTM - Public API addition is correct.

The new getOrganizationCreationDefaults method correctly delegates to the OrganizationCreationDefaults.retrieve() static method. The implementation is sound and follows the established pattern for similar methods in this class.

Note: JSDoc documentation for this public API method can be added as indicated in the PR objectives.

Also applies to: 279-280

packages/shared/src/types/index.ts (1)

16-16: LGTM - Type exports are correct.

The addition of the organizationCreationDefaults export and reordering of elementIds have no functional impact. Changes align with the new feature requirements.

Also applies to: 36-36

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

2-2: LGTM - Conditional fetching and data flow are correct.

The organization creation defaults are properly gated by the organizationCreationDefaults?.enabled setting and safely handle undefined user state. The data flow through the component hierarchy is clean and type-safe.

Also applies to: 5-6, 21-25, 57-60, 116-116, 126-126

@LauraBeatris LauraBeatris force-pushed the laura/orgs-1136-update-taskchooseorganization-to-show-warning-when branch from 5611bb5 to 7b52750 Compare January 12, 2026 14:55
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: 2

🤖 Fix all issues with AI agents
In @packages/clerk-js/src/core/resources/OrganizationCreationDefaults.ts:
- Around line 63-73: The snapshot method __internal_toSnapshot on
OrganizationCreationDefaults only serializes advisory and omits the form fields,
then masks the mistake with an unsafe as unknown as
OrganizationCreationDefaultsJSONSnapshot cast; update __internal_toSnapshot to
also include a form key when this.form is present, mapping its properties (name,
slug, logo, blurHash) into the returned object alongside advisory, and remove
the need to fake-cast the result so the returned shape truly matches
OrganizationCreationDefaultsJSONSnapshot.

In
@packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx:
- Around line 69-74: The fetch of defaultLogoUrl and subsequent setLogo call can
throw and abort the flow after the organization was created; wrap the
fetch(defaultLogoUrl) / blob / new File / organization.setLogo(...) sequence in
a try-catch, catch and log the error (or report it to your error reporter) and
continue without rethrowing so the created organization and its setActive flow
are not interrupted; specifically modify the block that checks defaultLogoUrl to
enclose the fetch + blob + File creation + organization.setLogo call in a
try-catch and handle failures gracefully (e.g., processLogger.warn or
reportError) so a failed logo upload does not roll back or break the rest of
CreateOrganizationScreen’s flow.
📜 Review details

Configuration used: Repository YAML (base), Organization UI (inherited)

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 5611bb5 and 87d56ea.

📒 Files selected for processing (20)
  • .changeset/calm-maps-work.md
  • packages/clerk-js/src/core/resources/OrganizationCreationDefaults.ts
  • packages/clerk-js/src/core/resources/OrganizationSettings.ts
  • packages/clerk-js/src/core/resources/User.ts
  • packages/clerk-js/src/test/fixture-helpers.ts
  • packages/localizations/src/en-US.ts
  • packages/shared/src/types/index.ts
  • packages/shared/src/types/localization.ts
  • packages/shared/src/types/organizationCreationDefaults.ts
  • packages/shared/src/types/organizationSettings.ts
  • packages/shared/src/types/snapshots.ts
  • packages/shared/src/types/user.ts
  • packages/ui/src/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/OrganizationCreationDefaultsAlert.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/__tests__/TaskChooseOrganization.test.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx
  • packages/ui/src/elements/Avatar.tsx
  • packages/ui/src/elements/AvatarUploader.tsx
  • packages/ui/src/elements/OrganizationAvatar.tsx
🚧 Files skipped from review as they are similar to previous changes (10)
  • packages/shared/src/types/localization.ts
  • packages/clerk-js/src/test/fixture-helpers.ts
  • packages/clerk-js/src/core/resources/User.ts
  • packages/shared/src/types/index.ts
  • packages/ui/src/elements/AvatarUploader.tsx
  • packages/shared/src/types/organizationCreationDefaults.ts
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx
  • packages/clerk-js/src/core/resources/OrganizationSettings.ts
  • .changeset/calm-maps-work.md
  • packages/localizations/src/en-US.ts
🧰 Additional context used
📓 Path-based instructions (19)
**/*.{js,jsx,ts,tsx}

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

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

Files:

  • packages/shared/src/types/snapshots.ts
  • packages/ui/src/elements/OrganizationAvatar.tsx
  • packages/ui/src/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx
  • packages/ui/src/elements/Avatar.tsx
  • packages/shared/src/types/user.ts
  • packages/clerk-js/src/core/resources/OrganizationCreationDefaults.ts
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/__tests__/TaskChooseOrganization.test.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/OrganizationCreationDefaultsAlert.tsx
  • packages/shared/src/types/organizationSettings.ts
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx
**/*.{js,jsx,ts,tsx,json,md,yml,yaml}

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

Use Prettier for consistent code formatting

Files:

  • packages/shared/src/types/snapshots.ts
  • packages/ui/src/elements/OrganizationAvatar.tsx
  • packages/ui/src/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx
  • packages/ui/src/elements/Avatar.tsx
  • packages/shared/src/types/user.ts
  • packages/clerk-js/src/core/resources/OrganizationCreationDefaults.ts
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/__tests__/TaskChooseOrganization.test.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/OrganizationCreationDefaultsAlert.tsx
  • packages/shared/src/types/organizationSettings.ts
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx
packages/**/src/**/*.{ts,tsx}

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

TypeScript is required for all packages

Files:

  • packages/shared/src/types/snapshots.ts
  • packages/ui/src/elements/OrganizationAvatar.tsx
  • packages/ui/src/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx
  • packages/ui/src/elements/Avatar.tsx
  • packages/shared/src/types/user.ts
  • packages/clerk-js/src/core/resources/OrganizationCreationDefaults.ts
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/__tests__/TaskChooseOrganization.test.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/OrganizationCreationDefaultsAlert.tsx
  • packages/shared/src/types/organizationSettings.ts
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx
**/*.{ts,tsx,js,jsx}

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

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

Files:

  • packages/shared/src/types/snapshots.ts
  • packages/ui/src/elements/OrganizationAvatar.tsx
  • packages/ui/src/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx
  • packages/ui/src/elements/Avatar.tsx
  • packages/shared/src/types/user.ts
  • packages/clerk-js/src/core/resources/OrganizationCreationDefaults.ts
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/__tests__/TaskChooseOrganization.test.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/OrganizationCreationDefaultsAlert.tsx
  • packages/shared/src/types/organizationSettings.ts
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.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/shared/src/types/snapshots.ts
  • packages/ui/src/elements/OrganizationAvatar.tsx
  • packages/ui/src/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx
  • packages/ui/src/elements/Avatar.tsx
  • packages/shared/src/types/user.ts
  • packages/clerk-js/src/core/resources/OrganizationCreationDefaults.ts
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/__tests__/TaskChooseOrganization.test.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/OrganizationCreationDefaultsAlert.tsx
  • packages/shared/src/types/organizationSettings.ts
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx
**/*.ts?(x)

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

Use proper TypeScript error types

Files:

  • packages/shared/src/types/snapshots.ts
  • packages/ui/src/elements/OrganizationAvatar.tsx
  • packages/ui/src/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx
  • packages/ui/src/elements/Avatar.tsx
  • packages/shared/src/types/user.ts
  • packages/clerk-js/src/core/resources/OrganizationCreationDefaults.ts
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/__tests__/TaskChooseOrganization.test.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/OrganizationCreationDefaultsAlert.tsx
  • packages/shared/src/types/organizationSettings.ts
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.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/shared/src/types/snapshots.ts
  • packages/ui/src/elements/OrganizationAvatar.tsx
  • packages/ui/src/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx
  • packages/ui/src/elements/Avatar.tsx
  • packages/shared/src/types/user.ts
  • packages/clerk-js/src/core/resources/OrganizationCreationDefaults.ts
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/__tests__/TaskChooseOrganization.test.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/OrganizationCreationDefaultsAlert.tsx
  • packages/shared/src/types/organizationSettings.ts
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx
**/*.{js,ts,jsx,tsx}

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

Use ESLint with custom configurations tailored for different package types

Files:

  • packages/shared/src/types/snapshots.ts
  • packages/ui/src/elements/OrganizationAvatar.tsx
  • packages/ui/src/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx
  • packages/ui/src/elements/Avatar.tsx
  • packages/shared/src/types/user.ts
  • packages/clerk-js/src/core/resources/OrganizationCreationDefaults.ts
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/__tests__/TaskChooseOrganization.test.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/OrganizationCreationDefaultsAlert.tsx
  • packages/shared/src/types/organizationSettings.ts
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.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/shared/src/types/snapshots.ts
  • packages/ui/src/elements/OrganizationAvatar.tsx
  • packages/ui/src/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx
  • packages/ui/src/elements/Avatar.tsx
  • packages/shared/src/types/user.ts
  • packages/clerk-js/src/core/resources/OrganizationCreationDefaults.ts
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/__tests__/TaskChooseOrganization.test.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/OrganizationCreationDefaultsAlert.tsx
  • packages/shared/src/types/organizationSettings.ts
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx
**/*

⚙️ CodeRabbit configuration file

If there are no tests added or modified as part of the PR, please suggest that tests be added to cover the changes.

**/*: Only comment on issues that would block merging, ignore minor or stylistic concerns.
Restrict feedback to errors, security risks, or functionality-breaking problems.
Do not post comments on code style, formatting, or non-critical improvements.
Keep reviews short: flag only issues that make the PR unsafe to merge.
Group similar issues into a single comment instead of posting multiple notes.
Skip repetition: if a pattern repeats, mention it once at a summary level only.
Do not add general suggestions, focus strictly on merge-blocking concerns.
If there are no critical problems, respond with minimal approval (e.g., 'Looks good'). Do not add additional review.
Avoid line-by-line commentary unless it highlights a critical bug or security hole.
Highlight only issues that could cause runtime errors, data loss, or severe maintainability issues.
Ignore minor optimization opportunities, focus solely on correctness and safety.
Provide a top-level summary of critical blockers rather than detailed per-line notes.
Comment only when the issue must be resolved before merge, otherwise remain silent.
When in doubt, err on the side of fewer comments, brevity and blocking issues only.
Avoid posting any refactoring issues.

Files:

  • packages/shared/src/types/snapshots.ts
  • packages/ui/src/elements/OrganizationAvatar.tsx
  • packages/ui/src/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx
  • packages/ui/src/elements/Avatar.tsx
  • packages/shared/src/types/user.ts
  • packages/clerk-js/src/core/resources/OrganizationCreationDefaults.ts
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/__tests__/TaskChooseOrganization.test.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/OrganizationCreationDefaultsAlert.tsx
  • packages/shared/src/types/organizationSettings.ts
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.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/elements/OrganizationAvatar.tsx
  • packages/ui/src/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx
  • packages/ui/src/elements/Avatar.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/__tests__/TaskChooseOrganization.test.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/OrganizationCreationDefaultsAlert.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx
**/*.{md,tsx}

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

Update documentation for API changes

Files:

  • packages/ui/src/elements/OrganizationAvatar.tsx
  • packages/ui/src/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx
  • packages/ui/src/elements/Avatar.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/__tests__/TaskChooseOrganization.test.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/OrganizationCreationDefaultsAlert.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.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/elements/OrganizationAvatar.tsx
  • packages/ui/src/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx
  • packages/ui/src/elements/Avatar.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/__tests__/TaskChooseOrganization.test.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/OrganizationCreationDefaultsAlert.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx
packages/ui/src/**/*.{ts,tsx}

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

packages/ui/src/**/*.{ts,tsx}: Use element descriptors for all themable elements by applying elementDescriptor prop to components and importing descriptors from packages/ui/src/customizables/elementDescriptors.ts
Use theme-aware functions in elements configuration to access design tokens (e.g., { theme } => ({ backgroundColor: theme.colors.$primary500 }))
Prefer CSS variables (e.g., --clerk-color-primary, --clerk-spacing) for runtime customization via the clerkCssVar utility
Automatically generate color scales using the color scale generation process rather than manually defining all lightness and alpha variations (25, 50, 100, 150, 200, 300, 400, 500, 600, 700, 750, 800, 850, 900, 950 shades)
Use the createVariants function from packages/ui/src/styledSystem/createVariants.ts for type-safe variant-based styling with base, variants, defaultVariants, and compoundVariants configuration
Wrap primitive components with makeCustomizable HOC from packages/ui/src/customizables/makeCustomizable.tsx to enable element descriptor support and theming
Apply the sx prop using either a theme-aware function (theme: InternalTheme) => StyleRule or static style object to components for theme-aware CSS
Use state props (isLoading, hasError, isOpen, isActive) to automatically generate state classes (cl-loading, cl-error, cl-open, cl-active) for styling
Use CSS light-dark() function via the lightDark utility from packages/ui/src/utils/lightDark.ts for automatic light/dark mode support with fallbacks
Use Emotion's css prop and ThemeProvider via InternalThemeProvider from packages/ui/src/styledSystem/InternalThemeProvider.tsx for styling and theme context
Use makeResponsive from packages/ui/src/customizables/makeResponsive.tsx with breakpoints defined in packages/ui/src/styledSystem/breakpoints.tsx for responsive design support
Use useDeepEqualMemo in AppearanceProvider to prevent unnecessary re-renders when appearance configuration changes

Files:

  • packages/ui/src/elements/OrganizationAvatar.tsx
  • packages/ui/src/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx
  • packages/ui/src/elements/Avatar.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/__tests__/TaskChooseOrganization.test.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/OrganizationCreationDefaultsAlert.tsx
  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/CreateOrganizationScreen.tsx
**/*.{test,spec}.{ts,tsx,js,jsx}

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

**/*.{test,spec}.{ts,tsx,js,jsx}: Unit tests are required for all new functionality
Verify proper error handling and edge cases
Include tests for all new features

Files:

  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/__tests__/TaskChooseOrganization.test.tsx
**/*.{test,spec,e2e}.{ts,tsx,js,jsx}

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

Use real Clerk instances for integration tests

Files:

  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/__tests__/TaskChooseOrganization.test.tsx
**/*.test.tsx

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

Use React Testing Library for component testing

Files:

  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/__tests__/TaskChooseOrganization.test.tsx
**/*.{test,spec}.{jsx,tsx}

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

**/*.{test,spec}.{jsx,tsx}: Use React Testing Library for unit testing React components
Test component behavior, not implementation details
Use proper test queries in React Testing Library tests
Implement proper test isolation in React component tests
Use proper test coverage in React component tests
Test component interactions in integration tests
Use proper test data in React component tests
Implement proper test setup in React component tests
Use proper test cleanup in React component tests
Implement proper test assertions in React component tests
Use proper test structure for React component tests

Files:

  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/__tests__/TaskChooseOrganization.test.tsx
**/*.test.{ts,tsx}

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

Use React Testing Library for component testing

Files:

  • packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/__tests__/TaskChooseOrganization.test.tsx
🧬 Code graph analysis (7)
packages/shared/src/types/snapshots.ts (1)
packages/shared/src/types/organizationCreationDefaults.ts (1)
  • OrganizationCreationDefaultsJSON (8-20)
packages/ui/src/elements/OrganizationAvatar.tsx (2)
packages/shared/src/types/organization.ts (1)
  • OrganizationResource (38-69)
packages/ui/src/elements/Avatar.tsx (1)
  • Avatar (25-184)
packages/ui/src/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx (2)
packages/ui/src/elements/AvatarUploader.tsx (1)
  • AvatarUploaderProps (17-23)
packages/shared/src/types/organization.ts (1)
  • OrganizationResource (38-69)
packages/shared/src/types/user.ts (1)
packages/shared/src/types/organizationCreationDefaults.ts (1)
  • OrganizationCreationDefaultsResource (22-34)
packages/clerk-js/src/core/resources/OrganizationCreationDefaults.ts (2)
packages/shared/src/types/organizationCreationDefaults.ts (4)
  • OrganizationCreationDefaultsResource (22-34)
  • OrganizationCreationAdvisoryType (4-4)
  • OrganizationCreationAdvisorySeverity (6-6)
  • OrganizationCreationDefaultsJSON (8-20)
packages/shared/src/types/snapshots.ts (1)
  • OrganizationCreationDefaultsJSONSnapshot (147-147)
packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/__tests__/TaskChooseOrganization.test.tsx (1)
packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/index.tsx (1)
  • TaskChooseOrganization (157-159)
packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/OrganizationCreationDefaultsAlert.tsx (3)
packages/shared/src/types/organizationCreationDefaults.ts (1)
  • OrganizationCreationDefaultsResource (22-34)
packages/ui/src/elements/Alert.tsx (1)
  • Alert (13-65)
packages/ui/src/primitives/Text.tsx (1)
  • Text (46-57)
⏰ 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). (20)
  • GitHub Check: Static analysis
  • GitHub Check: Publish with pkg-pr-new
  • GitHub Check: Unit Tests (**)
  • GitHub Check: Integration Tests (nextjs, chrome, 15)
  • GitHub Check: Integration Tests (quickstart, chrome, 16)
  • GitHub Check: Integration Tests (sessions, chrome)
  • GitHub Check: Integration Tests (ap-flows, chrome)
  • GitHub Check: Integration Tests (machine, chrome)
  • GitHub Check: Integration Tests (machine, chrome, RQ)
  • GitHub Check: Integration Tests (custom, chrome)
  • GitHub Check: Integration Tests (billing, chrome)
  • GitHub Check: Integration Tests (nextjs, chrome, 16, RQ)
  • GitHub Check: Integration Tests (nextjs, chrome, 16)
  • GitHub Check: Integration Tests (billing, chrome, RQ)
  • GitHub Check: Integration Tests (localhost, chrome)
  • GitHub Check: Integration Tests (quickstart, chrome, 15)
  • GitHub Check: Integration Tests (sessions:staging, chrome)
  • GitHub Check: Integration Tests (astro, chrome)
  • GitHub Check: Integration Tests (generic, chrome)
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (8)
packages/shared/src/types/organizationSettings.ts (1)

23-25: LGTM!

The new organization_creation_defaults field additions follow the established conventions in this file (snake_case for JSON, camelCase for Resource) and are additive type changes.

Also applies to: 43-45

packages/shared/src/types/user.ts (1)

10-10: LGTM!

The new getOrganizationCreationDefaults method follows the established patterns for async resource methods on UserResource and correctly imports the return type.

Also applies to: 119-119

packages/shared/src/types/snapshots.ts (1)

31-31: LGTM!

The new OrganizationCreationDefaultsJSONSnapshot type alias follows the established pattern used for other snapshot types in this file.

Also applies to: 147-148

packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/__tests__/TaskChooseOrganization.test.tsx (1)

357-435: LGTM!

Good test coverage for the new organization creation defaults feature, covering:

  • Warning display when an organization already exists for the user's email domain
  • Form prefilling with default values
  • Conditional fetch behavior based on environment settings
packages/ui/src/elements/OrganizationAvatar.tsx (1)

6-23: LGTM!

Clean implementation that forwards the new showLoadingSpinner prop to the underlying Avatar component, enabling the loading spinner UI during image loading.

packages/ui/src/components/OrganizationProfile/OrganizationProfileAvatarUploader.tsx (1)

10-42: LGTM!

The prop addition and forwarding to OrganizationAvatar is straightforward and correctly typed.

packages/ui/src/elements/Avatar.tsx (1)

22-87: LGTM!

The loading spinner implementation with delay and minimum duration prevents UI flicker. Timer cleanup is properly handled in the effect cleanup functions.

packages/ui/src/components/SessionTasks/tasks/TaskChooseOrganization/OrganizationCreationDefaultsAlert.tsx (1)

1-40: LGTM!

The component correctly guards against missing advisory data and maps known codes to localization keys. The switch statement with default null provides safe handling for unknown advisory codes.

@LauraBeatris LauraBeatris force-pushed the laura/orgs-1136-update-taskchooseorganization-to-show-warning-when branch from 0e8a088 to 437ada9 Compare January 12, 2026 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants