User-facing behavior is unchanged — visiting /settings/billing now
redirects to /settings/billing/plans where the same plan picker renders.
This frees up /settings/billing for a new usage-based billing dashboard
in a follow-up PR.
Changes:
- Move all plan-picker components from billing/_components/ to
billing/plans/_components/ (preserves git rename history for the 5
files whose content was unchanged)
- Rename BillingContent -> PlansContent, BillingContentSkeleton ->
PlansContentSkeleton (with file rename); update import paths in the
moved components to point at the new ../../_analytics location
- Add plans/page.tsx — owns auth + analytics + prefetch + ErrorBoundary
per the pages.md convention
- Add plans/_preload.ts — prefetches billing.getSubscription so the
plan picker hydrates with the current plan
- Add plans/_analytics.ts — page-view + retry events local to /plans
- Refactor PlansContent to fetch the org's current plan via
trpc.billing.getSubscription instead of receiving it as a prop. This
drops the raw
db import that was previously in billing/page.tsx,
honoring server-clients.md ("never import raw db in pages — use
the scoped client via tRPC procedures")
- Replace billing/page.tsx with a minimal redirect to /plans
Depends on the billing tRPC router (previous PR in the stack).
Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com