feat(desktop): show Pro badge in account dropdown
Merged
KI
6mo ago+63+63+01234567890123456789-3-3-0123456789
Summary
- Adds a
billing.activePlantRPC query that returns the active org's plan tier and subscription status (defaults tofreewhen there's no active subscription). - Renders a
Pro/Enterprisebadge next to the user's name in theAgentsHeaderdesktop dropdown and mobile drawer when the org is on a paid plan. - Skipped the legacy
(dashboard-legacy)/Header.tsxsince the v1 dashboard is being sunset.
Test plan
- Sign in as a user whose active org is on the
freeplan — no badge shows. - Switch to an org on
pro—Probadge renders next to the name in both the desktop dropdown and the mobile drawer. - Switch to an org on
enterprise— badge label readsEnterprise. - 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.activePlanreturns{ plan, status }for the active org; defaults tofree/nulland filters to active statuses via@superset/shared/billing.- Web (
AgentsHeader): render aBadgenext 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 aBadgenext to the org name in both trigger variants usinguseCurrentPlan.
-
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.