Skip to content

Conversation

@anmolsinghbhatia
Copy link
Collaborator

@anmolsinghbhatia anmolsinghbhatia commented Oct 31, 2025

Summary

Converts the use case selection in the onboarding flow from single-select to multi-select, allowing users to choose multiple use cases that describe how they plan to use Plane.

Type of Change

  • Improvement
  • Code refactoring

Summary by CodeRabbit

  • New Features

    • Use case selection during profile setup now supports multiple selections, allowing users to choose multiple relevant options.
  • Refactor

    • Updated user name display logic in onboarding header.
    • Enhanced use case selection UI with multi-select chip-style interface.
    • Adjusted validation requirements and messaging for the new multi-select experience.

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

@makeplane
Copy link

makeplane bot commented Oct 31, 2025

Linked to Plane Work Item(s)

This comment was auto-generated by Plane

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 31, 2025

Warning

Rate limit exceeded

@anmolsinghbhatia has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 5 minutes and 38 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between e5790aa and af71cc0.

📒 Files selected for processing (2)
  • apps/web/core/components/onboarding/header.tsx (1 hunks)
  • apps/web/core/components/onboarding/profile-setup.tsx (9 hunks)

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

The onboarding flow's use-case field is converted from single-string to multi-string-array selection. Updates span form type definitions, UI from single-select to multi-select chips, validation rules requiring at least one selection, payload serialization (array joined with ". "), and event tracking. Additionally, header name derivation logic shifts from nullish-coalescing to explicit conditionals.

Changes

Cohort / File(s) Summary
Type Definition Update
apps/web/core/components/onboarding/steps/profile/root.tsx
use_case field in TProfileSetupFormValues type signature changed from string to string[].
Multi-Select Feature (UI, Validation, Payload)
apps/web/core/components/onboarding/profile-setup.tsx, apps/web/core/components/onboarding/steps/usecase/root.tsx
Default values updated to []; UI switched from single-select options to multi-select chip-style with toggle behavior; validation extended to require at least one selection with error messaging; selection logic updated to check array membership; payload construction joins array with ". " separator; event tracking updated to reference transformed payload instead of raw form data.
Name Derivation Logic
apps/web/core/components/onboarding/header.tsx
Display name derivation changed from nullish-coalescing chain to explicit conditionals; now treats empty display_name as falsy; makes last_name optional in constructed name.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

  • apps/web/core/components/onboarding/profile-setup.tsx: High complexity with interrelated changes across payload construction, validation messaging, event tracking, and multi-select rendering logic; requires careful verification of array-to-string serialization consistency.
  • apps/web/core/components/onboarding/steps/usecase/root.tsx: Multiple coordinated updates to form initialization, seeding from stored data (split operation), selection toggling, and validation rules; ensure split/join round-trip correctness.
  • Type propagation: Verify the string[] type change flows correctly through dependent components and doesn't introduce type mismatches in event payloads or API calls.

Poem

🐰 From one choice bounded to many now free,
Array-select blooms in our onboarding tree!
Chips multicolor, validation so keen,
A hopping-good change to the form ever seen! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Description check ❓ Inconclusive The description provides a clear summary and marks appropriate change types, but is missing several required template sections: Screenshots and Media, Test Scenarios, and References/linked issues. Complete the PR description by adding Screenshots/Media showing the multi-select UI change, Test Scenarios describing validation and functionality tests, and References linking to issue WEB-5317.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: enabling multi-select for use case in the onboarding flow, which aligns with the primary objective of converting from single-select to multi-select.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@anmolsinghbhatia anmolsinghbhatia removed the request for review from pablohashescobar October 31, 2025 09:02
@anmolsinghbhatia anmolsinghbhatia removed ⚙️backend 🔄migrations Contains Migration changes labels Oct 31, 2025
@anmolsinghbhatia anmolsinghbhatia marked this pull request as ready for review December 1, 2025 10:20
Copilot AI review requested due to automatic review settings December 1, 2025 10:20
@cursor
Copy link

cursor bot commented Dec 1, 2025

You have run out of free Bugbot PR reviews for this billing cycle. This will reset on December 20.

To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

♻️ Duplicate comments (1)
apps/web/core/components/onboarding/profile-setup.tsx (1)

554-558: Use cn for conditional class names.

As noted in a previous review, use the cn utility for conditional class composition instead of template literals for consistency with the codebase patterns.

 <div
   key={userDomain}
-  className={`flex-shrink-0 border-[0.5px] hover:cursor-pointer hover:bg-custom-background-90 ${
-    isSelected ? "border-custom-primary-100" : "border-custom-border-300"
-  } rounded px-3 py-1.5 text-sm font-medium`}
+  className={cn(
+    "flex-shrink-0 border-[0.5px] hover:cursor-pointer hover:bg-custom-background-90 rounded px-3 py-1.5 text-sm font-medium",
+    isSelected ? "border-custom-primary-100" : "border-custom-border-300"
+  )}
   onClick={() => {
🧹 Nitpick comments (2)
apps/web/core/components/onboarding/header.tsx (1)

59-63: Minor: Potential trailing space when last_name is empty.

When first_name is truthy but last_name is empty or undefined, the result will be "FirstName " with a trailing space. Consider trimming or conditionally including the space.

 const userName = user?.display_name
   ? user?.display_name
   : user?.first_name
-    ? `${user?.first_name} ${user?.last_name ?? ""}`
+    ? `${user?.first_name}${user?.last_name ? ` ${user.last_name}` : ""}`
     : user?.email;
apps/web/core/components/onboarding/steps/usecase/root.tsx (1)

94-94: Simplify boolean expression.

The expression !isSubmitting && isValid ? false : true is equivalent to isSubmitting || !isValid.

-  const isButtonDisabled = !isSubmitting && isValid ? false : true;
+  const isButtonDisabled = isSubmitting || !isValid;
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 123f59e and e5790aa.

📒 Files selected for processing (4)
  • apps/web/core/components/onboarding/header.tsx (1 hunks)
  • apps/web/core/components/onboarding/profile-setup.tsx (7 hunks)
  • apps/web/core/components/onboarding/steps/profile/root.tsx (1 hunks)
  • apps/web/core/components/onboarding/steps/usecase/root.tsx (4 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,mts,cts}

📄 CodeRabbit inference engine (.github/instructions/typescript.instructions.md)

**/*.{ts,tsx,mts,cts}: Use const type parameters for more precise literal inference in TypeScript 5.0+
Use the satisfies operator to validate types without widening them
Leverage inferred type predicates to reduce the need for explicit is return types in filter/check functions
Use NoInfer<T> utility to block inference for specific type arguments when they should be determined by other arguments
Utilize narrowing in switch(true) blocks for control flow analysis (TypeScript 5.3+)
Rely on narrowing from direct boolean comparisons for type guards
Trust preserved narrowing in closures when variables aren't modified after the check (TypeScript 5.4+)
Use constant indices to narrow object/array properties (TypeScript 5.5+)
Use standard ECMAScript decorators (Stage 3) instead of legacy experimentalDecorators
Use using declarations for explicit resource management with Disposable pattern instead of manual cleanup (TypeScript 5.2+)
Use with { type: "json" } for import attributes; avoid deprecated assert syntax (TypeScript 5.3/5.8+)
Use import type explicitly when importing types to ensure they are erased during compilation, respecting verbatimModuleSyntax flag
Use .ts, .mts, .cts extensions in import type statements (TypeScript 5.2+)
Use import type { Type } from "mod" with { "resolution-mode": "import" } for specific module resolution contexts (TypeScript 5.3+)
Use new iterator methods (map, filter, etc.) if targeting modern environments (TypeScript 5.6+)
Utilize new Set methods like union, intersection, etc., when available (TypeScript 5.5+)
Use Object.groupBy / Map.groupBy standard methods for grouping instead of external libraries (TypeScript 5.4+)
Use Promise.withResolvers() for creating promises with exposed resolve/reject functions (TypeScript 5.7+)
Use copying array methods (toSorted, toSpliced, with) for immutable array operations (TypeScript 5.2+)
Avoid accessing instance fields via super in classes (TypeScript 5....

Files:

  • apps/web/core/components/onboarding/steps/profile/root.tsx
  • apps/web/core/components/onboarding/header.tsx
  • apps/web/core/components/onboarding/steps/usecase/root.tsx
  • apps/web/core/components/onboarding/profile-setup.tsx
🧠 Learnings (1)
📚 Learning: 2025-10-10T13:25:14.810Z
Learnt from: gakshita
Repo: makeplane/plane PR: 7949
File: apps/web/core/components/issues/issue-modal/form.tsx:183-189
Timestamp: 2025-10-10T13:25:14.810Z
Learning: In `apps/web/core/components/issues/issue-modal/form.tsx`, the form reset effect uses a `dataResetProperties` dependency array prop (default: []) to give parent components explicit control over when the form resets. Do not suggest adding the `data` prop itself to the dependency array, as this would cause unwanted resets on every render when the data object reference changes, disrupting user input. The current pattern is intentional and allows the parent to trigger resets only when specific conditions are met.

Applied to files:

  • apps/web/core/components/onboarding/profile-setup.tsx
🧬 Code graph analysis (1)
apps/web/core/components/onboarding/steps/usecase/root.tsx (4)
apps/web/core/components/onboarding/steps/profile/root.tsx (1)
  • TProfileSetupFormValues (30-39)
packages/types/src/current-user/profile.ts (1)
  • TUserProfile (1-30)
packages/types/src/users.ts (1)
  • TUserProfile (57-84)
packages/constants/src/workspace.ts (1)
  • USE_CASES (347-353)
⏰ 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: CodeQL analysis (javascript-typescript)
  • GitHub Check: Agent
  • GitHub Check: Build and lint web apps
🔇 Additional comments (7)
apps/web/core/components/onboarding/steps/profile/root.tsx (1)

30-39: LGTM!

The type change from string to string[] for use_case correctly supports the multi-select functionality. The exported type is properly aligned with the usage in other onboarding components.

apps/web/core/components/onboarding/steps/usecase/root.tsx (3)

24-26: LGTM!

Default value correctly initializes as an empty array with proper type assertion.


105-129: LGTM!

The multi-select toggle logic is correctly implemented:

  • Uses includes() for array membership check
  • Properly handles add/remove with filter and spread
  • Prevents default form submission with e.preventDefault()

37-42: Delimiter consistency is correctly implemented throughout the use_case data flow.

The form saves multiple selections by joining them with ". " (profile-setup.tsx lines 142, 215), and this component correctly splits on the same delimiter when loading. Legacy single-value data without the delimiter will properly return a single-element array via split(), which is the intended behavior. No changes needed.

apps/web/core/components/onboarding/profile-setup.tsx (3)

29-47: LGTM!

Type definition and default value correctly updated to support multi-select with string[].


141-144: LGTM!

Payload construction correctly joins the array with ". " delimiter, consistent with the approach in usecase/root.tsx.


545-548: LGTM!

Validation rules correctly enforce at least one selection with both required and custom validate function for proper error messaging.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR converts the use case selection in the onboarding flow from single-select to multi-select, allowing users to choose multiple use cases describing how they plan to use Plane. The backend stores these as a period-delimited string (e.g., "Use case 1. Use case 2"), which is split into an array for the frontend form and joined back when submitting. Additionally, the PR includes an unrelated fix to the onboarding header's userName construction logic.

Key Changes

  • Updated use_case field type from string to string[] in form values
  • Implemented array-based selection logic with proper split/join for backend compatibility
  • Enhanced validation to ensure at least one option is selected
  • Updated UI text from "Choose one" to "Choose one or more"

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
apps/web/core/components/onboarding/steps/usecase/root.tsx Converted use case field to array type, added split/join logic for backend string format, implemented multi-select toggle behavior
apps/web/core/components/onboarding/steps/profile/root.tsx Updated TProfileSetupFormValues type definition to change use_case from string to string[]
apps/web/core/components/onboarding/profile-setup.tsx Updated type definition, default values, split/join logic, validation rules, and multi-select UI for the combined onboarding flow
apps/web/core/components/onboarding/header.tsx Fixed userName construction to properly handle missing user fields (unrelated to main PR purpose)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sriramveeraghanta sriramveeraghanta merged commit f41e121 into preview Dec 8, 2025
6 checks passed
@sriramveeraghanta sriramveeraghanta deleted the chore-multi-select-use-case-onboarding-and-refactoring branch December 8, 2025 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants