feat(dashboard): end onboarding with a compact plan step

IZ
7d ago
+479-96

Cherry-pick of staging 8c5517d3d.

Why

New owners finished onboarding without ever seeing what paid plans give them. A plan checkpoint added earlier sat between feature picks and setup and dropped the full Billing table into the flow, before the user had connected anything.

What changes

  • After the setup checklist, owners and admins on cloud get a final Pick a plan step. Self-hosted installs and members without billing rights skip it.
  • One card in the checklist's style: current plan, then a row per plan with its monthly allowances (events, investigations), price, and upgrade action. The footer opens the dashboard or Insights, so an upgrade made here unlocks "Open Insights" immediately.
  • Checkout returns to the same step (website and step=plan are kept in the URL).
  • The preview, confirm, and checkout logic is extracted from PricingCard into a shared PlanButton, so Billing and onboarding buy plans the same way.
  • Billing provider now reports real isError/isFetching; the plans error state has a retry.

Verification

  • Dashboard e2e (chromium, local): core onboarding (fresh account through the plan step, back to setup, reload on the plan step), plan-step billing recovery and checkout return, verified-onboarding regression, and billing-controls regression all pass.
  • Dashboard typecheck and Biome clean on this branch.
  • Not checked: mobile widths, and rendering with live Autumn plans (e2e uses a mocked plan list).

Summary by cubic

Adds a final Pick a plan step after the onboarding setup checklist so cloud owners and admins can upgrade before opening the dashboard.

  • The step is gated by the onboarding-plan-step flag and a live billing build; self-hosted installs, E2E, members without billing rights, and billing failures skip it.
  • One compact card lists each plan's monthly events and investigations allowance, price, and upgrade action, then opens the dashboard or Insights; checkout returns to the same step=plan URL, so a completed upgrade unlocks "Open Insights" right away.
  • Extracts preview, confirm, and checkout logic from PricingTable into a shared PlanButton, and billing reports isError/isFetching only when its data is missing, so a failed plan list or background refetch no longer turns Open Insights into Open dashboard.
  • Returning from checkout or a reload no longer repeats the onboarding-started and tracking-verified events; going back to setup re-records tracking verification, and the "Skip setup" button is removed from the interests step.
  • E2E coverage runs on a key-gated public fixture that checks plan rows, retry after the plan list fails, and checkout returning to the plan step.

Rollout

The step is gated by the onboarding-plan-step flag on the dashboard's flag website (OXmNQsViBT-FOS_wZCTHc). Until that flag exists and is on for a user, onboarding behaves as it does today. Create it as a rollout flag at 50%. E2E runs with flags disabled, so the gate treats E2E as on.

Review fixes (46f009b35)

  • Billing isError/isFetching only report missing billing data, so a failed plan list or a background refetch no longer turns Open Insights into Open dashboard.
  • Returning to the plan step from checkout or a reload no longer repeats onboarding_started and the tracking-verified events.