Skip to content

[Dashboard] Add plan selection step to team onboarding flow #7324

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

jnsdls
Copy link
Member

@jnsdls jnsdls commented Jun 11, 2025

Add Plan Selection Step to Team Onboarding Flow

This PR adds a new "Plan Selection" step to the team onboarding flow, allowing users to choose a subscription plan during the onboarding process.

Changes:

  • Added a new /get-started/team/[team_slug]/select-plan page with a plan selector component
  • Updated the team onboarding flow to include the plan selection step between team creation and member invitation
  • Adjusted the step numbering in the onboarding layout to accommodate the new step
  • Modified the team info form to redirect to the plan selection page after completion
  • Updated the subscription overview display format in the billing info card

The plan selector includes options for Starter, Growth, Scale, and Pro plans, with appropriate tracking events and the ability to skip plan selection for later.

Summary by CodeRabbit

  • New Features

    • Introduced a dedicated plan selection step in the team onboarding flow, allowing users to choose a subscription plan or skip and proceed to add members.
    • Added a new page for team plan selection with interactive plan cards and a streamlined navigation experience.
  • Improvements

    • Updated onboarding navigation to direct users to the new plan selection step after team creation.
    • Enhanced onboarding layout and step indicators for clarity and improved user experience.
    • Refined billing information card with clearer date formatting and improved link styling.

PR-Codex overview

This PR focuses on updating the team onboarding process in the application, specifically enhancing the flow for selecting a plan and modifying the current step in the onboarding layout.

Detailed summary

  • Changed currentStep from 2 to 3 in TeamOnboardingLayout for the add members page.
  • Updated redirection from /add-members to /select-plan after team update.
  • Introduced a new select-plan page with a PlanSelector component.
  • Added a new onboarding step for plan selection.
  • Enhanced PlanSelector with multiple pricing options and analytics tracking.
  • Adjusted layout styles for better presentation in onboarding components.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Copy link

vercel bot commented Jun 11, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
thirdweb-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 12, 2025 0:18am
4 Skipped Deployments
Name Status Preview Comments Updated (UTC)
docs-v2 ⬜️ Skipped (Inspect) Jun 12, 2025 0:18am
login ⬜️ Skipped (Inspect) Jun 12, 2025 0:18am
thirdweb_playground ⬜️ Skipped (Inspect) Jun 12, 2025 0:18am
wallet-ui ⬜️ Skipped (Inspect) Jun 12, 2025 0:18am

@vercel vercel bot temporarily deployed to Preview – wallet-ui June 11, 2025 22:46 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground June 11, 2025 22:46 Inactive
@vercel vercel bot temporarily deployed to Preview – login June 11, 2025 22:46 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 June 11, 2025 22:46 Inactive
Copy link

changeset-bot bot commented Jun 11, 2025

⚠️ No Changeset found

Latest commit: 49b483a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

Copy link
Contributor

coderabbitai bot commented Jun 11, 2025

Walkthrough

A new "Plan Selection" step is added to the team onboarding flow, introducing a dedicated page and a PlanSelector component for choosing a billing plan. Navigation and step indicators are updated accordingly, and minor UI adjustments are made. The onboarding sequence now routes users through plan selection before adding team members.

Changes

File(s) Change Summary
.../get-started/team/[team_slug]/select-plan/_components/plan-selector.tsx Added new PlanSelector React client component for team plan selection, analytics, Stripe redirect handling, polling, and routing.
.../get-started/team/[team_slug]/select-plan/page.tsx Added new server component page for plan selection; fetches team/token, renders onboarding layout and PlanSelector.
.../get-started/team/[team_slug]/add-members/page.tsx Updated currentStep prop for onboarding layout from 2 to 3.
.../login/onboarding/onboarding-layout.tsx Inserted "Plan Selection" as onboarding step 2, adjusted step types, and made minor layout changes to container spacing and width.
.../login/onboarding/team-onboarding/team-onboarding.tsx Changed post-team-info navigation from "add-members" to "select-plan" step.
.../team/[team_slug]/(team)/~/settings/billing/components/PlanInfoCard.tsx Updated UI text and styling for billing period and "View Breakdown" link; no logic changes.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant TeamOnboarding
    participant PlanSelector
    participant PricingCard
    participant Analytics
    participant Router

    User->>TeamOnboarding: Complete team info form
    TeamOnboarding->>Router: Navigate to /get-started/team/{slug}/select-plan
    Router->>PlanSelector: Render with team data

    User->>PlanSelector: Selects a plan or skips
    PlanSelector->>Analytics: Track plan selection or skip event
    alt Plan selected
        PlanSelector->>PricingCard: Initiate checkout
        PricingCard-->>PlanSelector: (Stripe redirect event)
        PlanSelector->>PlanSelector: Poll for billing plan change
        alt Plan upgraded
            PlanSelector->>Analytics: Track upgrade
            PlanSelector->>Router: Navigate to add members
        end
    else Skip
        PlanSelector->>Router: Navigate to add members
    end
Loading

Possibly related PRs

Suggested reviewers

  • MananTank

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between aef6e94 and 49b483a.

📒 Files selected for processing (6)
  • apps/dashboard/src/app/(app)/get-started/team/[team_slug]/add-members/page.tsx (1 hunks)
  • apps/dashboard/src/app/(app)/get-started/team/[team_slug]/select-plan/_components/plan-selector.tsx (1 hunks)
  • apps/dashboard/src/app/(app)/get-started/team/[team_slug]/select-plan/page.tsx (1 hunks)
  • apps/dashboard/src/app/(app)/login/onboarding/onboarding-layout.tsx (3 hunks)
  • apps/dashboard/src/app/(app)/login/onboarding/team-onboarding/team-onboarding.tsx (1 hunks)
  • apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/settings/billing/components/PlanInfoCard.tsx (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (6)
  • apps/dashboard/src/app/(app)/get-started/team/[team_slug]/select-plan/_components/plan-selector.tsx
  • apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/settings/billing/components/PlanInfoCard.tsx
  • apps/dashboard/src/app/(app)/get-started/team/[team_slug]/add-members/page.tsx
  • apps/dashboard/src/app/(app)/login/onboarding/team-onboarding/team-onboarding.tsx
  • apps/dashboard/src/app/(app)/login/onboarding/onboarding-layout.tsx
  • apps/dashboard/src/app/(app)/get-started/team/[team_slug]/select-plan/page.tsx
⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: E2E Tests (pnpm, webpack)
  • GitHub Check: Size
  • GitHub Check: Lint Packages
  • GitHub Check: E2E Tests (pnpm, esbuild)
  • GitHub Check: E2E Tests (pnpm, vite)
  • GitHub Check: Unit Tests
  • GitHub Check: Build Packages
  • GitHub Check: Analyze (javascript)
✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added the Dashboard Involves changes to the Dashboard. label Jun 11, 2025
Copy link
Member Author

jnsdls commented Jun 11, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • merge-queue - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@jnsdls jnsdls marked this pull request as ready for review June 11, 2025 22:46
@jnsdls jnsdls requested review from a team as code owners June 11, 2025 22:46
cursor[bot]

This comment was marked as outdated.

Copy link

codecov bot commented Jun 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 55.57%. Comparing base (8489844) to head (49b483a).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7324   +/-   ##
=======================================
  Coverage   55.57%   55.57%           
=======================================
  Files         909      909           
  Lines       58675    58675           
  Branches     4157     4157           
=======================================
  Hits        32608    32608           
  Misses      25960    25960           
  Partials      107      107           
Flag Coverage Δ
packages 55.57% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

🧹 Nitpick comments (5)
apps/dashboard/src/app/(app)/get-started/team/[team_slug]/select-plan/page.tsx (2)

25-32: Minor: avoid redundant network hit in getTeam.

You already have team from the initial fetch. Consider short-circuiting if the ID matches or memoising the value to reduce server load.
Optional refactor only.


20-24: Dead code – commented-out client creation.

Unless this will be activated imminently, remove to keep the file clean.

apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/settings/billing/components/PlanInfoCard.tsx (1)

303-305: Anchor styling tweak OK – confirm accessibility.

Dotted underline is fine; ensure contrast and focus styles remain WCAG-compliant across themes.

apps/dashboard/src/app/(app)/get-started/team/[team_slug]/select-plan/_components/plan-selector.tsx (2)

49-116: Capitalisation drift in CTA labels

"Get Started" (title-case) vs "Get started" (sentence-case) across cards breaks visual consistency. Pick one style and apply to all CTAs.


43-130: Avoid four nearly-identical JSX blocks

The only per-plan deltas are billingPlan, highlighted, and the analytics plan value. Building the cards from a data array will cut ~70 lines and reduce future maintenance slip-ups (like the starter-plan bug).

Pseudo-refactor:

const plans = [
  { id: "starter", label: "Get Started" },
  { id: "growth",  label: "Get Started", highlighted: true },
  { id: "scale",   label: "Get Started" },
  { id: "pro",     label: "Get Started" },
];

{plans.map(({ id, highlighted, label }) => (
  <PricingCard
    key={id}
    billingPlan={id}
    highlighted={highlighted}
    billingStatus={props.team.billingStatus}
    teamSlug={props.team.slug}
    cta={{
      label,
      type: "checkout",
      onClick: () =>
        trackEvent({
          category: "teamOnboarding",
          action: "selectPlan",
          label: "attempt",
          plan: id,
        }),
    }}
    getTeam={props.getTeam}
    teamId={props.team.id}
  />
))}
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8489844 and 121d650.

📒 Files selected for processing (6)
  • apps/dashboard/src/app/(app)/get-started/team/[team_slug]/add-members/page.tsx (1 hunks)
  • apps/dashboard/src/app/(app)/get-started/team/[team_slug]/select-plan/_components/plan-selector.tsx (1 hunks)
  • apps/dashboard/src/app/(app)/get-started/team/[team_slug]/select-plan/page.tsx (1 hunks)
  • apps/dashboard/src/app/(app)/login/onboarding/onboarding-layout.tsx (3 hunks)
  • apps/dashboard/src/app/(app)/login/onboarding/team-onboarding/team-onboarding.tsx (1 hunks)
  • apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/settings/billing/components/PlanInfoCard.tsx (2 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
apps/dashboard/src/app/(app)/get-started/team/[team_slug]/add-members/page.tsx (1)
apps/dashboard/src/app/(app)/login/onboarding/onboarding-layout.tsx (1)
  • TeamOnboardingLayout (94-107)
⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: E2E Tests (pnpm, esbuild)
  • GitHub Check: E2E Tests (pnpm, vite)
  • GitHub Check: Size
  • GitHub Check: E2E Tests (pnpm, webpack)
  • GitHub Check: Build Packages
  • GitHub Check: Lint Packages
  • GitHub Check: Unit Tests
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (5)
apps/dashboard/src/app/(app)/get-started/team/[team_slug]/add-members/page.tsx (1)

27-29: currentStep renumbering looks correct.

TeamOnboardingLayout now accepts 1 | 2 | 3; passing 3 here is consistent with the new flow.

apps/dashboard/src/app/(app)/login/onboarding/onboarding-layout.tsx (1)

80-91: Step metadata update looks good.

Unique, sequential step numbers (1-3) and the added RocketIcon align with the new flow. No issues spotted.

apps/dashboard/src/app/(app)/get-started/team/[team_slug]/select-plan/page.tsx (2)

34-37: currentStep={2} is consistent with new step order.

Good catch aligning with the layout changes.


7-15: 🛠️ Refactor suggestion

Type signature for params should not be a Promise.

props.params is already a plain object in Next JS server components. Declaring it as Promise<...> adds unnecessary indirection and may confuse type-checking tools.

-export default async function Page(props: {
-  params: Promise<{ team_slug: string }>;
-}) {
-  const params = await props.params;
+export default async function Page(props: {
+  params: { team_slug: string };
+}) {
+  const { params } = props;
⛔ Skipped due to learnings
Learnt from: MananTank
PR: thirdweb-dev/js#7152
File: apps/dashboard/src/app/(app)/(dashboard)/(chain)/[chain_id]/[contractAddress]/accounts/page.tsx:2-10
Timestamp: 2025-05-26T16:28:10.079Z
Learning: In Next.js 14+, the `params` object in page components is always a Promise that needs to be awaited, so the correct typing is `params: Promise<ParamsType>` rather than `params: ParamsType`.
Learnt from: jnsdls
PR: thirdweb-dev/js#6929
File: apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/insight/webhooks/page.tsx:14-19
Timestamp: 2025-05-21T05:17:31.283Z
Learning: In Next.js server components, the `params` object can sometimes be a Promise that needs to be awaited, despite type annotations suggesting otherwise. In apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/insight/webhooks/page.tsx, it's necessary to await the params object before accessing its properties.
apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/settings/billing/components/PlanInfoCard.tsx (1)

335-339: Date rendering change: verify locale & TZ.

Using format(..., "MMMM dd, yyyy") drops the time zone context. If teams span regions, consider displaying locale-aware dates or adding the user’s TZ elsewhere.

Copy link
Contributor

github-actions bot commented Jun 11, 2025

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 62.57 KB (0%) 1.3 s (0%) 217 ms (+44.59% 🔺) 1.5 s
thirdweb (cjs) 345.55 KB (0%) 7 s (0%) 1.2 s (-1.05% 🔽) 8.2 s
thirdweb (minimal + tree-shaking) 5.7 KB (0%) 114 ms (0%) 69 ms (+695.37% 🔺) 183 ms
thirdweb/chains (tree-shaking) 531 B (0%) 11 ms (0%) 10 ms (+147.61% 🔺) 21 ms
thirdweb/react (minimal + tree-shaking) 19.56 KB (0%) 392 ms (0%) 82 ms (+287.95% 🔺) 474 ms

@jnsdls jnsdls force-pushed the _Dashboard_Add_plan_selection_step_to_team_onboarding_flow branch from 121d650 to dfb4ad4 Compare June 11, 2025 23:12
@vercel vercel bot temporarily deployed to Preview – wallet-ui June 11, 2025 23:12 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 June 11, 2025 23:12 Inactive
@vercel vercel bot temporarily deployed to Preview – login June 11, 2025 23:12 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground June 11, 2025 23:12 Inactive
@jnsdls jnsdls force-pushed the _Dashboard_Add_plan_selection_step_to_team_onboarding_flow branch from dfb4ad4 to aef6e94 Compare June 11, 2025 23:13
@vercel vercel bot temporarily deployed to Preview – wallet-ui June 11, 2025 23:13 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground June 11, 2025 23:13 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 June 11, 2025 23:13 Inactive
@vercel vercel bot temporarily deployed to Preview – login June 11, 2025 23:13 Inactive
cursor[bot]

This comment was marked as outdated.

@jnsdls jnsdls force-pushed the _Dashboard_Add_plan_selection_step_to_team_onboarding_flow branch from aef6e94 to 49b483a Compare June 12, 2025 00:11
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground June 12, 2025 00:11 Inactive
@vercel vercel bot temporarily deployed to Preview – login June 12, 2025 00:11 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui June 12, 2025 00:11 Inactive
@vercel vercel bot temporarily deployed to Preview – docs-v2 June 12, 2025 00:11 Inactive
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

✅ BugBot reviewed your changes and found no bugs!


Was this report helpful? Give feedback by reacting with 👍 or 👎

@jnsdls jnsdls merged commit 38f1821 into main Jun 12, 2025
25 checks passed
@jnsdls jnsdls deleted the _Dashboard_Add_plan_selection_step_to_team_onboarding_flow branch June 12, 2025 00:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dashboard Involves changes to the Dashboard.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant