Phase 2 Task 41 — Dashboard redesign.
Backend:
- Extend GET /users/onboarding-status with email_verified and shop_setup_done.
- tried_ai_assistant kept in payload for backward-compat during deploy.
Frontend:
- New NextStepCard: surfaces the highest-priority incomplete onboarding item
with a primary CTA. Priority order: verify email > set up shop > run first
FlowPilot session > connect PSA > invite teammate > pick a plan (gated on
trial stage warning/urgent/expired). Returns null when all done OR
onboarding_dismissed.
- New SetupChecklist: unified single list (no SOLO/TEAM bifurcation), drops
the stale tried_ai_assistant / Script Builder item, surfaces "Pick a plan"
when trial stage is warning or later.
- Mounted on QuickStartPage below the hero with a "Show all setup steps"
toggle. The whole onboarding section auto-hides when there's nothing left
to nudge on, so the dashboard goes back to clean once setup is done.
- Removed the orphaned OnboardingChecklist component (was defined but never
mounted).
- New useOnboardingStatus hook so page + components share one fetch contract.
Tests:
- Backend: test_onboarding_status_includes_email_verified_and_shop_setup_done.
- Frontend (Vitest): 13 new tests across NextStepCard, SetupChecklist, and
QuickStartPage covering priority ordering, dismissal, the SOLO/TEAM
removal, the toggle reveal, and the trial-stage gate on Pick a plan.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Lays the groundwork for the post-signup welcome wizard (Phase 2,
Task 38). Authed users hitting /welcome are routed to the next
incomplete step based on users.onboarding_step_completed +
users.onboarding_dismissed; refresh resumes correctly because every
navigation persists state server-side first.
Backend:
- Expose onboarding_step_completed (Optional[int]) and
onboarding_dismissed (bool) on UserResponse so /auth/me drives
client-side routing without a separate fetch.
Frontend:
- WelcomeRouter handles the /welcome decision table (dismissed → /,
completed >=3 → /, else next step).
- WelcomeStep1 renders the "Your shop" form (company name pre-filled
from accounts.name, team size 1-2/3-5/6-10/11-25/26+, role
Owner/Lead Tech/Tech/Other). Continue PATCHes /users/me/onboarding-step
with action=complete; Skip-this-step PATCHes action=skip; Skip-the-rest
POSTs /users/me/onboarding-dismiss-rest. Each action refreshes the
auth store before navigating so the router resumes correctly on the
next visit.
- onboardingApi.updateStep + dismissRest (typed against backend
OnboardingStepRequest/Response schemas).
- Routes mounted inside AppLayout so EmailVerificationBanner persists
above each step per spec.
- 11 vitest cases covering the routing decision table + Continue / Skip
/ Skip-the-rest / persist-failure paths.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>