feat(desktop): show Pro badge in account dropdown

Merged
KI
6mo ago
+63-3

Summary

  • Adds a billing.activePlan tRPC query that returns the active org's plan tier and subscription status (defaults to free when there's no active subscription).
  • Renders a Pro / Enterprise badge next to the user's name in the AgentsHeader desktop dropdown and mobile drawer when the org is on a paid plan.
  • Skipped the legacy (dashboard-legacy)/Header.tsx since the v1 dashboard is being sunset.

Test plan

  • Sign in as a user whose active org is on the free plan — no badge shows.
  • Switch to an org on pro — Pro badge renders next to the name in both the desktop dropdown and the mobile drawer.
  • Switch to an org on enterprise — badge label reads Enterprise.
  • Subscription with non-active status (e.g. canceled) does not show a badge.

Summary by cubic

Show a Pro/Enterprise badge when the active org has a paid plan in the web account menu (dropdown + mobile drawer) and the desktop Organization dropdown. Adds a billing.activePlan tRPC query to expose the active org’s plan and subscription status.

  • New Features

    • billing.activePlan returns { plan, status } for the active org; defaults to free/null and filters to active statuses via @superset/shared/billing.
    • Web (AgentsHeader): render a Badge next to the user’s name in the desktop dropdown and mobile drawer; label shows "Pro" or "Enterprise"; hidden for free or non-active subscriptions.
    • Desktop (OrganizationDropdown): render a Badge next to the org name in both trigger variants using useCurrentPlan.
  • Bug Fixes

    • Avoid stale plan text by computing the label only when on a paid tier.
    • Remove a redundant status check in billing.activePlan.

Summary by CodeRabbit

  • New Features
    • Your active billing plan is now shown with a compact badge next to your account name and organization name in both mobile and desktop menus.
    • A human-readable plan label and status are consistently displayed across account and organization dropdowns, with the badge shown only for non-free (paid) plans.
    • The app reliably falls back to a free plan label when no active subscription is found.