mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-15 15:02:04 +00:00
feat(onboarding): add resumable module-tour progress field + API
Add nullable onboarding_tour_progress_json to users (migration 0173), a Zod-validated progress shape, and extend POST /api/onboarding/tour to accept a mid-tour resume checkpoint and clear it on replay. Surface the resume point on GET /api/auth/me and register the contract in OpenAPI so the native client mirrors it.
This commit is contained in:
1 parent
b474ea1489
commit
59e7b33285
15 files changed
+442
-17
No files matched your search
@@ -10,6 +10,7 @@ import {
|
||||
resolveModuleMap,
|
||||
getOperatorModuleAvailability,
|
||||
} from "@/lib/modules/gate";
|
||||
import { parseTourProgress } from "@/lib/onboarding/tour-progress";
|
||||
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
@@ -70,6 +71,11 @@ export const GET = apiHandler(async () => {
|
||||
timezone: user.timezone,
|
||||
onboardingCompletedAt: user.onboardingCompletedAt,
|
||||
onboardingTourCompleted: user.onboardingTourCompleted,
|
||||
// v1.18.6 — resumable module-tour progress. Null when the user has
|
||||
// not started the tour; otherwise the resume point the launcher
|
||||
// seeds its index from. Fail-soft parse: a corrupt blob degrades to
|
||||
// null ("start from the top") rather than 500-ing the /me read.
|
||||
onboardingTourProgress: parseTourProgress(user.onboardingTourProgressJson),
|
||||
// v1.5.5 — self-hosted avatar. Replaces the Gravatar leak; the
|
||||
// URL is relative so PWA + native clients render identically
|
||||
// and the `?v={updatedAtMs}` suffix busts the browser cache on
|
||||
|
||||
Reference in new issue
Block a user