diff --git a/.planning/ROADMAP.md b/.planning/ROADMAP.md index 7837867..40459f6 100644 --- a/.planning/ROADMAP.md +++ b/.planning/ROADMAP.md @@ -14,7 +14,7 @@ Decimal phases appear between their surrounding integers in numeric order. - [ ] **Phase 5: Design System Token Rework** - Replace rounded corners with sharp edges and refine OKLCH pastel tokens across all 9 pages - [x] **Phase 6: Preset Data, First-Run Detection, and DB Safety** - Seed preset library, build first-run hook, and add DB uniqueness constraints that protect against duplicate data -- [ ] **Phase 7: Setup Wizard** - 3-step first-run wizard with income, pre-filled recurring items, and review — skippable, state-persisted, bilingual +- [x] **Phase 7: Setup Wizard** - 3-step first-run wizard with income, pre-filled recurring items, and review — skippable, state-persisted, bilingual (completed 2026-04-20) - [ ] **Phase 8: Auto-Budget Creation** - Auto-create current month's budget from template on dashboard visit, with correct currency and first-creation toast - [ ] **Phase 9: Inline Add and Dashboard Simplification** - Replace Quick Add page with inline Sheet panel, simplify dashboard to at-a-glance view, add empty states @@ -61,10 +61,10 @@ Plans: 3. A "remaining to allocate" balance updates live as items are checked or unchecked in step 2, showing income minus the sum of selected item amounts 4. User can click "Skip" on any individual step or "Skip setup" to exit the wizard entirely without creating any data — and lands on the dashboard 5. Completing the wizard creates a populated template from selected items — user lands on the dashboard with their template in place, and refreshing the browser mid-wizard restores the wizard at the correct step -**Plans:** 2 plans +**Plans:** 2/2 plans complete Plans: -- [ ] 07-01-PLAN.md — Wizard state hook, i18n keys, stepper + step 1/2 UI components (income, recurring items, allocation bar) -- [ ] 07-02-PLAN.md — ReviewStep, completion logic, skip handling, /setup route, first-run redirect, and verification checkpoint +- [x] 07-01-PLAN.md — Wizard state hook, i18n keys, stepper + step 1/2 UI components (income, recurring items, allocation bar) +- [x] 07-02-PLAN.md — ReviewStep, completion logic, skip handling, /setup route, first-run redirect, and verification checkpoint ### Phase 8: Auto-Budget Creation **Goal**: Users never manually trigger budget creation — visiting a month for the first time automatically creates their budget from the template, silently and correctly @@ -130,6 +130,6 @@ Phases execute in numeric order: 5 → 6 → 7 → 8 → 9 |-------|----------------|--------|-----------| | 5. Design System Token Rework | 0/3 | Planned | - | | 6. Preset Data, First-Run Detection, DB Safety | 3/3 | Complete | 2026-04-20 | -| 7. Setup Wizard | 0/2 | Planned | - | +| 7. Setup Wizard | 2/2 | Complete | 2026-04-20 | | 8. Auto-Budget Creation | 0/? | Not started | - | | 9. Inline Add and Dashboard Simplification | 0/? | Not started | - | diff --git a/.planning/STATE.md b/.planning/STATE.md index f667a6f..3408c60 100644 --- a/.planning/STATE.md +++ b/.planning/STATE.md @@ -4,13 +4,13 @@ milestone: v2.0 milestone_name: milestone status: executing stopped_at: Completed 06-03-PLAN.md — Phase 06 fully executed -last_updated: "2026-04-20T18:19:39.090Z" +last_updated: "2026-04-20T19:15:23.317Z" last_activity: 2026-04-20 progress: total_phases: 5 - completed_phases: 2 - total_plans: 6 - completed_plans: 6 + completed_phases: 3 + total_plans: 8 + completed_plans: 8 percent: 100 --- @@ -21,13 +21,13 @@ progress: See: .planning/PROJECT.md (updated 2026-04-02) **Core value:** Opening the app should feel like opening a beautifully designed personal spreadsheet — clean pastel colors, clear data layout, approachable and visually delightful. The UI IS the product. -**Current focus:** Phase 06 — preset-data-first-run-detection-and-db-safety +**Current focus:** Phase 7 — Setup Wizard ## Current Position -Phase: 7 +Phase: 8 Plan: Not started -Status: Executing Phase 06 +Status: Executing Phase 7 Last activity: 2026-04-20 Progress: [████████████████████] 3/3 plans (100%) @@ -50,6 +50,7 @@ Progress: [████████████████████] 3/3 pla | 04 Full-App Consistency | 3 | ~7 min | 2.3 min | | 05 | 3 | - | - | | 06 | 3 | - | - | +| 7 | 2 | - | - | **v2.0 Trend:** diff --git a/.planning/phases/07-setup-wizard/07-VERIFICATION.md b/.planning/phases/07-setup-wizard/07-VERIFICATION.md new file mode 100644 index 0000000..6ee34a9 --- /dev/null +++ b/.planning/phases/07-setup-wizard/07-VERIFICATION.md @@ -0,0 +1,137 @@ +--- +phase: 07-setup-wizard +verified: 2026-04-20T19:30:00Z +status: human_needed +score: 5/5 +overrides_applied: 0 +human_verification: + - test: "Create a new user (zero categories/template items), log in, verify auto-redirect to /setup and complete the 3-step wizard flow end-to-end" + expected: "Step 1 shows income pre-filled at 3000 with EUR suffix. Step 2 shows grouped presets with bills+variable_expense pre-checked. AllocationBar updates live. Step 3 shows read-only summary. Complete creates categories + template items, redirects to dashboard with success toast." + why_human: "Full user flow spanning multiple pages, Supabase writes, React Query cache invalidation, redirect behavior, and toast notifications cannot be verified statically" + - test: "Test skip flow: fresh user clicks Skip setup from step 1" + expected: "Redirects to dashboard with no data created, setup_completed=true in profiles table" + why_human: "Requires Supabase interaction and verifying database state after redirect" + - test: "Test localStorage persistence: start wizard, advance to step 2, refresh page" + expected: "Wizard resumes at step 2 with previously entered income preserved" + why_human: "Browser localStorage behavior cannot be verified without running the app" + - test: "Verify no redirect loop: after completing wizard, dashboard loads normally" + expected: "Dashboard renders without redirecting back to /setup" + why_human: "Requires React Query cache freshness and useFirstRunState reading updated data after completion" +--- + +# Phase 7: Setup Wizard Verification Report + +**Phase Goal:** A new user can set up their budget template in under 3 minutes by following a guided 3-step wizard with pre-filled common items and a live running balance +**Verified:** 2026-04-20T19:30:00Z +**Status:** human_needed +**Re-verification:** No -- initial verification + +## Goal Achievement + +### Observable Truths + +| # | Truth | Status | Evidence | +|---|-------|--------|----------| +| 1 | A new user is automatically redirected to /setup on first login and sees a 3-step wizard | VERIFIED | DashboardPage.tsx:293 `if (isFirstRun) return `, SetupPage renders WizardStepper with 3 steps | +| 2 | The recurring items step shows ~15-20 pre-filled common items with editable default amounts | VERIFIED | RecurringItemsStep imports PRESETS (20 items counted in presets.ts), renders each with PresetItemRow including editable amount Input | +| 3 | A "remaining to allocate" balance updates live as items are checked/unchecked | VERIFIED | AllocationBar computes `income - totalChecked` inline, renders with `aria-live="polite"`, colors switch at remaining < 0 | +| 4 | User can skip any step or skip setup entirely without creating data | VERIFIED | handleSkipStep advances steps, handleSkipSetup clears localStorage + marks setup_completed=true + redirects, no category/template creation | +| 5 | Completing the wizard creates a populated template and refreshing mid-wizard restores state | VERIFIED | handleComplete creates categories via create.mutateAsync + template items via createItem.mutateAsync; useWizardState reads/writes localStorage keyed by userId | + +**Score:** 5/5 truths verified + +### Required Artifacts + +| Artifact | Expected | Status | Details | +|----------|----------|--------|---------| +| `src/pages/SetupPage.tsx` | Wizard page orchestrator | VERIFIED | 290 lines, renders stepper + conditional steps + completion logic | +| `src/hooks/useWizardState.ts` | localStorage-synced wizard state | VERIFIED | 85 lines, exports useWizardState with full CRUD + clearState | +| `src/components/setup/WizardStepper.tsx` | Horizontal 1-2-3 stepper | VERIFIED | 62 lines, role="navigation", clickable completed steps | +| `src/components/setup/IncomeStep.tsx` | Step 1 income input | VERIFIED | 45 lines, number input with currency suffix + validation display | +| `src/components/setup/RecurringItemsStep.tsx` | Step 2 grouped checklist | VERIFIED | 81 lines, groups PRESETS by type, renders AllocationBar + PresetItemRow | +| `src/components/setup/AllocationBar.tsx` | Sticky remaining balance bar | VERIFIED | 31 lines, sticky top-0, aria-live="polite", color conditional | +| `src/components/setup/PresetItemRow.tsx` | Single checkbox row | VERIFIED | 59 lines, Checkbox + name + Badge + amount Input (disabled when unchecked) | +| `src/components/setup/CategoryGroupHeader.tsx` | Section header with colored dot | VERIFIED | 36 lines, w-2.5 h-2.5 rounded-full + color var mapping | +| `src/components/setup/ReviewStep.tsx` | Read-only summary | VERIFIED | 118 lines, groups checked items, shows totals, remaining with color | +| `src/App.tsx` | /setup route registration | VERIFIED | path="/setup" inside ProtectedRoute, outside AppLayout | +| `src/pages/DashboardPage.tsx` | First-run redirect | VERIFIED | useFirstRunState + Navigate to="/setup" replace | + +### Key Link Verification + +| From | To | Via | Status | Details | +|------|----|-----|--------|---------| +| SetupPage.tsx | useWizardState.ts | `useWizardState(userId)` | WIRED | Line 54-55 | +| RecurringItemsStep.tsx | presets.ts | `import PRESETS` | WIRED | Line 2 | +| DashboardPage.tsx | useFirstRunState.ts | `useFirstRunState() -> Navigate /setup` | WIRED | Lines 276, 293 | +| SetupPage.tsx | useCategories.ts | `create.mutateAsync` | WIRED | Line 128 | +| SetupPage.tsx | useTemplate.ts | `createItem.mutateAsync` | WIRED | Line 153 | +| App.tsx | SetupPage.tsx | Route path="/setup" | WIRED | Lines 48-55 | + +### Data-Flow Trace (Level 4) + +| Artifact | Data Variable | Source | Produces Real Data | Status | +|----------|---------------|--------|-------------------|--------| +| RecurringItemsStep | selectedItems | useWizardState (localStorage) -> PRESETS defaults | Yes (20 preset items with defaultAmount) | FLOWING | +| AllocationBar | remaining | Computed from income - sum(checked amounts) | Yes (derived from wizard state) | FLOWING | +| ReviewStep | selectedItems + income | useWizardState state passed as props | Yes (filtered from wizard state) | FLOWING | + +### Behavioral Spot-Checks + +| Behavior | Command | Result | Status | +|----------|---------|--------|--------| +| TypeScript compiles | `npx tsc --noEmit` | Exit 0, no errors | PASS | +| All setup components exist | `ls src/components/setup/*.tsx` | 7 files found | PASS | +| i18n keys in EN | `grep "setup" src/i18n/en.json` | setup object at line 124 | PASS | +| i18n keys in DE | `grep "setup" src/i18n/de.json` | setup object at line 124 | PASS | +| Presets count | `grep -c slug src/data/presets.ts` | 20 items | PASS | + +### Requirements Coverage + +| Requirement | Source Plan | Description | Status | Evidence | +|-------------|-----------|-------------|--------|----------| +| SETUP-01 | 07-01, 07-02 | New user guided through 3-step wizard: income -> recurring items -> review | SATISFIED | WizardStepper + 3 step components + DashboardPage redirect | +| SETUP-02 | 07-01 | User sees pre-filled common budget items with sensible defaults (~15-20 items) | SATISFIED | 20 PRESETS in presets.ts, rendered in RecurringItemsStep with defaultAmount | +| SETUP-03 | 07-02 | User can skip any wizard step or the entire wizard | SATISFIED | handleSkipStep + handleSkipSetup in SetupPage | +| SETUP-04 | 07-01 | User sees a live "remaining to allocate" balance updating as items are selected | SATISFIED | AllocationBar with computed remaining, aria-live="polite" | +| SETUP-05 | 07-02 | User's template is created from wizard selections on completion | SATISFIED | handleComplete creates categories + template items via mutateAsync | + +### Anti-Patterns Found + +| File | Line | Pattern | Severity | Impact | +|------|------|---------|----------|--------| +| (none) | - | - | - | No TODOs, FIXMEs, placeholders, or stubs found in any wizard file | + +### Human Verification Required + +### 1. Full Wizard Flow (End-to-End) + +**Test:** Create a new user (zero categories/template items), log in, verify auto-redirect to /setup and complete the 3-step wizard flow end-to-end +**Expected:** Step 1 shows income pre-filled at 3000 with EUR suffix. Step 2 shows grouped presets with bills+variable_expense pre-checked. AllocationBar updates live. Step 3 shows read-only summary. Complete creates categories + template items, redirects to dashboard with success toast. +**Why human:** Full user flow spanning multiple pages, Supabase writes, React Query cache invalidation, redirect behavior, and toast notifications cannot be verified statically + +### 2. Skip Flow + +**Test:** Fresh user clicks "Skip setup" from step 1 +**Expected:** Redirects to dashboard with no data created, setup_completed=true in profiles table +**Why human:** Requires Supabase interaction and verifying database state after redirect + +### 3. localStorage Persistence + +**Test:** Start wizard, advance to step 2, refresh page +**Expected:** Wizard resumes at step 2 with previously entered income preserved +**Why human:** Browser localStorage behavior cannot be verified without running the app + +### 4. No Redirect Loop After Completion + +**Test:** After completing wizard, verify dashboard loads normally without re-redirecting to /setup +**Expected:** Dashboard renders correctly, useFirstRunState returns isFirstRun=false +**Why human:** Requires React Query cache freshness and useFirstRunState reading updated data after completion + +### Gaps Summary + +No code-level gaps found. All artifacts exist, are substantive (no stubs or placeholders), are properly wired, and TypeScript compiles cleanly. The implementation covers all 5 ROADMAP success criteria and all 5 requirement IDs (SETUP-01 through SETUP-05). Human verification is needed to confirm the runtime behavior (Supabase writes, redirect flows, localStorage persistence). + +--- + +_Verified: 2026-04-20T19:30:00Z_ +_Verifier: Claude (gsd-verifier)_