From db5a49d593c6dfad67dac7e4e5d3564ffee833b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Sat, 9 May 2026 21:14:00 +0200 Subject: [PATCH] feat(db): User.onboardingTourCompleted flag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit v1.4.15 Phase B5 — first commit. Adds a boolean column `users.onboarding_tour_completed` (default false) to track whether the user has finished or explicitly dismissed the new spotlight tour that overlays the dashboard on first arrival. This is *distinct* from the existing `onboarding_completed_at` column which gates the 3-step wizard at `/onboarding`. The new tour runs *after* the wizard, on the dashboard, walking new users through the tile strip, quick-add menu, insights page, integrations, and (when B4 ships) achievements. Flipped to `true` on tour completion or explicit dismiss; users can replay the tour from Settings → Account → "Restart onboarding tour". Migration `0030_onboarding_tour_completed` is additive-only (column default `false`), so no backfill is needed and existing users will see the tour on next dashboard load — acceptable because the tour is a 4-6 step tooltip overlay with a Skip button on every step, not a forced flow. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../0030_onboarding_tour_completed/migration.sql | 14 ++++++++++++++ prisma/schema.prisma | 10 ++++++++++ 2 files changed, 24 insertions(+) create mode 100644 prisma/migrations/0030_onboarding_tour_completed/migration.sql diff --git a/prisma/migrations/0030_onboarding_tour_completed/migration.sql b/prisma/migrations/0030_onboarding_tour_completed/migration.sql new file mode 100644 index 000000000..55f07d393 --- /dev/null +++ b/prisma/migrations/0030_onboarding_tour_completed/migration.sql @@ -0,0 +1,14 @@ +-- v1.4.15 Phase B5: track completion of the post-onboarding spotlight +-- tour that overlays the dashboard for first-time users. +-- +-- Distinct from `onboarding_completed_at` (the 3-step wizard at +-- `/onboarding`). Once the wizard finishes the user lands on the +-- dashboard; this column tracks whether the spotlight tour that walks +-- the user through the tile strip / quick-add menu / insights / +-- integrations has been seen-or-dismissed. Default false so existing +-- users who never saw the tour will see it on next dashboard load +-- (acceptable: it's a 4-6 step tooltip overlay with a Skip button on +-- every step, not a forced flow). Users can replay it from +-- Settings → Account → "Restart onboarding tour". +ALTER TABLE "users" + ADD COLUMN "onboarding_tour_completed" BOOLEAN NOT NULL DEFAULT false; diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 62d600057..75c399607 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -78,6 +78,16 @@ model User { // Onboarding onboardingCompletedAt DateTime? @map("onboarding_completed_at") + // v1.4.15 Phase B5: tracks whether the user has finished (or + // explicitly dismissed) the spotlight tour that overlays the + // dashboard on first arrival. Distinct from the wizard at + // `/onboarding` (which is gated by `onboardingCompletedAt`); the + // tour runs *after* the wizard, on the dashboard itself, walking + // the user through the tile strip, quick-add menu, insights, + // integrations, and achievements. Default false; flipped to true + // on tour completion or dismiss; users can replay the tour from + // Settings → Account. + onboardingTourCompleted Boolean @default(false) @map("onboarding_tour_completed") // HealthKit (iOS) integration config — list of per-metric direction toggles. // Shape: { entries: [{ id, kind, direction, enabled }], lastSyncedAt }