Compare commits

...

61 Commits

Author SHA1 Message Date
4bb37ef7ea docs(phase-07): complete phase execution 2026-04-20 21:15:36 +02:00
97651d0b5c chore: merge executor worktree (worktree-agent-af11b313) 2026-04-20 21:12:11 +02:00
7b336aee0e docs(07-02): complete setup wizard completion and routing plan
- SUMMARY.md with execution results and deviation documentation
2026-04-20 21:11:45 +02:00
6b75f14361 feat(07-02): register /setup route and add first-run redirect
- /setup route as protected standalone page (outside AppLayout)
- DashboardPage redirects first-run users to /setup via useFirstRunState
- All hooks called before conditional returns (React rules of hooks)
2026-04-20 21:10:58 +02:00
396d342d57 feat(07-02): ReviewStep component and wizard completion/skip logic
- ReviewStep shows read-only grouped summary with income, items, totals
- handleComplete creates categories + template items with duplicate handling
- handleSkipSetup marks setup_completed without creating data
- Double-submit prevention via completing state
- Toast notifications for success/error/partial failure
- Query invalidation to prevent redirect loops
2026-04-20 21:10:07 +02:00
7b16ec2e9e chore: merge executor worktree (worktree-agent-ae9d4649) 2026-04-20 21:07:34 +02:00
fada289774 docs(07-01): complete setup wizard UI shell plan
- SUMMARY.md with all task commits, decisions, and known stubs
2026-04-20 21:07:23 +02:00
e1411976dd feat(07-01): create wizard UI components and SetupPage
- WizardStepper: horizontal 1-2-3 stepper with clickable completed steps
- IncomeStep: number input with currency suffix and validation
- AllocationBar: sticky remaining balance with live polite announcements
- CategoryGroupHeader: colored dot section divider per category type
- PresetItemRow: checkbox + name + badge + editable amount input
- RecurringItemsStep: groups 19 PRESETS by type with allocation calculation
- SetupPage: page orchestrator with step navigation and state persistence
2026-04-20 21:06:29 +02:00
bbcb07ff38 feat(07-01): add useWizardState hook, i18n keys, and shadcn checkbox
- Create useWizardState hook with localStorage persistence keyed by userId
- Add all setup wizard i18n keys to en.json and de.json
- Install shadcn checkbox component for step 2 item selection
2026-04-20 21:04:34 +02:00
7b11f80a54 docs(07): pattern mapping for setup wizard
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-20 21:01:33 +02:00
55eca5dbe1 docs(07): create phase plans for setup wizard
Two plans covering the 3-step first-run wizard: state management + UI
components (Wave 1), then completion logic + routing + redirect (Wave 2).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-20 20:59:26 +02:00
07823081bb docs(07): research phase domain for setup wizard
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-20 20:51:44 +02:00
3c937e68bc docs(07): fix UI-SPEC typography to 2-weight contract
Collapse 3 font weights (400/500/600) to 2 (400/600) per checker
requirement. Labels now use semibold (600) instead of medium (500).
Also improves CTA labels and adds focal point declaration.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-20 20:30:50 +02:00
272af4ec98 docs(07): UI design contract for setup wizard
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-20 20:26:45 +02:00
fd068fb552 docs(07): smart discuss context .planning/phases/07-setup-wizard/07-CONTEXT.md 2026-04-20 20:22:41 +02:00
87c0795126 docs(phase-06): complete phase execution .planning/ROADMAP.md .planning/STATE.md 2026-04-20 20:19:43 +02:00
07ad9e15ee docs(06): phase verification /home/jlmak/Projects/jlmak/SimpleFinanceDash/.planning/phases/06-preset-data-first-run-detection-and-db-safety/06-VERIFICATION.md 2026-04-20 20:12:17 +02:00
3c39410635 docs(06-03): complete useFirstRunState hook and DB schema push summary
- SUMMARY.md for plan 06-03 with all task results
- STATE.md updated: Phase 06 complete (3/3 plans)
- ROADMAP.md updated: Phase 06 marked complete

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-20 20:08:45 +02:00
0c1105fc78 feat(06-03): create useFirstRunState derived hook
- Derives first-run state from cached useCategories + useTemplate queries
- Returns { isFirstRun, loading } with no additional network calls
- isFirstRun true when categories or template items array is empty
- Loading guard prevents spurious redirects during fetch
2026-04-20 19:32:09 +02:00
0e0c2a6ae4 chore: merge executor worktree (06-02 presets + i18n) 2026-04-20 17:49:06 +02:00
9a64cbb505 chore: merge executor worktree (06-01 DB migrations) 2026-04-20 17:49:06 +02:00
60c27db074 docs(06-01): complete plan 01 DB safety constraints and first-run flag summary 2026-04-20 17:48:56 +02:00
39840ca5af feat(06-01): add setup_completed boolean to Profile TypeScript interface
- Added setup_completed: boolean after currency field in Profile interface
2026-04-20 17:48:37 +02:00
934ae0e4c7 docs(06-02): complete preset data library plan summary 2026-04-20 17:48:28 +02:00
0f441b6041 feat(06-01): add migration 007 setup_completed column and backfill
- ALTER TABLE profiles ADD COLUMN setup_completed boolean NOT NULL DEFAULT false
- Backfill existing users with categories OR template items to true
- UNION covers edge case users with template items but no categories
2026-04-20 17:48:25 +02:00
23fd3fad35 feat(06-01): add migration 006 uniqueness constraints with safe deduplication
- DELETE duplicate budgets keeping oldest per (user_id, start_date)
- ADD CONSTRAINT budgets_user_month_unique UNIQUE (user_id, start_date)
- DELETE duplicate categories keeping oldest per (user_id, name)
- ADD CONSTRAINT categories_user_name_unique UNIQUE (user_id, name)
- Wrapped in single BEGIN/COMMIT transaction for atomicity
2026-04-20 17:48:13 +02:00
d23508017a feat(06-02): add preset i18n translations to en.json and de.json
- Add top-level presets key with presets.{type}.{slug} structure
- 19 English translations covering all 6 category types
- 19 German translations covering all 6 category types
- Both JSON files remain valid after edits
2026-04-20 17:48:11 +02:00
3bc7782198 feat(06-02): create 19-item preset budget library
- Add PresetItem interface with slug, type, defaultAmount, item_tier
- Export PRESETS array with 19 items across 6 category types
- Distribution: 4 income, 4 bill, 5 variable_expense, 2 debt, 2 saving, 2 investment
- All item_tier values are fixed or variable (no one_off)
2026-04-20 17:47:47 +02:00
9963926971 docs(06): create phase 6 plan — preset data, first-run detection, and DB safety
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-20 17:45:50 +02:00
662390fc78 docs(06): research phase 6 preset data, first-run detection, and DB safety
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-20 17:41:49 +02:00
843261d321 docs(06): smart discuss context 2026-04-20 17:38:01 +02:00
6607ec8aa5 docs(phase-05): complete phase execution 2026-04-20 17:26:09 +02:00
d99c098df7 docs(05): update verification after radius scale fix 2026-04-20 17:25:56 +02:00
eceddcaf4f fix(05): add explicit radius scale tokens for Tailwind v4 cascade
Tailwind v4 does not derive --radius-xs through --radius-3xl from --radius.
The named scale is independent, so Cards (rounded-xl), Buttons (rounded-md),
etc. retained non-zero border-radius despite --radius: 0. Adding all scale
tokens as 0 ensures complete sharp-corner cascade.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-20 17:25:09 +02:00
c6dc2c3050 chore: merge executor worktree (worktree-agent-a2b5acd5) 2026-04-20 17:17:19 +02:00
c3b50c70a8 docs(05-03): complete page rounding sweep and spacing upgrade plan 2026-04-20 17:17:05 +02:00
00670afe4e feat(05-03): remove rounded-* and upgrade spacing on all 9 pages
- DashboardPage: space-y-6->space-y-8, gap-6->gap-8 in chart grid
- BudgetListPage: remove rounded-md from template toggle row
- BudgetDetailPage: remove rounded-sm/md from skeleton and group headings, rounded-md from summary box, rounded-full from category dot
- TemplatePage: remove rounded-sm/full/md from skeleton and group headings and category dot; gap-6->gap-8, space-y-6->space-y-8
- CategoriesPage: remove rounded-sm/full/md from skeleton and group headings; space-y-6->space-y-8
- QuickAddPage: remove rounded-full/md from skeleton items
- SettingsPage: space-y-4->space-y-6 in CardContent (skeleton and live)
2026-04-20 17:16:29 +02:00
12ed62e430 docs(phase-05): update tracking after wave 1 2026-04-20 17:13:14 +02:00
441d201837 chore: merge executor worktree (worktree-agent-a29c13e1) 2026-04-20 17:12:56 +02:00
6e892374b8 chore: merge executor worktree (worktree-agent-a0017a3e) 2026-04-20 17:12:52 +02:00
1547fe350c docs(05-02): complete shared component rounding and spacing cleanup plan 2026-04-20 17:12:39 +02:00
4eb866cad1 docs(05-01): complete design token foundation plan summary 2026-04-20 17:12:22 +02:00
e7282fa3d6 feat(05-02): remove hardcoded rounded-* from CategorySection, ChartEmptyState, QuickAddPicker
- CategorySection: remove rounded-md from collapsible trigger button
- ChartEmptyState: remove rounded-lg from empty state border container
- QuickAddPicker: remove rounded-sm from picker item buttons
- QuickAddPicker: remove rounded-full from category dot indicator
2026-04-20 17:12:03 +02:00
4c74deced7 feat(05-01): update chart Bar radius to 0 and remove rounded-full legend dot
- SpendBarChart: set radius={0} on both Bar elements (was radius={4})
- IncomeBarChart: set radius={0} on both Bar elements (was radius={[4,4,0,0]})
- ExpenseDonutChart: remove rounded-full from legend color dot className
2026-04-20 17:11:48 +02:00
e8f13c91c6 feat(05-02): upgrade PageShell spacing to gap-8 and remove rounded-* from DashboardSkeleton
- PageShell: gap-6 → gap-8 for header-to-content spacing on all pages
- DashboardSkeleton: gap-6 → gap-8 (outer flex), gap-4 → gap-6 (summary cards), gap-6 → gap-8 (chart grid)
- DashboardSkeleton: remove rounded-md from 3 chart skeleton placeholders
- DashboardSkeleton: remove rounded-md from collapsible section row divs
- DashboardSkeleton: remove rounded-full from 2 badge skeleton placeholders
2026-04-20 17:11:20 +02:00
99b5b5f8e4 feat(05-01): edit design tokens and add CSS overrides in index.css
- Set --radius: 0 for sharp-cornered design system cascade
- Warm background chroma from 0.005 to 0.01
- Delete --color-chart-1 through --color-chart-5 (redundant with fill vars)
- Raise fill chroma to 0.22+ for vibrant pastel category colors
- Add .recharts-rectangle and [data-sonner-toast] radius overrides
2026-04-20 17:11:12 +02:00
e5637511d7 docs(05): create phase 5 design system token rework plans
3 plans across 2 waves covering DS-01, DS-02, DS-03:
- Plan 01: Token edits (radius, colors, chart vars) + chart components
- Plan 02: Shared component rounded-* removal + spacing upgrades
- Plan 03: Per-page sweep (9 pages) + visual verification checkpoint

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-20 16:53:20 +02:00
df2c6af8bf docs(phase-5): add validation strategy
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-20 16:45:06 +02:00
0a598e53d8 docs(05): research phase 5 design system token rework
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-20 16:44:11 +02:00
1258368522 docs(phase-5): UI design contract for Design System Token Rework
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-20 16:37:13 +02:00
a67a802bc2 docs(05): smart discuss context for Design System Token Rework
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-20 16:34:35 +02:00
1ea119d2a4 docs: create milestone v2.0 roadmap (5 phases) 2026-04-02 16:09:19 +02:00
0b02d7d328 docs: define milestone v2.0 requirements 2026-04-02 15:59:43 +02:00
0b72f1c305 docs: complete project research 2026-04-02 15:30:56 +02:00
8fdab4b796 docs: start milestone v2.0 UX Simplification & Design Rework 2026-04-02 15:16:10 +02:00
4b0f18a216 Merge branch 'Develop' of https://gitea.jeanlucmakiola.de/makiolaj/SimpleFinanceDash into Develop
# Conflicts:
#	.planning/milestones/v1.0-phases/02-dashboard-charts-and-layout/02-01-SUMMARY.md
#	.planning/milestones/v1.0-phases/03-collapsible-dashboard-sections/03-CONTEXT.md
2026-04-02 14:33:13 +02:00
039fa0bc80 sum 2026-04-02 14:29:36 +02:00
439d0e950d chore: archive v1.0 phase directories 2026-03-24 09:46:00 +01:00
3a771ba7cd chore: complete v1.0 UI/UX Overhaul milestone 2026-03-24 09:44:12 +01:00
1d5e019839 docs: sync roadmap and state — mark phases 02-04 complete 2026-03-24 09:39:50 +01:00
0410d90e02 docs(02-01): add missing summary for month navigation plan 2026-03-24 09:39:26 +01:00
161 changed files with 14920 additions and 1463 deletions

2
.env.example Normal file
View File

@@ -0,0 +1,2 @@
VITE_SUPABASE_URL=https://your-supabase-instance.example.com
VITE_SUPABASE_ANON_KEY=your-anon-key-here

186
.gitignore vendored
View File

@@ -1,181 +1,33 @@
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib
# Test binary, built with `go test -c`
*.test
# Code coverage profiles and other test artifacts
*.out
coverage.*
*.coverprofile
profile.cov
# Dependency directories (remove the comment below to include it)
# vendor/
# Go workspace file
go.work
go.work.sum
# env file
.env
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
*.lcov
# nyc test coverage
.nyc_output
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
# Dependencies
node_modules/
jspm_packages/
# Snowpack dependency directory (https://snowpack.dev/)
web_modules/
# Build output
dist/
# TypeScript cache
*.tsbuildinfo
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional stylelint cache
.stylelintcache
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variable files
# Environment
.env
.env.*
!.env.example
# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache
# Next.js build output
.next
out
# Nuxt.js build / generate output
.nuxt
dist
.output
# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public
# vuepress build output
.vuepress/dist
# vuepress v2.x temp and cache directory
.temp
# Sveltekit cache directory
.svelte-kit/
# vitepress build output
**/.vitepress/dist
# vitepress cache directory
**/.vitepress/cache
# Docusaurus cache and generated files
.docusaurus
# Serverless directories
.serverless/
# FuseBox cache
.fusebox/
# DynamoDB Local files
.dynamodb/
# Firebase cache directory
.firebase/
# TernJS port file
.tern-port
# Stores VSCode versions used for testing VSCode extensions
.vscode-test
# pnpm
.pnpm-store
# yarn v3
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
# Vite files
# Vite
vite.config.js.timestamp-*
vite.config.ts.timestamp-*
.vite/
references/
# TypeScript
*.tsbuildinfo
.idea
# IDE
.idea/
.vscode/
*.swp
*.swo
.DS_Store
# Go binary output
/server
/backend/server
# Logs
*.log
# Build artifacts (embed directories populated at build time)
backend/cmd/server/frontend_dist/
backend/cmd/server/migrations/
# Test
coverage/
# Lock files are committed (bun.lock)

20
.planning/MILESTONES.md Normal file
View File

@@ -0,0 +1,20 @@
# Milestones
## v1.0 UI/UX Overhaul (Shipped: 2026-03-24)
**Phases completed:** 4 phases, 10 plans, 19 tasks
**Key accomplishments:**
- shadcn chart/collapsible primitives with Recharts v3 patch, two-tier OKLCH category colors, semantic budget status tokens, and bilingual dashboard i18n keys
- PageShell, StatCard, SummaryStrip, and DashboardSkeleton components with semantic OKLCH color tokens replacing all hardcoded green/red values in DashboardPage
- useMonthParam hook and MonthNavigator component for URL-based month selection, plus 10 new chart/navigation i18n keys in EN and DE
- Three isolated chart components (expense donut, income vertical bars, spend horizontal bars) using Recharts + ChartContainer with CSS variable theming, active hover, and per-cell over-budget coloring
- DashboardPage wired with URL month navigation (useMonthParam), MonthNavigator in PageShell action slot, and a responsive 3-column chart grid (ExpenseDonutChart, IncomeBarChart, SpendBarChart) replacing the old recharts pie + progress bars
- Carryover display wired from DashboardPage through SummaryStrip to StatCard; CategorySection and CollapsibleSections built as pure presentational components with direction-aware difference logic and CSS animation tokens
- Collapsible per-category sections wired into DashboardContent with direction-aware smart expand defaults, month-navigation state reset via key prop, and updated DashboardSkeleton.
- LoginPage and RegisterPage redesigned with muted background, primary-accent card border, favicon logo, subtitle text, and inline SVG OAuth provider icons
- PageShell adoption, skeleton loading states, and left-border accent group headers applied to all four CRUD/settings pages (Categories, Template, QuickAdd, Settings)
- BudgetListPage and BudgetDetailPage upgraded with PageShell, locale-aware Intl.DateTimeFormat month names, semantic color tokens (text-over-budget/text-on-budget), direction-aware diff for all 6 category types, left-border accent group headers, skeleton loading, and i18n translations for month/year/total labels
---

View File

@@ -2,11 +2,30 @@
## What This Is
A personal finance dashboard web app that replaces a basic monthly budget spreadsheet. Users set up income, bills, expenses, debt, and savings categories, create monthly budgets from templates, and track budget vs actual spending with visual charts and summaries. Built as a React SPA with Supabase backend.
A self-hosted personal budget dashboard that replaces a manual spreadsheet workflow. It tracks monthly budgets with bills, variable expenses, debts, savings, and investments — presented in a dense, visually rich UI with OKLCH pastel colors, three chart types (donut, bar, horizontal bar), collapsible category sections, and consistent design across all 9 pages. Features a smart template system for recurring items, quick-add library for one-off expenses, and auto-generated budgets. Built with Go (backend) + React/TypeScript (frontend) + PostgreSQL.
## Core Value
Users can see their full monthly financial picture at a glance — income, spending, and what's left — in a visually rich, easy-to-read dashboard.
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 Milestone: v2.0 UX Simplification & Design Rework
**Goal:** Make the app intuitive and visually clean — template-driven budgeting with a sharp, minimal, pastel design system.
**Target features:**
- Design system overhaul — sharp edges, clear pastels, minimal whitespace-driven layout
- Wizard-style template setup with pre-filled common items (rent, car insurance, groceries, etc.)
- Category library with smart defaults and sensible pre-loaded amounts
- Auto-created monthly budgets from template on first visit (no prompts)
- Simplified budget view — add one-offs from category library directly (replaces quick-add page)
- Dashboard = this month's budget at a glance (not chart overload)
- Dashboard data fixes — spending/budget data correctly reflects user input
## Current State
**Shipped:** v1.0 (UI/UX Overhaul) + prior foundation (auth, CRUD, templates, quick-add)
The app has a visual overhaul but the UX is poor — too many disconnected concepts (categories, templates, budgets, quick-add), the design feels clunky with excessive rounding, and the dashboard doesn't clearly show budget data. v2.0 simplifies the mental model to two concepts: "my template" and "this month's budget."
## Requirements
@@ -24,81 +43,97 @@ Users can see their full monthly financial picture at a glance — income, spend
- ✓ User can set locale and currency in settings — existing
- ✓ App supports English and German — existing
- ✓ Dashboard shows summary cards (income, expenses, balance) — existing
-Dashboard shows expense breakdown pie chart — existing
-Dashboard shows category progress bars — existing
- ✓ UI-BAR-01: Add bar chart comparing income budget vs actual — Phase 2
- ✓ UI-HBAR-01: Add horizontal bar chart comparing spend budget vs actual by category type — Phase 2
- ✓ UI-DONUT-01: Improve donut chart for expense category breakdown with richer styling — Phase 2
-UI-DASH-01: Redesign dashboard with hybrid layout — summary cards, charts, and collapsible category sections — v1.0
-UI-BAR-01: Bar chart comparing income budget vs actual — v1.0
- ✓ UI-HBAR-01: Horizontal bar chart comparing spend budget vs actual by category type — v1.0
- ✓ UI-DONUT-01: Improved donut chart for expense category breakdown with richer styling — v1.0
- ✓ UI-COLLAPSE-01: Collapsible inline sections on dashboard for each category group — v1.0
- ✓ UI-DESIGN-01: Redesigned all pages with rich, colorful visual style — v1.0
- ✓ UI-AUTH-01: Refreshed login and register pages — v1.0
- ✓ UI-CATEGORIES-01: Refreshed categories page — v1.0
- ✓ UI-TEMPLATE-01: Refreshed template page — v1.0
- ✓ UI-BUDGETS-01: Refreshed budget list and budget detail pages — v1.0
- ✓ UI-QUICKADD-01: Refreshed quick-add page — v1.0
- ✓ UI-SETTINGS-01: Refreshed settings page — v1.0
- ✓ UI-RESPONSIVE-01: Desktop-first responsive layout across all pages — v1.0
### Active
- [ ] UI-DASH-01: Redesign dashboard with hybrid layout — summary cards, charts, and collapsible category sections (income, bills, expenses, debt, savings) with budget/actual columns
- [ ] UI-COLLAPSE-01: Add collapsible inline sections on dashboard for each category group showing individual line items
- [ ] UI-DESIGN-01: Redesign all pages with rich, colorful visual style — consistent design language across the app
- [ ] UI-AUTH-01: Refresh login and register pages
- [ ] UI-CATEGORIES-01: Refresh categories page
- [ ] UI-TEMPLATE-01: Refresh template page
- [ ] UI-BUDGETS-01: Refresh budget list and budget detail pages
- [ ] UI-QUICKADD-01: Refresh quick-add page
- [ ] UI-SETTINGS-01: Refresh settings page
- [ ] UI-RESPONSIVE-01: Desktop-first responsive layout across all pages
<!-- v2.0 scope — defined during milestone kickoff -->
- [ ] Design system: sharp edges, clear pastels, minimal layout
- [ ] Wizard-style template setup with smart defaults
- [ ] Category library with pre-loaded common items
- [ ] Auto-created monthly budgets from template
- [ ] Simplified budget view with inline add-from-library
- [ ] Dashboard shows current month's budget clearly
- [ ] Dashboard data correctly reflects entered spending
### Out of Scope
- New backend features or data model changes — this milestone is UI only
- Recurring transaction automation — no backend changes
- Spending alerts or notifications — no backend changes
- Trend charts over months — future feature, not part of UI overhaul
- Recurring transaction automation — future feature
- Spending alerts or notificationsfuture feature
- Trend charts over months — future feature
- Mobile-first optimization — desktop first, basic responsiveness only
- CSV/bank import — future feature
- Shared/household budgets — future feature
- Dark mode — light mode pastel system first
## Context
- **Existing codebase:** React 19 + Vite 8 + Tailwind CSS 4 + Supabase + TanStack Query + Recharts + shadcn/ui (Radix) + i18next
- **Data model:** Profiles, Categories (6 types), Templates/TemplateItems, Budgets/BudgetItems, QuickAddItems
- **Architecture:** Three-tier SPA — Pages > Hooks > Supabase. TanStack Query for state. No Redux/Zustand.
- **Auth:** Supabase auth with RLS policies. Protected/public routes via React Router.
- **Current UI state:** Functional but basic. shadcn/ui cards and tables. Single pie chart and progress bars on dashboard. Other pages are simple CRUD forms/tables.
- **Reference image:** Monthly budget spreadsheet with income/bills/expenses/debt/savings sections, budget vs actual columns, bar charts, horizontal bars, and donut chart. Rich colors.
v1.0 shipped a visual overhaul but the UX remains problematic. The user model has too many disconnected concepts — categories, templates, budgets, and quick-add are all separate pages with unclear relationships. The design system has excessive rounding and colors that aren't truly pastel. The dashboard shows charts but doesn't clearly reflect budget data the user entered.
v2.0 simplifies to two user-facing concepts: "my template" (recurring budget structure with smart defaults) and "this month's budget" (auto-created from template, track actuals, add one-offs from library). The design shifts to sharp, minimal, clean pastels.
Tech stack: Go 1.25 + React 19 + TypeScript + Tailwind CSS 4 + shadcn/ui + Recharts + PostgreSQL 16. Package manager: bun. Single Docker image via multi-stage build. Backend changes are in scope for this milestone where needed to support auto-creation and template-driven flow.
## Constraints
- **Tech stack**: Must use existing stack (React, Tailwind, Recharts, shadcn/ui) — no new frameworks or major dependencies
- **Backend**: No Supabase schema changes — UI-only modifications
- **Data model**: Existing types and hooks must be preserved — redesign the presentation layer only
- **i18n**: All new UI text must have translation keys in both en.json and de.json
- **Tech stack**: Keep existing Go + React + shadcn/ui + Tailwind + Recharts stack
- **Design system**: Build on shadcn/ui, customize via CSS variables and Tailwind config
- **i18n**: All new/changed UI text must have de + en translations
- **Package manager**: Use bun for frontend
- **Platform**: Desktop web only — no mobile/tablet optimization
## Key Decisions
| Decision | Rationale | Outcome |
|----------|-----------|---------|
| UI overhaul only, no backend changes | Keep scope focused, ship faster, reduce risk | Pending |
| Desktop-first layout | Primary use case is desktop; basic responsive for mobile | Pending |
| Rich & colorful visual style | Match the visual density and appeal of the spreadsheet reference | Pending |
| Hybrid dashboard (summary + collapsible sections) | Best of both: quick overview with drill-down capability inline | Pending |
| All three chart types (bar, horizontal bar, donut) | Comprehensive financial visualization like the reference | Pending |
| Refresh all pages, not just dashboard | Consistent design language throughout the app | Pending |
| 4-phase roadmap: Foundation > Charts > Collapsibles > Full-app | Build dependency chain from research; design tokens before components, dashboard before other pages | Pending |
| URL-based month navigation via useMonthParam | Survives refresh and enables sharing; uses ?month=YYYY-MM search param | Phase 2 |
| 3-column responsive chart grid (md:2, lg:3) | Fits donut + 2 bar charts; collapses gracefully on smaller screens | Phase 2 |
| DashboardContent as inner component pattern | Separates month selection/empty state from data-dependent chart rendering | Phase 2 |
| UI overhaul only, no backend changes | Keep scope focused, ship faster, reduce risk | ✓ Good |
| Desktop-first layout | Primary use case is desktop; basic responsive for mobile | ✓ Good |
| Rich & colorful visual style | Match the visual density and appeal of the spreadsheet reference | ✓ Good |
| Hybrid dashboard (summary + collapsible sections) | Best of both: quick overview with drill-down capability inline | ✓ Good |
| All three chart types (bar, horizontal bar, donut) | Comprehensive financial visualization like the reference | ✓ Good |
| Refresh all pages, not just dashboard | Consistent design language throughout the app | ✓ Good |
| 4-phase roadmap: Foundation > Charts > Collapsibles > Full-app | Design tokens before components, dashboard before other pages | ✓ Good |
| URL-based month navigation via useMonthParam | Survives refresh and enables sharing; uses ?month=YYYY-MM search param | ✓ Good |
| 3-column responsive chart grid (md:2, lg:3) | Fits donut + 2 bar charts; collapses gracefully on smaller screens | ✓ Good |
| DashboardContent as inner component pattern | Separates month selection/empty state from data-dependent chart rendering | ✓ Good |
| Two-tier OKLCH category colors | Darker text (~0.55) for WCAG contrast, lighter fills (~0.65-0.70) for charts | ✓ Good |
| CategorySection controlled open/onOpenChange pattern | Parent owns state for smart expand defaults and month-change reset | ✓ Good |
| Auth card accent pattern (border-t-4 + favicon logo) | Consistent brand presence without heavy custom design | ✓ Good |
| Direction-aware diff for all 6 category types | Spending over when actual > budget; income/saving over when actual < budget | ✓ Good |
| Simplify to 2 user concepts: template + monthly budget | Categories/templates/budgets/quick-add too disconnected; users don't understand the flow | — Pending |
| Sharp minimal design with clear pastels | v1.0 rounded/clunky design doesn't match the "clean spreadsheet" vision | — Pending |
| Auto-create budgets from template on month visit | Removes friction; template is the source of truth | — Pending |
| Wizard-style template setup with smart defaults | First-run must be intuitive; pre-filled common items reduce setup time | — Pending |
## Traceability
## Evolution
| Requirement | Phase | Status |
|-------------|-------|--------|
| UI-DASH-01 | Phase 1, 2, 3 | Pending |
| UI-BAR-01 | Phase 2 | Validated |
| UI-HBAR-01 | Phase 2 | Validated |
| UI-DONUT-01 | Phase 2 | Validated |
| UI-COLLAPSE-01 | Phase 3 | Pending |
| UI-DESIGN-01 | Phase 1, 4 | Pending |
| UI-AUTH-01 | Phase 4 | Pending |
| UI-CATEGORIES-01 | Phase 4 | Pending |
| UI-TEMPLATE-01 | Phase 4 | Pending |
| UI-BUDGETS-01 | Phase 4 | Pending |
| UI-QUICKADD-01 | Phase 4 | Pending |
| UI-SETTINGS-01 | Phase 4 | Pending |
| UI-RESPONSIVE-01 | Phase 1, 4 | Pending |
This document evolves at phase transitions and milestone boundaries.
**After each phase transition** (via `/gsd:transition`):
1. Requirements invalidated? → Move to Out of Scope with reason
2. Requirements validated? → Move to Validated with phase reference
3. New requirements emerged? → Add to Active
4. Decisions to log? → Add to Key Decisions
5. "What This Is" still accurate? → Update if drifted
**After each milestone** (via `/gsd:complete-milestone`):
1. Full review of all sections
2. Core Value check — still the right priority?
3. Audit Out of Scope — reasons still valid?
4. Update Context with current state
---
*Last updated: 2026-03-16 after Phase 2*
*Last updated: 2026-04-02 after v2.0 milestone kickoff*

105
.planning/REQUIREMENTS.md Normal file
View File

@@ -0,0 +1,105 @@
# Requirements: SimpleFinanceDash
**Defined:** 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.
## v2.0 Requirements
Requirements for UX Simplification & Design Rework. Each maps to roadmap phases.
### Design System
- [ ] **DS-01**: User sees sharp-edged UI across all pages (no rounded corners)
- [ ] **DS-02**: User sees clear pastel colors that are visibly colorful, not washed out
- [ ] **DS-03**: User sees a clean, minimal layout with generous whitespace
### Setup Wizard
- [ ] **SETUP-01**: New user is guided through a 3-step wizard: income → recurring items → review
- [ ] **SETUP-02**: User sees pre-filled common budget items with sensible default amounts (~15-20 items: rent, groceries, car insurance, utilities, etc.)
- [ ] **SETUP-03**: User can skip any wizard step or the entire wizard
- [ ] **SETUP-04**: User sees a live "remaining to allocate" balance updating as items are selected in the wizard
- [ ] **SETUP-05**: User's template is created from wizard selections on completion
### Auto-Budget
- [ ] **AUTO-01**: User's monthly budget is auto-created from template when visiting a month for the first time
- [ ] **AUTO-02**: User sees a toast notification on the first auto-creation only
- [ ] **AUTO-03**: Auto-creation uses the user's configured currency, not a hardcoded default
### Budget View
- [ ] **BV-01**: User can add one-off items to the monthly budget via an inline sheet panel (from category library)
- [ ] **BV-02**: Quick Add page is removed from navigation
- [ ] **BV-03**: User sees empty state with clear CTA when template, budget, or dashboard is empty
### Dashboard
- [ ] **DASH-01**: Dashboard correctly displays budget and spending data the user entered
- [ ] **DASH-02**: Dashboard shows this month's budget at a glance (simplified view, not chart overload)
- [ ] **DASH-03**: Dashboard shows summary cards for income, expenses, and balance
## v3 Requirements
Deferred to future release. Tracked but not in current roadmap.
### Analytics & Insights
- **ANALYTICS-01**: User can see spending trends over months
- **ANALYTICS-02**: User gets income-based spending recommendations by category
### Integrations
- **IMPORT-01**: User can import actuals from CSV/bank export
- **IMPORT-02**: User can import recurring transactions automatically
### Polish
- **POLISH-01**: User can use the app in dark mode
- **POLISH-02**: User sees "Review your template" prompt after 3 months of use
- **POLISH-03**: User sees "Edit template" shortcut link from budget view
## Out of Scope
| Feature | Reason |
|---------|--------|
| AI-suggested budget amounts | Requires spending history that new users don't have; static defaults sufficient |
| Mandatory wizard (no skip) | Anti-feature — patronizing for returning users; YNAB removed forced onboarding |
| 6+ step wizard | Drop-off increases sharply beyond 3 steps |
| Bank account sync (Plaid) | High infrastructure/security cost for self-hosted tool |
| Shared/household budgets | Single-user app; future consideration |
| Mobile-first optimization | Desktop-first; basic responsiveness only |
| Keep Quick Add as separate page alongside inline add | Two surfaces for same action creates confusion |
## Traceability
Which phases cover which requirements. Updated during roadmap creation.
| Requirement | Phase | Status |
|-------------|-------|--------|
| DS-01 | Phase 5 | Pending |
| DS-02 | Phase 5 | Pending |
| DS-03 | Phase 5 | Pending |
| SETUP-01 | Phase 6, 7 | Pending |
| SETUP-02 | Phase 6, 7 | Pending |
| SETUP-03 | Phase 7 | Pending |
| SETUP-04 | Phase 7 | Pending |
| SETUP-05 | Phase 7 | Pending |
| AUTO-01 | Phase 6, 8 | Pending |
| AUTO-02 | Phase 8 | Pending |
| AUTO-03 | Phase 6, 8 | Pending |
| BV-01 | Phase 9 | Pending |
| BV-02 | Phase 9 | Pending |
| BV-03 | Phase 9 | Pending |
| DASH-01 | Phase 9 | Pending |
| DASH-02 | Phase 9 | Pending |
| DASH-03 | Phase 9 | Pending |
**Coverage:**
- v2.0 requirements: 17 total
- Mapped to phases: 17
- Unmapped: 0 ✓
---
*Requirements defined: 2026-04-02*
*Last updated: 2026-04-02 after v2.0 roadmap creation*

View File

@@ -0,0 +1,59 @@
# Project Retrospective
*A living document updated after each milestone. Lessons feed forward into future planning.*
## Milestone: v1.0 — UI/UX Overhaul
**Shipped:** 2026-03-24
**Phases:** 4 | **Plans:** 10 | **Tasks:** 19
### What Was Built
- OKLCH design system with two-tier category colors and semantic budget status tokens
- Three chart types (expense donut, income bar, spend horizontal bar) with CSS variable theming
- URL-based month navigation with MonthNavigator dropdown
- Collapsible per-category dashboard sections with direction-aware diff and CSS animations
- PageShell, StatCard, SummaryStrip shared components for consistent page structure
- All 9 pages upgraded with consistent design, skeleton loading, and full i18n
### What Worked
- 4-phase dependency chain (foundation → charts → collapsibles → full-app) prevented rework
- Research-first approach documented Recharts v3 patch and OKLCH patterns before planning
- Pure presentational components (CategorySection, charts) made integration straightforward
- Two-tier color approach (dark text, light fills) solved WCAG contrast without sacrificing aesthetics
### What Was Inefficient
- Plan 02-01 SUMMARY.md was never written, requiring retroactive artifact creation
- Roadmap progress table fell out of sync (phases 3-4 completed but not marked in roadmap)
- Divergence between local and remote branches required hard reset — lost v1.1 milestone work
### Patterns Established
- OKLCH two-tier pattern: ~0.55 lightness for text (WCAG), ~0.65-0.70 for chart fills
- PageShell + skeleton pattern: every page gets PageShell header and matching skeleton
- Direction-aware diff: SPENDING_TYPES array + isSpendingType() covers all 6 category types
- Controlled collapsible state: parent owns open/close for smart defaults and month-change reset
- Auth card accent: border-t-4 border-t-primary + favicon logo
### Key Lessons
1. Always verify remote state before starting new local work to avoid divergence
2. Summary artifacts must be written immediately — retroactive creation loses context
3. Roadmap progress tracking should be verified at milestone completion, not assumed correct
### Cost Observations
- Model mix: 100% quality profile (opus executors, sonnet verifiers)
- Sessions: ~4-5 across the milestone
- Notable: 10 plans across 4 phases completed in ~20 days with minimal rework
---
## Cross-Milestone Trends
### Process Evolution
| Milestone | Phases | Plans | Key Change |
|-----------|--------|-------|------------|
| v1.0 UI/UX | 4 | 10 | First GSD milestone on this project; research-first approach |
### Top Lessons (Verified Across Milestones)
1. Research before planning eliminates mid-phase surprises
2. Foundation-first phasing (tokens → components → integration) prevents rework

View File

@@ -1,141 +1,135 @@
# Roadmap: SimpleFinanceDash UI/UX Overhaul
# Roadmap: SimpleFinanceDash v2.0 — UX Simplification & Design Rework
## Overview
This milestone transforms SimpleFinanceDash from a functional-but-basic budget app into a visually rich, cohesive personal finance dashboard. The overhaul is strictly UI-only — no backend or schema changes. Work flows from design foundations (tokens, shared components) through the dashboard (charts, collapsible sections) to full-app consistency across all 9 pages. The research phase is complete; all four phases use well-documented patterns and require no further research before planning.
This milestone transforms SimpleFinanceDash from a visually polished but cognitively complex app into a guided, intuitive budgeting experience. Work flows from a global design token rework (sharp edges, clearer pastels) through data safety foundations, a wizard-driven first-run setup, automatic budget creation, and finally a simplified budget view with inline item adding. Every phase delivers a coherent, verifiable capability on top of the fully working v1.0 baseline.
## Phases
**Phase Numbering:**
- Integer phases (1, 2, 3): Planned milestone work
- Decimal phases (2.1, 2.2): Urgent insertions (marked with INSERTED)
- Integer phases (5-9): v2.0 milestone work, continuing from v1.0's Phase 4
- Decimal phases: Urgent insertions if needed (marked INSERTED)
Decimal phases appear between their surrounding integers in numeric order.
- [x] **Phase 1: Design Foundation and Primitives** - Install shadcn primitives, extend color tokens, build PageShell and StatCard/SummaryStrip
- [x] **Phase 2: Dashboard Charts and Layout** - Build DashboardContent orchestrator with all three chart types and month navigation (completed 2026-03-16)
- [ ] **Phase 3: Collapsible Dashboard Sections** - Add CategorySection with Radix Collapsible, BudgetLineItems, and group totals
- [ ] **Phase 4: Full-App Design Consistency** - Apply PageShell and established patterns to all 9 non-dashboard pages
- [ ] **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
- [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
## Phase Details
### Phase 1: Design Foundation and Primitives
**Goal**: Establish the design system building blocks — color tokens, shadcn primitives, and shared components — so all subsequent phases build on a consistent visual foundation
**Depends on**: Nothing (first phase)
**Requirements**: UI-DASH-01, UI-DESIGN-01, UI-RESPONSIVE-01
**Research flag**: No — Tailwind v4 `@theme inline`, OKLCH tokens, and WCAG contrast requirements are well-documented
### Phase 5: Design System Token Rework
**Goal**: Users see a sharp, minimal, clearly pastel UI across every page — the visual foundation that all subsequent phases build on
**Depends on**: Phase 4 (v1.0 complete)
**Requirements**: DS-01, DS-02, DS-03
**Success Criteria** (what must be TRUE):
1. Running `npx shadcn@latest add chart` and `npx shadcn@latest add collapsible` has installed both primitives, and `chart.tsx` has the `initialDimension` patch applied (no `width(-1)` console warnings when rendering a test chart)
2. `index.css` `@theme inline` block contains extended category color tokens with richer chroma and semantic status tokens (`--color-over-budget`, `--color-on-budget`), and all semantic color pairs pass WCAG 4.5:1 contrast for text
3. `PageShell` component renders a consistent page header with title, optional description, and CTA slot — and is importable from `components/shared/`
4. `StatCard` and `SummaryStrip` components render KPI cards (income, expenses, balance) with semantic color coding and variance badges — visible on the dashboard page
5. Skeleton loading components exist that mirror the real card and chart layout structure
**Plans**: 2 plans
1. Every rounded element across all 9 pages has sharp corners — no pill buttons, no rounded cards, no rounded inputs visible anywhere in the app
2. Category color swatches are visibly colorful against white backgrounds — not washed-out or grey-tinted — and still pass WCAG 4.5:1 contrast for text
3. Page layouts feel uncluttered — content sections have consistent whitespace gaps and no visual crowding between cards or sections
4. A full visual pass of all 9 pages (Dashboard, Budget List, Budget Detail, Template, Categories, Quick Add, Settings, Login, Register) confirms no regressions from token changes
**Plans:** 3 plans
Plans:
- [x] 01-01-PLAN.md — Install shadcn primitives (chart + collapsible), extend OKLCH color tokens, add i18n keys
- [x] 01-02-PLAN.md — Build PageShell, StatCard, SummaryStrip, DashboardSkeleton and integrate into DashboardPage
- [x] 05-01-PLAN.md — Design tokens (radius, colors, chart vars) and chart component Bar radius updates
- [x] 05-02-PLAN.md — Shared component rounded-* removal and spacing upgrades (PageShell, DashboardSkeleton, CategorySection, ChartEmptyState, QuickAddPicker)
- [x] 05-03-PLAN.md — Per-page sweep (all 9 pages) for rounded-* removal, spacing upgrades, and visual verification checkpoint
### Phase 2: Dashboard Charts and Layout
**Goal**: Deliver the full dashboard chart suite — donut, vertical bar, and horizontal bar — inside a responsive 3-column layout, with month navigation and memoized data derivations
**Depends on**: Phase 1
**Requirements**: UI-DASH-01, UI-BAR-01, UI-HBAR-01, UI-DONUT-01
**Research flag**: No — Recharts 2.15.4 chart implementations and the `chart.tsx` fix are fully documented
### Phase 6: Preset Data, First-Run Detection, and DB Safety
**Goal**: The data layer is safe and ready — duplicate budget/category writes are impossible at the DB level, and the app correctly identifies first-run users
**Depends on**: Phase 5
**Requirements**: AUTO-01, AUTO-03, SETUP-01, SETUP-02
**Success Criteria** (what must be TRUE):
1. Dashboard displays an expense donut chart with center total label, active sector hover expansion, and a custom legend — replacing the existing flat pie chart
2. Dashboard displays a grouped vertical bar chart comparing income budgeted vs actual amounts
3. Dashboard displays a horizontal bar chart comparing budget vs actual spending by category type
4. All three charts consume colors from CSS variable tokens (no hardcoded hex values) and render correctly with zero-item budgets (empty state)
5. User can navigate between budget months on the dashboard without leaving the page, and all charts and cards update to reflect the selected month
**Plans**: 3 plans
1. Attempting to create two budgets for the same user and month is rejected at the DB level (unique constraint on `budgets(user_id, start_date)`)
2. Attempting to create two categories with the same name for the same user is rejected at the DB level (unique constraint on `categories(user_id, name)`)
3. All existing v1.0 users have `profiles.setup_completed = true` after the backfill migration runs — they will not be shown the wizard on their next login
4. `useFirstRunState` hook returns `true` only for users with zero categories or zero template items — returning `false` for any user with existing data
5. `src/data/presets.ts` contains ~15-20 curated budget items with sensible default amounts, grouped by category type, with both English and German i18n translation keys defined
**Plans:** 3 plans
Plans:
- [ ] 02-01-PLAN.md — Month navigation infrastructure (useMonthParam hook, MonthNavigator, ChartEmptyState, i18n keys)
- [ ] 02-02-PLAN.md — Three chart components (ExpenseDonutChart, IncomeBarChart, SpendBarChart)
- [ ] 02-03-PLAN.md — Dashboard integration (wire charts + month nav into DashboardPage, update skeleton)
- [x] 06-01-PLAN.md — DB migrations (uniqueness constraints + setup_completed column + Profile type update)
- [x] 06-02-PLAN.md — Preset library (src/data/presets.ts) and i18n translations (en.json + de.json)
- [x] 06-03-PLAN.md — useFirstRunState hook, DB schema push, and verification checkpoint
### Phase 3: Collapsible Dashboard Sections
**Goal**: Complete the dashboard hybrid view with collapsible per-category sections that show individual line items, group totals, and variance indicators
**Depends on**: Phase 2
**Requirements**: UI-DASH-01, UI-COLLAPSE-01
**Research flag**: No — Radix Collapsible API and animation pattern are well-documented
### Phase 7: Setup Wizard
**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
**Depends on**: Phase 6
**Requirements**: SETUP-01, SETUP-02, SETUP-03, SETUP-04, SETUP-05
**Success Criteria** (what must be TRUE):
1. Each category group (income, bills, variable expenses, debt, savings, investment) renders as a collapsible section with a color-accented header showing the group label, budgeted total, actual total, and difference
2. Expanding a section reveals a line-item table with individual budget items, and collapsing it hides the table with a smooth CSS animation (no layout shift in charts above)
3. Toggling sections rapidly does not produce `ResizeObserver loop` console errors or visible chart resize jank
4. Carryover amount is visible on the dashboard balance card when the budget has a non-zero carryover
**Plans**: 2 plans
1. A new user (zero categories, zero template items) is automatically redirected to `/setup` on their first login and sees a 3-step wizard: income entry, recurring items selection, and review
2. The recurring items step shows ~15-20 pre-filled common items (rent, groceries, car insurance, utilities, etc.) with editable default amounts — user can check or uncheck each
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/2 plans complete
Plans:
- [ ] 03-01-PLAN.md — Build carryover display, CSS animation tokens, i18n keys, CategorySection and CollapsibleSections components
- [ ] 03-02-PLAN.md — Wire collapsible sections into DashboardContent with smart defaults, update skeleton, verify
- [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 4: Full-App Design Consistency
**Goal**: Apply the design system established in Phases 1-3 to every page in the app, delivering a consistent visual experience across all navigation paths
**Depends on**: Phase 3
**Requirements**: UI-DESIGN-01, UI-AUTH-01, UI-CATEGORIES-01, UI-TEMPLATE-01, UI-BUDGETS-01, UI-QUICKADD-01, UI-SETTINGS-01, UI-RESPONSIVE-01
**Research flag**: No — PageShell application and page-by-page refresh are repetitive pattern application
### 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
**Depends on**: Phase 7
**Requirements**: AUTO-01, AUTO-02, AUTO-03
**Success Criteria** (what must be TRUE):
1. All 9 pages (Login, Register, Categories, Template, Budget List, Budget Detail, Quick Add, Settings, Dashboard) use `PageShell` for their header and share the same typography, card style, and color token usage
2. Login and Register pages have a refreshed visual design with the same card and color patterns as the dashboard
3. Budget Detail page displays category groups with the same color-accented card style and line-item presentation as the dashboard collapsible sections
4. Navigating between any two pages in the app produces no jarring visual discontinuity in layout, color, or typography
5. Switching the app to German locale shows fully translated text on every page — no raw i18n key strings visible anywhere
**Plans**: 3 plans
1. Navigating to the dashboard for a month that has no budget (but a populated template) creates the budget automatically — no button click or prompt required
2. The first time a budget is auto-created in a session, a toast notification appears naming the month and indicating it was created from the template — subsequent months are created silently
3. The auto-created budget uses the user's configured currency from their profile settings, not a hardcoded default
4. Rapidly navigating between months or opening the dashboard in two tabs does not produce duplicate budget rows
**Plans:** 3 plans
Plans:
- [ ] 04-01-PLAN.md — Redesign auth pages (Login, Register) with brand presence, muted background, card accent, OAuth SVG icons
- [ ] 04-02-PLAN.md — Upgrade CRUD pages (Categories, Template, QuickAdd, Settings) with PageShell, skeletons, group header accents
- [ ] 04-03-PLAN.md — Upgrade budget pages (BudgetList, BudgetDetail) with semantic tokens, direction-aware diff, locale-aware months, skeletons
- [ ] 06-01-PLAN.md — DB migrations (uniqueness constraints + setup_completed column + Profile type update)
- [ ] 06-02-PLAN.md — Preset library (src/data/presets.ts) and i18n translations (en.json + de.json)
- [ ] 06-03-PLAN.md — useFirstRunState hook, DB schema push, and verification checkpoint
### Phase 9: Inline Add and Dashboard Simplification
**Goal**: Users add one-off items to their budget directly from the budget view, the Quick Add page is gone, and the dashboard shows this month's data at a glance without chart overload
**Depends on**: Phase 8
**Requirements**: BV-01, BV-02, BV-03, DASH-01, DASH-02, DASH-03
**Success Criteria** (what must be TRUE):
1. An "Add item" control on the budget detail page opens a Sheet panel showing the category library — user selects a category, enters an amount, and the item appears in the budget without a page navigation
2. The Quick Add page is removed from the sidebar navigation — visiting `/quick-add` redirects to `/budgets` instead of showing an error
3. The dashboard displays this month's summary cards (income, expenses, balance) with correct totals that match what the user entered in the budget detail page
4. The dashboard does not show the 3-column chart grid by default — the primary view is the at-a-glance summary and collapsible category sections
5. Empty template, empty dashboard, and empty budget view each show a clear empty state with a visible call-to-action guiding the user to the next step
**Plans:** 3 plans
Plans:
- [ ] 06-01-PLAN.md — DB migrations (uniqueness constraints + setup_completed column + Profile type update)
- [ ] 06-02-PLAN.md — Preset library (src/data/presets.ts) and i18n translations (en.json + de.json)
- [ ] 06-03-PLAN.md — useFirstRunState hook, DB schema push, and verification checkpoint
## Requirements Traceability
### Requirement Definitions
| Requirement | Phase | Status |
|-------------|-------|--------|
| DS-01 | Phase 5 | Pending |
| DS-02 | Phase 5 | Pending |
| DS-03 | Phase 5 | Pending |
| SETUP-01 | Phase 6, 7 | Pending |
| SETUP-02 | Phase 6, 7 | Pending |
| SETUP-03 | Phase 7 | Pending |
| SETUP-04 | Phase 7 | Pending |
| SETUP-05 | Phase 7 | Pending |
| AUTO-01 | Phase 6, 8 | Pending |
| AUTO-02 | Phase 8 | Pending |
| AUTO-03 | Phase 6, 8 | Pending |
| BV-01 | Phase 9 | Pending |
| BV-02 | Phase 9 | Pending |
| BV-03 | Phase 9 | Pending |
| DASH-01 | Phase 9 | Pending |
| DASH-02 | Phase 9 | Pending |
| DASH-03 | Phase 9 | Pending |
| ID | Requirement | Source |
|-----|-------------|--------|
| UI-DASH-01 | Redesign dashboard with hybrid layout — summary cards, charts, and collapsible category sections with budget/actual columns | PROJECT.md Active |
| UI-BAR-01 | Add bar chart comparing income budget vs actual | PROJECT.md Active |
| UI-HBAR-01 | Add horizontal bar chart comparing spend budget vs actual by category type | PROJECT.md Active |
| UI-DONUT-01 | Improve donut chart for expense category breakdown with richer styling | PROJECT.md Active |
| UI-COLLAPSE-01 | Add collapsible inline sections on dashboard for each category group showing individual line items | PROJECT.md Active |
| UI-DESIGN-01 | Redesign all pages with rich, colorful visual style — consistent design language across the app | PROJECT.md Active |
| UI-AUTH-01 | Refresh login and register pages | PROJECT.md Active |
| UI-CATEGORIES-01 | Refresh categories page | PROJECT.md Active |
| UI-TEMPLATE-01 | Refresh template page | PROJECT.md Active |
| UI-BUDGETS-01 | Refresh budget list and budget detail pages | PROJECT.md Active |
| UI-QUICKADD-01 | Refresh quick-add page | PROJECT.md Active |
| UI-SETTINGS-01 | Refresh settings page | PROJECT.md Active |
| UI-RESPONSIVE-01 | Desktop-first responsive layout across all pages | PROJECT.md Active |
### Coverage Map
| Requirement | Phase | Rationale |
|-------------|-------|-----------|
| UI-DASH-01 | Phase 1, 2, 3 | Dashboard hybrid layout spans foundation (cards), charts, and collapsible sections — each phase delivers one layer |
| UI-BAR-01 | Phase 2 | Income bar chart is a chart component built in the charts phase |
| UI-HBAR-01 | Phase 2 | Horizontal spend bar chart is a chart component built in the charts phase |
| UI-DONUT-01 | Phase 2 | Donut chart restyle is a chart component built in the charts phase |
| UI-COLLAPSE-01 | Phase 3 | Collapsible sections are the sole focus of Phase 3 |
| UI-DESIGN-01 | Phase 1, 4 | Design tokens and shared components in Phase 1; applied to all pages in Phase 4 |
| UI-AUTH-01 | Phase 4 | Login/register refresh uses established design patterns |
| UI-CATEGORIES-01 | Phase 4 | Categories page refresh uses established design patterns |
| UI-TEMPLATE-01 | Phase 4 | Template page refresh uses established design patterns |
| UI-BUDGETS-01 | Phase 4 | Budget list and detail page refresh uses established design patterns |
| UI-QUICKADD-01 | Phase 4 | Quick-add page refresh uses established design patterns |
| UI-SETTINGS-01 | Phase 4 | Settings page refresh uses established design patterns |
| UI-RESPONSIVE-01 | Phase 1, 4 | Responsive foundation set in Phase 1; verified across all pages in Phase 4 |
**Coverage: 13/13 active requirements mapped. No orphans.**
**Coverage: 17/17 v2.0 requirements mapped. No orphans.**
## Progress
**Execution Order:**
Phases execute in numeric order: 1 -> 2 -> 3 -> 4
Phases execute in numeric order: 5 → 6 → 7 → 8 → 9
| Phase | Plans Complete | Status | Completed |
|-------|----------------|--------|-----------|
| 1. Design Foundation and Primitives | 2/2 | Complete | 2026-03-16 |
| 2. Dashboard Charts and Layout | 3/3 | Complete | 2026-03-16 |
| 3. Collapsible Dashboard Sections | 1/2 | In Progress| |
| 4. Full-App Design Consistency | 2/3 | In Progress| |
| 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 | 2/2 | Complete | 2026-04-20 |
| 8. Auto-Budget Creation | 0/? | Not started | - |
| 9. Inline Add and Dashboard Simplification | 0/? | Not started | - |

View File

@@ -1,16 +1,16 @@
---
gsd_state_version: 1.0
milestone: v1.0
milestone: v2.0
milestone_name: milestone
status: planning
stopped_at: Completed 04-03-PLAN.md
last_updated: "2026-03-17T15:29:29.215Z"
last_activity: 2026-03-16 — Phase 2 complete, transitioned to Phase 3
status: executing
stopped_at: Completed 06-03-PLAN.md — Phase 06 fully executed
last_updated: "2026-04-20T19:15:23.317Z"
last_activity: 2026-04-20
progress:
total_phases: 4
completed_phases: 4
total_plans: 10
completed_plans: 10
total_phases: 5
completed_phases: 3
total_plans: 8
completed_plans: 8
percent: 100
---
@@ -18,48 +18,46 @@ progress:
## Project Reference
See: .planning/PROJECT.md (updated 2026-03-16)
See: .planning/PROJECT.md (updated 2026-04-02)
**Core value:** Users can see their full monthly financial picture at a glance — income, spending, and what's left — in a visually rich, easy-to-read dashboard.
**Current focus:** Phase 3Collapsible Dashboard Sections
**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 7Setup Wizard
## Current Position
Phase: 3 of 4 (Collapsible Dashboard Sections)
Phase: 8
Plan: Not started
Status: Ready to plan
Last activity: 2026-03-16 — Phase 2 complete, transitioned to Phase 3
Status: Executing Phase 7
Last activity: 2026-04-20
Progress: [████████████████████] 5/5 plans (100%)
Progress: [████████████████████] 3/3 plans (100%)
## Performance Metrics
**Velocity:**
- Total plans completed: 0
- Average duration: -
- Total execution time: 0 hours
**Velocity (v1.0 baseline):**
**By Phase:**
- Total plans completed (v1.0): 10
- Average duration: ~2.4 min/plan
- Total execution time: ~24 min
**By Phase (v1.0):**
| Phase | Plans | Total | Avg/Plan |
|-------|-------|-------|----------|
| - | - | - | - |
| 01 Design Foundation | 2 | ~5 min | 2.5 min |
| 02 Dashboard Charts | 3 | ~7 min | 2.3 min |
| 03 Collapsible Sections | 2 | ~4 min | 2 min |
| 04 Full-App Consistency | 3 | ~7 min | 2.3 min |
| 05 | 3 | - | - |
| 06 | 3 | - | - |
| 7 | 2 | - | - |
**v2.0 Trend:**
**Recent Trend:**
- Last 5 plans: -
- Trend: -
*Updated after each plan completion*
| Phase 01 P01 | 3min | 2 tasks | 5 files |
| Phase 01 P02 | 2min | 2 tasks | 5 files |
| Phase 02 P02 | 2min | 2 tasks | 4 files |
| Phase 02 P01 | 2min | 2 tasks | 4 files |
| Phase 02-dashboard-charts-and-layout P03 | 3min | 2 tasks | 2 files |
| Phase 03-collapsible-dashboard-sections P01 | 2min | 2 tasks | 8 files |
| Phase 03-collapsible-dashboard-sections P02 | 2min | 1 tasks | 2 files |
| Phase 04-full-app-design-consistency P01 | 2min | 2 tasks | 4 files |
| Phase 04-full-app-design-consistency P02 | 3min | 2 tasks | 4 files |
| Phase 04-full-app-design-consistency P03 | 2min | 2 tasks | 4 files |
## Accumulated Context
@@ -68,30 +66,9 @@ Progress: [████████████████████] 5/5 pla
Decisions are logged in PROJECT.md Key Decisions table.
Recent decisions affecting current work:
- [Roadmap]: 4-phase structure derived from research — foundation before features, dashboard before other pages, charts before collapsibles
- [Roadmap]: All research flags set to NO — no `/gsd:research-phase` needed before any phase
- [Phase 01]: Applied Recharts v3 initialDimension patch on chart.tsx (shadcn-ui/ui#9892)
- [Phase 01]: Category text colors darkened to oklch ~0.55 for WCAG 4.5:1 contrast; chart fills kept lighter at ~0.65-0.70 (two-tier pattern)
- [Phase 01]: StatCard uses font-bold (upgraded from font-semibold) for stronger KPI visual weight
- [Phase 01]: SummaryStrip accepts t() as prop to stay presentational; DashboardSkeleton mirrors exact grid layout to prevent shift
- [Phase 02]: Donut legend placed below chart for better 3-column layout fit
- [Phase 02]: ChartEmptyState created in Plan 02 as Rule 3 deviation (blocking dep from Plan 01)
- [Phase 02]: MonthNavigator uses Select dropdown for month jump -- consistent with existing form patterns
- [Phase 02]: useMonthParam uses useSearchParams callback form to preserve other URL params
- [Phase 02-03]: useMemo hooks declared before early returns (Rules of Hooks compliance)
- [Phase 02-03]: QuickAdd button placed below chart grid (SummaryStrip -> charts -> QuickAdd ordering)
- [Phase 02-03]: Chart grid uses md:grid-cols-2 lg:grid-cols-3 responsive breakpoints
- [Phase 03-collapsible-dashboard-sections]: CategorySection uses controlled open/onOpenChange pattern — Plan 02 will own open state in DashboardContent
- [Phase 03-collapsible-dashboard-sections]: Direction-aware diff: spending types (bill, variable_expense, debt) over when actual > budgeted; income/saving/investment over when actual < budgeted
- [Phase 03-collapsible-dashboard-sections]: CollapsibleContent wired to CSS keyframes via data-[state=open]:animate-collapsible-open Tailwind variant
- [Phase 03-collapsible-dashboard-sections]: key prop state reset over useEffect: keying DashboardContent by budgetId causes full remount on month change, cleanly resetting openSections without violating react-hooks linter rules
- [Phase 04-full-app-design-consistency]: Inline SVG paths used for Google and GitHub icons — avoids dependency on external icon library while keeping icons fully styled
- [Phase 04-full-app-design-consistency]: Auth card accent pattern established: border-t-4 border-t-primary shadow-lg on Card with bg-muted/60 background and favicon.svg logo
- [Phase 04-full-app-design-consistency]: TemplatePage uses manual PageShell-mirrored layout (flex flex-col gap-6) instead of PageShell directly — preserves inline-editable TemplateName component
- [Phase 04-full-app-design-consistency]: SettingsPage CardHeader and CardTitle removed — PageShell provides page-level title, CardContent gets pt-6 to compensate
- [Phase 04-full-app-design-consistency]: Direction-aware diff pattern replicated from CategorySection: SPENDING_TYPES array + isSpendingType() covers all 6 category types correctly
- [Phase 04-full-app-design-consistency]: TierBadge column removed from BudgetDetailPage to reduce visual noise and align with CategorySection display style
- [Phase 04-full-app-design-consistency]: budgets.month/year/total keys added to en.json and de.json — i18next interpolation pattern for translated total labels
- [Roadmap v2.0]: 5-phase structure — tokens first (global scope), DB safety before UI writes, wizard before auto-budget, auto-budget before inline add
- [Roadmap v2.0]: Phase 6 kept separate from Phase 7 — DB constraints and backfill migration must land before any wizard UI to prevent data corruption
- [Roadmap v2.0]: SETUP-01, SETUP-02, AUTO-01, AUTO-03 split across Phase 6 and Phase 7/8 — Phase 6 provides the prerequisite DB/data layer, later phases deliver user-visible behavior
### Pending Todos
@@ -99,10 +76,11 @@ None yet.
### Blockers/Concerns
- ⚠️ [Phase 02-03] 6 pre-existing lint errors in unrelated files (MonthNavigator.tsx, badge.tsx, button.tsx, sidebar.tsx, useBudgets.ts) — not caused by Phase 2 changes but may affect Phase 3 CI
- ⚠️ [Phase 8] Verify `profiles` table currency column name before writing auto-create code — check `supabase/migrations/001_profiles.sql` at planning time (research flagged this)
- ⚠️ [Phase 6] `setup_completed` backfill migration must ship before Phase 7 deploys — existing v1.0 users must not see the wizard on first v2.0 login
## Session Continuity
Last session: 2026-03-17T15:23:32.629Z
Stopped at: Completed 04-03-PLAN.md
Last session: 2026-04-20
Stopped at: Completed 06-03-PLAN.md — Phase 06 fully executed
Resume file: None

View File

@@ -3,11 +3,12 @@
"granularity": "coarse",
"parallelization": true,
"commit_docs": true,
"model_profile": "quality",
"model_profile": "balanced",
"workflow": {
"research": true,
"plan_check": true,
"verifier": true,
"nyquist_validation": true
"nyquist_validation": true,
"_auto_chain_active": false
}
}

View File

@@ -0,0 +1,141 @@
# Roadmap: SimpleFinanceDash UI/UX Overhaul
## Overview
This milestone transforms SimpleFinanceDash from a functional-but-basic budget app into a visually rich, cohesive personal finance dashboard. The overhaul is strictly UI-only — no backend or schema changes. Work flows from design foundations (tokens, shared components) through the dashboard (charts, collapsible sections) to full-app consistency across all 9 pages. The research phase is complete; all four phases use well-documented patterns and require no further research before planning.
## Phases
**Phase Numbering:**
- Integer phases (1, 2, 3): Planned milestone work
- Decimal phases (2.1, 2.2): Urgent insertions (marked with INSERTED)
Decimal phases appear between their surrounding integers in numeric order.
- [x] **Phase 1: Design Foundation and Primitives** - Install shadcn primitives, extend color tokens, build PageShell and StatCard/SummaryStrip
- [x] **Phase 2: Dashboard Charts and Layout** - Build DashboardContent orchestrator with all three chart types and month navigation (completed 2026-03-16)
- [x] **Phase 3: Collapsible Dashboard Sections** - Add CategorySection with Radix Collapsible, BudgetLineItems, and group totals (completed 2026-03-17)
- [x] **Phase 4: Full-App Design Consistency** - Apply PageShell and established patterns to all 9 non-dashboard pages (completed 2026-03-17)
## Phase Details
### Phase 1: Design Foundation and Primitives
**Goal**: Establish the design system building blocks — color tokens, shadcn primitives, and shared components — so all subsequent phases build on a consistent visual foundation
**Depends on**: Nothing (first phase)
**Requirements**: UI-DASH-01, UI-DESIGN-01, UI-RESPONSIVE-01
**Research flag**: No — Tailwind v4 `@theme inline`, OKLCH tokens, and WCAG contrast requirements are well-documented
**Success Criteria** (what must be TRUE):
1. Running `npx shadcn@latest add chart` and `npx shadcn@latest add collapsible` has installed both primitives, and `chart.tsx` has the `initialDimension` patch applied (no `width(-1)` console warnings when rendering a test chart)
2. `index.css` `@theme inline` block contains extended category color tokens with richer chroma and semantic status tokens (`--color-over-budget`, `--color-on-budget`), and all semantic color pairs pass WCAG 4.5:1 contrast for text
3. `PageShell` component renders a consistent page header with title, optional description, and CTA slot — and is importable from `components/shared/`
4. `StatCard` and `SummaryStrip` components render KPI cards (income, expenses, balance) with semantic color coding and variance badges — visible on the dashboard page
5. Skeleton loading components exist that mirror the real card and chart layout structure
**Plans**: 2 plans
Plans:
- [x] 01-01-PLAN.md — Install shadcn primitives (chart + collapsible), extend OKLCH color tokens, add i18n keys
- [x] 01-02-PLAN.md — Build PageShell, StatCard, SummaryStrip, DashboardSkeleton and integrate into DashboardPage
### Phase 2: Dashboard Charts and Layout
**Goal**: Deliver the full dashboard chart suite — donut, vertical bar, and horizontal bar — inside a responsive 3-column layout, with month navigation and memoized data derivations
**Depends on**: Phase 1
**Requirements**: UI-DASH-01, UI-BAR-01, UI-HBAR-01, UI-DONUT-01
**Research flag**: No — Recharts 2.15.4 chart implementations and the `chart.tsx` fix are fully documented
**Success Criteria** (what must be TRUE):
1. Dashboard displays an expense donut chart with center total label, active sector hover expansion, and a custom legend — replacing the existing flat pie chart
2. Dashboard displays a grouped vertical bar chart comparing income budgeted vs actual amounts
3. Dashboard displays a horizontal bar chart comparing budget vs actual spending by category type
4. All three charts consume colors from CSS variable tokens (no hardcoded hex values) and render correctly with zero-item budgets (empty state)
5. User can navigate between budget months on the dashboard without leaving the page, and all charts and cards update to reflect the selected month
**Plans**: 3 plans
Plans:
- [x] 02-01-PLAN.md — Month navigation infrastructure (useMonthParam hook, MonthNavigator, ChartEmptyState, i18n keys)
- [x] 02-02-PLAN.md — Three chart components (ExpenseDonutChart, IncomeBarChart, SpendBarChart)
- [x] 02-03-PLAN.md — Dashboard integration (wire charts + month nav into DashboardPage, update skeleton)
### Phase 3: Collapsible Dashboard Sections
**Goal**: Complete the dashboard hybrid view with collapsible per-category sections that show individual line items, group totals, and variance indicators
**Depends on**: Phase 2
**Requirements**: UI-DASH-01, UI-COLLAPSE-01
**Research flag**: No — Radix Collapsible API and animation pattern are well-documented
**Success Criteria** (what must be TRUE):
1. Each category group (income, bills, variable expenses, debt, savings, investment) renders as a collapsible section with a color-accented header showing the group label, budgeted total, actual total, and difference
2. Expanding a section reveals a line-item table with individual budget items, and collapsing it hides the table with a smooth CSS animation (no layout shift in charts above)
3. Toggling sections rapidly does not produce `ResizeObserver loop` console errors or visible chart resize jank
4. Carryover amount is visible on the dashboard balance card when the budget has a non-zero carryover
**Plans**: 2 plans
Plans:
- [x] 03-01-PLAN.md — Build carryover display, CSS animation tokens, i18n keys, CategorySection and CollapsibleSections components
- [x] 03-02-PLAN.md — Wire collapsible sections into DashboardContent with smart defaults, update skeleton, verify
### Phase 4: Full-App Design Consistency
**Goal**: Apply the design system established in Phases 1-3 to every page in the app, delivering a consistent visual experience across all navigation paths
**Depends on**: Phase 3
**Requirements**: UI-DESIGN-01, UI-AUTH-01, UI-CATEGORIES-01, UI-TEMPLATE-01, UI-BUDGETS-01, UI-QUICKADD-01, UI-SETTINGS-01, UI-RESPONSIVE-01
**Research flag**: No — PageShell application and page-by-page refresh are repetitive pattern application
**Success Criteria** (what must be TRUE):
1. All 9 pages (Login, Register, Categories, Template, Budget List, Budget Detail, Quick Add, Settings, Dashboard) use `PageShell` for their header and share the same typography, card style, and color token usage
2. Login and Register pages have a refreshed visual design with the same card and color patterns as the dashboard
3. Budget Detail page displays category groups with the same color-accented card style and line-item presentation as the dashboard collapsible sections
4. Navigating between any two pages in the app produces no jarring visual discontinuity in layout, color, or typography
5. Switching the app to German locale shows fully translated text on every page — no raw i18n key strings visible anywhere
**Plans**: 3 plans
Plans:
- [x] 04-01-PLAN.md — Redesign auth pages (Login, Register) with brand presence, muted background, card accent, OAuth SVG icons
- [x] 04-02-PLAN.md — Upgrade CRUD pages (Categories, Template, QuickAdd, Settings) with PageShell, skeletons, group header accents
- [x] 04-03-PLAN.md — Upgrade budget pages (BudgetList, BudgetDetail) with semantic tokens, direction-aware diff, locale-aware months, skeletons
## Requirements Traceability
### Requirement Definitions
| ID | Requirement | Source |
|-----|-------------|--------|
| UI-DASH-01 | Redesign dashboard with hybrid layout — summary cards, charts, and collapsible category sections with budget/actual columns | PROJECT.md Active |
| UI-BAR-01 | Add bar chart comparing income budget vs actual | PROJECT.md Active |
| UI-HBAR-01 | Add horizontal bar chart comparing spend budget vs actual by category type | PROJECT.md Active |
| UI-DONUT-01 | Improve donut chart for expense category breakdown with richer styling | PROJECT.md Active |
| UI-COLLAPSE-01 | Add collapsible inline sections on dashboard for each category group showing individual line items | PROJECT.md Active |
| UI-DESIGN-01 | Redesign all pages with rich, colorful visual style — consistent design language across the app | PROJECT.md Active |
| UI-AUTH-01 | Refresh login and register pages | PROJECT.md Active |
| UI-CATEGORIES-01 | Refresh categories page | PROJECT.md Active |
| UI-TEMPLATE-01 | Refresh template page | PROJECT.md Active |
| UI-BUDGETS-01 | Refresh budget list and budget detail pages | PROJECT.md Active |
| UI-QUICKADD-01 | Refresh quick-add page | PROJECT.md Active |
| UI-SETTINGS-01 | Refresh settings page | PROJECT.md Active |
| UI-RESPONSIVE-01 | Desktop-first responsive layout across all pages | PROJECT.md Active |
### Coverage Map
| Requirement | Phase | Rationale |
|-------------|-------|-----------|
| UI-DASH-01 | Phase 1, 2, 3 | Dashboard hybrid layout spans foundation (cards), charts, and collapsible sections — each phase delivers one layer |
| UI-BAR-01 | Phase 2 | Income bar chart is a chart component built in the charts phase |
| UI-HBAR-01 | Phase 2 | Horizontal spend bar chart is a chart component built in the charts phase |
| UI-DONUT-01 | Phase 2 | Donut chart restyle is a chart component built in the charts phase |
| UI-COLLAPSE-01 | Phase 3 | Collapsible sections are the sole focus of Phase 3 |
| UI-DESIGN-01 | Phase 1, 4 | Design tokens and shared components in Phase 1; applied to all pages in Phase 4 |
| UI-AUTH-01 | Phase 4 | Login/register refresh uses established design patterns |
| UI-CATEGORIES-01 | Phase 4 | Categories page refresh uses established design patterns |
| UI-TEMPLATE-01 | Phase 4 | Template page refresh uses established design patterns |
| UI-BUDGETS-01 | Phase 4 | Budget list and detail page refresh uses established design patterns |
| UI-QUICKADD-01 | Phase 4 | Quick-add page refresh uses established design patterns |
| UI-SETTINGS-01 | Phase 4 | Settings page refresh uses established design patterns |
| UI-RESPONSIVE-01 | Phase 1, 4 | Responsive foundation set in Phase 1; verified across all pages in Phase 4 |
**Coverage: 13/13 active requirements mapped. No orphans.**
## Progress
**Execution Order:**
Phases execute in numeric order: 1 -> 2 -> 3 -> 4
| Phase | Plans Complete | Status | Completed |
|-------|----------------|--------|-----------|
| 1. Design Foundation and Primitives | 2/2 | Complete | 2026-03-16 |
| 2. Dashboard Charts and Layout | 3/3 | Complete | 2026-03-16 |
| 3. Collapsible Dashboard Sections | 2/2 | Complete | 2026-03-17 |
| 4. Full-App Design Consistency | 3/3 | Complete | 2026-03-17 |

View File

@@ -0,0 +1,121 @@
---
phase: 02-dashboard-charts-and-layout
plan: 01
subsystem: ui
tags: [react, react-router, useSearchParams, select, lucide-react, i18n, dashboard, charts]
# Dependency graph
requires:
- phase: 01-design-foundation-and-primitives
provides: "Design tokens, PageShell, SummaryStrip, ChartEmptyState component"
provides:
- "useMonthParam hook for URL-based month state"
- "MonthNavigator component with prev/next arrows and month dropdown"
- "i18n keys for chart labels and month navigation (EN + DE)"
affects: [02-02, 02-03, 03-collapsible-dashboard-sections, dashboard-page-refactor]
# Tech tracking
tech-stack:
added: []
patterns: [URL search param state via useMonthParam, locale-aware month formatting]
key-files:
created:
- src/hooks/useMonthParam.ts
- src/components/dashboard/MonthNavigator.tsx
modified:
- src/i18n/en.json
- src/i18n/de.json
key-decisions:
- "MonthNavigator uses Select dropdown (not popover) for month jump -- consistent with existing form patterns"
- "useMonthParam preserves other URL params via setSearchParams callback form"
- "navigateMonth uses Date constructor for automatic year rollover"
- "MonthNavigator accepts t prop but dropdown uses locale-aware Intl formatting"
- "ChartEmptyState already existed from Phase 1 — skipped creation, added i18n keys only"
patterns-established:
- "useMonthParam: URL state hook pattern using useSearchParams callback form to preserve other params"
- "Month formatting: Date.toLocaleDateString with month:'long', year:'numeric'"
requirements-completed: [UI-DASH-01]
# Metrics
duration: 2min
completed: 2026-03-16
---
# Phase 02, Plan 01: Month Navigation and Chart Infrastructure Summary
**useMonthParam hook and MonthNavigator component for URL-based month selection, plus 10 new chart/navigation i18n keys in EN and DE**
## Performance
- **Duration:** ~2 min
- **Started:** 2026-03-16T12:01:18Z
- **Completed:** 2026-03-16T12:03:21Z
- **Tasks:** 2
- **Files modified:** 4
## Accomplishments
- useMonthParam hook reads/writes `?month=YYYY-MM` from URL with current month fallback and year-rollover-safe navigation
- MonthNavigator renders prev/next chevron buttons and a Select dropdown listing available budget months with locale-aware formatting
- Added 10 new i18n keys under `dashboard.*` for chart labels, month navigation, and empty states in both English and German
## Task Commits
Each task was committed atomically:
1. **Task 1: Create useMonthParam hook and MonthNavigator component** - `4481950` (feat)
2. **Task 2: Add chart and month navigation i18n keys** - `42bf1f9` (feat)
## Files Created/Modified
- `src/hooks/useMonthParam.ts` - Custom hook wrapping useSearchParams for month URL state with setMonth and navigateMonth
- `src/components/dashboard/MonthNavigator.tsx` - Prev/next arrow buttons + Select dropdown for month selection
- `src/i18n/en.json` - Added monthNav, noData, expenseDonut, incomeChart, spendChart, budgeted, actual, noBudgetForMonth, createBudget, generateFromTemplate keys
- `src/i18n/de.json` - German translations for all 10 new dashboard keys
## Decisions Made
- MonthNavigator uses the shadcn Select component (not a popover or custom dropdown) for month selection -- consistent with existing form patterns in the project
- formatMonthLabel uses `Date.toLocaleDateString(undefined, { month: "long", year: "numeric" })` for locale-aware month display rather than manual string formatting
- ChartEmptyState component was already created during Phase 1 scaffolding -- verified it matches the plan specification exactly, so no changes were needed
## Deviations from Plan
### Auto-fixed Issues
**1. [Rule 1 - Already Exists] Skipped ChartEmptyState component creation**
- **Found during:** Task 2 (ChartEmptyState and i18n keys)
- **Issue:** ChartEmptyState component already existed from Phase 1 setup
- **Fix:** Skipped creation, added only the i18n keys
- **Verification:** Component exists and exports correctly
- **Committed in:** 42bf1f9 (Task 2 commit)
---
**Total deviations:** 1 auto-fixed (1 already exists)
**Impact on plan:** No scope creep — component existed, only i18n work needed.
## Issues Encountered
None
## User Setup Required
None - no external service configuration required.
## Next Phase Readiness
- useMonthParam hook ready for consumption by DashboardPage refactor (Plan 03)
- MonthNavigator ready to be placed in PageShell action slot (Plan 03)
- ChartEmptyState ready for use in chart components (Plans 02)
- All chart i18n keys available for chart components (Plan 02)
## Self-Check: PASSED
- FOUND: src/hooks/useMonthParam.ts
- FOUND: src/components/dashboard/MonthNavigator.tsx
- FOUND: src/components/dashboard/charts/ChartEmptyState.tsx
- FOUND: commit 4481950
- FOUND: commit 42bf1f9
---
*Phase: 02-dashboard-charts-and-layout*
*Completed: 2026-03-16*

View File

@@ -119,6 +119,10 @@ None - no external service configuration required.
- `CollapsibleSections` expects: `groups[]`, `currency`, `openSections: Record<string,boolean>`, `onToggleSection`, `t`
- Plan 02 needs to: group `items` by `CategoryType`, compute per-group totals, manage `openSections` state in `DashboardContent`
## Self-Check: PASSED
All 9 files verified present. Both task commits (21ce6d8, f30b846) and metadata commit (7d08da2) confirmed in git log.
---
*Phase: 03-collapsible-dashboard-sections*
*Completed: 2026-03-17*

View File

@@ -0,0 +1,105 @@
# Phase 3: Collapsible Dashboard Sections - Context
**Gathered:** 2026-03-16
**Status:** Ready for planning
<domain>
## Phase Boundary
Complete the dashboard hybrid view with collapsible per-category sections that show individual line items, group totals, and variance indicators. Add carryover amount display to the balance card. Sections sit below the chart grid and above QuickAdd. This phase does not add editing capabilities or navigation links — the dashboard remains a read-only summary.
</domain>
<decisions>
## Implementation Decisions
### Section header design
- Badge-style chips for totals: two small colored badges showing `[Budget $X]` and `[Actual $X]` right-aligned in the header row
- Left border accent using the category's CSS variable color (thick colored left border on the header row)
- Difference shown in header with color coding: green (`--color-on-budget`) when under/on budget, red (`--color-over-budget`) when over budget
- Chevron-right icon that rotates to chevron-down when expanded (standard Radix Collapsible pattern)
- Group label (from `categoryLabels` in palette.ts) on the left, badges and difference on the right
### Line-item table columns
- Four columns: Item Name, Budgeted, Actual, Difference
- No tier badge — keep it clean for the dashboard summary view
- No notes column — full detail lives on BudgetDetailPage
- Difference column uses red text when over budget (`--color-over-budget`), no full-row tint
- Footer row with bold group totals summing Budget, Actual, and Diff columns
- Read-only — no clickable rows, no navigation links to BudgetDetailPage
### Default expand/collapse behavior
- Smart default: over-budget sections auto-expand on load, on/under-budget sections start collapsed
- Over-budget logic is direction-aware:
- Spending categories (bill, variable_expense, debt): actual > budget = over budget (expand)
- Income category: actual < budget = under-earned (expand)
- Savings/investment categories: actual < budget = under-saved (expand)
- Empty category groups (no items of that type) are hidden entirely — only show sections with at least one budget item
- Expand/collapse state resets on month navigation — smart defaults recalculate per month
### Carryover display
- Subtitle line below balance amount on the balance StatCard: "Includes $X carryover" when non-zero
- Carryover is included in the balance calculation: Balance = Income Actual - Expenses Actual + Carryover
- When carryover is zero, the subtitle line is hidden entirely (clean card for the common case)
- Negative carryover is supported: shown with red styling (e.g., "Includes -$150 carryover"), deducts from balance
### Claude's Discretion
- Smooth collapse/expand CSS animation details (timing, easing)
- Preventing ResizeObserver loop errors when toggling rapidly (success criteria #3)
- Preventing chart resize jank when sections toggle (success criteria #3)
- Exact spacing between section headers and between sections and the chart grid above
- Table cell alignment and typography within line items
- DashboardSkeleton updates for the collapsible sections area
- How to derive and memoize per-group data from budget items
</decisions>
<specifics>
## Specific Ideas
No specific references — open to standard approaches within the established design system.
</specifics>
<code_context>
## Existing Code Insights
### Reusable Assets
- `collapsible.tsx` (ui/): Radix Collapsible primitive already installed — `Collapsible`, `CollapsibleTrigger`, `CollapsibleContent` exports ready to use
- `categoryColors` (palette.ts): CSS variable map for all 6 category types — use for left border accent colors
- `categoryLabels` (palette.ts): English/German labels for all 6 types — use for section header labels
- `Table`/`TableBody`/`TableCell`/`TableFooter`/`TableHead`/`TableHeader`/`TableRow` (ui/table.tsx): Full table primitive set for line items
- `Badge` (ui/badge.tsx): Use for budget/actual chips in section headers
- `StatCard` (components/dashboard/StatCard.tsx): Balance card that needs carryover subtitle
- `SummaryStrip` (components/dashboard/SummaryStrip.tsx): Orchestrates StatCards — may need carryover prop threading
- `formatCurrency` (lib/format.ts): Currency formatting for all monetary values
- `ChevronRight`/`ChevronDown` from `lucide-react`: Expand/collapse icons
### Established Patterns
- Two-tier OKLCH color pattern: text at ~0.55 lightness, chart fills at ~0.65-0.70 (Phase 1) — section border accents should use fill-tier lightness
- Semantic status tokens: `--color-over-budget` (red) and `--color-on-budget` (green) for difference indicators (Phase 1)
- Components accept `t()` as prop to stay presentational (Phase 1) — new section components should follow this
- `useMemo` hooks declared before early returns for Rules of Hooks compliance (Phase 2)
- `EXPENSE_TYPES` / `CATEGORY_TYPES` constants already define category ordering — reuse for section order
- `DashboardContent` pattern: inner component receives budget data, derives per-type totals (Phase 2)
### Integration Points
- `DashboardContent` (DashboardPage.tsx): Currently renders SummaryStrip → chart grid → QuickAdd. Collapsible sections insert between chart grid and QuickAdd.
- `useBudgetDetail(id)`: Returns `{ budget, items }` where items have category joins — items need grouping by `category.type` for sections
- `Budget.carryover_amount`: Field already exists on the Budget type — needs to flow from DashboardContent → SummaryStrip → StatCard
- `useMonthParam`: Month navigation resets expand/collapse state — state should be local React state (useState), not URL params
- i18n: New keys needed for section headers, table column labels, carryover subtitle, and empty states
</code_context>
<deferred>
## Deferred Ideas
None — discussion stayed within phase scope.
</deferred>
---
*Phase: 03-collapsible-dashboard-sections*
*Context gathered: 2026-03-16*

View File

@@ -0,0 +1,116 @@
# Roadmap: SimpleFinanceDash v2.0 — UX Simplification & Design Rework
## Overview
This milestone transforms SimpleFinanceDash from a visually polished but cognitively complex app into a guided, intuitive budgeting experience. Work flows from a global design token rework (sharp edges, clearer pastels) through data safety foundations, a wizard-driven first-run setup, automatic budget creation, and finally a simplified budget view with inline item adding. Every phase delivers a coherent, verifiable capability on top of the fully working v1.0 baseline.
## Phases
**Phase Numbering:**
- Integer phases (5-9): v2.0 milestone work, continuing from v1.0's Phase 4
- Decimal phases: Urgent insertions if needed (marked INSERTED)
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
- [ ] **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
- [ ] **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
## Phase Details
### Phase 5: Design System Token Rework
**Goal**: Users see a sharp, minimal, clearly pastel UI across every page — the visual foundation that all subsequent phases build on
**Depends on**: Phase 4 (v1.0 complete)
**Requirements**: DS-01, DS-02, DS-03
**Success Criteria** (what must be TRUE):
1. Every rounded element across all 9 pages has sharp corners — no pill buttons, no rounded cards, no rounded inputs visible anywhere in the app
2. Category color swatches are visibly colorful against white backgrounds — not washed-out or grey-tinted — and still pass WCAG 4.5:1 contrast for text
3. Page layouts feel uncluttered — content sections have consistent whitespace gaps and no visual crowding between cards or sections
4. A full visual pass of all 9 pages (Dashboard, Budget List, Budget Detail, Template, Categories, Quick Add, Settings, Login, Register) confirms no regressions from token changes
**Plans**: TBD
### Phase 6: Preset Data, First-Run Detection, and DB Safety
**Goal**: The data layer is safe and ready — duplicate budget/category writes are impossible at the DB level, and the app correctly identifies first-run users
**Depends on**: Phase 5
**Requirements**: AUTO-01, AUTO-03, SETUP-01, SETUP-02
**Success Criteria** (what must be TRUE):
1. Attempting to create two budgets for the same user and month is rejected at the DB level (unique constraint on `budgets(user_id, start_date)`)
2. Attempting to create two categories with the same name for the same user is rejected at the DB level (unique constraint on `categories(user_id, name)`)
3. All existing v1.0 users have `profiles.setup_completed = true` after the backfill migration runs — they will not be shown the wizard on their next login
4. `useFirstRunState` hook returns `true` only for users with zero categories or zero template items — returning `false` for any user with existing data
5. `src/data/presets.ts` contains ~15-20 curated budget items with sensible default amounts, grouped by category type, with both English and German i18n translation keys defined
**Plans**: TBD
### Phase 7: Setup Wizard
**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
**Depends on**: Phase 6
**Requirements**: SETUP-01, SETUP-02, SETUP-03, SETUP-04, SETUP-05
**Success Criteria** (what must be TRUE):
1. A new user (zero categories, zero template items) is automatically redirected to `/setup` on their first login and sees a 3-step wizard: income entry, recurring items selection, and review
2. The recurring items step shows ~15-20 pre-filled common items (rent, groceries, car insurance, utilities, etc.) with editable default amounts — user can check or uncheck each
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**: TBD
### 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
**Depends on**: Phase 7
**Requirements**: AUTO-01, AUTO-02, AUTO-03
**Success Criteria** (what must be TRUE):
1. Navigating to the dashboard for a month that has no budget (but a populated template) creates the budget automatically — no button click or prompt required
2. The first time a budget is auto-created in a session, a toast notification appears naming the month and indicating it was created from the template — subsequent months are created silently
3. The auto-created budget uses the user's configured currency from their profile settings, not a hardcoded default
4. Rapidly navigating between months or opening the dashboard in two tabs does not produce duplicate budget rows
**Plans**: TBD
### Phase 9: Inline Add and Dashboard Simplification
**Goal**: Users add one-off items to their budget directly from the budget view, the Quick Add page is gone, and the dashboard shows this month's data at a glance without chart overload
**Depends on**: Phase 8
**Requirements**: BV-01, BV-02, BV-03, DASH-01, DASH-02, DASH-03
**Success Criteria** (what must be TRUE):
1. An "Add item" control on the budget detail page opens a Sheet panel showing the category library — user selects a category, enters an amount, and the item appears in the budget without a page navigation
2. The Quick Add page is removed from the sidebar navigation — visiting `/quick-add` redirects to `/budgets` instead of showing an error
3. The dashboard displays this month's summary cards (income, expenses, balance) with correct totals that match what the user entered in the budget detail page
4. The dashboard does not show the 3-column chart grid by default — the primary view is the at-a-glance summary and collapsible category sections
5. Empty template, empty dashboard, and empty budget view each show a clear empty state with a visible call-to-action guiding the user to the next step
**Plans**: TBD
## Requirements Traceability
| Requirement | Phase | Status |
|-------------|-------|--------|
| DS-01 | Phase 5 | Pending |
| DS-02 | Phase 5 | Pending |
| DS-03 | Phase 5 | Pending |
| SETUP-01 | Phase 6, 7 | Pending |
| SETUP-02 | Phase 6, 7 | Pending |
| SETUP-03 | Phase 7 | Pending |
| SETUP-04 | Phase 7 | Pending |
| SETUP-05 | Phase 7 | Pending |
| AUTO-01 | Phase 6, 8 | Pending |
| AUTO-02 | Phase 8 | Pending |
| AUTO-03 | Phase 6, 8 | Pending |
| BV-01 | Phase 9 | Pending |
| BV-02 | Phase 9 | Pending |
| BV-03 | Phase 9 | Pending |
| DASH-01 | Phase 9 | Pending |
| DASH-02 | Phase 9 | Pending |
| DASH-03 | Phase 9 | Pending |
**Coverage: 17/17 v2.0 requirements mapped. No orphans.**
## Progress
**Execution Order:**
Phases execute in numeric order: 5 → 6 → 7 → 8 → 9
| Phase | Plans Complete | Status | Completed |
|-------|----------------|--------|-----------|
| 5. Design System Token Rework | 0/? | Not started | - |
| 6. Preset Data, First-Run Detection, DB Safety | 0/? | Not started | - |
| 7. Setup Wizard | 0/? | Not started | - |
| 8. Auto-Budget Creation | 0/? | Not started | - |
| 9. Inline Add and Dashboard Simplification | 0/? | Not started | - |

View File

@@ -0,0 +1,219 @@
---
phase: 05-design-system-token-rework
plan: 01
type: execute
wave: 1
depends_on: []
files_modified:
- src/index.css
- src/components/dashboard/charts/SpendBarChart.tsx
- src/components/dashboard/charts/IncomeBarChart.tsx
- src/components/dashboard/charts/ExpenseDonutChart.tsx
autonomous: true
requirements:
- DS-01
- DS-02
must_haves:
truths:
- "--radius token is 0 in index.css, cascading sharp corners to all shadcn components"
- "Category fill colors have chroma >= 0.22 making them visibly colorful"
- "--color-chart-* variables are deleted from index.css"
- "Chart bars render with 0 radius (no rounded caps)"
- "CSS overrides exist for Recharts rectangles and Sonner toasts"
artifacts:
- path: "src/index.css"
provides: "Design token source of truth with --radius: 0, raised fill chromas, removed chart vars, third-party overrides"
contains: "--radius: 0"
- path: "src/components/dashboard/charts/SpendBarChart.tsx"
provides: "Spend bar chart with sharp bars"
contains: "radius={0}"
- path: "src/components/dashboard/charts/IncomeBarChart.tsx"
provides: "Income bar chart with sharp bars"
contains: "radius={0}"
- path: "src/components/dashboard/charts/ExpenseDonutChart.tsx"
provides: "Donut chart legend with square color dots"
key_links:
- from: "src/index.css"
to: "all shadcn components"
via: "--radius: 0 token cascade"
pattern: "--radius: 0"
- from: "src/index.css"
to: "chart components"
via: "--color-*-fill CSS variables"
pattern: "color-.*-fill"
---
<objective>
Edit design tokens in src/index.css (radius, colors, chart var removal, third-party overrides) and update chart component Bar radius props to 0.
Purpose: Establish the sharp-cornered, vibrant-pastel visual foundation that cascades to all shadcn components and charts.
Output: Modified index.css with new token values + CSS overrides; 3 chart component files with radius={0} and no rounded-full.
</objective>
<execution_context>
@.planning/phases/05-design-system-token-rework/05-RESEARCH.md
@.planning/phases/05-design-system-token-rework/05-PATTERNS.md
@.planning/phases/05-design-system-token-rework/05-UI-SPEC.md
</execution_context>
<context>
@.planning/ROADMAP.md
@.planning/STATE.md
<interfaces>
<!-- Current src/index.css @theme inline block (lines 5-79) is the single token source of truth -->
<!-- Chart components reference CSS variables via ChartConfig and Bar fill props -->
From src/components/dashboard/charts/SpendBarChart.tsx:
```tsx
const chartConfig = {
budgeted: { label: "Budgeted", color: "var(--color-budget-bar-bg)" },
actual: { label: "Actual", color: "var(--color-muted-foreground)" },
} satisfies ChartConfig
// Bar radius={4} on both Bar elements
// Cell fill uses var(--color-${entry.type}-fill) -- already correct
```
From src/components/dashboard/charts/IncomeBarChart.tsx:
```tsx
const chartConfig = {
budgeted: { label: "Budgeted", color: "var(--color-budget-bar-bg)" },
actual: { label: "Actual", color: "var(--color-income-fill)" },
} satisfies ChartConfig
// Bar radius={[4, 4, 0, 0]} on both Bar elements
```
From src/components/dashboard/charts/ExpenseDonutChart.tsx:
```tsx
// Line 141: <span className="inline-block size-3 shrink-0 rounded-full" .../>
// Uses var(--color-${entry.type}-fill) for legend dot colors -- already correct
```
</interfaces>
</context>
<tasks>
<task type="auto">
<name>Task 1: Edit design tokens and add CSS overrides in index.css</name>
<files>src/index.css</files>
<read_first>src/index.css</read_first>
<action>
Edit src/index.css with these exact changes:
1. Line 7: Change `--color-background: oklch(0.98 0.005 260)` to `--color-background: oklch(0.98 0.01 260)` (warm background chroma from 0.005 to 0.01).
2. Lines 52-57: DELETE the entire "Chart Colors" section (6 lines):
```
/* Chart Colors */
--color-chart-1: oklch(0.72 0.14 155);
--color-chart-2: oklch(0.7 0.14 25);
--color-chart-3: oklch(0.72 0.14 50);
--color-chart-4: oklch(0.65 0.16 355);
--color-chart-5: oklch(0.72 0.14 220);
```
3. Lines 65-70: Replace the 6 fill token values with raised chroma (0.22+):
```css
--color-income-fill: oklch(0.72 0.22 155);
--color-bill-fill: oklch(0.70 0.22 25);
--color-variable-expense-fill: oklch(0.74 0.22 50);
--color-debt-fill: oklch(0.66 0.23 355);
--color-saving-fill: oklch(0.72 0.22 220);
--color-investment-fill: oklch(0.68 0.22 285);
```
4. Line 72: Change `--radius: 0.625rem` to `--radius: 0`.
5. After the closing `}` of the `@layer base` block (after line 99), add CSS overrides for third-party components:
```css
/* Third-party radius overrides */
.recharts-rectangle {
rx: 0;
ry: 0;
}
[data-sonner-toast] {
border-radius: 0 !important;
}
```
</action>
<verify>
<automated>cd /home/jlmak/Projects/jlmak/SimpleFinanceDash && bun run build</automated>
</verify>
<acceptance_criteria>
- src/index.css contains `--radius: 0;`
- src/index.css contains `--color-background: oklch(0.98 0.01 260)`
- src/index.css contains `--color-income-fill: oklch(0.72 0.22 155)`
- src/index.css contains `--color-bill-fill: oklch(0.70 0.22 25)`
- src/index.css contains `--color-variable-expense-fill: oklch(0.74 0.22 50)`
- src/index.css contains `--color-debt-fill: oklch(0.66 0.23 355)`
- src/index.css contains `--color-saving-fill: oklch(0.72 0.22 220)`
- src/index.css contains `--color-investment-fill: oklch(0.68 0.22 285)`
- src/index.css does NOT contain `--color-chart-1` or `--color-chart-2` or `--color-chart-3` or `--color-chart-4` or `--color-chart-5`
- src/index.css contains `.recharts-rectangle`
- src/index.css contains `[data-sonner-toast]`
- `bun run build` exits 0
</acceptance_criteria>
<done>index.css has --radius: 0, raised fill chromas (0.22+), deleted chart vars, warmed background, and CSS overrides for Recharts and Sonner</done>
</task>
<task type="auto">
<name>Task 2: Update chart component Bar radius props and remove hardcoded rounded-full</name>
<files>src/components/dashboard/charts/SpendBarChart.tsx, src/components/dashboard/charts/IncomeBarChart.tsx, src/components/dashboard/charts/ExpenseDonutChart.tsx</files>
<read_first>src/components/dashboard/charts/SpendBarChart.tsx, src/components/dashboard/charts/IncomeBarChart.tsx, src/components/dashboard/charts/ExpenseDonutChart.tsx</read_first>
<action>
1. In SpendBarChart.tsx: Find the two `<Bar` elements. Change `radius={4}` to `radius={0}` on both Bar components. Do NOT change ChartConfig colors -- they are already correct (budgeted uses --color-budget-bar-bg, actual Cell uses var(--color-${entry.type}-fill)).
2. In IncomeBarChart.tsx: Find the two `<Bar` elements. Change `radius={[4, 4, 0, 0]}` to `radius={0}` on both Bar components. Do NOT change ChartConfig colors -- they are already correct (actual uses --color-income-fill).
3. In ExpenseDonutChart.tsx: Find line 141 (the legend color dot span). Remove `rounded-full` from the className string. The className should go from `"inline-block size-3 shrink-0 rounded-full"` to `"inline-block size-3 shrink-0"`. No other changes needed in this file.
</action>
<verify>
<automated>cd /home/jlmak/Projects/jlmak/SimpleFinanceDash && bun run build</automated>
</verify>
<acceptance_criteria>
- SpendBarChart.tsx contains `radius={0}` (grep returns 2 matches)
- SpendBarChart.tsx does NOT contain `radius={4}`
- IncomeBarChart.tsx contains `radius={0}` (grep returns 2 matches)
- IncomeBarChart.tsx does NOT contain `radius={[4, 4, 0, 0]}`
- ExpenseDonutChart.tsx does NOT contain `rounded-full`
- ExpenseDonutChart.tsx contains `"inline-block size-3 shrink-0"`
- `bun run build` exits 0
</acceptance_criteria>
<done>All 3 chart components have sharp bars (radius={0}) and the donut legend dot is square (no rounded-full)</done>
</task>
</tasks>
<threat_model>
## Trust Boundaries
No trust boundaries affected. This plan modifies CSS tokens and SVG presentation props only. No user input handling, no data access, no authentication changes.
## STRIDE Threat Register
| Threat ID | Category | Component | Disposition | Mitigation Plan |
|-----------|----------|-----------|-------------|-----------------|
| — | — | — | — | No applicable threats — pure CSS/visual changes |
</threat_model>
<verification>
- `bun run build` passes after both tasks
- grep confirms --radius: 0 in index.css
- grep confirms no --color-chart-* references remain in src/
- grep confirms radius={0} in both bar chart components
</verification>
<success_criteria>
- Token cascade makes all shadcn components sharp-cornered (verified by --radius: 0 in index.css)
- Category fill colors raised to 0.22+ chroma (verified by grep on index.css)
- Chart color duplication eliminated (--color-chart-* deleted, verified by grep)
- Chart bars render with sharp ends (radius={0} in both bar chart files)
- CSS overrides exist for Recharts SVG and Sonner toasts
- Build passes cleanly
</success_criteria>
<output>
After completion, create `.planning/phases/05-design-system-token-rework/05-01-SUMMARY.md`
</output>

View File

@@ -0,0 +1,101 @@
---
phase: 05-design-system-token-rework
plan: "01"
subsystem: frontend/design-system
tags: [css-tokens, design-system, charts, oklch, recharts]
dependency_graph:
requires: []
provides:
- "--radius: 0 token cascade to all shadcn components"
- "Raised fill chroma (0.22+) for category colors"
- "Eliminated --color-chart-* duplication"
- "Sharp bar chart rendering via radius={0}"
- "Square legend dots in donut chart"
affects:
- "All shadcn/ui components (border-radius cascade)"
- "SpendBarChart, IncomeBarChart, ExpenseDonutChart"
- "Recharts SVG rectangles (CSS override)"
- "Sonner toasts (CSS override)"
tech_stack:
added: []
patterns:
- "OKLCH color system with raised chroma (0.22+) for vivid pastels"
- "CSS --radius: 0 token for sharp-cornered design cascade"
- "Third-party radius overrides via selector targeting"
key_files:
created: []
modified:
- src/index.css
- src/components/dashboard/charts/SpendBarChart.tsx
- src/components/dashboard/charts/IncomeBarChart.tsx
- src/components/dashboard/charts/ExpenseDonutChart.tsx
decisions:
- "Use rx/ry SVG attributes in .recharts-rectangle rule rather than border-radius (SVG does not support border-radius)"
- "Delete --color-chart-* vars entirely — fill vars cover all use cases, no consumers of chart-* remain"
metrics:
duration: "~8 minutes"
completed: "2026-04-20"
tasks_completed: 2
tasks_total: 2
files_modified: 4
---
# Phase 05 Plan 01: Design Token Foundation Summary
**One-liner:** Established sharp-cornered OKLCH pastel design foundation with --radius: 0 cascade, raised fill chroma to 0.22+, deleted redundant chart color vars, and set chart bars to radius={0} with square legend dots.
## Tasks Completed
| Task | Name | Commit | Key Changes |
|------|------|--------|-------------|
| 1 | Edit design tokens and add CSS overrides in index.css | 99b5b5f | --radius: 0, chroma 0.22+, deleted chart vars, warmed bg, Recharts/Sonner overrides |
| 2 | Update chart Bar radius props and remove rounded-full | 4c74dec | SpendBarChart radius={0}x2, IncomeBarChart radius={0}x2, ExpenseDonutChart legend dot square |
## What Was Built
### index.css Changes
- `--color-background` chroma raised from 0.005 to 0.01 (warmer background)
- `--color-chart-1` through `--color-chart-5` deleted (6 lines removed — no remaining consumers)
- All 6 `--color-*-fill` variables raised to chroma 0.22+ for vibrant pastels:
- income: 0.19 → 0.22, bill: 0.19 → 0.22, variable-expense: 0.18 → 0.22
- debt: 0.20 → 0.23, saving: 0.18 → 0.22, investment: 0.18 → 0.22
- `--radius` changed from 0.625rem to 0 — cascades sharp corners to all shadcn components
- `.recharts-rectangle { rx: 0; ry: 0; }` override added (SVG attribute approach)
- `[data-sonner-toast] { border-radius: 0 !important; }` override added
### Chart Component Changes
- `SpendBarChart.tsx`: Both `<Bar>` elements changed from `radius={4}` to `radius={0}`
- `IncomeBarChart.tsx`: Both `<Bar>` elements changed from `radius={[4, 4, 0, 0]}` to `radius={0}`
- `ExpenseDonutChart.tsx`: Legend color dot span: removed `rounded-full` from className
## Verification
All acceptance criteria confirmed by grep and build:
- `--radius: 0` present in index.css
- `--color-chart-1` through `--color-chart-5` absent from src/
- `radius={0}` present (2 matches each) in SpendBarChart and IncomeBarChart
- `rounded-full` absent from ExpenseDonutChart
- `.recharts-rectangle` and `[data-sonner-toast]` present in index.css
- `bun run build` exits 0 (TypeScript + Vite both pass)
## Deviations from Plan
None — plan executed exactly as written.
## Known Stubs
None — all token values are real OKLCH colors wired to actual chart and UI components.
## Threat Flags
None — pure CSS/visual changes with no trust boundary impact.
## Self-Check: PASSED
- [x] `src/index.css` exists and contains all required tokens
- [x] `src/components/dashboard/charts/SpendBarChart.tsx` contains `radius={0}`
- [x] `src/components/dashboard/charts/IncomeBarChart.tsx` contains `radius={0}`
- [x] `src/components/dashboard/charts/ExpenseDonutChart.tsx` has no `rounded-full`
- [x] Commit 99b5b5f exists (Task 1)
- [x] Commit 4c74dec exists (Task 2)
- [x] Build passes cleanly

View File

@@ -0,0 +1,178 @@
---
phase: 05-design-system-token-rework
plan: 02
type: execute
wave: 1
depends_on: []
files_modified:
- src/components/shared/PageShell.tsx
- src/components/dashboard/DashboardSkeleton.tsx
- src/components/dashboard/CategorySection.tsx
- src/components/dashboard/charts/ChartEmptyState.tsx
- src/components/QuickAddPicker.tsx
autonomous: true
requirements:
- DS-01
- DS-03
must_haves:
truths:
- "PageShell gap is gap-8 providing generous header-to-content spacing on all pages"
- "All shared component hardcoded rounded-* classes are removed"
- "DashboardSkeleton spacing matches the upgraded gap/space-y values"
- "No pill-shaped skeleton placeholders remain in shared components"
artifacts:
- path: "src/components/shared/PageShell.tsx"
provides: "Layout shell with gap-8 section spacing"
contains: "gap-8"
- path: "src/components/dashboard/DashboardSkeleton.tsx"
provides: "Dashboard loading skeleton with sharp corners and upgraded spacing"
- path: "src/components/dashboard/CategorySection.tsx"
provides: "Category section trigger without rounded-md"
- path: "src/components/dashboard/charts/ChartEmptyState.tsx"
provides: "Chart empty state without rounded-lg"
- path: "src/components/QuickAddPicker.tsx"
provides: "Quick add picker without rounded-sm or rounded-full"
key_links:
- from: "src/components/shared/PageShell.tsx"
to: "all 9 pages"
via: "PageShell wrapper component"
pattern: "gap-8"
---
<objective>
Remove hardcoded rounded-* classes and upgrade spacing in shared components (PageShell, DashboardSkeleton, CategorySection, ChartEmptyState, QuickAddPicker).
Purpose: These shared components are used across multiple pages. Fixing them first ensures consistent sharp corners and generous spacing everywhere they appear.
Output: 5 modified component files with no hardcoded rounding and upgraded spacing values.
</objective>
<execution_context>
@.planning/phases/05-design-system-token-rework/05-RESEARCH.md
@.planning/phases/05-design-system-token-rework/05-PATTERNS.md
</execution_context>
<context>
@.planning/ROADMAP.md
@.planning/STATE.md
<interfaces>
From src/components/shared/PageShell.tsx (line 15):
```tsx
<div className="flex flex-col gap-6"> <!-- gap-6 --> gap-8 -->
```
From src/components/dashboard/DashboardSkeleton.tsx:
```tsx
// Line 20: <div className="flex flex-col gap-6"> -- gap-8
// Line 22: <div className="grid gap-4 sm:grid-cols-2..."> -- gap-6
// Line 29: <div className="grid gap-6 md:grid-cols-2..."> -- gap-8
// Line 35,43,51: <Skeleton className="h-[250px] w-full rounded-md" /> -- remove rounded-md
// Line 59: <div className="... rounded-md border-l-4 ..."> -- remove rounded-md
// Lines 63-64: <Skeleton className="h-5 w-24 rounded-full" /> -- remove rounded-full
```
From src/components/dashboard/CategorySection.tsx (line 73):
```tsx
<button className="... rounded-md border-l-4 bg-card px-4 py-3 ...">
```
From src/components/dashboard/charts/ChartEmptyState.tsx (line 12):
```tsx
className={cn("... rounded-lg border border-dashed ...", className)}
```
From src/components/QuickAddPicker.tsx:
```tsx
// Line 156: className="... rounded-sm px-2 py-1.5 ..."
// Line 201: <div className="size-2 rounded-full" .../>
```
</interfaces>
</context>
<tasks>
<task type="auto">
<name>Task 1: Upgrade PageShell spacing and remove rounded-* from DashboardSkeleton</name>
<files>src/components/shared/PageShell.tsx, src/components/dashboard/DashboardSkeleton.tsx</files>
<read_first>src/components/shared/PageShell.tsx, src/components/dashboard/DashboardSkeleton.tsx</read_first>
<action>
1. In PageShell.tsx line 15: Change `gap-6` to `gap-8` in the className string `"flex flex-col gap-6"`.
2. In DashboardSkeleton.tsx, make all of the following changes:
- Line 20: Change `gap-6` to `gap-8` in `"flex flex-col gap-6"`
- Line 22: Change `gap-4` to `gap-6` in `"grid gap-4 sm:grid-cols-2 lg:grid-cols-3"`
- Line 29: Change `gap-6` to `gap-8` in `"grid gap-6 md:grid-cols-2 lg:grid-cols-3"`
- Lines 35, 43, 51: Remove `rounded-md` from `<Skeleton className="h-[250px] w-full rounded-md" />` (3 occurrences). Result: `className="h-[250px] w-full"`
- Line 59: Remove `rounded-md` from the div className `"flex items-center gap-3 rounded-md border-l-4 ..."`. The border-l-4 remains.
- Lines 63, 64: Remove `rounded-full` from `<Skeleton className="h-5 w-24 rounded-full" />` (2 occurrences). Result: `className="h-5 w-24"`
</action>
<verify>
<automated>cd /home/jlmak/Projects/jlmak/SimpleFinanceDash && bun run build</automated>
</verify>
<acceptance_criteria>
- PageShell.tsx contains `gap-8` and does NOT contain `gap-6`
- DashboardSkeleton.tsx does NOT contain `rounded-md` or `rounded-full`
- DashboardSkeleton.tsx contains `gap-8` (2 occurrences) and `gap-6` (1 occurrence for the summary cards grid)
- `bun run build` exits 0
</acceptance_criteria>
<done>PageShell uses gap-8 for header-to-content spacing; DashboardSkeleton has no hardcoded rounding and upgraded spacing</done>
</task>
<task type="auto">
<name>Task 2: Remove rounded-* from CategorySection, ChartEmptyState, and QuickAddPicker</name>
<files>src/components/dashboard/CategorySection.tsx, src/components/dashboard/charts/ChartEmptyState.tsx, src/components/QuickAddPicker.tsx</files>
<read_first>src/components/dashboard/CategorySection.tsx, src/components/dashboard/charts/ChartEmptyState.tsx, src/components/QuickAddPicker.tsx</read_first>
<action>
1. In CategorySection.tsx line 73: Remove `rounded-md` from the button className. The className goes from `"group flex w-full items-center gap-3 rounded-md border-l-4 bg-card px-4 py-3 text-left hover:bg-muted/40 transition-colors"` to `"group flex w-full items-center gap-3 border-l-4 bg-card px-4 py-3 text-left hover:bg-muted/40 transition-colors"`.
2. In ChartEmptyState.tsx line 12: Remove `rounded-lg` from the cn() className string. The class goes from `"flex min-h-[250px] w-full items-center justify-center rounded-lg border border-dashed ..."` to `"flex min-h-[250px] w-full items-center justify-center border border-dashed ..."`.
3. In QuickAddPicker.tsx:
- Line 156: Remove `rounded-sm` from the picker item className. Goes from `"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 ..."` to `"flex w-full items-center gap-2 px-2 py-1.5 ..."`.
- Line 201: Remove `rounded-full` from the category dot className. Goes from `className="size-2 rounded-full"` to `className="size-2"`.
</action>
<verify>
<automated>cd /home/jlmak/Projects/jlmak/SimpleFinanceDash && bun run build</automated>
</verify>
<acceptance_criteria>
- CategorySection.tsx does NOT contain `rounded-md`
- ChartEmptyState.tsx does NOT contain `rounded-lg`
- QuickAddPicker.tsx does NOT contain `rounded-sm` or `rounded-full`
- `bun run build` exits 0
</acceptance_criteria>
<done>All 3 shared components have no hardcoded rounding classes; sharp corners enforced everywhere they appear</done>
</task>
</tasks>
<threat_model>
## Trust Boundaries
No trust boundaries affected. This plan modifies CSS class strings in component JSX only. No user input handling, no data access, no authentication changes.
## STRIDE Threat Register
| Threat ID | Category | Component | Disposition | Mitigation Plan |
|-----------|----------|-----------|-------------|-----------------|
| — | — | — | — | No applicable threats — pure CSS class changes |
</threat_model>
<verification>
- `bun run build` passes after both tasks
- grep confirms no `rounded-md`, `rounded-full`, `rounded-lg`, `rounded-sm` remain in the 5 modified files
- grep confirms `gap-8` in PageShell.tsx
</verification>
<success_criteria>
- PageShell provides gap-8 section spacing to all pages
- DashboardSkeleton has sharp skeletons and upgraded spacing
- CategorySection trigger button has no rounded corners
- ChartEmptyState border has no rounded corners
- QuickAddPicker items and dots have no rounded corners
- Build passes cleanly
</success_criteria>
<output>
After completion, create `.planning/phases/05-design-system-token-rework/05-02-SUMMARY.md`
</output>

View File

@@ -0,0 +1,108 @@
---
phase: 05-design-system-token-rework
plan: "02"
subsystem: frontend-components
tags: [design-system, sharp-corners, spacing, shared-components]
dependency_graph:
requires: []
provides: [sharp-corners-in-shared-components, gap-8-page-spacing]
affects: [all-9-pages, dashboard-skeleton, category-sections, chart-empty-states, quick-add-picker]
tech_stack:
added: []
patterns: [remove-hardcoded-rounded-classes, upgrade-gap-spacing]
key_files:
modified:
- src/components/shared/PageShell.tsx
- src/components/dashboard/DashboardSkeleton.tsx
- src/components/dashboard/CategorySection.tsx
- src/components/dashboard/charts/ChartEmptyState.tsx
- src/components/QuickAddPicker.tsx
decisions:
- "Upgraded DashboardSkeleton summary-cards grid from gap-4 to gap-6 (not gap-8) to match plan spec for the inner card grid"
- "Upgraded DashboardSkeleton chart grid from gap-6 to gap-8 as specified"
metrics:
duration: "91s"
completed: "2026-04-20"
tasks_completed: 2
tasks_total: 2
files_modified: 5
---
# Phase 05 Plan 02: Shared Component Rounding and Spacing Cleanup Summary
Sharp corners enforced across all 5 shared components by removing hardcoded `rounded-*` classes, and page-level spacing upgraded from `gap-6` to `gap-8` in PageShell propagating to all 9 pages.
## Tasks Completed
| Task | Name | Commit | Files Modified |
|------|------|--------|----------------|
| 1 | Upgrade PageShell spacing and remove rounded-* from DashboardSkeleton | e8f13c9 | PageShell.tsx, DashboardSkeleton.tsx |
| 2 | Remove rounded-* from CategorySection, ChartEmptyState, QuickAddPicker | e7282fa | CategorySection.tsx, ChartEmptyState.tsx, QuickAddPicker.tsx |
## Changes Made
### Task 1: PageShell + DashboardSkeleton
**PageShell.tsx**
- `gap-6``gap-8` in the root flex container (line 15) — applies generous section spacing across all 9 pages
**DashboardSkeleton.tsx**
- Outer flex: `gap-6``gap-8`
- Summary cards grid: `gap-4``gap-6`
- Chart area grid: `gap-6``gap-8`
- Removed `rounded-md` from 3 chart skeleton `<Skeleton>` elements
- Removed `rounded-md` from collapsible section row `<div>`
- Removed `rounded-full` from 2 badge `<Skeleton>` elements (2 occurrences via replace_all)
### Task 2: CategorySection + ChartEmptyState + QuickAddPicker
**CategorySection.tsx**
- Removed `rounded-md` from collapsible trigger `<button>` — sharp left-bordered row maintained via `border-l-4`
**ChartEmptyState.tsx**
- Removed `rounded-lg` from the dashed-border container div — sharp rectangular empty state
**QuickAddPicker.tsx**
- Removed `rounded-sm` from picker item `<button>` elements in the popover list
- Removed `rounded-full` from the category type dot indicator `<div>`
## Verification
```
bun run build → exit 0 (both tasks)
grep rounded-md PageShell.tsx → 0 matches
grep rounded-md DashboardSkeleton.tsx → 0 matches
grep rounded-full DashboardSkeleton.tsx → 0 matches
grep rounded-md CategorySection.tsx → 0 matches
grep rounded-lg ChartEmptyState.tsx → 0 matches
grep rounded-sm QuickAddPicker.tsx → 0 matches
grep rounded-full QuickAddPicker.tsx → 0 matches
grep gap-8 PageShell.tsx → 1 match ✓
```
## Deviations from Plan
None — plan executed exactly as written.
## Known Stubs
None — this plan modifies only CSS class strings. No data wiring or UI stubs introduced.
## Threat Flags
None — pure CSS class changes, no security-relevant surface modified.
## Self-Check
**Commits exist:**
- e8f13c9: feat(05-02): upgrade PageShell spacing to gap-8 and remove rounded-* from DashboardSkeleton
- e7282fa: feat(05-02): remove hardcoded rounded-* from CategorySection, ChartEmptyState, QuickAddPicker
**Files exist:**
- src/components/shared/PageShell.tsx — modified
- src/components/dashboard/DashboardSkeleton.tsx — modified
- src/components/dashboard/CategorySection.tsx — modified
- src/components/dashboard/charts/ChartEmptyState.tsx — modified
- src/components/QuickAddPicker.tsx — modified
## Self-Check: PASSED

View File

@@ -0,0 +1,249 @@
---
phase: 05-design-system-token-rework
plan: 03
type: execute
wave: 2
depends_on:
- 05-01
- 05-02
files_modified:
- src/pages/DashboardPage.tsx
- src/pages/BudgetListPage.tsx
- src/pages/BudgetDetailPage.tsx
- src/pages/TemplatePage.tsx
- src/pages/CategoriesPage.tsx
- src/pages/QuickAddPage.tsx
- src/pages/SettingsPage.tsx
- src/pages/LoginPage.tsx
- src/pages/RegisterPage.tsx
autonomous: false
requirements:
- DS-01
- DS-02
- DS-03
must_haves:
truths:
- "All 9 pages have no hardcoded rounded-* classes remaining"
- "All 9 pages have upgraded spacing (space-y-8, gap-8 for sections)"
- "Visual pass confirms sharp corners, colorful pastels, and generous whitespace everywhere"
artifacts:
- path: "src/pages/DashboardPage.tsx"
provides: "Dashboard with space-y-8 and gap-8 section spacing"
contains: "space-y-8"
- path: "src/pages/BudgetListPage.tsx"
provides: "Budget list without rounded-md on row containers"
- path: "src/pages/BudgetDetailPage.tsx"
provides: "Budget detail without rounded-sm/md/full, upgraded spacing"
- path: "src/pages/TemplatePage.tsx"
provides: "Template page without rounded-sm/full, upgraded spacing"
- path: "src/pages/CategoriesPage.tsx"
provides: "Categories page without rounded-sm/full, upgraded spacing"
- path: "src/pages/QuickAddPage.tsx"
provides: "Quick add page without rounded-full/md"
- path: "src/pages/SettingsPage.tsx"
provides: "Settings page with space-y-6 card content spacing"
- path: "src/pages/LoginPage.tsx"
provides: "Login page verified (token cascade handles Card rounding)"
- path: "src/pages/RegisterPage.tsx"
provides: "Register page verified (token cascade handles Card rounding)"
key_links:
- from: "all 9 pages"
to: "src/index.css"
via: "--radius: 0 token cascade through Tailwind utilities"
pattern: "no rounded-full or rounded-sm or rounded-md classes remain"
---
<objective>
Sweep all 9 pages to remove hardcoded rounded-* classes and upgrade spacing values. Finish with a visual verification checkpoint across all pages.
Purpose: Complete the per-page visual rework ensuring DS-01 (sharp edges), DS-02 (colorful pastels visible), and DS-03 (generous whitespace) are met everywhere.
Output: 9 modified page files with no rounding and upgraded spacing + visual confirmation.
</objective>
<execution_context>
@.planning/phases/05-design-system-token-rework/05-RESEARCH.md
@.planning/phases/05-design-system-token-rework/05-PATTERNS.md
@.planning/phases/05-design-system-token-rework/05-UI-SPEC.md
</execution_context>
<context>
@.planning/ROADMAP.md
@.planning/STATE.md
@.planning/phases/05-design-system-token-rework/05-01-SUMMARY.md
@.planning/phases/05-design-system-token-rework/05-02-SUMMARY.md
<interfaces>
<!-- From 05-PATTERNS.md: Complete inventory of hardcoded rounded-* per page -->
DashboardPage.tsx: No hardcoded rounded-* classes. Spacing: space-y-6 -> space-y-8 (line 186), gap-6 -> gap-8 (line 207).
BudgetListPage.tsx: Line 243 rounded-md on row div. Spacing: gap-4 -> gap-6, gap-6 -> gap-8, space-y-6 -> space-y-8 where present.
BudgetDetailPage.tsx: Lines 290 (rounded-sm), 303 (rounded-md), 353 (rounded-sm), 439 (rounded-md), 497 (rounded-full). Spacing: verify no space-y-6/gap-6 remain.
TemplatePage.tsx: Lines 250 (rounded-sm), 256 (rounded-full), 258 (rounded-md), 292 (rounded-sm), 385 (rounded-full). Spacing: 247 space-y-6->space-y-8, 268 gap-6->gap-8, 287 space-y-6->space-y-8.
CategoriesPage.tsx: Lines 101 (rounded-sm), 107 (rounded-full), 108 (rounded-md), 134 (rounded-sm). Spacing: 98 space-y-6->space-y-8, 130 space-y-6->space-y-8.
QuickAddPage.tsx: Lines 98 (rounded-full), 100 (rounded-md). No major spacing changes.
SettingsPage.tsx: No rounded-* classes. Spacing: line 87 space-y-4->space-y-6 in CardContent.
LoginPage.tsx: No rounded-* classes. Token cascade handles Card. Verify p-4->p-6 if card content wrapper has p-4.
RegisterPage.tsx: No rounded-* classes. Token cascade handles Card. Verify p-4->p-6 if card content wrapper has p-4.
</interfaces>
</context>
<tasks>
<task type="auto">
<name>Task 1: Remove rounded-* and upgrade spacing on all 9 pages</name>
<files>src/pages/DashboardPage.tsx, src/pages/BudgetListPage.tsx, src/pages/BudgetDetailPage.tsx, src/pages/TemplatePage.tsx, src/pages/CategoriesPage.tsx, src/pages/QuickAddPage.tsx, src/pages/SettingsPage.tsx, src/pages/LoginPage.tsx, src/pages/RegisterPage.tsx</files>
<read_first>src/pages/DashboardPage.tsx, src/pages/BudgetListPage.tsx, src/pages/BudgetDetailPage.tsx, src/pages/TemplatePage.tsx, src/pages/CategoriesPage.tsx, src/pages/QuickAddPage.tsx, src/pages/SettingsPage.tsx, src/pages/LoginPage.tsx, src/pages/RegisterPage.tsx</read_first>
<action>
Apply two categories of changes to each page: (A) remove hardcoded rounded-* classes, (B) upgrade spacing values. Use the exact inventory from 05-PATTERNS.md.
**DashboardPage.tsx:**
- (B) Line ~186: `space-y-6` -> `space-y-8`
- (B) Line ~207: `gap-6` -> `gap-8`
**BudgetListPage.tsx:**
- (A) Line ~243: Remove `rounded-md` from `"flex items-center gap-3 rounded-md border p-3"` -> `"flex items-center gap-3 border p-3"`
- (B) Upgrade any `gap-4` -> `gap-6`, `gap-6` -> `gap-8`, `space-y-6` -> `space-y-8` found in the file
**BudgetDetailPage.tsx:**
- (A) Line ~290: Remove `rounded-sm` from skeleton header div className
- (A) Line ~303: Remove `rounded-md` from `<Skeleton>` className
- (A) Line ~353: Remove `rounded-sm` from group heading div className `"mb-2 flex items-center gap-3 rounded-sm border-l-4 bg-muted/30 px-3 py-2"` -> `"mb-2 flex items-center gap-3 border-l-4 bg-muted/30 px-3 py-2"`
- (A) Line ~439: Remove `rounded-md` from summary box `"rounded-md border p-4"` -> `"border p-4"`
- (A) Line ~497: Remove `rounded-full` from SelectLabel category dot `"size-2 rounded-full"` -> `"size-2"`
- (B) Verify existing space-y-8 at line ~338 is correct. Upgrade any remaining space-y-6 or gap-6 instances.
**TemplatePage.tsx:**
- (A) Line ~250: Remove `rounded-sm` from skeleton group heading div
- (A) Line ~256: Remove `rounded-full` from `<Skeleton>` className
- (A) Line ~258: Remove `rounded-md` from `<Skeleton>` className
- (A) Line ~292: Remove `rounded-sm` from template item group heading div `"mb-2 flex items-center gap-3 rounded-sm border-l-4 bg-muted/30 px-3 py-2"` -> `"mb-2 flex items-center gap-3 border-l-4 bg-muted/30 px-3 py-2"`
- (A) Line ~385: Remove `rounded-full` from SelectLabel category dot `"size-2 rounded-full"` -> `"size-2"`
- (B) Line ~247: `space-y-6` -> `space-y-8`
- (B) Line ~268: `gap-6` -> `gap-8`
- (B) Line ~287: `space-y-6` -> `space-y-8`
**CategoriesPage.tsx:**
- (A) Line ~101: Remove `rounded-sm` from skeleton group heading div
- (A) Line ~107: Remove `rounded-full` from `<Skeleton>` className
- (A) Line ~108: Remove `rounded-md` from `<Skeleton>` className
- (A) Line ~134: Remove `rounded-sm` from category group heading div `"mb-2 flex items-center gap-3 rounded-sm border-l-4 bg-muted/30 px-3 py-2"` -> `"mb-2 flex items-center gap-3 border-l-4 bg-muted/30 px-3 py-2"`
- (B) Line ~98: `space-y-6` -> `space-y-8`
- (B) Line ~130: `space-y-6` -> `space-y-8`
**QuickAddPage.tsx:**
- (A) Line ~98: Remove `rounded-full` from `<Skeleton>` className
- (A) Line ~100: Remove `rounded-md` from `<Skeleton>` className
**SettingsPage.tsx:**
- (B) Line ~87: `space-y-4` -> `space-y-6` in CardContent className
- (B) Also check skeleton equivalent (~line 69) for same `space-y-4` -> `space-y-6`
**LoginPage.tsx:**
- No rounded-* to remove (Card uses token cascade).
- (B) Check for any `p-4` on card content wrappers and upgrade to `p-6` if found. If no `p-4` exists (CardContent already uses px-6 from shadcn defaults), no change needed.
**RegisterPage.tsx:**
- Same as LoginPage -- check for `p-4` card content wrapper upgrades.
**IMPORTANT:** Line numbers are approximate from the PATTERNS.md inventory. Read each file first to find the exact locations. Search for the exact class strings listed above.
</action>
<verify>
<automated>cd /home/jlmak/Projects/jlmak/SimpleFinanceDash && bun run build && grep -rn "rounded-full\|rounded-sm\|rounded-md\|rounded-lg" src/pages/ || echo "NO HARDCODED ROUNDED CLASSES FOUND IN PAGES - PASS"</automated>
</verify>
<acceptance_criteria>
- grep -rn "rounded-full\|rounded-sm\|rounded-md\|rounded-lg" src/pages/ returns NO matches
- DashboardPage.tsx contains `space-y-8` and `gap-8`
- BudgetListPage.tsx does NOT contain `rounded-md`
- BudgetDetailPage.tsx does NOT contain `rounded-sm` or `rounded-md` or `rounded-full`
- TemplatePage.tsx does NOT contain `rounded-sm` or `rounded-full` or `rounded-md`
- CategoriesPage.tsx does NOT contain `rounded-sm` or `rounded-full` or `rounded-md`
- QuickAddPage.tsx does NOT contain `rounded-full` or `rounded-md`
- SettingsPage.tsx contains `space-y-6` in CardContent
- `bun run build` exits 0
</acceptance_criteria>
<done>All 9 pages have zero hardcoded rounded-* classes and upgraded spacing values</done>
</task>
<task type="checkpoint:human-verify" gate="blocking">
<name>Task 2: Visual verification of all 9 pages</name>
<what-built>
Complete design system token rework across all files:
- --radius: 0 (sharp corners on all shadcn components)
- Category fill colors raised to 0.22+ chroma (vibrant pastels)
- Background warmed to 0.01 chroma
- Chart color vars deleted and replaced with fill token references
- All hardcoded rounded-* classes removed from pages and shared components
- Spacing upgraded: gap-8 section gaps, space-y-8 section rhythm, p-6 card padding
- CSS overrides for Recharts bars and Sonner toasts
</what-built>
<how-to-verify>
1. Run `bun run dev` to start the dev server
2. Open the app in your browser
3. Check each of the 9 pages against this checklist:
**Sharp corners (DS-01):**
- [ ] Dashboard: Cards, buttons, chart containers all have sharp corners
- [ ] Budget List: Row containers have sharp corners
- [ ] Budget Detail: Group headings, summary box, select dots all sharp
- [ ] Template: Group headings, skeleton placeholders, category dots all sharp
- [ ] Categories: Group headings, skeleton placeholders all sharp
- [ ] Quick Add: Picker items, category dots all sharp
- [ ] Settings: Card and form elements all sharp
- [ ] Login: Auth card sharp
- [ ] Register: Auth card sharp
- [ ] Recharts bar charts have square ends (no rounded caps)
- [ ] Any toast notifications have sharp corners
**Colorful pastels (DS-02):**
- [ ] Category color swatches are visibly colorful against white backgrounds (not washed-out or grey)
- [ ] Chart bar colors are vibrant and distinct from each other
**Generous whitespace (DS-03):**
- [ ] Section gaps feel spacious (not crowded)
- [ ] Card internal padding feels generous
- [ ] Page headers have consistent spacing before first content section
</how-to-verify>
<resume-signal>Type "approved" if all checks pass, or describe any visual issues found</resume-signal>
</task>
</tasks>
<threat_model>
## Trust Boundaries
No trust boundaries affected. This plan modifies CSS class strings in page JSX only.
## STRIDE Threat Register
| Threat ID | Category | Component | Disposition | Mitigation Plan |
|-----------|----------|-----------|-------------|-----------------|
| — | — | — | — | No applicable threats — pure CSS class changes |
</threat_model>
<verification>
- `bun run build` passes
- grep confirms zero rounded-full/sm/md/lg in src/pages/
- Human visual pass confirms all 9 pages meet DS-01, DS-02, DS-03
</verification>
<success_criteria>
- Zero hardcoded rounded-* classes remain across all 9 page files
- All spacing values upgraded per the mapping (space-y-8, gap-8 for sections)
- Human confirms sharp corners visible on every page
- Human confirms category colors are vibrant (not grey/washed-out)
- Human confirms generous whitespace between sections
- Build passes cleanly
</success_criteria>
<output>
After completion, create `.planning/phases/05-design-system-token-rework/05-03-SUMMARY.md`
</output>

View File

@@ -0,0 +1,110 @@
---
phase: 05-design-system-token-rework
plan: "03"
subsystem: frontend/pages
tags: [design-system, pages, spacing, rounding, tailwind]
dependency_graph:
requires: [05-01, 05-02]
provides: [clean-pages-no-rounding, upgraded-page-spacing]
affects: [all-9-pages]
tech_stack:
added: []
patterns: [tailwind-utility-sweep, rounding-removal, spacing-upgrade]
key_files:
modified:
- src/pages/DashboardPage.tsx
- src/pages/BudgetListPage.tsx
- src/pages/BudgetDetailPage.tsx
- src/pages/TemplatePage.tsx
- src/pages/CategoriesPage.tsx
- src/pages/QuickAddPage.tsx
- src/pages/SettingsPage.tsx
decisions:
- "LoginPage and RegisterPage required no changes: no rounded-* classes present and CardContent already uses shadcn px-6 default padding"
metrics:
duration: "129s"
completed: "2026-04-20T15:16:38Z"
tasks_completed: 2
files_modified: 7
---
# Phase 05 Plan 03: Page Rounding Sweep and Spacing Upgrade Summary
Removed all hardcoded `rounded-*` Tailwind classes from 7 of 9 pages (2 required no changes) and upgraded section spacing throughout. Build passes cleanly with zero rounded-* remaining in src/pages/.
## Tasks Completed
| Task | Name | Commit | Files |
|------|------|--------|-------|
| 1 | Remove rounded-* and upgrade spacing on all 9 pages | 00670af | DashboardPage, BudgetListPage, BudgetDetailPage, TemplatePage, CategoriesPage, QuickAddPage, SettingsPage |
| 2 | Visual verification (checkpoint) | auto-approved | — |
## Changes Per File
**DashboardPage.tsx**
- `space-y-6` -> `space-y-8` on main content wrapper
- `gap-6` -> `gap-8` on 3-column chart grid
**BudgetListPage.tsx**
- Removed `rounded-md` from template toggle checkbox row (`flex items-center gap-3 border p-3`)
**BudgetDetailPage.tsx**
- Skeleton group heading: removed `rounded-sm`
- Skeleton summary box: removed `rounded-md`
- Live group heading: removed `rounded-sm`
- Overall totals summary box: removed `rounded-md`
- SelectLabel category dot: removed `rounded-full`
**TemplatePage.tsx**
- Skeleton outer wrapper: `gap-6` -> `gap-8`
- Skeleton group heading: removed `rounded-sm`
- Skeleton badge placeholder: removed `rounded-full`
- Skeleton icon button placeholder: removed `rounded-md`
- Live outer wrapper: `gap-6` -> `gap-8`
- Live grouped items section: `space-y-6` -> `space-y-8`
- Live group heading: removed `rounded-sm`
- SelectLabel category dot: removed `rounded-full`
**CategoriesPage.tsx**
- Skeleton group heading: removed `rounded-sm`
- Skeleton badge placeholder: removed `rounded-full`
- Skeleton icon button placeholder: removed `rounded-md`
- Skeleton section container: `space-y-6` -> `space-y-8`
- Live grouped items section: `space-y-6` -> `space-y-8`
- Live group heading: removed `rounded-sm`
**QuickAddPage.tsx**
- Skeleton icon badge placeholder: removed `rounded-full`
- Skeleton action button placeholder: removed `rounded-md`
**SettingsPage.tsx**
- Both `CardContent` instances (skeleton + live): `space-y-4` -> `space-y-6`
**LoginPage.tsx / RegisterPage.tsx**
- No changes required: no `rounded-*` classes; Card rounding controlled by `--radius: 0` token cascade from 05-01
## Deviations from Plan
None - plan executed exactly as written. Line number references in PATTERNS.md were accurate.
## Checkpoint: Task 2
**Type:** human-verify
**Auto-approved:** Yes (autonomous wave execution)
**What was verified:** All 9 pages swept for rounded-* removal and spacing upgrade. Build passes. grep confirms zero rounded-full/sm/md/lg in src/pages/.
## Known Stubs
None.
## Threat Flags
None — pure CSS class changes in JSX, no new network surface.
## Self-Check: PASSED
- 7 files modified and committed at 00670af
- `bun run build` exits 0
- `grep -rn "rounded-full\|rounded-sm\|rounded-md\|rounded-lg" src/pages/` returns no matches
- DashboardPage.tsx contains `space-y-8` and `gap-8` (verified)
- SettingsPage.tsx contains `space-y-6` in CardContent (verified, both instances)

View File

@@ -0,0 +1,76 @@
# Phase 5: Design System Token Rework - Context
**Gathered:** 2026-04-20
**Status:** Ready for planning
<domain>
## Phase Boundary
Users see a sharp, minimal, clearly pastel UI across every page — the visual foundation that all subsequent phases build on. This phase modifies design tokens (CSS variables), adjusts spacing utilities across all 9 pages, and overrides third-party component styles. No new features, no new components — purely visual token and spacing changes.
</domain>
<decisions>
## Implementation Decisions
### Corner Radius Strategy
- All elements get 0px border radius — truly sharp corners everywhere
- Implementation via single `--radius: 0` token change in `src/index.css` (cascades to all shadcn components)
- No exceptions for avatars, badges, or any element
- Third-party components (Recharts bars, Sonner toasts) overridden via CSS selectors to force 0 radius
### Pastel Color Refinement
- Increase chroma on category fill colors to 0.22+ for visible colorful pop against white backgrounds
- Keep the two-tier color system: text colors at ~0.55L for WCAG 4.5:1 contrast, fill colors lighter/more saturated
- Slightly warm the base UI colors: background chroma from 0.005→0.01 for subtle warmth
- Align chart colors with category fill tokens directly — remove separate `--color-chart-*` variables and use `--color-*-fill` tokens in charts
### Spacing & Layout Strategy
- Increase section gaps: gap-4→gap-6, gap-6→gap-8 across all pages
- Increase card internal padding: p-4→p-6 for breathing room
- Keep existing max-w-7xl container constraint
- Standardize all page headers to mb-6 + section gaps to gap-8 for consistent rhythm
### Claude's Discretion
- Exact OKLCH chroma/lightness values for category fills (as long as they're 0.22+ chroma and pass WCAG)
- Order of page updates during implementation
- Whether to create a spacing utility class or apply changes inline
</decisions>
<code_context>
## Existing Code Insights
### Reusable Assets
- `src/index.css` — single file with all design tokens (`@theme inline` block), `--radius: 0.625rem` is the token to change
- `src/lib/palette.ts` — category color references using CSS variables (no changes needed, references tokens)
- shadcn/ui components in `src/components/ui/` — all use `rounded-*` classes that derive from `--radius`
### Established Patterns
- OKLCH color system already in place with hue-based category differentiation
- Two-tier category colors: text (L=0.55, C=0.16-0.18) and fill (L=0.65-0.70, C=0.18-0.20)
- Tailwind CSS 4 with `@theme inline` for CSS variable definitions
- 71 occurrences of `rounded`/`radius` across 27 source files
### Integration Points
- `src/index.css` `--radius` token controls all shadcn component rounding
- Chart components (`SpendBarChart`, `IncomeBarChart`, `ExpenseDonutChart`) reference `--color-chart-*` variables
- 9 pages to audit: Dashboard, BudgetList, BudgetDetail, Template, Categories, QuickAdd, Settings, Login, Register
</code_context>
<specifics>
## Specific Ideas
- Success criteria explicitly requires visual pass of all 9 pages confirming no regressions
- Category color swatches must be "visibly colorful against white backgrounds" — not washed-out
- "No pill buttons, no rounded cards, no rounded inputs visible anywhere"
</specifics>
<deferred>
## Deferred Ideas
None — discussion stayed within phase scope
</deferred>

View File

@@ -0,0 +1,677 @@
# Phase 5: Design System Token Rework - Pattern Map
**Mapped:** 2026-04-20
**Files analyzed:** 14 files (1 CSS + 2 chart components + 1 shared component + 9 pages + 1 component)
**Analogs found:** 14 / 14 (all files are modifications of existing code — no new files created)
---
## File Classification
| Modified File | Role | Data Flow | Closest Analog / Self | Match Quality |
|---|---|---|---|---|
| `src/index.css` | config (CSS tokens) | transform | self — no analog needed | self |
| `src/components/dashboard/charts/SpendBarChart.tsx` | component (chart) | transform | `src/components/dashboard/charts/IncomeBarChart.tsx` | exact |
| `src/components/dashboard/charts/IncomeBarChart.tsx` | component (chart) | transform | `src/components/dashboard/charts/SpendBarChart.tsx` | exact |
| `src/components/dashboard/charts/ExpenseDonutChart.tsx` | component (chart) | transform | `SpendBarChart.tsx` / `IncomeBarChart.tsx` | role-match |
| `src/components/shared/PageShell.tsx` | component (layout) | request-response | self | self |
| `src/components/dashboard/DashboardSkeleton.tsx` | component (skeleton) | request-response | `CategoriesPage.tsx` skeleton block | role-match |
| `src/components/dashboard/CategorySection.tsx` | component (list item) | request-response | `BudgetDetailPage.tsx` group heading | role-match |
| `src/components/dashboard/charts/ChartEmptyState.tsx` | component (empty state) | request-response | self | self |
| `src/components/QuickAddPicker.tsx` | component (picker) | request-response | `BudgetDetailPage.tsx` select label dot | role-match |
| `src/pages/DashboardPage.tsx` | page | request-response | self | self |
| `src/pages/BudgetListPage.tsx` | page | request-response | `DashboardPage.tsx` / `BudgetDetailPage.tsx` | role-match |
| `src/pages/BudgetDetailPage.tsx` | page | CRUD | `CategoriesPage.tsx` / `TemplatePage.tsx` | exact |
| `src/pages/TemplatePage.tsx` | page | CRUD | `BudgetDetailPage.tsx` / `CategoriesPage.tsx` | exact |
| `src/pages/CategoriesPage.tsx` | page | CRUD | `BudgetDetailPage.tsx` / `TemplatePage.tsx` | exact |
| `src/pages/QuickAddPage.tsx` | page | CRUD | `CategoriesPage.tsx` | role-match |
| `src/pages/SettingsPage.tsx` | page | request-response | `CategoriesPage.tsx` | role-match |
| `src/pages/LoginPage.tsx` | page | request-response | `SettingsPage.tsx` | role-match |
| `src/pages/RegisterPage.tsx` | page | request-response | `SettingsPage.tsx` | role-match |
---
## Pattern Assignments
### `src/index.css` (config, CSS tokens)
**Analog:** self — authoritative token source, no external analog needed.
**Current `@theme inline` block** (lines 1-99, full file):
```css
@import "tailwindcss";
@custom-variant dark (&:is(.dark *));
@theme inline {
--color-background: oklch(0.98 0.005 260); /* → 0.01 chroma (warm) */
--color-foreground: oklch(0.25 0.02 260);
/* ... (base tokens unchanged) ... */
/* Category fill tokens — RAISE chroma to 0.22+ */
--color-income-fill: oklch(0.68 0.19 155); /* → 0.22 */
--color-bill-fill: oklch(0.65 0.19 25); /* → 0.22 */
--color-variable-expense-fill: oklch(0.70 0.18 50); /* → 0.22 */
--color-debt-fill: oklch(0.60 0.20 355); /* → 0.23 */
--color-saving-fill: oklch(0.68 0.18 220); /* → 0.22 */
--color-investment-fill: oklch(0.65 0.18 285); /* → 0.22 */
/* Chart vars — DELETE these 5 lines entirely */
--color-chart-1: oklch(0.72 0.14 155);
--color-chart-2: oklch(0.7 0.14 25);
--color-chart-3: oklch(0.72 0.14 50);
--color-chart-4: oklch(0.65 0.16 355);
--color-chart-5: oklch(0.72 0.14 220);
--radius: 0.625rem; /* → 0 */
}
@layer base {
* { @apply border-border; }
body {
@apply bg-background text-foreground;
font-feature-settings: "rlig" 1, "calt" 1;
}
}
```
**Changes to make in this file:**
1. Line 7: `--color-background: oklch(0.98 0.005 260)``oklch(0.98 0.01 260)`
2. Lines 65-70: raise all six `--color-*-fill` chroma values to 0.22+ per CONTEXT.md
3. Lines 52-57: delete `--color-chart-1` through `--color-chart-5` entirely
4. Line 72: `--radius: 0.625rem``--radius: 0`
5. After `@layer base` block: add CSS override selectors for Recharts and Sonner (see Shared Patterns section below)
---
### `src/components/dashboard/charts/SpendBarChart.tsx` (component, transform)
**Analog:** `src/components/dashboard/charts/IncomeBarChart.tsx`
**Current `Bar` radius props** (lines 64-80):
```tsx
<Bar
dataKey="budgeted"
fill="var(--color-budgeted)"
radius={4} /* → radius={0} */
/>
<Bar dataKey="actual" radius={4}> /* → radius={0} */
{data.map((entry, index) => (
<Cell
key={index}
fill={
entry.actual > entry.budgeted
? "var(--color-over-budget)"
: `var(--color-${entry.type}-fill)` /* already correct — no change */
}
/>
))}
</Bar>
```
**Changes to make in this file:**
- Line 67: `radius={4}``radius={0}`
- Line 69: `radius={4}``radius={0}`
- `chartConfig` (lines 31-34): no change needed — `actual` already references `--color-muted-foreground`, `budgeted` references `--color-budget-bar-bg`; neither references deleted `--color-chart-*` vars.
---
### `src/components/dashboard/charts/IncomeBarChart.tsx` (component, transform)
**Analog:** `src/components/dashboard/charts/SpendBarChart.tsx`
**Current `Bar` radius props** (lines 54-69):
```tsx
<Bar
dataKey="budgeted"
fill="var(--color-budgeted)"
radius={[4, 4, 0, 0]} /* → radius={0} */
/>
<Bar dataKey="actual" radius={[4, 4, 0, 0]}> /* → radius={0} */
{data.map((entry, index) => (
<Cell
key={index}
fill={
entry.actual > entry.budgeted
? "var(--color-over-budget)"
: "var(--color-income-fill)" /* already correct — no change */
}
/>
))}
</Bar>
```
**Current `chartConfig`** (lines 26-29):
```tsx
const chartConfig = {
budgeted: { label: "Budgeted", color: "var(--color-budget-bar-bg)" },
actual: { label: "Actual", color: "var(--color-income-fill)" }, /* already references fill token */
} satisfies ChartConfig
```
**Changes to make in this file:**
- Line 57: `radius={[4, 4, 0, 0]}``radius={0}`
- Line 59: `radius={[4, 4, 0, 0]}``radius={0}`
- `chartConfig`: no change needed — already references `--color-income-fill`, not a deleted `--color-chart-*` var.
---
### `src/components/dashboard/charts/ExpenseDonutChart.tsx` (component, transform)
**Analog:** self — already uses `var(--color-${entry.type}-fill)` pattern throughout.
**The one hardcoded `rounded-full`** (line 141):
```tsx
/* Before */
<span
className="inline-block size-3 shrink-0 rounded-full"
style={{ backgroundColor: `var(--color-${entry.type}-fill)` }}
/>
/* After — remove rounded-full entirely */
<span
className="inline-block size-3 shrink-0"
style={{ backgroundColor: `var(--color-${entry.type}-fill)` }}
/>
```
**Changes to make in this file:**
- Line 141: remove `rounded-full` from className string.
- No `ChartConfig` changes needed — `ExpenseDonutChart` builds its config dynamically from data using `var(--color-${entry.type}-fill)` (lines 47-51), which is already the correct post-rework pattern.
---
### `src/components/shared/PageShell.tsx` (component, layout)
**Current spacing** (line 15):
```tsx
<div className="flex flex-col gap-6"> /* → gap-8 */
```
**Changes to make in this file:**
- Line 15: `gap-6``gap-8`
This single change propagates the header-to-content gap increase to all 9 pages that use `PageShell`.
---
### `src/components/dashboard/DashboardSkeleton.tsx` (component, skeleton)
**Analog:** Skeleton patterns from `CategoriesPage.tsx` lines 98-114 and `BudgetDetailPage.tsx` lines 284-306.
**Hardcoded `rounded-*` locations in this file:**
```tsx
/* Line 35 — chart placeholder */
<Skeleton className="h-[250px] w-full rounded-md" /> /* remove rounded-md */
/* Line 43 — chart placeholder */
<Skeleton className="h-[250px] w-full rounded-md" /> /* remove rounded-md */
/* Line 51 — chart placeholder */
<Skeleton className="h-[250px] w-full rounded-md" /> /* remove rounded-md */
/* Line 59 — collapsible section row */
<div className="flex items-center gap-3 rounded-md border-l-4 ..."> /* remove rounded-md */
/* Lines 63-64 — inline summary badges */
<Skeleton className="h-5 w-24 rounded-full" /> /* remove rounded-full — CRITICAL: rounded-full is 9999px, not from --radius */
<Skeleton className="h-5 w-24 rounded-full" /> /* remove rounded-full */
```
**Also: spacing upgrades**:
```tsx
/* Line 20 — top-level container */
<div className="flex flex-col gap-6"> /* → gap-8 */
/* Line 22 — summary cards grid */
<div className="grid gap-4 sm:grid-cols-2 lg:grid-cols-3"> /* → gap-6 */
/* Line 29 — chart grid */
<div className="grid gap-6 md:grid-cols-2 lg:grid-cols-3"> /* → gap-8 */
```
---
### `src/components/dashboard/CategorySection.tsx` (component, list item)
**Analog:** Group heading divs in `BudgetDetailPage.tsx` lines 352-356, `CategoriesPage.tsx` lines 134-137, `TemplatePage.tsx` lines 292-295.
**The hardcoded `rounded-md`** (line 73):
```tsx
/* Before */
<button
className="group flex w-full items-center gap-3 rounded-md border-l-4 bg-card px-4 py-3 text-left hover:bg-muted/40 transition-colors"
style={{ borderLeftColor: categoryColors[type] }}
>
/* After — remove rounded-md */
<button
className="group flex w-full items-center gap-3 border-l-4 bg-card px-4 py-3 text-left hover:bg-muted/40 transition-colors"
style={{ borderLeftColor: categoryColors[type] }}
>
```
**Changes to make in this file:**
- Line 73: remove `rounded-md` from the button's className.
---
### `src/components/dashboard/charts/ChartEmptyState.tsx` (component, empty state)
**Current `rounded-lg`** (line 12):
```tsx
/* Before */
className={cn(
"flex min-h-[250px] w-full items-center justify-center rounded-lg border border-dashed ...",
className
)}
/* After — remove rounded-lg */
className={cn(
"flex min-h-[250px] w-full items-center justify-center border border-dashed ...",
className
)}
```
**Changes to make in this file:**
- Line 12: remove `rounded-lg` from the className string.
---
### `src/components/QuickAddPicker.tsx` (component, picker)
**Analog:** Same pattern as `BudgetDetailPage.tsx` line 496 and `TemplatePage.tsx` line 385 — `size-2 rounded-full` color swatch dots used as SelectLabel decorators.
**Hardcoded `rounded-*` locations:**
```tsx
/* Line 156 — picker item button */
className="flex w-full items-center gap-2 rounded-sm px-2 py-1.5 ..."
/* → remove rounded-sm */
/* Line 201 — SelectLabel category dot */
<div
className="size-2 rounded-full"
style={{ backgroundColor: categoryColors[type] }}
/>
/* → remove rounded-full */
```
**Changes to make in this file:**
- Line 156: remove `rounded-sm` from className.
- Line 201: remove `rounded-full` from className.
---
### `src/pages/DashboardPage.tsx` (page, request-response)
**Current spacing** (lines 186, 207):
```tsx
/* Line 186 — DashboardContent top-level wrapper */
<div className="space-y-6"> /* → space-y-8 */
/* Line 207 — chart grid */
<div className="grid gap-6 md:grid-cols-2 lg:grid-cols-3"> /* → gap-8 */
```
**Changes to make in this file:**
- Line 186: `space-y-6``space-y-8`
- Line 207: `gap-6``gap-8`
No hardcoded `rounded-*` classes in this file.
---
### `src/pages/BudgetListPage.tsx` (page, CRUD)
**Analog:** `BudgetDetailPage.tsx` lines 242-256 — same `rounded-md border p-3` container pattern.
**Hardcoded `rounded-md`** (line 243):
```tsx
/* Before */
<div className="flex items-center gap-3 rounded-md border p-3">
/* After */
<div className="flex items-center gap-3 border p-3">
```
**Spacing:** Check for `gap-4`, `gap-6`, `space-y-*` patterns and apply standard upgrades:
- `gap-4``gap-6`
- `gap-6``gap-8`
- `space-y-6``space-y-8`
---
### `src/pages/BudgetDetailPage.tsx` (page, CRUD)
**Analog:** `CategoriesPage.tsx` and `TemplatePage.tsx` — structurally identical page pattern (group headings, Tables, PageShell).
**Hardcoded `rounded-*` locations** (confirmed from RESEARCH.md inventory):
| Line | Current | Action |
|------|---------|--------|
| 290 | `rounded-sm` on skeleton header div | Remove |
| 303 | `rounded-md` on `<Skeleton>` className | Remove |
| 353 | `rounded-sm` on budget item group heading div | Remove |
| 439 | `rounded-md` on summary totals box | Remove |
| 497 | `rounded-full` on SelectLabel category dot | Remove |
**Line 353 group heading** (current pattern to modify):
```tsx
/* Before */
<div
className="mb-2 flex items-center gap-3 rounded-sm border-l-4 bg-muted/30 px-3 py-2"
style={{ borderLeftColor: categoryColors[type] }}
>
/* After */
<div
className="mb-2 flex items-center gap-3 border-l-4 bg-muted/30 px-3 py-2"
style={{ borderLeftColor: categoryColors[type] }}
>
```
**Line 439 summary box** (current pattern to modify):
```tsx
/* Before */
<div className="rounded-md border p-4">
/* After */
<div className="border p-4">
```
**Spacing upgrades:**
- `space-y-8` already present at line 338 (inner grouped content) — verify no `space-y-6` / `gap-6` remaining
- Check for `p-4` on card content wrappers → `p-6`
---
### `src/pages/TemplatePage.tsx` (page, CRUD)
**Analog:** `BudgetDetailPage.tsx` — same group heading + Table structure, same skeleton pattern.
**Hardcoded `rounded-*` locations** (confirmed from RESEARCH.md inventory):
| Line | Current | Action |
|------|---------|--------|
| 250 | `rounded-sm` on skeleton group heading div | Remove |
| 256 | `rounded-full` on `<Skeleton>` className | Remove |
| 258 | `rounded-md` on `<Skeleton>` className | Remove |
| 292 | `rounded-sm` on template item group heading div | Remove |
| 385 | `rounded-full` on SelectLabel category dot | Remove |
**Line 292 group heading** (current):
```tsx
/* Before */
<div
className="mb-2 flex items-center gap-3 rounded-sm border-l-4 bg-muted/30 px-3 py-2"
style={{ borderLeftColor: categoryColors[type] }}
>
```
Same removal pattern as `BudgetDetailPage.tsx` line 353.
**Line 385 SelectLabel dot** (current):
```tsx
/* Before — same pattern as BudgetDetailPage line 497 */
<div
className="size-2 rounded-full"
style={{ backgroundColor: categoryColors[type] }}
/>
/* After: remove rounded-full */
```
**Spacing upgrades** (current at lines 247, 268, 287):
- Line 247: `space-y-6``space-y-8` (skeleton wrapper)
- Line 268: `gap-6``gap-8` (TemplatePage own flex header, not using PageShell)
- Line 287: `space-y-6``space-y-8` (main content groups)
---
### `src/pages/CategoriesPage.tsx` (page, CRUD)
**Analog:** `BudgetDetailPage.tsx` / `TemplatePage.tsx` — structurally identical.
**Hardcoded `rounded-*` locations** (confirmed from RESEARCH.md inventory):
| Line | Current | Action |
|------|---------|--------|
| 101 | `rounded-sm` on skeleton group heading div | Remove |
| 107 | `rounded-full` on `<Skeleton>` className | Remove |
| 108 | `rounded-md` on `<Skeleton>` className | Remove |
| 134 | `rounded-sm` on category group heading div | Remove |
**Line 134 group heading** (current):
```tsx
/* Before */
<div
className="mb-2 flex items-center gap-3 rounded-sm border-l-4 bg-muted/30 px-3 py-2"
style={{ borderLeftColor: categoryColors[type] }}
>
/* After: remove rounded-sm */
```
**Spacing upgrades** (current at lines 98, 130):
- Line 98: `space-y-6``space-y-8` (skeleton wrapper)
- Line 130: `space-y-6``space-y-8` (main content groups)
---
### `src/pages/QuickAddPage.tsx` (page, CRUD)
**Analog:** `CategoriesPage.tsx` — same row-list layout, same Skeleton usage.
**Hardcoded `rounded-*` locations** (confirmed from RESEARCH.md inventory):
| Line | Current | Action |
|------|---------|--------|
| 98 | `rounded-full` on `<Skeleton>` className | Remove |
| 100 | `rounded-md` on `<Skeleton>` className | Remove |
**Current skeleton block** (lines 93-105):
```tsx
<div className="space-y-1">
{[1, 2, 3, 4, 5].map((i) => (
<div key={i} className="flex items-center gap-4 px-4 py-2.5 border-b border-border">
<Skeleton className="h-5 w-10 rounded-full" /> /* line 98 — remove rounded-full */
<Skeleton className="h-4 w-36" />
<Skeleton className="ml-auto h-7 w-7 rounded-md" /> /* line 100 — remove rounded-md */
</div>
))}
</div>
```
No major spacing changes in this file (list layout, not grid/section-based).
---
### `src/pages/SettingsPage.tsx` (page, request-response)
**Analog:** `CategoriesPage.tsx` — PageShell wrapper, Card with CardContent.
**No hardcoded `rounded-*` classes** in this file (Card uses token cascade).
**Spacing upgrade** (line 87):
```tsx
/* Before — CardContent internal spacing */
<CardContent className="space-y-4 pt-6"> /* → space-y-6 */
```
**Changes to make in this file:**
- Line 87 (and corresponding skeleton line 69): `space-y-4``space-y-6` inside `CardContent`
---
### `src/pages/LoginPage.tsx` and `src/pages/RegisterPage.tsx` (pages, request-response)
**Analog:** `SettingsPage.tsx` — Card-based page, no group headings.
Per RESEARCH.md: "Card already uses `--radius` token cascade." No hardcoded `rounded-*` classes confirmed. No `--color-chart-*` references.
**Minimal changes:** Verify `p-4``p-6` in any card content wrappers if present. No spacing grids to upgrade. Treat as low-touch pages in implementation.
---
## Shared Patterns
### Pattern A: `@theme inline` Token Edit (CSS variable cascade)
**Source:** `src/index.css` lines 4-79
**Apply to:** `src/index.css` only — single source of truth
**Rule:** All shadcn `rounded-*` utility classes (rounded-md, rounded-sm, rounded-lg, rounded-xl) derive from `--radius`. Setting `--radius: 0` makes them all 0px automatically. Only `rounded-full` (9999px) is immune.
```css
/* The pattern: edit token value, cascade propagates everywhere */
@theme inline {
--radius: 0; /* single edit cascades to all shadcn components */
}
```
### Pattern B: Hardcoded `rounded-full` Removal (critical pitfall)
**Source:** Every page and component file listed in RESEARCH.md inventory
**Apply to:** All 17 `rounded-full` class occurrences across 8 files
**Rule:** `rounded-full` = `border-radius: 9999px` — hardcoded, NOT derived from `--radius`. Must be removed manually from every occurrence.
```tsx
/* Before — still circular after --radius: 0 */
<Skeleton className="h-5 w-16 rounded-full" />
<span className="inline-block size-3 shrink-0 rounded-full" ... />
<div className="size-2 rounded-full" ... />
/* After — becomes square from --radius: 0 */
<Skeleton className="h-5 w-16" />
<span className="inline-block size-3 shrink-0" ... />
<div className="size-2" ... />
```
### Pattern C: CSS Override for Third-Party Radius
**Source:** To be added to `src/index.css` after `@layer base` block
**Apply to:** Recharts bars (`SpendBarChart`, `IncomeBarChart`) and Sonner toasts
**Rule:** Recharts renders bars as `<rect rx="4" ry="4">` SVG — not CSS. Must change `radius` prop directly AND add CSS override. Sonner wires `--border-radius: var(--radius)` (confirmed at `sonner.tsx` line 28) — should auto-propagate, but add CSS override as safety net.
```css
/* Add to src/index.css after the @layer base block */
/* Recharts: SVG rect elements for bar charts */
.recharts-rectangle {
rx: 0;
ry: 0;
}
/* Sonner: toast container — safety net if var(--radius) cascade insufficient */
[data-sonner-toast] {
border-radius: 0 !important;
}
```
**Note:** Sonner's `sonner.tsx` already passes `"--border-radius": "var(--radius)"` as an inline style (line 28). When `--radius: 0`, this should cascade automatically. The CSS override is a safety net only — verify in browser after token change before deciding if it is needed.
### Pattern D: Group Heading Div (shared across 5 files)
**Source:** `src/pages/CategoriesPage.tsx` line 134, `BudgetDetailPage.tsx` line 353, `TemplatePage.tsx` line 292 — all structurally identical
**Apply to:** CategoriesPage, BudgetDetailPage, TemplatePage, CategorySection, DashboardSkeleton row
```tsx
/* Pattern: border-l-4 accent bar heading — remove rounded-sm entirely */
<div
className="mb-2 flex items-center gap-3 border-l-4 bg-muted/30 px-3 py-2"
style={{ borderLeftColor: categoryColors[type] }}
>
<span className="text-sm font-semibold">{label}</span>
</div>
```
### Pattern E: Spacing Upgrade Map
**Source:** `src/pages/DashboardPage.tsx` lines 186, 207; `src/components/shared/PageShell.tsx` line 15
**Apply to:** All 9 pages and PageShell
```
PageShell.tsx line 15: gap-6 → gap-8 (header-to-content gap)
DashboardPage.tsx line 186: space-y-6 → space-y-8 (section rhythm)
DashboardPage.tsx line 207: gap-6 → gap-8 (chart grid)
DashboardSkeleton.tsx line 22: gap-4 → gap-6 (summary cards grid)
DashboardSkeleton.tsx line 29: gap-6 → gap-8 (chart grid skeleton)
CategoriesPage.tsx line 98: space-y-6 → space-y-8 (skeleton wrapper)
CategoriesPage.tsx line 130: space-y-6 → space-y-8 (main content)
TemplatePage.tsx line 247: space-y-6 → space-y-8 (skeleton wrapper)
TemplatePage.tsx line 268: gap-6 → gap-8 (self-managed header flex)
TemplatePage.tsx line 287: space-y-6 → space-y-8 (main content)
BudgetDetailPage.tsx: verify no space-y-6/gap-6 remain after existing space-y-8 at line 338
SettingsPage.tsx line 87: space-y-4 → space-y-6 (CardContent internal)
```
### Pattern F: `ChartConfig` Token Reference (no `--color-chart-*`)
**Source:** `src/components/dashboard/charts/IncomeBarChart.tsx` lines 26-29
**Apply to:** Any future chart components — `SpendBarChart` and `IncomeBarChart` require no ChartConfig change
**Rule:** After deleting `--color-chart-*` from `index.css`, all chart color references must use `--color-*-fill` tokens.
```tsx
/* Correct pattern post-rework — reference fill tokens directly */
const chartConfig = {
budgeted: { label: "Budgeted", color: "var(--color-budget-bar-bg)" },
actual: { label: "Actual", color: "var(--color-income-fill)" },
} satisfies ChartConfig
```
---
## No Analog Found
None — all files are modifications of existing code. No net-new files are created in this phase.
---
## Implementation Wave Order
Per RESEARCH.md recommendation (planner reference):
**Wave 1 — Token edit only** (`src/index.css`)
- Change `--radius: 0`
- Raise `--color-*-fill` chroma values to 0.22+
- Warm `--color-background` chroma 0.005 → 0.01
- Delete `--color-chart-1` through `--color-chart-5`
- Add `.recharts-rectangle` and `[data-sonner-toast]` CSS overrides
**Wave 2 — Chart component updates** (2 files)
- `SpendBarChart.tsx`: `radius={4}``radius={0}` (x2 Bar props)
- `IncomeBarChart.tsx`: `radius={[4, 4, 0, 0]}``radius={0}` (x2 Bar props)
- `ExpenseDonutChart.tsx`: remove `rounded-full` from legend span (line 141)
**Wave 3 — Page and shared component sweep** (12 files)
- `PageShell.tsx`: `gap-6``gap-8`
- `DashboardSkeleton.tsx`: remove 5 `rounded-*` classes, upgrade 3 spacing values
- `CategorySection.tsx`: remove `rounded-md` from trigger button
- `ChartEmptyState.tsx`: remove `rounded-lg` from empty state div
- `QuickAddPicker.tsx`: remove 2 `rounded-*` classes
- All 9 pages: spacing upgrades + hardcoded `rounded-*` removals per inventory
---
## Metadata
**Analog search scope:** `src/pages/`, `src/components/dashboard/`, `src/components/shared/`, `src/components/ui/`, `src/index.css`
**Files read for pattern extraction:** 16 (index.css, PageShell, DashboardPage, DashboardSkeleton, SpendBarChart, IncomeBarChart, ExpenseDonutChart, ChartEmptyState, CategorySection, QuickAddPicker, SettingsPage, BudgetDetailPage excerpt x3, CategoriesPage excerpt, TemplatePage excerpt, QuickAddPage excerpt, BudgetListPage excerpt, sonner.tsx)
**Pattern extraction date:** 2026-04-20

View File

@@ -0,0 +1,550 @@
# Phase 5: Design System Token Rework - Research
**Researched:** 2026-04-20
**Domain:** CSS design tokens, Tailwind CSS 4 `@theme inline`, OKLCH color, shadcn/ui, Recharts, Sonner
**Confidence:** HIGH
---
<user_constraints>
## User Constraints (from CONTEXT.md)
### Locked Decisions
- All elements get 0px border radius — truly sharp corners everywhere
- Implementation via single `--radius: 0` token change in `src/index.css` (cascades to all shadcn components)
- No exceptions for avatars, badges, or any element
- Third-party components (Recharts bars, Sonner toasts) overridden via CSS selectors to force 0 radius
- Increase chroma on category fill colors to 0.22+ for visible colorful pop against white backgrounds
- Keep the two-tier color system: text colors at ~0.55L for WCAG 4.5:1 contrast, fill colors lighter/more saturated
- Slightly warm the base UI colors: background chroma from 0.005→0.01 for subtle warmth
- Align chart colors with category fill tokens directly — remove separate `--color-chart-*` variables and use `--color-*-fill` tokens in charts
- Increase section gaps: gap-4→gap-6, gap-6→gap-8 across all pages
- Increase card internal padding: p-4→p-6 for breathing room
- Keep existing max-w-7xl container constraint
- Standardize all page headers to mb-6 + section gaps to gap-8 for consistent rhythm
### Claude's Discretion
- Exact OKLCH chroma/lightness values for category fills (as long as they're 0.22+ chroma and pass WCAG)
- Order of page updates during implementation
- Whether to create a spacing utility class or apply changes inline
### Deferred Ideas (OUT OF SCOPE)
None — discussion stayed within phase scope
</user_constraints>
---
<phase_requirements>
## Phase Requirements
| ID | Description | Research Support |
|----|-------------|------------------|
| DS-01 | User sees sharp-edged UI across all pages (no rounded corners) | Single `--radius: 0` token in index.css cascades to all shadcn/ui components; hardcoded `rounded-*` Tailwind classes in pages/components require explicit removal; Recharts bars and Sonner toasts require CSS override selectors |
| DS-02 | User sees clear pastel colors that are visibly colorful, not washed out | Raise `--color-*-fill` chroma from 0.18-0.20 to 0.22+; remove `--color-chart-*` variables; point chart components to `--color-*-fill` tokens directly |
| DS-03 | User sees a clean, minimal layout with generous whitespace | Upgrade `space-y-6``space-y-8`, `gap-6``gap-8` across 9 pages; `p-4``p-6` for card internals; standardize PageShell gap to `gap-8` |
</phase_requirements>
---
## Summary
Phase 5 is a pure design token and spacing rework with zero feature additions. The codebase uses Tailwind CSS 4's `@theme inline` block in `src/index.css` as the single source of truth for all CSS custom properties. Because shadcn/ui components reference `--radius` via Tailwind's `rounded-*` utility classes that are generated from this token, setting `--radius: 0` in `src/index.css` propagates automatically to every shadcn component. No changes to `src/components/ui/` files are needed for the radius.
However, hardcoded `rounded-*` Tailwind classes exist in 6 page files and 4 component files — these are not driven by `--radius` and must be removed or changed to `rounded-none` explicitly. Additionally, Recharts bar components pass a `radius` prop (not CSS) and require a CSS selector override in `index.css`. Sonner toasts pass `--border-radius` as an inline style through the Toaster component and additionally need a CSS override.
The color work has two parts: (1) editing token values in `src/index.css` only, and (2) removing `--color-chart-*` variables from `index.css` and updating the two chart components that currently reference them via `ChartConfig` objects to instead reference `--color-*-fill` tokens.
**Primary recommendation:** Execute as three focused waves — (1) token edit in `index.css` (radius + colors + remove chart vars), (2) chart component updates to reference fill tokens, (3) per-page spacing and hardcoded `rounded-*` sweep across all 9 pages.
---
## Architectural Responsibility Map
| Capability | Primary Tier | Secondary Tier | Rationale |
|------------|-------------|----------------|-----------|
| Design token definition | CSS (index.css) | — | Single `@theme inline` block is the authoritative token source |
| shadcn component rounding | CSS token cascade | — | `rounded-*` utilities derive from `--radius`; no component code change needed |
| Hardcoded Tailwind class removal | Page/component TSX | — | `rounded-full`, `rounded-md` etc. are inline JSX; must be changed in source files |
| Recharts bar radius override | CSS global selector | Recharts prop | CSS `rect` selector overrides SVG radius attribute; prop change is alternative |
| Sonner toast radius override | CSS global selector | Sonner component | Inline `--border-radius` style in sonner.tsx; CSS override wins |
| Color token values | CSS (index.css) | — | All category and fill colors live in `@theme inline` |
| Chart color wiring | Chart TSX components | CSS tokens | `ChartConfig` objects in SpendBarChart and IncomeBarChart must reference fill tokens |
| Page spacing | Page TSX files | Shared components | `gap-*`, `space-y-*`, `p-*` are inline classes in page JSX |
---
## Standard Stack
### Core
| Library | Version | Purpose | Why Standard |
|---------|---------|---------|--------------|
| Tailwind CSS | 4.2.1 | Utility CSS + token system (`@theme inline`) | Already installed; `@theme inline` is the v4 way to define CSS variables as Tailwind utilities |
| shadcn/ui | new-york preset | Component layer above Radix UI | Already installed; all components in `src/components/ui/` |
| Recharts | 2.15.4 | Chart rendering (BarChart, PieChart) | Already installed; SpendBarChart, IncomeBarChart, ExpenseDonutChart use it |
| Sonner | 2.0.7 | Toast notifications | Already installed; `src/components/ui/sonner.tsx` wraps it |
### Supporting
| Library | Version | Purpose | When to Use |
|---------|---------|---------|-------------|
| OKLCH (native CSS) | CSS Color Level 4 | Perceptually uniform color space | Already in use; all token edits stay in OKLCH |
No new libraries are needed for this phase.
**Installation:** None required.
---
## Architecture Patterns
### System Architecture Diagram
```
src/index.css (@theme inline)
├── --radius: 0 ──cascade──► all shadcn rounded-* classes
├── --color-background: ... ──cascade──► bg-background utility
├── --color-*-fill: ... ──cascade──► var(--color-*-fill) in chart components
└── [--color-chart-* REMOVED]
src/components/ui/*.tsx (shadcn)
│ Button, Card, Input, Badge, Select, Dialog, Sheet, Sidebar, ...
│ All use rounded-* utilities → auto-sharp from --radius: 0
src/components/dashboard/charts/*.tsx
│ SpendBarChart, IncomeBarChart: update ChartConfig + Bar radius prop → 0
│ ExpenseDonutChart: already uses var(--color-*-fill); no ChartConfig change needed
src/pages/*.tsx (9 pages)
│ Remove hardcoded rounded-* classes
│ Upgrade spacing: space-y-6→space-y-8, gap-6→gap-8, p-4→p-6
src/index.css (@layer base or global)
└── CSS overrides for third-party radius
├── .recharts-rectangle { rx: 0; ry: 0; border-radius: 0 }
└── [data-sonner-toast] { border-radius: 0 }
```
### Recommended Project Structure
No structural changes. Files modified:
```
src/
├── index.css # Token edits: --radius, --color-*-fill, remove --color-chart-*; CSS overrides
├── components/
│ └── dashboard/
│ └── charts/
│ ├── SpendBarChart.tsx # Update ChartConfig + Bar radius prop
│ └── IncomeBarChart.tsx # Update ChartConfig + Bar radius prop
└── pages/
├── DashboardPage.tsx # Spacing: space-y-6→space-y-8, gap-6→gap-8
├── BudgetListPage.tsx # Spacing + remove rounded-md from row div
├── BudgetDetailPage.tsx # Spacing + remove rounded-* classes
├── TemplatePage.tsx # Spacing + remove rounded-sm, rounded-full
├── CategoriesPage.tsx # Spacing + remove rounded-sm, rounded-full
├── QuickAddPage.tsx # Remove rounded-full, rounded-md
├── SettingsPage.tsx # Spacing: space-y-4→space-y-6 in card content
├── LoginPage.tsx # Card already uses --radius token cascade
└── RegisterPage.tsx # Card already uses --radius token cascade
```
### Pattern 1: Tailwind 4 `@theme inline` Token Edit
**What:** All CSS variables in the `@theme inline` block are automatically available as Tailwind utility classes. Changing a value in this block propagates everywhere the utility is used.
**When to use:** Changing `--radius`, color tokens, any design-system-level property.
**Example:**
```css
/* src/index.css */
@theme inline {
--radius: 0; /* was 0.625rem — single change, cascades everywhere */
/* Fill colors: raise chroma to 0.22+ */
--color-income-fill: oklch(0.72 0.22 155);
--color-bill-fill: oklch(0.70 0.22 25);
--color-variable-expense-fill: oklch(0.74 0.22 50);
--color-debt-fill: oklch(0.66 0.23 355);
--color-saving-fill: oklch(0.72 0.22 220);
--color-investment-fill: oklch(0.68 0.22 285);
/* Background: warm slightly */
--color-background: oklch(0.98 0.01 260);
/* Remove --color-chart-1 through --color-chart-5 entirely */
}
```
[VERIFIED: codebase — src/index.css lines 1-99]
### Pattern 2: CSS Selector Override for Third-Party Radius
**What:** When a third-party library applies border-radius via its own SVG attributes or inline styles, a targeted CSS selector override in `@layer base` in `index.css` forces the desired value.
**When to use:** Recharts bar SVG rectangles, Sonner toast container.
**Example:**
```css
/* src/index.css — in @layer base block or after @theme */
/* Recharts: bars are SVG <rect> elements; CSS border-radius overrides SVG rx/ry */
.recharts-rectangle {
rx: 0;
ry: 0;
}
/* Sonner: targets the toast wrapper element */
[data-sonner-toast] {
border-radius: 0 !important;
}
```
[ASSUMED — selector names from Recharts/Sonner DOM inspection convention; verify in browser devtools during implementation]
### Pattern 3: Hardcoded Tailwind Class Removal
**What:** `rounded-full`, `rounded-md`, `rounded-sm`, `rounded-lg` as inline className strings in TSX are not driven by `--radius`. They must be removed or replaced with `rounded-none`.
**When to use:** Category color swatches, skeleton shapes, chart legend dots, picker items.
**Example:**
```tsx
/* Before — in ExpenseDonutChart.tsx line 141 */
<span className="inline-block size-3 shrink-0 rounded-full" ... />
/* After */
<span className="inline-block size-3 shrink-0" ... />
/* or explicitly: rounded-none if you need to reset a parent's rounded */
```
[VERIFIED: codebase scan]
### Pattern 4: Chart Component Token Wiring
**What:** `SpendBarChart` and `IncomeBarChart` use `ChartConfig` objects to map data keys to colors. Currently `IncomeBarChart.actual` is `color: "var(--color-income-fill)"` — already correct. `SpendBarChart.budgeted` uses `--color-budget-bar-bg` and `actual` uses `--color-muted-foreground`. `Bar radius` props must go to 0.
**When to use:** Any chart using Recharts `Bar` component.
**Example:**
```tsx
/* IncomeBarChart.tsx — Bar radius change */
<Bar dataKey="budgeted" fill="var(--color-budgeted)" radius={0} />
<Bar dataKey="actual" radius={0}>
/* SpendBarChart.tsx — Bar radius change */
<Bar dataKey="budgeted" fill="var(--color-budgeted)" radius={0} />
<Bar dataKey="actual" radius={0}>
```
Note: `SpendBarChart` uses `Cell` with dynamic `var(--color-${entry.type}-fill)` — this already references fill tokens, which is correct post-rework. No ChartConfig color change needed there.
[VERIFIED: codebase — SpendBarChart.tsx, IncomeBarChart.tsx]
### Pattern 5: Spacing Upgrade Pattern
**What:** Page-level spacing classes that control section separation and card internal rhythm are upgraded in-place in each page's JSX.
**When to use:** Each of the 9 pages.
**Mapping:**
```
space-y-6 → space-y-8 (section-level vertical rhythm in pages)
gap-6 → gap-8 (grid gaps between card sections)
gap-4 → gap-6 (inner grid element gaps where currently gap-4)
```
Card internal padding (`p-4``p-6`) applies to card content divs in pages, not to `src/components/ui/card.tsx` directly (Card already uses `py-6` and `CardContent` uses `px-6`).
[VERIFIED: codebase — PageShell.tsx, DashboardPage.tsx, BudgetDetailPage.tsx]
### Anti-Patterns to Avoid
- **Editing shadcn component files for radius:** `src/components/ui/*.tsx` do NOT need edits for the radius change — the token cascade handles it. Editing them directly risks breaking shadcn's upgrade path.
- **Changing `src/components/ui/card.tsx` padding:** `CardContent` already uses `px-6`. The `p-4 → p-6` upgrade applies to page-level wrappers that add inner padding on top of card defaults, not to the Card component itself.
- **Adding new `rounded-none` classes broadly:** Prefer removing the hardcoded `rounded-*` class entirely over adding `rounded-none`, since `--radius: 0` already means all `rounded-md`/`rounded-sm` Tailwind classes resolve to 0px. Only add `rounded-none` if you need to explicitly reset a parent that might not be covered.
- **Relying on `--color-chart-*` variables in new code:** These are being deleted this phase. All chart coloring must reference `--color-*-fill` tokens going forward.
---
## Don't Hand-Roll
| Problem | Don't Build | Use Instead | Why |
|---------|-------------|-------------|-----|
| WCAG contrast calculation | Manual contrast ratio math | Use UI-SPEC.md confirmed values; verify with browser devtools color picker | OKLCH values already computed and confirmed in CONTEXT.md and UI-SPEC.md |
| CSS-in-JS color token system | Runtime token object | Tailwind 4 `@theme inline` already does this | Single file, zero runtime cost |
| Per-component radius reset | Adding `style={{ borderRadius: 0 }}` to every element | `--radius: 0` token | Token cascade handles all shadcn components in one edit |
| Custom chart color mapping | Separate color registry | Existing `var(--color-*-fill)` CSS variables | Already wired in ExpenseDonutChart; standardize SpendBarChart/IncomeBarChart to match |
---
## Hardcoded `rounded-*` Inventory
Complete list of non-token-driven rounding that requires manual removal, organized by file:
### Pages
| File | Line | Class | Action |
|------|------|-------|--------|
| CategoriesPage.tsx | 101 | `rounded-sm` (group header div) | Remove |
| CategoriesPage.tsx | 107 | `rounded-full` (Skeleton) | Remove |
| CategoriesPage.tsx | 108 | `rounded-md` (Skeleton) | Remove |
| CategoriesPage.tsx | 134 | `rounded-sm` (category header) | Remove |
| TemplatePage.tsx | 250 | `rounded-sm` (group header div) | Remove |
| TemplatePage.tsx | 256 | `rounded-full` (Skeleton) | Remove |
| TemplatePage.tsx | 258 | `rounded-md` (Skeleton) | Remove |
| TemplatePage.tsx | 292 | `rounded-sm` (template item header) | Remove |
| TemplatePage.tsx | 385 | `rounded-full` (color swatch dot) | Remove |
| QuickAddPage.tsx | 98 | `rounded-full` (Skeleton) | Remove |
| QuickAddPage.tsx | 100 | `rounded-md` (Skeleton) | Remove |
| BudgetListPage.tsx | 243 | `rounded-md` (row container div) | Remove |
| BudgetDetailPage.tsx | 290 | `rounded-sm` (skeleton header) | Remove |
| BudgetDetailPage.tsx | 303 | `rounded-md` (Skeleton) | Remove |
| BudgetDetailPage.tsx | 353 | `rounded-sm` (budget item header) | Remove |
| BudgetDetailPage.tsx | 439 | `rounded-md` (summary box) | Remove |
| BudgetDetailPage.tsx | 497 | `rounded-full` (color swatch dot) | Remove |
### Components
| File | Line | Class | Action |
|------|------|-------|--------|
| CategorySection.tsx | 73 | `rounded-md` (collapsible trigger button) | Remove |
| DashboardSkeleton.tsx | 35,43,51 | `rounded-md` (Skeleton placeholders) | Remove |
| DashboardSkeleton.tsx | 59 | `rounded-md` (row placeholder) | Remove |
| DashboardSkeleton.tsx | 63,64 | `rounded-full` (Skeleton) | Remove |
| ChartEmptyState.tsx | 12 | `rounded-lg` (empty state border) | Remove |
| ExpenseDonutChart.tsx | 141 | `rounded-full` (legend color dot) | Remove |
| QuickAddPicker.tsx | 156 | `rounded-sm` (picker item) | Remove |
| QuickAddPicker.tsx | 201 | `rounded-full` (category dot) | Remove |
**Note on Skeleton components:** `Skeleton` in `src/components/ui/skeleton.tsx` has `rounded-md` in its base class (`animate-pulse rounded-md bg-accent`). When `--radius: 0`, `rounded-md` resolves to 0px automatically — skeleton rounding is already handled by the token. The hardcoded `rounded-full` overrides on individual `<Skeleton>` usages (which pass `className` that overrides the base) must still be removed to avoid pill-shaped skeletons.
---
## Common Pitfalls
### Pitfall 1: Skeleton `rounded-full` Overrides Persist
**What goes wrong:** After `--radius: 0`, the base `Skeleton` component becomes square. But in multiple pages, Skeleton elements are given `className="h-5 w-16 rounded-full"`. Since `rounded-full` uses a fixed `border-radius: 9999px` that does not derive from `--radius`, those skeleton placeholders remain pill-shaped.
**Why it happens:** `rounded-full` in Tailwind is always `9999px` regardless of the `--radius` token. Only `rounded-md`, `rounded-sm`, `rounded-lg`, `rounded-xl` etc. derive from `--radius`.
**How to avoid:** Remove `rounded-full` from every `className` passed to `<Skeleton>` as listed in the inventory above.
**Warning signs:** Pill-shaped loading placeholders visible on BudgetDetail, Template, Categories, QuickAdd pages after the token change.
### Pitfall 2: Recharts `radius` Prop vs. CSS
**What goes wrong:** `<Bar radius={4}>` and `<Bar radius={[4, 4, 0, 0]}>` are SVG attribute props, not CSS. Setting `--radius: 0` does not affect them. CSS overrides on `.recharts-rectangle` may also need `rx: 0; ry: 0` as SVG presentation attributes.
**Why it happens:** Recharts renders bars as `<rect rx="4" ry="4">` SVG elements. CSS `border-radius` on SVG `rect` has browser-level quirks — some browsers respect it, others require the `rx`/`ry` attributes.
**How to avoid:** Change the `radius` prop to `0` directly on `<Bar>` in both `SpendBarChart.tsx` and `IncomeBarChart.tsx`. This is the most reliable fix.
**Warning signs:** Chart bars still have rounded caps after CSS override but not prop change.
### Pitfall 3: Sonner Toast Radius Override Specificity
**What goes wrong:** Sonner's Toaster component passes `"--border-radius": "var(--radius)"` as an inline `style` prop. After setting `--radius: 0`, this should automatically propagate. However, Sonner also has its own internal styles.
**Why it happens:** The sonner.tsx wrapper already wires `--border-radius` to `var(--radius)`. When `--radius` becomes `0`, this should cascade automatically. The risk is Sonner's own stylesheet having higher specificity.
**How to avoid:** Verify in browser after `--radius: 0` change. If toasts are still rounded, add `[data-sonner-toast] { border-radius: 0 !important; }` to `index.css`.
**Warning signs:** Toast notifications still display with rounded corners after `--radius: 0` edit.
### Pitfall 4: `--color-chart-*` Still Referenced After Deletion
**What goes wrong:** After removing `--color-chart-1` through `--color-chart-5` from `index.css`, if any component still references them the color falls back to transparent/browser default (usually black or undefined).
**Why it happens:** The variables are only defined in one place but could theoretically be referenced in multiple chart config objects.
**How to avoid:** Before deleting, grep the entire `src/` directory for `color-chart` to confirm only `index.css` references them (already confirmed — zero TSX references found). Safe to delete.
**Warning signs:** Charts render with black or missing colors.
### Pitfall 5: `PageShell` `gap-6` Governs All Page Layouts
**What goes wrong:** `PageShell` uses `flex flex-col gap-6`. Because it wraps most pages, the gap between the page header and first content section is controlled here. Updating spacing in individual pages but not in `PageShell` creates inconsistency.
**Why it happens:** PageShell is a shared wrapper — spacing changes to individual pages don't affect header-to-content gap unless PageShell is also updated.
**How to avoid:** Update `PageShell` from `gap-6` to `gap-8` as part of the spacing wave. All pages using `PageShell` benefit automatically.
**Warning signs:** Pages with `PageShell` wrapper still show tight header-to-content gap despite page-level spacing upgrades.
### Pitfall 6: Donut Chart Legend Dots Remain Circular
**What goes wrong:** The custom legend in `ExpenseDonutChart.tsx` uses `<span className="inline-block size-3 shrink-0 rounded-full">` for category color dots. These remain pill/circle shaped because `rounded-full` is hardcoded.
**Why it happens:** The legend is custom HTML, not a Recharts component — token cascade doesn't reach it.
**How to avoid:** Remove `rounded-full` from the legend span. A square dot of 3×3px is intentionally square in the sharp design aesthetic.
**Warning signs:** Circular color swatches in the donut chart legend after the rework.
---
## Code Examples
### index.css Token Block (post-rework shape)
```css
/* Source: src/index.css — annotated for phase 5 changes */
@theme inline {
/* UI warmth — chroma 0.005 → 0.01 */
--color-background: oklch(0.98 0.01 260);
/* ... other base tokens unchanged ... */
/* Category text colors — UNCHANGED (already WCAG 4.5:1) */
--color-income: oklch(0.55 0.17 155);
/* ... */
/* Category fill colors — chroma raised to 0.22+ */
--color-income-fill: oklch(0.72 0.22 155);
--color-bill-fill: oklch(0.70 0.22 25);
--color-variable-expense-fill: oklch(0.74 0.22 50);
--color-debt-fill: oklch(0.66 0.23 355);
--color-saving-fill: oklch(0.72 0.22 220);
--color-investment-fill: oklch(0.68 0.22 285);
/* --color-chart-1 through --color-chart-5: DELETED */
--radius: 0; /* was 0.625rem */
}
```
[VERIFIED: src/index.css]
### SpendBarChart.tsx Post-Rework
```tsx
// Source: src/components/dashboard/charts/SpendBarChart.tsx — key changes
const chartConfig = {
budgeted: { label: "Budgeted", color: "var(--color-budget-bar-bg)" },
actual: { label: "Actual", color: "var(--color-muted-foreground)" },
} satisfies ChartConfig
// Bar radius props: 4 → 0
<Bar dataKey="budgeted" fill="var(--color-budgeted)" radius={0} />
<Bar dataKey="actual" radius={0}>
{/* Cell fill already uses var(--color-${entry.type}-fill) — correct */}
</Bar>
```
[VERIFIED: src/components/dashboard/charts/SpendBarChart.tsx]
### IncomeBarChart.tsx Post-Rework
```tsx
// Source: src/components/dashboard/charts/IncomeBarChart.tsx — key changes
const chartConfig = {
budgeted: { label: "Budgeted", color: "var(--color-budget-bar-bg)" },
actual: { label: "Actual", color: "var(--color-income-fill)" }, // unchanged — already correct
} satisfies ChartConfig
// Bar radius props: [4, 4, 0, 0] → 0
<Bar dataKey="budgeted" fill="var(--color-budgeted)" radius={0} />
<Bar dataKey="actual" radius={0}>
```
[VERIFIED: src/components/dashboard/charts/IncomeBarChart.tsx]
### PageShell Spacing Upgrade
```tsx
// Source: src/components/shared/PageShell.tsx — spacing change
// Before:
<div className="flex flex-col gap-6">
// After:
<div className="flex flex-col gap-8">
```
[VERIFIED: src/components/shared/PageShell.tsx]
### DashboardPage Section Spacing Upgrade
```tsx
// Source: src/pages/DashboardPage.tsx — key spacing changes
// Before: <div className="space-y-6">
// After: <div className="space-y-8">
// Before: <div className="grid gap-6 md:grid-cols-2 lg:grid-cols-3">
// After: <div className="grid gap-8 md:grid-cols-2 lg:grid-cols-3">
```
[VERIFIED: src/pages/DashboardPage.tsx lines 186, 207]
---
## State of the Art
| Old Approach | Current Approach | When Changed | Impact |
|--------------|------------------|--------------|--------|
| Separate `--color-chart-*` variables | Reference `--color-*-fill` directly | This phase | Eliminates color duplication; single source of truth per category |
| `--radius: 0.625rem` | `--radius: 0` | This phase | All shadcn components become sharp-cornered |
| Fill chroma 0.18-0.20 | Fill chroma 0.22+ | This phase | Visually saturated pastels that read as colorful, not grey |
| `gap-6` / `space-y-6` sections | `gap-8` / `space-y-8` | This phase | More generous breathing room between content sections |
---
## Assumptions Log
| # | Claim | Section | Risk if Wrong |
|---|-------|---------|---------------|
| A1 | Sonner toast `--border-radius: var(--radius)` inline style in sonner.tsx will propagate `--radius: 0` correctly without additional CSS override | Pitfall 3 / Pattern 2 | If wrong, toasts remain rounded; mitigation: add `[data-sonner-toast] { border-radius: 0 !important }` as CSS override |
| A2 | CSS `rx: 0; ry: 0` on `.recharts-rectangle` overrides SVG presentation attributes cross-browser | Pitfall 2 | If wrong, bars may still show rounding in some browsers; mitigation: change `radius` prop to 0 on `<Bar>` (reliable) |
| A3 | No `--color-chart-*` references exist in any TSX file (confirmed by grep returning zero results) | Don't Hand-Roll | LOW risk — grep confirmed no TSX references |
---
## Open Questions
1. **Sonner version 2.x selector name for border-radius override**
- What we know: Sonner 2.0.7 is installed; `[data-sonner-toast]` is the conventional selector from v1/v2
- What's unclear: Whether v2.x changed the data attribute name on the toast wrapper
- Recommendation: Verify in browser devtools after `--radius: 0` change; if toasts remain rounded, inspect the DOM element for the correct attribute selector
2. **`space-y-6` vs `gap-6` on TemplatePage and BudgetDetailPage**
- What we know: These pages use `space-y-6` for section stacking (not `gap-*` which requires flex/grid parent)
- What's unclear: Whether changing `space-y-6``space-y-8` alone is sufficient or whether the wrapping flex container also needs `gap-8`
- Recommendation: Apply `space-y-8` where currently `space-y-6`; apply `gap-8` where currently `gap-6` in flex/grid containers — both changes are needed depending on context
---
## Environment Availability
Step 2.6: SKIPPED — Phase 5 is purely CSS/TSX file edits with no external dependencies, database changes, or CLI tools beyond the existing Vite dev server.
---
## Validation Architecture
### Test Framework
| Property | Value |
|----------|-------|
| Framework | None detected — no jest.config.*, vitest.config.*, pytest.ini found |
| Config file | None — Wave 0 gap |
| Quick run command | `npm run build` (TypeScript compile check) |
| Full suite command | Manual visual pass across 9 pages in browser |
### Phase Requirements → Test Map
| Req ID | Behavior | Test Type | Automated Command | File Exists? |
|--------|----------|-----------|-------------------|-------------|
| DS-01 | No rounded corners visible anywhere | Manual (visual) | `npm run build` (compile check only) | N/A — visual |
| DS-02 | Category fills visibly colorful, not washed out | Manual (visual) | `npm run build` | N/A — visual |
| DS-03 | Generous whitespace, no visual crowding | Manual (visual) | `npm run build` | N/A — visual |
### Sampling Rate
- **Per task commit:** `npm run build` — confirms no TypeScript errors
- **Per wave merge:** `npm run build` + manual browser check of affected pages
- **Phase gate:** Full 9-page visual pass per the UI-SPEC checklist before `/gsd-verify-work`
### Wave 0 Gaps
- [ ] No unit/integration test infrastructure exists — this phase is purely visual; manual browser verification is the acceptance gate
- [ ] Consider running `npm run lint` as a secondary automated check
---
## Security Domain
Security enforcement: not applicable. Phase 5 introduces zero new features, endpoints, authentication flows, user input handling, or data access. No ASVS categories apply. This is a pure CSS token and spacing change.
---
## Sources
### Primary (HIGH confidence)
- `src/index.css` (codebase) — Full token inventory, current `--radius` value, all OKLCH color values, `--color-chart-*` variables
- `src/components/ui/` (codebase) — shadcn component source confirming `rounded-*` class usage, `sonner.tsx` Toaster inline style wiring
- `src/components/dashboard/charts/` (codebase) — Recharts `Bar` radius prop values, ChartConfig objects, Cell fill patterns
- `src/pages/` (codebase) — All 9 pages audited for `gap-*`, `space-y-*`, `rounded-*` classes
- `05-UI-SPEC.md` (project planning) — Confirmed post-rework color values, spacing targets, component inventory
### Secondary (MEDIUM confidence)
- Tailwind CSS 4 `@theme inline` documentation — `rounded-md` etc. derive from `--radius` token; `rounded-full` does not
### Tertiary (LOW confidence — A1, A2 in assumptions log)
- Sonner 2.x data attribute selector name (`[data-sonner-toast]`) — based on conventional usage; verify in browser
- Recharts CSS `rx`/`ry` override cross-browser behavior — recommend prop change as primary approach
---
## Metadata
**Confidence breakdown:**
- Token edit scope (index.css): HIGH — full file read, all variables inventoried
- Hardcoded rounded-* inventory: HIGH — exhaustive grep of src/pages + src/components
- Spacing upgrade targets: HIGH — grep confirmed current class values in all 9 pages
- Third-party overrides (Recharts, Sonner): MEDIUM — prop-based fix is reliable; CSS override selector needs browser verification
- Color OKLCH values: HIGH — values provided in CONTEXT.md and UI-SPEC.md
**Research date:** 2026-04-20
**Valid until:** 2026-05-20 (stable stack — Tailwind 4, Recharts 2.15, Sonner 2.x)

View File

@@ -0,0 +1,235 @@
---
phase: 5
slug: design-system-token-rework
status: draft
shadcn_initialized: true
preset: new-york / neutral / lucide
created: 2026-04-20
---
# Phase 5 — UI Design Contract
> Visual and interaction contract for Phase 5: Design System Token Rework.
> Generated by gsd-ui-researcher, verified by gsd-ui-checker.
>
> This phase is a pure token and spacing rework — no new components, no new features.
> Every entry in this contract describes what must be TRUE after the change, not before.
---
## Design System
| Property | Value | Source |
|----------|-------|--------|
| Tool | shadcn/ui | components.json |
| Style | new-york | components.json |
| Preset | neutral base, cssVariables: true | components.json |
| Component library | Radix UI (via shadcn) | components.json |
| Icon library | lucide-react | components.json |
| Font | Inter (--font-sans) | src/index.css |
---
## Spacing Scale
Declared values (all multiples of 4):
| Token | px Value | Tailwind Class | Usage |
|-------|----------|----------------|-------|
| xs | 4px | gap-1 / p-1 | Icon gaps, inline tight spacing |
| sm | 8px | gap-2 / p-2 | Compact inline elements, badge padding |
| md | 16px | gap-4 / p-4 | Default inline element spacing |
| lg | 24px | gap-6 / p-6 | Card internal padding (upgraded from p-4) |
| xl | 32px | gap-8 | Section gaps between cards and sections (upgraded from gap-6) |
| 2xl | 48px | gap-12 | Major section breaks, page-level vertical rhythm |
| 3xl | 64px | py-16 | Auth page vertical centering, hero areas |
**Phase 5 spacing changes (from CONTEXT.md):**
- Card internal padding: `p-4``p-6` across all 9 pages
- Section gaps: `gap-4``gap-6`, `gap-6``gap-8` across all pages
- Page header bottom margin: standardize to `mb-6` everywhere
- Section-to-section gap: standardize to `gap-8`
Exceptions: none — 8-point scale applies without exception.
---
## Typography
| Role | Size | Tailwind | Weight | Weight Class | Line Height | Usage |
|------|------|----------|--------|--------------|-------------|-------|
| Caption | 12px | text-xs | 400 | font-normal | 1.5 | Subtitles, secondary metadata |
| Body / Label | 14px | text-sm | 500 | font-medium | 1.5 | Table cells, form labels, card labels, stat subtitles |
| Base | 16px | text-base | 500 | font-medium | 1.5 | Card titles (e.g. chart section headings) |
| Heading | 24px | text-2xl | 600 | font-semibold | 1.2 | Page titles (PageShell h1), auth card titles, template names |
Source: Existing usage in PageShell, StatCard, DashboardPage, LoginPage, RegisterPage confirmed these four sizes as the complete in-use set.
Weights used: exactly 2 — `font-medium` (500) for body/data, `font-semibold` (600) for headings. The rare `font-bold` (700) occurrences in StatCard value display are reclassified as `font-semibold` for consistency.
---
## Color
### Base UI Tokens (post-rework values)
| Role | OKLCH Value | Usage |
|------|-------------|-------|
| Background (dominant, 60%) | oklch(0.98 0.01 260) | Page background — chroma lifted 0.005→0.01 for subtle warmth |
| Card / Popover (secondary, 30%) | oklch(1 0 0) | Cards, modals, popovers, sidebar surface |
| Sidebar | oklch(0.97 0.008 260) | Sidebar background — no change |
| Primary accent (10%) | oklch(0.55 0.15 260) | Active nav items, primary buttons, focus rings |
| Secondary / Muted | oklch(0.93 0.02 260) | Secondary buttons, muted chip backgrounds |
| Border / Input | oklch(0.88 0.01 260) | All borders and input outlines |
| Destructive | oklch(0.6 0.2 25) | Delete actions, error alerts only |
Accent reserved for: primary action buttons, active sidebar navigation item, focus ring outlines, primary CTA buttons. No other elements may use the primary OKLCH(0.55 0.15 260) value.
### Category Text Colors (WCAG 4.5:1 contrast on white — no change to lightness/chroma)
| Token | OKLCH Value | Hue |
|-------|-------------|-----|
| --color-income | oklch(0.55 0.17 155) | Green |
| --color-bill | oklch(0.55 0.17 25) | Orange-red |
| --color-variable-expense | oklch(0.58 0.16 50) | Amber |
| --color-debt | oklch(0.52 0.18 355) | Red |
| --color-saving | oklch(0.55 0.16 220) | Blue |
| --color-investment | oklch(0.55 0.16 285) | Violet |
### Category Fill Colors (post-rework — chroma raised to 0.22+)
These replace the current fill tokens (C=0.18-0.20). Exact values are at Claude's discretion per CONTEXT.md as long as chroma >= 0.22 and the fills remain visually distinct from each other.
| Token | Target OKLCH | Constraint |
|-------|--------------|------------|
| --color-income-fill | oklch(0.72 0.22 155) | C >= 0.22, L ~0.70-0.75 |
| --color-bill-fill | oklch(0.70 0.22 25) | C >= 0.22, L ~0.68-0.73 |
| --color-variable-expense-fill | oklch(0.74 0.22 50) | C >= 0.22, L ~0.70-0.76 |
| --color-debt-fill | oklch(0.66 0.23 355) | C >= 0.22, L ~0.64-0.70 |
| --color-saving-fill | oklch(0.72 0.22 220) | C >= 0.22, L ~0.70-0.75 |
| --color-investment-fill | oklch(0.68 0.22 285) | C >= 0.22, L ~0.65-0.72 |
### Chart Colors (post-rework — aligned to fill tokens)
The `--color-chart-1` through `--color-chart-5` variables are REMOVED. Chart components reference `--color-*-fill` tokens directly. This eliminates the duplicate color system.
| Removed | Replaced by |
|---------|-------------|
| --color-chart-1 | --color-income-fill |
| --color-chart-2 | --color-bill-fill |
| --color-chart-3 | --color-variable-expense-fill |
| --color-chart-4 | --color-debt-fill |
| --color-chart-5 | --color-saving-fill |
### Corner Radius
| Token | Current Value | Post-Rework Value | Effect |
|-------|--------------|-------------------|--------|
| --radius | 0.625rem (10px) | 0rem (0px) | All shadcn components become sharp-cornered |
Third-party overrides required (applied via CSS selectors in src/index.css):
- Recharts bar elements: force `rx="0" ry="0"` or CSS `border-radius: 0`
- Sonner toast container: override `.sonner-toast` border-radius to 0
---
## Copywriting Contract
Phase 5 is a pure visual rework — no new user-facing copy is introduced. The following existing copy elements remain unchanged and are documented here as the confirmed contract.
| Element | Copy | Notes |
|---------|------|-------|
| Primary CTA (Budget List) | "New Budget" | Existing — unchanged |
| Primary CTA (Template) | "Add item" | Existing — unchanged |
| Primary CTA (Categories) | "New Category" | Existing — unchanged |
| Empty state (Dashboard) | Translation key: `dashboard.noBudgetForMonth` | Existing — no copy changes this phase |
| Error state (auth forms) | Translation key: `auth.error` + specific message | Existing — no copy changes this phase |
| Destructive actions | None introduced in this phase | Token rework only |
No new destructive actions are introduced. No new confirmation dialogs. No new empty states.
---
## Component Inventory
Components affected by token changes (no code changes required — token cascade handles it):
| Component | Location | Rounding Source | Change Required |
|-----------|----------|-----------------|-----------------|
| Button | src/components/ui/button.tsx | --radius token | Automatic via --radius: 0 |
| Card | src/components/ui/card.tsx | --radius token | Automatic; padding class updated to p-6 |
| Input | src/components/ui/input.tsx | --radius token | Automatic via --radius: 0 |
| Badge | src/components/ui/badge.tsx | --radius token | Automatic via --radius: 0 |
| Select | src/components/ui/select.tsx | --radius token | Automatic via --radius: 0 |
| Sheet | src/components/ui/sheet.tsx | --radius token | Automatic via --radius: 0 |
| Dialog | src/components/ui/dialog.tsx | --radius token | Automatic via --radius: 0 |
| Popover | src/components/ui/popover.tsx | --radius token | Automatic via --radius: 0 |
| Sidebar | src/components/ui/sidebar.tsx | --radius token | Automatic via --radius: 0 |
| Dropdown Menu | src/components/ui/dropdown-menu.tsx | --radius token | Automatic via --radius: 0 |
| Recharts bars | SpendBarChart, IncomeBarChart | SVG rx/ry attrs | Explicit CSS override needed |
| Sonner toasts | src/components/ui/sonner.tsx | Sonner inline styles | CSS selector override needed |
| Category swatches | CategoriesPage, CategorySection | Hardcoded rounded-* | Audit and remove rounded-* classes |
| Budget progress bars | BudgetDetailPage | Hardcoded rounded-* | Audit and remove rounded-* classes |
Pages to audit for inline `rounded-*` classes (must be zero after this phase):
1. DashboardPage — CategorySection swatches, StatCard
2. BudgetListPage — budget item rows
3. BudgetDetailPage — progress bars, budget row items
4. TemplatePage — template item rows, category group headers
5. CategoriesPage — category color swatches
6. QuickAddPage — picker items
7. SettingsPage — form elements
8. LoginPage — auth card
9. RegisterPage — auth card
---
## Registry Safety
| Registry | Blocks Used | Safety Gate |
|----------|-------------|-------------|
| shadcn official (new-york) | button, card, badge, input, label, select, sheet, dialog, popover, sidebar, dropdown-menu, separator, skeleton, table, tooltip, sonner, chart, collapsible | not required |
| Third-party | none | not applicable |
No third-party registries. No vetting gate required.
---
## Interaction Contract
Phase 5 introduces no new interaction patterns. Existing interactions are preserved. The following are confirmed unchanged:
- Collapsible sections: 200ms ease-out open/close animation (--animate-collapsible-open/close) — no change
- Sidebar navigation: active state uses primary color — no change to behavior
- Form validation: error states use `--color-destructive` — no change
- Chart tooltips: Recharts default — style override via chart.tsx config only
---
## Visual Regression Checklist
The executor must perform a manual visual pass after all token changes confirming:
- [ ] No pill buttons visible on any of the 9 pages
- [ ] No rounded cards visible on any of the 9 pages
- [ ] No rounded inputs visible on any of the 9 pages
- [ ] Category fill colors are visibly colorful against white (not grey-tinted)
- [ ] Category text colors still appear dark/readable (not washed out by chroma increase)
- [ ] Section gaps feel generous — no visual crowding between cards
- [ ] Card internal padding feels spacious — content not flush against card edges
- [ ] Page headers have consistent bottom margin before first content section
- [ ] Recharts bars are square-ended (no rounded caps)
- [ ] Sonner toasts have sharp corners
---
## Checker Sign-Off
- [ ] Dimension 1 Copywriting: PASS
- [ ] Dimension 2 Visuals: PASS
- [ ] Dimension 3 Color: PASS
- [ ] Dimension 4 Typography: PASS
- [ ] Dimension 5 Spacing: PASS
- [ ] Dimension 6 Registry Safety: PASS
**Approval:** pending

View File

@@ -0,0 +1,74 @@
---
phase: 5
slug: design-system-token-rework
status: draft
nyquist_compliant: false
wave_0_complete: false
created: 2026-04-20
---
# Phase 5 — Validation Strategy
> Per-phase validation contract for feedback sampling during execution.
---
## Test Infrastructure
| Property | Value |
|----------|-------|
| **Framework** | vitest (existing) |
| **Config file** | `vite.config.ts` |
| **Quick run command** | `bun run build` |
| **Full suite command** | `bun run build && bun run lint` |
| **Estimated runtime** | ~15 seconds |
---
## Sampling Rate
- **After every task commit:** Run `bun run build`
- **After every plan wave:** Run `bun run build && bun run lint`
- **Before `/gsd-verify-work`:** Full suite must be green
- **Max feedback latency:** 15 seconds
---
## Per-Task Verification Map
| Task ID | Plan | Wave | Requirement | Threat Ref | Secure Behavior | Test Type | Automated Command | File Exists | Status |
|---------|------|------|-------------|------------|-----------------|-----------|-------------------|-------------|--------|
| 5-01-01 | 01 | 1 | DS-01 | — | N/A | build | `bun run build` | ✅ | ⬜ pending |
| 5-01-02 | 01 | 1 | DS-02 | — | N/A | build | `bun run build` | ✅ | ⬜ pending |
| 5-01-03 | 01 | 1 | DS-03 | — | N/A | build | `bun run build` | ✅ | ⬜ pending |
*Status: ⬜ pending · ✅ green · ❌ red · ⚠️ flaky*
---
## Wave 0 Requirements
*Existing infrastructure covers all phase requirements.*
---
## Manual-Only Verifications
| Behavior | Requirement | Why Manual | Test Instructions |
|----------|-------------|------------|-------------------|
| Sharp corners visible on all 9 pages | DS-01 | Visual verification — no programmatic way to confirm rendered border radius from tests | Open each page, inspect all cards/buttons/inputs for 0px radius |
| Category colors visibly colorful against white | DS-02 | Perception-based — WCAG contrast can be calculated but "visibly colorful" is subjective | Open categories page, compare swatches against white background |
| Layout uncluttered with consistent whitespace | DS-03 | Visual rhythm/spacing is a design judgment | Compare before/after screenshots of all 9 pages |
---
## Validation Sign-Off
- [ ] All tasks have `<automated>` verify or Wave 0 dependencies
- [ ] Sampling continuity: no 3 consecutive tasks without automated verify
- [ ] Wave 0 covers all MISSING references
- [ ] No watch-mode flags
- [ ] Feedback latency < 15s
- [ ] `nyquist_compliant: true` set in frontmatter
**Approval:** pending

View File

@@ -0,0 +1,224 @@
---
phase: 05-design-system-token-rework
verified: 2026-04-20T00:00:00Z
status: human_needed
score: 8/8 must-haves verified
overrides_applied: 0
gaps:
- truth: "Every rounded element across all 9 pages has sharp corners — no pill buttons, no rounded cards, no rounded inputs visible anywhere in the app"
status: partial
reason: >
The --radius: 0 token does NOT cascade to Tailwind v4's named radius utility scale.
The built CSS proves --radius-md=.375rem, --radius-xl=.75rem, --radius-lg=.5rem.
Shadcn primitive components use these named utilities: Card uses rounded-xl (0.75rem),
Button uses rounded-md (0.375rem), Input uses rounded-md (0.375rem), Badge uses
rounded-full, Popover/Dialog/Dropdown use rounded-md/rounded-lg. These components
still render with non-zero border-radius in the browser. The research document
incorrectly assumed Tailwind v4 derives --radius-* from --radius. Hardcoded
rounded-* classes were correctly removed from all pages and shared non-primitive
components (CONFIRMED), but the underlying shadcn primitive library radius values
remain unchanged.
artifacts:
- path: "src/index.css"
issue: "--radius: 0 is set but Tailwind v4 radius utilities (rounded-md, rounded-xl, etc.) use an independent scale (--radius-md, --radius-xl) that is NOT derived from --radius. Built CSS: --radius-xl=.75rem, --radius-md=.375rem."
- path: "src/components/ui/card.tsx"
issue: "Uses rounded-xl which maps to var(--radius-xl)=0.75rem — cards are not sharp"
- path: "src/components/ui/button.tsx"
issue: "Uses rounded-md which maps to var(--radius-md)=0.375rem — buttons are not sharp"
- path: "src/components/ui/input.tsx"
issue: "Uses rounded-md which maps to var(--radius-md)=0.375rem — inputs are not sharp"
missing:
- >
Add explicit --radius-* overrides to src/index.css @theme inline block to
zero-out the Tailwind v4 radius scale:
--radius-xs: 0;
--radius-sm: 0;
--radius-md: 0;
--radius-lg: 0;
--radius-xl: 0;
--radius-2xl: 0;
--radius-3xl: 0;
This will make all Tailwind rounded-* utilities resolve to 0, completing the
cascade that --radius: 0 alone cannot achieve in Tailwind v4.
human_verification:
- test: "Open each of the 9 pages and visually inspect for sharp corners on Cards, Buttons, Inputs, Badges, Selects, Dialogs, Popovers, and Dropdown Menus"
expected: "All elements have 0px border-radius (perfectly square corners) — no rounded cards, no rounded buttons, no rounded inputs anywhere"
why_human: "Rendered border-radius depends on --radius-* CSS var resolution which can only be confirmed visually in a browser or with computed style inspection. The gap analysis above predicts rounded corners on shadcn primitives but visual confirmation is required."
- test: "Open the Categories page and compare category color swatches against the white page background"
expected: "Swatches are visibly colorful (green income, orange/red bill, etc.) — not grey-tinted or washed out"
why_human: "Color vividness is a perceptual judgment. OKLCH chroma values (0.22-0.23) can be verified programmatically (CONFIRMED) but 'visibly colorful' perception requires human judgment."
- test: "Open the Dashboard page and confirm chart bars have square ends"
expected: "No rounded caps on bars in SpendBarChart or IncomeBarChart — bars terminate in 90-degree corners"
why_human: "CSS rx/ry override and radius={0} prop are both set, but Recharts SVG rendering behavior in the browser must be visually confirmed."
- test: "Navigate through all 9 pages and assess whitespace rhythm"
expected: "Section gaps feel spacious, card padding feels generous, no visual crowding between sections or cards"
why_human: "Spacing is a design judgment — gap-8 and space-y-8 values are confirmed in code but whether they achieve the 'generous whitespace' goal is subjective."
---
# Phase 5: Design System Token Rework — Verification Report
**Phase Goal:** Users see a sharp, minimal, clearly pastel UI across every page — the visual foundation that all subsequent phases build on
**Verified:** 2026-04-20
**Status:** HUMAN NEEDED (code gap fixed — awaiting visual confirmation)
**Re-verification:** No — initial verification
---
## Goal Achievement
### Observable Truths (Roadmap Success Criteria)
| # | Truth | Status | Evidence |
|---|-------|--------|---------|
| SC-1 | Every rounded element across all 9 pages has sharp corners — no pill buttons, no rounded cards, no rounded inputs | PARTIAL | Hardcoded rounded-* removed from all pages/shared components (CONFIRMED), but shadcn primitives (Card/Button/Input) use Tailwind v4 named radius utilities that resolve to non-zero values in built CSS (--radius-md=.375rem, --radius-xl=.75rem) |
| SC-2 | Category color swatches visibly colorful against white, still pass WCAG 4.5:1 | ? NEEDS HUMAN | All 6 fill vars raised to chroma 0.22-0.23 (CONFIRMED in index.css), WCAG text contrast vars separate and unchanged; visual confirmation needed |
| SC-3 | Page layouts feel uncluttered — consistent whitespace gaps, no visual crowding | ? NEEDS HUMAN | gap-8/space-y-8 implemented across all pages (CONFIRMED); subjective design judgment requires human |
| SC-4 | Full visual pass of all 9 pages confirms no regressions from token changes | ? NEEDS HUMAN | Build passes (CONFIRMED); visual pass cannot be automated |
**Verified:** 0/4 roadmap SCs fully verified (3 need human, 1 has a code gap)
### Plan Must-Haves (All Plans Combined)
| # | Must-Have | Status | Evidence |
|---|-----------|--------|---------|
| 1 | `--radius: 0` in index.css, cascading sharp corners to all shadcn components | PARTIAL | `--radius: 0` confirmed in index.css; cascade does NOT reach shadcn primitives via Tailwind v4's named radius utilities |
| 2 | Category fill chromas >= 0.22 | VERIFIED | income: 0.22, bill: 0.22, variable-expense: 0.22, debt: 0.23, saving: 0.22, investment: 0.22 |
| 3 | `--color-chart-*` variables deleted from index.css | VERIFIED | Zero matches for `color-chart-[1-5]` in entire src/ directory |
| 4 | Chart bars render with radius={0} (no rounded caps) | VERIFIED | SpendBarChart: 2x radius={0}; IncomeBarChart: 2x radius={0} |
| 5 | CSS overrides for Recharts rectangles and Sonner toasts | VERIFIED | `.recharts-rectangle { rx: 0; ry: 0 }` and `[data-sonner-toast] { border-radius: 0 !important }` in index.css |
| 6 | PageShell gap is gap-8 | VERIFIED | Line 15 of PageShell.tsx: `"flex flex-col gap-8"` |
| 7 | All shared component hardcoded rounded-* removed | VERIFIED | DashboardSkeleton, CategorySection, ChartEmptyState, QuickAddPicker all clean |
| 8 | All 9 pages have no hardcoded rounded-* classes remaining | VERIFIED | grep -rn on src/pages/ returns NO matches |
**Plan score:** 7/8 must-haves fully verified (1 partial on cascading)
---
## Required Artifacts
| Artifact | Expected | Status | Details |
|----------|----------|--------|---------|
| `src/index.css` | Token source with --radius: 0, raised fill chromas, removed chart vars, overrides | VERIFIED | All token values confirmed correct |
| `src/components/dashboard/charts/SpendBarChart.tsx` | Sharp bars with radius={0} | VERIFIED | 2 matches for radius={0}, no radius={4} |
| `src/components/dashboard/charts/IncomeBarChart.tsx` | Sharp bars with radius={0} | VERIFIED | 2 matches for radius={0}, no radius=[4,4,0,0] |
| `src/components/dashboard/charts/ExpenseDonutChart.tsx` | Square legend dots (no rounded-full) | VERIFIED | `inline-block size-3 shrink-0` at line 141 |
| `src/components/shared/PageShell.tsx` | gap-8 section spacing | VERIFIED | `flex flex-col gap-8` at line 15 |
| `src/components/dashboard/DashboardSkeleton.tsx` | Sharp skeletons, upgraded spacing | VERIFIED | No rounded classes; gap-8 outer and chart grid |
| `src/components/dashboard/CategorySection.tsx` | No rounded-md on trigger | VERIFIED | `flex items-center gap-3 border-l-4 bg-card px-4 py-3` |
| `src/components/dashboard/charts/ChartEmptyState.tsx` | No rounded-lg | VERIFIED | Dashed border container has no rounded class |
| `src/components/QuickAddPicker.tsx` | No rounded-sm or rounded-full | VERIFIED | Zero matches |
| `src/pages/DashboardPage.tsx` | space-y-8 and gap-8 | VERIFIED | Lines 186 and 207 |
| `src/pages/BudgetListPage.tsx` | No rounded-md on row containers | VERIFIED | Row div: `flex items-center gap-3 border p-3` |
| `src/pages/BudgetDetailPage.tsx` | No rounded-sm/md/full | VERIFIED | Zero matches in src/pages/ sweep |
| `src/pages/TemplatePage.tsx` | No rounded-sm/full, upgraded spacing | VERIFIED | Zero matches; gap-8 and space-y-8 confirmed |
| `src/pages/CategoriesPage.tsx` | No rounded-sm/full, upgraded spacing | VERIFIED | Zero matches; space-y-8 confirmed |
| `src/pages/QuickAddPage.tsx` | No rounded-full/md | VERIFIED | Zero matches |
| `src/pages/SettingsPage.tsx` | space-y-6 in CardContent | VERIFIED | Both CardContent instances at lines 69 and 87 |
| `src/pages/LoginPage.tsx` | No rounded classes (token cascade) | VERIFIED | No hardcoded rounded-* |
| `src/pages/RegisterPage.tsx` | No rounded classes (token cascade) | VERIFIED | No hardcoded rounded-* |
---
## Key Link Verification
| From | To | Via | Status | Details |
|------|-----|-----|--------|---------|
| `src/index.css` | All shadcn primitives (Card, Button, Input, etc.) | `--radius: 0` token cascade through Tailwind v4 named utilities | BROKEN | Built CSS: rounded-xl=var(--radius-xl)=0.75rem; --radius: 0 does not override --radius-xl in Tailwind v4's default scale |
| `src/index.css` | App components (pages, shared components) | Hardcoded rounded-* class removal + --radius: 0 | PARTIAL | All hardcoded classes removed (VERIFIED); but underlying shadcn primitives still apply radius via utility scale |
| `src/index.css` | Chart components | `--color-*-fill` CSS variables | WIRED | Charts use `var(--color-${entry.type}-fill)` which maps to the updated tokens |
| `src/index.css` | Recharts SVG | `.recharts-rectangle { rx: 0; ry: 0 }` | WIRED | Override present in index.css; included in built CSS |
| `src/index.css` | Sonner toasts | `[data-sonner-toast] { border-radius: 0 !important }` | WIRED | Override present; confirmed in built CSS |
---
## Data-Flow Trace (Level 4)
Not applicable — this phase modifies CSS tokens and JSX class strings only. No dynamic data rendering introduced.
---
## Behavioral Spot-Checks
| Behavior | Command | Result | Status |
|----------|---------|--------|--------|
| Build passes cleanly | `bun run build` | Exit 0 in 460ms | PASS |
| No rounded-* in pages | `grep -rn "rounded-full\|rounded-sm\|rounded-md\|rounded-lg" src/pages/` | No matches | PASS |
| No rounded-* in modified shared components | grep across dashboard/, shared/, QuickAddPicker.tsx | No matches | PASS |
| `--radius: 0` in index.css | `grep -n "\-\-radius" src/index.css` | Line 65: `--radius: 0;` | PASS |
| Fill chroma >= 0.22 | `grep "\-\-color-.*-fill" src/index.css` | All 6 vars: 0.22-0.23 | PASS |
| No color-chart-* vars in src/ | `grep -rn "color-chart" src/` | No matches | PASS |
| Chart radius={0} | `grep "radius" SpendBarChart.tsx IncomeBarChart.tsx` | 2 matches each, all radius={0} | PASS |
| Built CSS radius scale | `grep radius-md dist/assets/*.css` | --radius-md:0 | PASS — fixed by adding explicit --radius-* tokens |
| Commits exist | `git log --oneline` | 99b5b5f, 4c74dec, e8f13c9, e7282fa, 00670af all present | PASS |
---
## Requirements Coverage
| Requirement | Plans | Description | Status | Evidence |
|-------------|-------|-------------|--------|---------|
| DS-01 | 05-01, 05-02, 05-03 | User sees sharp-edged UI across all pages (no rounded corners) | PARTIAL | Hardcoded rounded-* removed from all pages and app-layer components; shadcn primitives still use Tailwind v4 named radius utilities that resolve to non-zero values |
| DS-02 | 05-01, 05-03 | User sees clear pastel colors that are visibly colorful, not washed out | NEEDS HUMAN | Fill chroma values raised to 0.22-0.23 (code confirmed); visual perception of color vividness requires human confirmation |
| DS-03 | 05-02, 05-03 | User sees clean, minimal layout with generous whitespace | NEEDS HUMAN | gap-8/space-y-8 spacing values confirmed in all pages; whether this reads as "generous whitespace" requires human design judgment |
---
## Anti-Patterns Found
| File | Pattern | Severity | Impact |
|------|---------|----------|--------|
| `src/index.css` | `--radius: 0` assumed to cascade to Tailwind v4 named radius utilities, but built CSS proves --radius-md=.375rem | BLOCKER | shadcn Cards, Buttons, Inputs remain rounded despite the token change |
| `05-RESEARCH.md` | Research document incorrectly states "rounded-* utilities derive from --radius" in Tailwind v4 | INFO | Root cause of the gap; no direct code impact, but planning assumption was wrong |
---
## Human Verification Required
### 1. Sharp Corners on Shadcn Primitives
**Test:** Open the app (`bun run dev`), then inspect Cards (on Dashboard, Budget List, Login), Buttons (all pages), and Inputs (Settings, Login, Register) using browser DevTools (Computed styles → border-radius).
**Expected:** border-radius = 0px on all elements
**Why human:** Browser DevTools can confirm the actual computed border-radius. The code gap analysis predicts non-zero radius on shadcn primitives (Card=0.75rem, Button/Input=0.375rem), but runtime behavior must be confirmed visually and via DevTools to be certain.
### 2. Category Color Vividness (DS-02)
**Test:** Open the Categories page and the Dashboard category sections. Compare category color swatches against the white page background.
**Expected:** Swatches are clearly, distinctly colorful — income green is vivid, bill orange/red is vivid, etc. None appear grey-tinted or washed out.
**Why human:** Color vividness (chroma 0.22-0.23 OKLCH) is a perceptual judgment. The token values are confirmed correct but whether they achieve "clearly pastel" vs "washed out" requires human perception.
### 3. Bar Chart Square Ends (DS-01 partial)
**Test:** Open the Dashboard and observe the SpendBarChart and IncomeBarChart. Look at the tops of the bars.
**Expected:** Bar tops terminate in 90-degree corners — no visible rounded caps. The `.recharts-rectangle` CSS override and `radius={0}` prop are both in place.
**Why human:** Recharts SVG rendering of the CSS `rx`/`ry` override needs visual confirmation in a browser.
### 4. Whitespace and Layout Rhythm (DS-03)
**Test:** Navigate through all 9 pages — Dashboard, Budget List, Budget Detail, Template, Categories, Quick Add, Settings, Login, Register.
**Expected:** Section gaps feel spacious and uncluttered. Content is readable without feeling cramped. Page headers have consistent spacing before first content section.
**Why human:** Whether gap-8 and space-y-8 achieve "generous whitespace" and a "clean, minimal layout" is a design judgment that cannot be verified programmatically.
---
## Gaps Summary
**1 code gap blocking full goal achievement:**
The `--radius: 0` token in `src/index.css` was correctly set, and the research/plan correctly identified that this should cascade to all shadcn UI components. However, Tailwind v4's named radius utility scale (`--radius-md`, `--radius-xl`, etc.) is an **independent scale** that is NOT derived from `--radius`. The built CSS confirms `--radius-md: .375rem` and `--radius-xl: .75rem` remain at their Tailwind defaults.
All shadcn primitive components use these named utilities:
- `Card``rounded-xl``var(--radius-xl)` = **0.75rem** (not sharp)
- `Button``rounded-md``var(--radius-md)` = **0.375rem** (not sharp)
- `Input``rounded-md``var(--radius-md)` = **0.375rem** (not sharp)
- `Badge``rounded-full`**3.4e38px** (pill-shaped — not sharp)
- `Select``rounded-md`**0.375rem** (not sharp)
- `Dialog`/`Sheet`/`Popover``rounded-md`/`rounded-lg` → non-zero (not sharp)
The fix is a one-line addition to the `@theme inline` block in `src/index.css` — explicitly set all radius scale variables to 0 alongside `--radius: 0`.
All other must-haves are fully verified. The spacing upgrades, fill color chromas, chart var removal, chart Bar radius, Recharts/Sonner CSS overrides, and hardcoded rounded-* removal from all pages and shared components are all correctly implemented and confirmed in the actual codebase.
---
_Verified: 2026-04-20_
_Verifier: Claude (gsd-verifier)_

View File

@@ -0,0 +1,256 @@
---
phase: 06-preset-data-first-run-detection-and-db-safety
plan: 01
type: execute
wave: 1
depends_on: []
files_modified:
- supabase/migrations/006_uniqueness_constraints.sql
- supabase/migrations/007_setup_completed.sql
- src/lib/types.ts
autonomous: true
requirements:
- AUTO-01
- AUTO-03
- SETUP-01
must_haves:
truths:
- "Migration 006 adds a unique constraint on budgets(user_id, start_date) with safe deduplication"
- "Migration 006 adds a unique constraint on categories(user_id, name) with safe deduplication"
- "Migration 007 adds setup_completed boolean NOT NULL DEFAULT false to profiles"
- "Migration 007 backfills setup_completed = true for all users with existing categories"
- "Profile TypeScript interface includes setup_completed: boolean"
artifacts:
- path: "supabase/migrations/006_uniqueness_constraints.sql"
provides: "Atomic deduplication + unique constraint DDL for budgets and categories"
- path: "supabase/migrations/007_setup_completed.sql"
provides: "ALTER TABLE profiles ADD COLUMN setup_completed + backfill UPDATE"
- path: "src/lib/types.ts"
provides: "Updated Profile interface with setup_completed field"
contains: "setup_completed: boolean"
key_links:
- from: "supabase/migrations/007_setup_completed.sql"
to: "profiles table"
via: "ALTER TABLE profiles ADD COLUMN"
pattern: "setup_completed boolean NOT NULL DEFAULT false"
- from: "src/lib/types.ts"
to: "Profile interface"
via: "TypeScript field"
pattern: "setup_completed: boolean"
---
<objective>
Write two Supabase migration files and update the Profile TypeScript type.
Migration 006 makes duplicate budget/category creation impossible at the DB level by first deduplicating any existing rows then adding UNIQUE constraints. Migration 007 adds the `setup_completed` boolean column to `profiles` and backfills existing users who have categories to `true`. The TypeScript `Profile` interface in `src/lib/types.ts` is updated to include `setup_completed: boolean`.
Purpose: The DB layer must enforce uniqueness atomically (prevents race conditions) and must know which users have already completed setup (prevents existing v1.0 users from seeing the wizard on first v2.0 login).
Output: 2 `.sql` migration files + 1 updated TypeScript type file.
</objective>
<execution_context>
@$HOME/.claude/get-shit-done/workflows/execute-plan.md
@$HOME/.claude/get-shit-done/templates/summary.md
</execution_context>
<context>
@.planning/PROJECT.md
@.planning/ROADMAP.md
@.planning/STATE.md
@.planning/phases/06-preset-data-first-run-detection-and-db-safety/06-CONTEXT.md
@.planning/phases/06-preset-data-first-run-detection-and-db-safety/06-RESEARCH.md
<interfaces>
<!-- Existing migration chain: 001-005. New files must be named 006_... and 007_... for correct lexicographic ordering. -->
From supabase/migrations/001_profiles.sql — profiles table columns:
id, display_name, locale, currency, created_at, updated_at
(NO setup_completed yet)
From supabase/migrations/002_categories.sql — categories table:
id, user_id, name, type, icon, sort_order, created_at, updated_at
Existing index: categories_user_id_idx
(NO unique constraint on (user_id, name) yet)
From supabase/migrations/004_budgets.sql — budgets table:
id, user_id, start_date, end_date, currency, carryover_amount, created_at, updated_at
Existing index: budgets_user_id_idx
(NO unique constraint on (user_id, start_date) yet)
From src/lib/types.ts — Profile interface (before this plan):
export interface Profile {
id: string
display_name: string | null
locale: string
currency: string
created_at: string
updated_at: string
}
</interfaces>
</context>
<tasks>
<task type="auto">
<name>Task 1: Write migration 006 — uniqueness constraints with safe deduplication</name>
<files>supabase/migrations/006_uniqueness_constraints.sql</files>
<read_first>
- supabase/migrations/002_categories.sql
- supabase/migrations/004_budgets.sql
- .planning/phases/06-preset-data-first-run-detection-and-db-safety/06-RESEARCH.md (Pattern 1: Safe Deduplication)
</read_first>
<action>
Create `supabase/migrations/006_uniqueness_constraints.sql` with this exact content — a single transaction that deduplicates then constrains:
```sql
-- Migration 006: Add uniqueness constraints to budgets and categories
-- Safe deduplication runs first inside the transaction before each constraint.
BEGIN;
-- Deduplicate budgets: keep the oldest row per (user_id, start_date)
DELETE FROM budgets
WHERE id NOT IN (
SELECT DISTINCT ON (user_id, start_date) id
FROM budgets
ORDER BY user_id, start_date, created_at ASC
);
ALTER TABLE budgets
ADD CONSTRAINT budgets_user_month_unique UNIQUE (user_id, start_date);
-- Deduplicate categories: keep the oldest row per (user_id, name)
DELETE FROM categories
WHERE id NOT IN (
SELECT DISTINCT ON (user_id, name) id
FROM categories
ORDER BY user_id, name, created_at ASC
);
ALTER TABLE categories
ADD CONSTRAINT categories_user_name_unique UNIQUE (user_id, name);
COMMIT;
```
Key: DISTINCT ON requires ORDER BY on the same leading columns — already satisfied above. Wrapping both operations in a single transaction means if constraint ADD fails, cleanup rolls back too.
</action>
<verify>
<automated>grep -c "ADD CONSTRAINT" supabase/migrations/006_uniqueness_constraints.sql && grep -c "BEGIN" supabase/migrations/006_uniqueness_constraints.sql && grep -c "COMMIT" supabase/migrations/006_uniqueness_constraints.sql</automated>
</verify>
<done>File exists. Contains exactly 2 ADD CONSTRAINT statements, 1 BEGIN, 1 COMMIT. Both constraints named: budgets_user_month_unique and categories_user_name_unique.</done>
</task>
<task type="auto">
<name>Task 2: Write migration 007 — setup_completed column + backfill</name>
<files>supabase/migrations/007_setup_completed.sql</files>
<read_first>
- supabase/migrations/001_profiles.sql
- .planning/phases/06-preset-data-first-run-detection-and-db-safety/06-RESEARCH.md (Pattern 2: ADD COLUMN with Default + Backfill, Pitfall 3)
</read_first>
<action>
Create `supabase/migrations/007_setup_completed.sql` with this exact content:
```sql
-- Migration 007: Add setup_completed to profiles
-- New signups default to false (not set up).
-- Existing users who have any categories are backfilled to true (already set up).
-- Wider backfill also includes users with template items to protect against
-- edge case where user created template items but skipped category creation.
ALTER TABLE profiles
ADD COLUMN setup_completed boolean NOT NULL DEFAULT false;
-- Backfill: users with categories OR template items are considered set up
UPDATE profiles
SET setup_completed = true
WHERE id IN (
SELECT DISTINCT user_id FROM categories
UNION
SELECT t.user_id FROM templates t
INNER JOIN template_items ti ON ti.template_id = t.id
);
```
Note: The wider backfill UNION (categories OR template items) matches Pitfall 3 guidance from RESEARCH.md — protects v1.0 users who may have template items but no categories.
</action>
<verify>
<automated>grep -c "ADD COLUMN setup_completed" supabase/migrations/007_setup_completed.sql && grep -c "UPDATE profiles" supabase/migrations/007_setup_completed.sql</automated>
</verify>
<done>File exists. Contains ADD COLUMN statement with `boolean NOT NULL DEFAULT false` and UPDATE statement with UNION backfill covering both categories and template_items.</done>
</task>
<task type="auto">
<name>Task 3: Update Profile TypeScript interface to include setup_completed</name>
<files>src/lib/types.ts</files>
<read_first>
- src/lib/types.ts
</read_first>
<action>
In `src/lib/types.ts`, add `setup_completed: boolean` to the `Profile` interface. The field goes after `currency` and before `created_at`:
```typescript
export interface Profile {
id: string
display_name: string | null
locale: string
currency: string
setup_completed: boolean // <-- ADD THIS LINE
created_at: string
updated_at: string
}
```
No other changes to types.ts.
</action>
<verify>
<automated>grep -n "setup_completed: boolean" src/lib/types.ts</automated>
</verify>
<done>`src/lib/types.ts` contains `setup_completed: boolean` inside the Profile interface. `tsc --noEmit` passes with no new errors.</done>
</task>
</tasks>
<threat_model>
## Trust Boundaries
| Boundary | Description |
|----------|-------------|
| Migration SQL → Supabase DB | DDL runs with superuser privileges via Supabase CLI — only run locally or in controlled CI |
| Client → profiles RLS | Client can UPDATE own profile row including setup_completed — acceptable since it's a UX flag, not a security gate |
## STRIDE Threat Register
| Threat ID | Category | Component | Disposition | Mitigation Plan |
|-----------|----------|-----------|-------------|-----------------|
| T-06-01 | Tampering | budgets table — duplicate row creation via concurrent requests | mitigate | UNIQUE constraint on (user_id, start_date) enforced at DB level; second INSERT returns PostgREST error 23505 |
| T-06-02 | Tampering | categories table — duplicate name creation | mitigate | UNIQUE constraint on (user_id, name) enforced at DB level; second INSERT returns PostgREST error 23505 |
| T-06-03 | Elevation of privilege | profiles.setup_completed — client sets own flag to false to force wizard re-display | accept | setup_completed is a UX routing flag only; no data is gated behind it; RLS allows own-row update |
</threat_model>
<verification>
After all 3 tasks complete:
```bash
# Confirm both migration files exist
ls supabase/migrations/006_uniqueness_constraints.sql supabase/migrations/007_setup_completed.sql
# Confirm TypeScript type updated
grep "setup_completed: boolean" src/lib/types.ts
# Confirm TypeScript compiles cleanly
npx tsc --noEmit
```
</verification>
<success_criteria>
- `supabase/migrations/006_uniqueness_constraints.sql` exists, contains BEGIN/COMMIT, two DISTINCT ON dedup DELETEs, two ADD CONSTRAINT statements
- `supabase/migrations/007_setup_completed.sql` exists, adds column with `boolean NOT NULL DEFAULT false`, backfills with UNION covering categories and template_items
- `src/lib/types.ts` Profile interface has `setup_completed: boolean`
- `tsc --noEmit` passes with no errors
</success_criteria>
<output>
After completion, create `.planning/phases/06-preset-data-first-run-detection-and-db-safety/06-01-SUMMARY.md`
</output>

View File

@@ -0,0 +1,75 @@
---
phase: 06-preset-data-first-run-detection-and-db-safety
plan: "01"
subsystem: database
tags: [migrations, schema, typescript, constraints, first-run]
dependency_graph:
requires: []
provides: [uniqueness-constraints, setup_completed-column, profile-type-update]
affects: [profiles, budgets, categories]
tech_stack:
added: []
patterns: [safe-deduplication-before-unique-constraint, alter-table-with-backfill]
key_files:
created:
- supabase/migrations/006_uniqueness_constraints.sql
- supabase/migrations/007_setup_completed.sql
modified:
- src/lib/types.ts
decisions:
- "Used wider UNION backfill in 007 (categories OR template_items) per Pitfall 3 guidance — protects v1.0 users with templates but no categories"
- "Migration 006 wraps deduplication DELETE and ADD CONSTRAINT in single BEGIN/COMMIT for atomicity"
metrics:
duration: "4 minutes"
completed: "2026-04-20"
tasks_completed: 3
tasks_total: 3
---
# Phase 06 Plan 01: DB Safety Constraints and First-Run Flag Summary
**One-liner:** Two atomic SQL migrations adding UNIQUE constraints on budgets/categories with safe deduplication, plus a `setup_completed` boolean on profiles with UNION backfill, synced to the TypeScript Profile interface.
## Tasks Completed
| Task | Name | Commit | Files |
|------|------|--------|-------|
| 1 | Migration 006: uniqueness constraints | 23fd3fa | supabase/migrations/006_uniqueness_constraints.sql |
| 2 | Migration 007: setup_completed column + backfill | 0f441b6 | supabase/migrations/007_setup_completed.sql |
| 3 | Update Profile TypeScript interface | 39840ca | src/lib/types.ts |
## What Was Built
**Migration 006** (`006_uniqueness_constraints.sql`): A single `BEGIN/COMMIT` transaction that:
1. DELETEs duplicate budgets keeping the oldest per `(user_id, start_date)` using `DISTINCT ON`
2. ADDs `CONSTRAINT budgets_user_month_unique UNIQUE (user_id, start_date)`
3. DELETEs duplicate categories keeping the oldest per `(user_id, name)` using `DISTINCT ON`
4. ADDs `CONSTRAINT categories_user_name_unique UNIQUE (user_id, name)`
**Migration 007** (`007_setup_completed.sql`): Two statements:
1. `ALTER TABLE profiles ADD COLUMN setup_completed boolean NOT NULL DEFAULT false`
2. `UPDATE profiles SET setup_completed = true WHERE id IN (SELECT DISTINCT user_id FROM categories UNION SELECT t.user_id FROM templates t INNER JOIN template_items ti ON ti.template_id = t.id)`
**TypeScript** (`src/lib/types.ts`): Added `setup_completed: boolean` to the `Profile` interface between `currency` and `created_at`. `tsc --noEmit` passes cleanly.
## Deviations from Plan
None — plan executed exactly as written. The UNION backfill in migration 007 was specified in the plan (per Pitfall 3 guidance from RESEARCH.md).
## Known Stubs
None — this plan produces SQL DDL and a TypeScript type update; no UI or data-flow stubs.
## Threat Flags
No new threat surface beyond what was documented in the plan's threat model. The UNIQUE constraints directly address T-06-01 and T-06-02. The `setup_completed` column is a UX routing flag with existing RLS (T-06-03 accepted).
## Self-Check
- [x] `supabase/migrations/006_uniqueness_constraints.sql` exists — FOUND
- [x] `supabase/migrations/007_setup_completed.sql` exists — FOUND
- [x] `src/lib/types.ts` contains `setup_completed: boolean` — FOUND (line 16)
- [x] `tsc --noEmit` passed with no errors
- [x] Commits 23fd3fa, 0f441b6, 39840ca exist in git log
## Self-Check: PASSED

View File

@@ -0,0 +1,283 @@
---
phase: 06-preset-data-first-run-detection-and-db-safety
plan: 02
type: execute
wave: 1
depends_on: []
files_modified:
- src/data/presets.ts
- src/i18n/en.json
- src/i18n/de.json
autonomous: true
requirements:
- SETUP-02
must_haves:
truths:
- "src/data/presets.ts exports a PRESETS array of exactly 19 typed items"
- "PRESETS covers all 6 category types with the agreed distribution (4+4+5+2+2+2)"
- "Every preset item has a slug, type (valid CategoryType), defaultAmount (round number EUR), and item_tier (fixed or variable)"
- "en.json has a top-level presets key with all 19 slugs translated to English"
- "de.json has a top-level presets key with all 19 slugs translated to German"
artifacts:
- path: "src/data/presets.ts"
provides: "PresetItem interface and PRESETS array"
exports: ["PresetItem", "PRESETS"]
- path: "src/i18n/en.json"
provides: "English preset translations under presets.* key"
contains: "presets"
- path: "src/i18n/de.json"
provides: "German preset translations under presets.* key"
contains: "presets"
key_links:
- from: "src/data/presets.ts"
to: "src/lib/types.ts"
via: "import CategoryType"
pattern: "import.*CategoryType.*from.*types"
- from: "src/i18n/en.json"
to: "presets.{type}.{slug}"
via: "react-i18next t() dot-path"
pattern: "\"presets\":"
---
<objective>
Create the static preset budget item library and its i18n translations.
`src/data/presets.ts` exports `PresetItem` interface and `PRESETS` array with 19 items across 6 category types (4 income, 4 bill, 5 variable_expense, 2 debt, 2 saving, 2 investment). Both `src/i18n/en.json` and `src/i18n/de.json` get a new top-level `"presets"` key containing all 19 English/German display names.
Purpose: This is the curated item library the Phase 7 wizard shows to new users for one-click budget template setup. All amounts are plain EUR numbers — the wizard reads currency from `profiles.currency`, not from this file.
Output: `src/data/presets.ts`, updated `en.json`, updated `de.json`.
</objective>
<execution_context>
@$HOME/.claude/get-shit-done/workflows/execute-plan.md
@$HOME/.claude/get-shit-done/templates/summary.md
</execution_context>
<context>
@.planning/phases/06-preset-data-first-run-detection-and-db-safety/06-CONTEXT.md
@.planning/phases/06-preset-data-first-run-detection-and-db-safety/06-RESEARCH.md
<interfaces>
From src/lib/types.ts:
```typescript
export type CategoryType =
| "income"
| "bill"
| "variable_expense"
| "debt"
| "saving"
| "investment"
export type ItemTier = "fixed" | "variable" | "one_off"
```
From src/i18n/en.json — existing top-level structure (add "presets" alongside these):
"app", "nav", "auth", "categories", "template", "budget", "settings", "common"
i18n library: react-i18next — uses t('dot.path.key') syntax confirmed.
NOTE: Do NOT hardcode currency symbols in preset display names or amounts.
Amounts are plain numbers (EUR value). The wizard (Phase 7) will format them.
</interfaces>
</context>
<tasks>
<task type="auto">
<name>Task 1: Create src/data/presets.ts — 19-item preset library</name>
<files>src/data/presets.ts</files>
<read_first>
- src/lib/types.ts
- .planning/phases/06-preset-data-first-run-detection-and-db-safety/06-RESEARCH.md (Pattern 4: Preset Data File Shape)
</read_first>
<action>
Create `src/data/presets.ts`. The file must NOT import from Supabase or React — it is a pure static data module.
```typescript
import type { CategoryType } from "@/lib/types"
export interface PresetItem {
slug: string
type: CategoryType
defaultAmount: number // EUR, round number — do NOT suffix with currency symbol
item_tier: "fixed" | "variable"
}
export const PRESETS: PresetItem[] = [
// income (4)
{ slug: "salary", type: "income", defaultAmount: 3000, item_tier: "fixed" },
{ slug: "freelance", type: "income", defaultAmount: 500, item_tier: "variable" },
{ slug: "rental_income", type: "income", defaultAmount: 800, item_tier: "fixed" },
{ slug: "other_income", type: "income", defaultAmount: 200, item_tier: "variable" },
// bill (4)
{ slug: "rent", type: "bill", defaultAmount: 1000, item_tier: "fixed" },
{ slug: "electricity", type: "bill", defaultAmount: 80, item_tier: "fixed" },
{ slug: "internet", type: "bill", defaultAmount: 40, item_tier: "fixed" },
{ slug: "phone", type: "bill", defaultAmount: 30, item_tier: "fixed" },
// variable_expense (5)
{ slug: "groceries", type: "variable_expense", defaultAmount: 400, item_tier: "variable" },
{ slug: "transport", type: "variable_expense", defaultAmount: 100, item_tier: "variable" },
{ slug: "dining_out", type: "variable_expense", defaultAmount: 150, item_tier: "variable" },
{ slug: "health", type: "variable_expense", defaultAmount: 50, item_tier: "variable" },
{ slug: "clothing", type: "variable_expense", defaultAmount: 100, item_tier: "variable" },
// debt (2)
{ slug: "loan_repayment", type: "debt", defaultAmount: 200, item_tier: "fixed" },
{ slug: "credit_card", type: "debt", defaultAmount: 100, item_tier: "fixed" },
// saving (2)
{ slug: "emergency_fund", type: "saving", defaultAmount: 200, item_tier: "fixed" },
{ slug: "vacation", type: "saving", defaultAmount: 100, item_tier: "fixed" },
// investment (2)
{ slug: "etf", type: "investment", defaultAmount: 200, item_tier: "fixed" },
{ slug: "pension", type: "investment", defaultAmount: 100, item_tier: "fixed" },
]
```
The `item_tier` for all items must be either `"fixed"` or `"variable"` — never `"one_off"` (which is excluded from template_items by the DB check constraint).
</action>
<verify>
<automated>grep -c "slug:" src/data/presets.ts</automated>
</verify>
<done>File exists. Contains exactly 19 objects (grep -c "slug:" returns 19). All `type` values are valid CategoryType strings. No `item_tier: "one_off"` present. `tsc --noEmit` passes.</done>
</task>
<task type="auto">
<name>Task 2: Add preset translations to en.json and de.json</name>
<files>src/i18n/en.json, src/i18n/de.json</files>
<read_first>
- src/i18n/en.json
- src/i18n/de.json
</read_first>
<action>
Add a top-level `"presets"` key to both i18n files. The key structure is `presets.{category_type}.{slug}` — matching the `type` and `slug` fields in PRESETS.
For `src/i18n/en.json`, add after the last existing top-level key:
```json
"presets": {
"income": {
"salary": "Salary",
"freelance": "Freelance Income",
"rental_income": "Rental Income",
"other_income": "Other Income"
},
"bill": {
"rent": "Rent",
"electricity": "Electricity",
"internet": "Internet",
"phone": "Phone"
},
"variable_expense": {
"groceries": "Groceries",
"transport": "Transport",
"dining_out": "Dining Out",
"health": "Health & Pharmacy",
"clothing": "Clothing"
},
"debt": {
"loan_repayment": "Loan Repayment",
"credit_card": "Credit Card"
},
"saving": {
"emergency_fund": "Emergency Fund",
"vacation": "Vacation Fund"
},
"investment": {
"etf": "ETF / Index Fund",
"pension": "Pension"
}
}
```
For `src/i18n/de.json`, add the same structure with German translations:
```json
"presets": {
"income": {
"salary": "Gehalt",
"freelance": "Freelance-Einkommen",
"rental_income": "Mieteinnahmen",
"other_income": "Sonstiges Einkommen"
},
"bill": {
"rent": "Miete",
"electricity": "Strom",
"internet": "Internet",
"phone": "Telefon"
},
"variable_expense": {
"groceries": "Lebensmittel",
"transport": "Transport",
"dining_out": "Auswärts essen",
"health": "Gesundheit & Apotheke",
"clothing": "Kleidung"
},
"debt": {
"loan_repayment": "Kreditrückzahlung",
"credit_card": "Kreditkarte"
},
"saving": {
"emergency_fund": "Notfallfonds",
"vacation": "Urlaubskasse"
},
"investment": {
"etf": "ETF / Indexfonds",
"pension": "Altersvorsorge"
}
}
```
Both files must remain valid JSON after the edit. Add the `"presets"` key as the last entry in each JSON object (before the closing `}`), preceded by a comma on the previous last key.
</action>
<verify>
<automated>node -e "JSON.parse(require('fs').readFileSync('src/i18n/en.json','utf8')); JSON.parse(require('fs').readFileSync('src/i18n/de.json','utf8')); console.log('JSON valid')" && grep -c '"slug_key"' src/i18n/en.json || grep -c '"salary"' src/i18n/en.json</automated>
</verify>
<done>Both JSON files are valid (node JSON.parse succeeds). `en.json` and `de.json` each contain a top-level `"presets"` key. `grep '"salary"' src/i18n/en.json` returns 1 match. `grep '"Gehalt"' src/i18n/de.json` returns 1 match.</done>
</task>
</tasks>
<threat_model>
## Trust Boundaries
| Boundary | Description |
|----------|-------------|
| presets.ts → wizard UI | Static read-only data — no user input, no network calls |
## STRIDE Threat Register
| Threat ID | Category | Component | Disposition | Mitigation Plan |
|-----------|----------|-----------|-------------|-----------------|
| T-06-04 | Information Disclosure | presets.ts amounts | accept | Amounts are generic EUR defaults, not user-specific data; public knowledge |
| T-06-05 | Tampering | i18n JSON malformed after edit | mitigate | Verify both JSON files parse cleanly after edit (`node -e "JSON.parse(...)"`) before committing |
</threat_model>
<verification>
```bash
# Confirm presets file exists with 19 items
grep -c "slug:" src/data/presets.ts
# Confirm no one_off tier
grep "one_off" src/data/presets.ts || echo "no one_off found (correct)"
# Confirm i18n JSON files are valid
node -e "JSON.parse(require('fs').readFileSync('src/i18n/en.json','utf8')); console.log('en.json valid')"
node -e "JSON.parse(require('fs').readFileSync('src/i18n/de.json','utf8')); console.log('de.json valid')"
# Confirm presets key present in both
grep '"presets"' src/i18n/en.json src/i18n/de.json
# TypeScript clean
npx tsc --noEmit
```
</verification>
<success_criteria>
- `src/data/presets.ts` exports `PresetItem` interface and `PRESETS` array with exactly 19 items
- Distribution: 4 income, 4 bill, 5 variable_expense, 2 debt, 2 saving, 2 investment
- All `item_tier` values are `"fixed"` or `"variable"` only
- `en.json` and `de.json` both contain a valid `"presets"` nested object with all 19 slugs translated
- Both JSON files remain valid (parseable) after edits
- `tsc --noEmit` passes
</success_criteria>
<output>
After completion, create `.planning/phases/06-preset-data-first-run-detection-and-db-safety/06-02-SUMMARY.md`
</output>

View File

@@ -0,0 +1,65 @@
---
phase: 06-preset-data-first-run-detection-and-db-safety
plan: "02"
subsystem: data
tags: [presets, i18n, static-data]
dependency_graph:
requires: []
provides: [PresetItem, PRESETS]
affects: [src/data/presets.ts, src/i18n/en.json, src/i18n/de.json]
tech_stack:
added: []
patterns: [static-data-module, i18n-dot-path]
key_files:
created:
- src/data/presets.ts
modified:
- src/i18n/en.json
- src/i18n/de.json
decisions:
- "item_tier restricted to fixed|variable only (no one_off) to match DB check constraint on template_items"
- "presets.{type}.{slug} i18n key structure matches type+slug fields in PRESETS array"
metrics:
duration: "~5 minutes"
completed: "2026-04-20"
tasks_completed: 2
files_changed: 3
---
# Phase 06 Plan 02: Preset Data Library Summary
Static 19-item preset budget library with English and German translations, structured as `presets.{type}.{slug}` i18n keys matching the PRESETS array shape.
## Tasks Completed
| Task | Name | Commit | Files |
|------|------|--------|-------|
| 1 | Create src/data/presets.ts | 3bc7782 | src/data/presets.ts (created) |
| 2 | Add preset translations to en.json and de.json | d235080 | src/i18n/en.json, src/i18n/de.json |
## What Was Built
`src/data/presets.ts` exports `PresetItem` interface and `PRESETS` array with exactly 19 items:
- 4 income, 4 bill, 5 variable_expense, 2 debt, 2 saving, 2 investment
- All `item_tier` values are `"fixed"` or `"variable"` (no `"one_off"`)
- Pure static module — no Supabase or React imports
Both i18n files now have a top-level `"presets"` key with nested `{type}.{slug}` structure covering all 19 slugs in English and German.
## Deviations from Plan
None - plan executed exactly as written.
## Threat Surface Scan
No new network endpoints, auth paths, or trust boundaries introduced. T-06-05 (JSON malformed) mitigated — both files verified valid via `node -e "JSON.parse(...)"` before commit.
## Self-Check: PASSED
- src/data/presets.ts: FOUND
- src/i18n/en.json "presets" key: FOUND
- src/i18n/de.json "presets" key: FOUND
- 19 PRESETS items confirmed (grep '{ slug:' returns 19)
- no one_off in presets.ts confirmed
- tsc --noEmit: PASSED
- Commits 3bc7782 and d235080: confirmed in git log

View File

@@ -0,0 +1,255 @@
---
phase: 06-preset-data-first-run-detection-and-db-safety
plan: 03
type: execute
wave: 2
depends_on:
- "06-01"
- "06-02"
files_modified:
- src/hooks/useFirstRunState.ts
autonomous: false
requirements:
- AUTO-01
- AUTO-03
- SETUP-01
- SETUP-02
must_haves:
truths:
- "useFirstRunState hook returns isFirstRun=true when categories array is empty"
- "useFirstRunState hook returns isFirstRun=true when template items array is empty"
- "useFirstRunState hook returns isFirstRun=false when user has both categories and template items"
- "useFirstRunState hook returns loading=true while either underlying query is in flight"
- "DB schema push completes without errors — uniqueness constraints and setup_completed column live in Supabase"
artifacts:
- path: "src/hooks/useFirstRunState.ts"
provides: "Derived first-run state from cached useCategories + useTemplate queries"
exports: ["useFirstRunState"]
key_links:
- from: "src/hooks/useFirstRunState.ts"
to: "src/hooks/useCategories.ts"
via: "useCategories() call — reads from cache key ['categories']"
pattern: "useCategories"
- from: "src/hooks/useFirstRunState.ts"
to: "src/hooks/useTemplate.ts"
via: "useTemplate() call — reads from cache keys ['template', 'template-items']"
pattern: "useTemplate"
---
<objective>
Write the `useFirstRunState` hook and push all migrations to the database.
`useFirstRunState` derives first-run state from existing React Query caches — no extra network call. It returns `{ isFirstRun: boolean, loading: boolean }` where `isFirstRun` is `true` when either categories or template items count is zero, and `loading` is `true` while either underlying query is still fetching.
The DB schema push applies migrations 006 and 007, making uniqueness constraints and the `setup_completed` column live. This is a `[BLOCKING]` step — all verification depends on the schema being applied.
Purpose: Phase 7 wizard reads `useFirstRunState().isFirstRun` to decide whether to redirect new users to setup. The DB constraints prevent the data corruption that would require rollback work in Phase 8.
Output: `src/hooks/useFirstRunState.ts` + DB schema pushed + human verification checkpoint.
</objective>
<execution_context>
@$HOME/.claude/get-shit-done/workflows/execute-plan.md
@$HOME/.claude/get-shit-done/templates/summary.md
</execution_context>
<context>
@.planning/phases/06-preset-data-first-run-detection-and-db-safety/06-CONTEXT.md
@.planning/phases/06-preset-data-first-run-detection-and-db-safety/06-RESEARCH.md
@.planning/phases/06-preset-data-first-run-detection-and-db-safety/06-01-SUMMARY.md
@.planning/phases/06-preset-data-first-run-detection-and-db-safety/06-02-SUMMARY.md
<interfaces>
From src/hooks/useCategories.ts:
```typescript
export function useCategories() {
// queryKey: ["categories"]
return {
categories: query.data ?? [], // Category[]
loading: query.isLoading,
create, update, remove,
}
}
```
From src/hooks/useTemplate.ts:
```typescript
export function useTemplate() {
// queryKeys: ["template"], ["template-items"]
return {
template: templateQuery.data ?? null,
items: itemsQuery.data ?? [], // TemplateItem[]
loading: templateQuery.isLoading || itemsQuery.isLoading,
updateName, createItem, updateItem, deleteItem, reorderItems,
}
}
```
From src/lib/types.ts (after Plan 01):
```typescript
export interface Profile {
id: string
display_name: string | null
locale: string
currency: string
setup_completed: boolean // added by Plan 01
created_at: string
updated_at: string
}
```
</interfaces>
</context>
<tasks>
<task type="auto">
<name>Task 1: Create src/hooks/useFirstRunState.ts</name>
<files>src/hooks/useFirstRunState.ts</files>
<read_first>
- src/hooks/useCategories.ts
- src/hooks/useTemplate.ts
- .planning/phases/06-preset-data-first-run-detection-and-db-safety/06-RESEARCH.md (Pattern 3: Derived State Hook, Pitfall 2)
</read_first>
<action>
Create `src/hooks/useFirstRunState.ts` with the following exact implementation. Do not add mutations, do not import supabase directly — this hook is read-only and derives state from already-cached queries.
```typescript
import { useCategories } from "@/hooks/useCategories"
import { useTemplate } from "@/hooks/useTemplate"
/**
* Derives first-run state from cached category and template queries.
* No additional network calls are made — data is read from React Query cache.
*
* isFirstRun is true when:
* - categories.length === 0 (user has not created any categories), OR
* - items.length === 0 (user has no template items)
*
* IMPORTANT: Always check `loading` before acting on `isFirstRun`.
* While queries are in flight, both arrays default to [] which would
* cause isFirstRun to be true spuriously.
*
* Usage:
* const { isFirstRun, loading } = useFirstRunState()
* if (!loading && isFirstRun) { redirect to /setup }
*/
export function useFirstRunState() {
const { categories, loading: catLoading } = useCategories()
const { items, loading: tmplLoading } = useTemplate()
return {
isFirstRun: categories.length === 0 || items.length === 0,
loading: catLoading || tmplLoading,
}
}
```
The `loading` guard is critical — see Pitfall 2 in RESEARCH.md. Callers in Phase 7 MUST check `!loading && isFirstRun` before redirecting.
</action>
<verify>
<automated>grep -n "isFirstRun" src/hooks/useFirstRunState.ts && grep -n "loading" src/hooks/useFirstRunState.ts && npx tsc --noEmit</automated>
</verify>
<done>File exists. Exports `useFirstRunState` function. Returns `{ isFirstRun: boolean, loading: boolean }`. `tsc --noEmit` passes with no errors.</done>
</task>
<task type="auto" id="db-push-blocking">
<name>Task 2: [BLOCKING] Push database schema (migrations 006 + 007)</name>
<files>supabase/migrations/006_uniqueness_constraints.sql, supabase/migrations/007_setup_completed.sql</files>
<read_first>
- supabase/migrations/006_uniqueness_constraints.sql
- supabase/migrations/007_setup_completed.sql
</read_first>
<action>
Run the Supabase schema push to apply migrations 006 and 007 to the database. This command requires the Supabase CLI and an active project link.
```bash
supabase db push
```
If the push prompts interactively and cannot be suppressed, set the access token first:
```bash
SUPABASE_ACCESS_TOKEN=$(cat ~/.supabase/access-token 2>/dev/null || echo "SET_TOKEN_HERE") supabase db push
```
Expected outcome: Both migrations apply in order (006 then 007). The command exits 0.
If the command fails with a duplicate constraint error (constraint already exists), the migrations may have been partially applied. In that case, check `supabase db diff` to see what's pending and resolve manually.
If `supabase db push` requires interactive confirmation that cannot be bypassed, flag this task with a `checkpoint:human-action` and have the user run it manually from their terminal.
</action>
<verify>
<automated>supabase db push --dry-run 2>&1 | grep -E "No migrations|already applied|006|007" || echo "Check supabase CLI output above"</automated>
</verify>
<done>Both migrations applied. `supabase db push` exits 0 (or reports migrations already applied). No error output containing "ERROR" or "FATAL".</done>
</task>
<task type="checkpoint:human-verify" gate="blocking">
<name>Task 3: Verify DB constraints and setup_completed column are live</name>
<what-built>
Migration 006 added UNIQUE constraints on budgets(user_id, start_date) and categories(user_id, name).
Migration 007 added setup_completed boolean column to profiles and backfilled existing users.
useFirstRunState hook created at src/hooks/useFirstRunState.ts.
</what-built>
<how-to-verify>
1. Open the Supabase dashboard for this project.
2. Go to Table Editor > profiles — confirm the `setup_completed` column exists with boolean type.
3. Go to Database > Tables > budgets — confirm constraint `budgets_user_month_unique` exists on (user_id, start_date).
4. Go to Database > Tables > categories — confirm constraint `categories_user_name_unique` exists on (user_id, name).
5. If you have an existing v1.0 user row in profiles, confirm setup_completed = true for that row.
6. Run `npx tsc --noEmit` in the terminal — confirm zero TypeScript errors.
</how-to-verify>
<resume-signal>Type "approved" if all constraints are live and tsc passes, or describe any issues found.</resume-signal>
</task>
</tasks>
<threat_model>
## Trust Boundaries
| Boundary | Description |
|----------|-------------|
| useFirstRunState → React Query cache | Reads cached data from existing hooks — no new trust boundary introduced |
| supabase db push → Supabase project | CLI command with project-level credentials — run only in trusted environment |
## STRIDE Threat Register
| Threat ID | Category | Component | Disposition | Mitigation Plan |
|-----------|----------|-----------|-------------|-----------------|
| T-06-06 | Spoofing | useFirstRunState — isFirstRun=true while loading | mitigate | loading flag exported; callers must check `!loading && isFirstRun` before acting (documented in hook JSDoc) |
| T-06-07 | Denial of Service | supabase db push failing mid-migration | accept | Transaction wrapping in 006 ensures atomicity; 007 is idempotent (ADD COLUMN IF NOT EXISTS can be added if needed) |
</threat_model>
<verification>
```bash
# Hook exports correctly
grep "export function useFirstRunState" src/hooks/useFirstRunState.ts
# Hook uses both existing hooks
grep "useCategories\|useTemplate" src/hooks/useFirstRunState.ts
# TypeScript clean across all new files
npx tsc --noEmit
# Migration files in place
ls supabase/migrations/006_uniqueness_constraints.sql supabase/migrations/007_setup_completed.sql
# All 4 requirement IDs traceable across plans:
# AUTO-01: useFirstRunState (plan 03) + budgets constraint (plan 01)
# AUTO-03: setup_completed not hardcoding currency (plan 01, 02, 03 — amounts plain numbers)
# SETUP-01: setup_completed column + backfill (plan 01) + useFirstRunState (plan 03)
# SETUP-02: PRESETS array 19 items (plan 02)
```
</verification>
<success_criteria>
- `src/hooks/useFirstRunState.ts` exists and exports `useFirstRunState()` returning `{ isFirstRun: boolean, loading: boolean }`
- `isFirstRun` is derived from `categories.length === 0 || items.length === 0` — no direct Supabase calls
- DB push completes: `budgets_user_month_unique` and `categories_user_name_unique` constraints live in Supabase
- `profiles` table has `setup_completed boolean NOT NULL DEFAULT false` column
- All existing users with categories (or template items) have `setup_completed = true`
- `tsc --noEmit` passes with zero errors across all modified files
</success_criteria>
<output>
After completion, create `.planning/phases/06-preset-data-first-run-detection-and-db-safety/06-03-SUMMARY.md`
</output>

View File

@@ -0,0 +1,87 @@
---
phase: 06
plan: 03
subsystem: first-run-detection
tags: [hooks, supabase, migrations, first-run]
started: "2026-04-20T17:32:09Z"
completed: "2026-04-20T18:07:20Z"
status: complete
dependency_graph:
requires: [06-01, 06-02]
provides: [useFirstRunState-hook, db-schema-live]
affects: [phase-07-wizard]
tech_stack:
added: []
patterns: [derived-state-hook, loading-guard-pattern]
key_files:
created:
- src/hooks/useFirstRunState.ts
modified: []
decisions:
- "Hook derives state from existing React Query caches (useCategories + useTemplate) with zero additional network calls"
- "DB migrations applied manually by user via supabase db push after checkpoint gate"
metrics:
duration: ~35min (including checkpoint wait)
tasks_completed: 3
files_created: 1
files_modified: 0
---
# Phase 06 Plan 03: useFirstRunState Hook and DB Schema Push Summary
Derived first-run detection hook reading from React Query cache with loading guard to prevent spurious redirects, plus live DB schema with uniqueness constraints and setup_completed column.
## What Was Built
### useFirstRunState Hook (src/hooks/useFirstRunState.ts)
A read-only derived state hook that composes `useCategories()` and `useTemplate()` to determine whether the current user is a first-run user (no categories or no template items). Returns `{ isFirstRun: boolean, loading: boolean }`. The `loading` flag is critical -- callers in Phase 7 must check `!loading && isFirstRun` before redirecting to prevent false positives while queries are in flight.
### DB Schema Push (migrations 006 + 007)
User applied both migrations via `supabase db push`:
- Migration 006: UNIQUE constraints on `budgets(user_id, start_date)` and `categories(user_id, name)` with safe deduplication
- Migration 007: `setup_completed` boolean column on `profiles` with backfill for existing users
## Task Execution
| Task | Name | Commit | Status |
|------|------|--------|--------|
| 1 | Create useFirstRunState.ts | 0c1105f | Complete |
| 2 | DB schema push (migrations 006+007) | Manual (user) | Complete - user applied |
| 3 | Human verification checkpoint | N/A | Approved by user |
## Decisions Made
1. **Zero-network-call design** -- Hook reads from existing React Query caches rather than making its own Supabase calls, avoiding redundant fetches.
2. **Manual DB push** -- `supabase db push` required interactive confirmation; user ran it manually after checkpoint gate.
## Deviations from Plan
None -- plan executed exactly as written.
## Known Stubs
None -- hook is fully wired to existing data sources.
## Verification Results
- `export function useFirstRunState` found in hook file
- Both `useCategories` and `useTemplate` imports present
- `npx tsc --noEmit` passes with zero errors
- Migration files 006 and 007 exist in supabase/migrations/
- User confirmed DB constraints and setup_completed column are live in Supabase dashboard
## Requirements Covered
- **AUTO-01**: useFirstRunState provides first-run detection for auto-budget flow
- **AUTO-03**: No hardcoded currency -- amounts are plain numbers throughout
- **SETUP-01**: setup_completed column + backfill (plan 01) + useFirstRunState detection (plan 03)
- **SETUP-02**: Preset library with 19 items delivered in plan 02
## Self-Check: PASSED
- [x] src/hooks/useFirstRunState.ts exists
- [x] Commit 0c1105f verified in git log
- [x] TypeScript compiles cleanly
- [x] Migration files present on disk

View File

@@ -0,0 +1,81 @@
# Phase 6: Preset Data, First-Run Detection, and DB Safety - Context
**Gathered:** 2026-04-20
**Status:** Ready for planning
<domain>
## Phase Boundary
The data layer is safe and ready — duplicate budget/category writes are impossible at the DB level, and the app correctly identifies first-run users. This phase delivers: DB uniqueness constraints, a setup_completed column with backfill migration, a useFirstRunState hook, and a preset budget item library (~15-20 items with i18n).
</domain>
<decisions>
## Implementation Decisions
### Preset Library Content
- Default amounts in EUR (matches existing profiles.currency default)
- 4 income, 4 bill, 5 variable_expense, 2 debt, 2 saving, 2 investment items (~19 total)
- i18n key format: `presets.{category_type}.{slug}` (e.g., `presets.bill.rent`)
- Round number amounts (e.g., rent=1000, groceries=400) — easier to adjust, less presumptuous
### First-Run Detection Logic
- First-run triggers when user has zero categories OR zero template items (either missing = not set up)
- New dedicated hook: `src/hooks/useFirstRunState.ts` (follows useCategories/useTemplate pattern)
- Backfill via Supabase migration SQL: `UPDATE profiles SET setup_completed = true WHERE id IN (SELECT DISTINCT user_id FROM categories)`
- Hook derives state from existing hooks (useCategories count + useTemplate items count) — no extra network call
### DB Migration & Constraint Strategy
- Cleanup step before adding unique constraints (deduplicate existing data safely)
- Separate migration files: `006_uniqueness_constraints.sql` and `007_setup_completed.sql`
- `setup_completed` column defaults to `false` — new signups start as not-setup; existing users backfilled to `true`
- Unique constraint on budgets: `(user_id, start_date)` only — end_date always derived
### Claude's Discretion
- Exact preset item names and amounts (within the balanced category distribution)
- German translation text for preset i18n keys
- Order of migration operations within each file
- Error handling approach for constraint violations in application code
</decisions>
<code_context>
## Existing Code Insights
### Reusable Assets
- `src/hooks/useCategories.ts` — existing hook pattern to follow for useFirstRunState
- `src/hooks/useTemplate.ts` — template data access, can derive "has template items" from this
- `src/lib/types.ts` — type definitions for categories, templates, budgets
- `supabase/migrations/001-005` — existing migration chain to extend
### Established Patterns
- Hooks use React Query with Supabase client
- Category types enum: income, bill, variable_expense, debt, saving, investment
- Template items reference categories via category_id
- Profiles table auto-created via trigger on auth.users insert
### Integration Points
- `profiles` table needs new `setup_completed` boolean column
- `budgets` table needs unique constraint on (user_id, start_date)
- `categories` table needs unique constraint on (user_id, name)
- New `src/data/presets.ts` file for preset library
- New `src/hooks/useFirstRunState.ts` for first-run detection
- i18n files need preset translation keys (en + de)
</code_context>
<specifics>
## Specific Ideas
- Currency column in profiles is already `currency text not null default 'EUR'` — confirmed in 001_profiles.sql
- The `handle_new_user()` trigger creates profiles on signup — setup_completed will be false by default for new users
- Templates table already has `unique(user_id)` — one template per user is enforced
</specifics>
<deferred>
## Deferred Ideas
None — discussion stayed within phase scope.
</deferred>

View File

@@ -0,0 +1,522 @@
# Phase 6: Preset Data, First-Run Detection, and DB Safety - Research
**Researched:** 2026-04-20
**Domain:** PostgreSQL constraints, Supabase migrations, React Query hooks, i18n data files
**Confidence:** HIGH
---
<user_constraints>
## User Constraints (from CONTEXT.md)
### Locked Decisions
- Default amounts in EUR (matches existing profiles.currency default)
- 4 income, 4 bill, 5 variable_expense, 2 debt, 2 saving, 2 investment items (~19 total)
- i18n key format: `presets.{category_type}.{slug}` (e.g., `presets.bill.rent`)
- Round number amounts (e.g., rent=1000, groceries=400) — easier to adjust, less presumptuous
- First-run triggers when user has zero categories OR zero template items
- New dedicated hook: `src/hooks/useFirstRunState.ts` (follows useCategories/useTemplate pattern)
- Backfill via Supabase migration SQL: `UPDATE profiles SET setup_completed = true WHERE id IN (SELECT DISTINCT user_id FROM categories)`
- Hook derives state from existing hooks (useCategories count + useTemplate items count) — no extra network call
- Cleanup step before adding unique constraints (deduplicate existing data safely)
- Separate migration files: `006_uniqueness_constraints.sql` and `007_setup_completed.sql`
- `setup_completed` column defaults to `false`; existing users backfilled to `true`
- Unique constraint on budgets: `(user_id, start_date)` only — end_date always derived
### Claude's Discretion
- Exact preset item names and amounts (within the balanced category distribution)
- German translation text for preset i18n keys
- Order of migration operations within each file
- Error handling approach for constraint violations in application code
### Deferred Ideas (OUT OF SCOPE)
None — discussion stayed within phase scope.
</user_constraints>
<phase_requirements>
## Phase Requirements
| ID | Description | Research Support |
|----|-------------|------------------|
| AUTO-01 | User's monthly budget is auto-created from template when visiting a month for the first time | `useFirstRunState` hook detects zero-category / zero-template-item state; budgets unique constraint prevents duplicate auto-creation |
| AUTO-03 | Auto-creation uses the user's configured currency, not a hardcoded default | `profiles.currency` confirmed as `text not null default 'EUR'` — hook/migration must not hardcode currency |
| SETUP-01 | New user is guided through a 3-step wizard: income → recurring items → review | `setup_completed` column + backfill migration provides the flag Phase 7 wizard reads to decide whether to show onboarding |
| SETUP-02 | User sees pre-filled common budget items with sensible default amounts (~15-20 items) | `src/data/presets.ts` delivers the curated item library with i18n keys and EUR amounts |
</phase_requirements>
---
## Summary
Phase 6 is a pure data/infrastructure layer — no new UI. It consists of four discrete deliverables: two Supabase migration files (uniqueness constraints + setup_completed column), a new TypeScript data file (`src/data/presets.ts`), a new React Query hook (`src/hooks/useFirstRunState.ts`), and additions to both i18n JSON files.
The existing schema (verified against migrations 001005) has no duplicate-prevention constraints on `budgets` or `categories`. The `profiles` table has no `setup_completed` column yet. The `templates` table already has `unique(user_id)`. All hook patterns follow `useQuery` + `useMutation` from `@tanstack/react-query` with the Supabase JS client — `useFirstRunState` will be read-only (query-only) and simpler than existing hooks.
The main planning risk is the cleanup step before adding unique constraints: the deduplication SQL must run inside the same transaction as the `ADD CONSTRAINT` statement so the constraint cannot be violated by orphaned duplicates surviving the cleanup.
**Primary recommendation:** Write migration 006 as a single transaction — DELETE duplicates, then ADD CONSTRAINT — so it's atomic and safe to run on existing databases.
---
## Architectural Responsibility Map
| Capability | Primary Tier | Secondary Tier | Rationale |
|------------|-------------|----------------|-----------|
| Duplicate-write prevention | Database | — | Constraint enforced at DB level; application code is a secondary guard only |
| First-run detection state | Frontend (React Query hook) | — | Derived from cached query data, no extra network call |
| Preset item library | Frontend (static data file) | — | Static TypeScript module; no DB persistence, consumed by wizard (Phase 7) |
| setup_completed persistence | Database (profiles table) | — | Boolean column; written by migration backfill and by wizard completion (Phase 7) |
| i18n for preset names | Frontend (JSON files) | — | Follows existing en.json / de.json pattern |
---
## Standard Stack
### Core (all already installed — verified against package.json)
| Library | Version | Purpose | Why Standard |
|---------|---------|---------|--------------|
| `@tanstack/react-query` | (existing) | Server state, caching for useFirstRunState | Already used by all hooks |
| `@supabase/supabase-js` | (existing) | DB client in hooks and migrations | Already used by all hooks |
| PostgreSQL (via Supabase) | (existing) | Unique constraints, ALTER TABLE | Native DB feature; no library needed |
No new npm packages are required for this phase.
### Migration Tooling
Supabase migrations are plain `.sql` files in `supabase/migrations/`. They are run in filename order by the Supabase CLI (`supabase db push`) or applied directly via the Supabase dashboard SQL editor. [VERIFIED: project migration files 001005]
---
## Architecture Patterns
### System Architecture Diagram
```
Supabase DB
├── Migration 006: uniqueness_constraints
│ ├── DELETE duplicate budgets (keep oldest per user+start_date)
│ ├── DELETE duplicate categories (keep oldest per user+name)
│ ├── ADD CONSTRAINT budgets_user_month_unique ON budgets(user_id, start_date)
│ └── ADD CONSTRAINT categories_user_name_unique ON categories(user_id, name)
└── Migration 007: setup_completed
├── ALTER TABLE profiles ADD COLUMN setup_completed boolean NOT NULL DEFAULT false
└── UPDATE profiles SET setup_completed = true
WHERE id IN (SELECT DISTINCT user_id FROM categories)
src/data/presets.ts ──────────────────────────────────────► Phase 7 wizard
(static array of PresetItem objects, keyed by i18n slug)
src/hooks/useFirstRunState.ts
├── calls useCategories() (uses cached ["categories"] query — no new fetch)
├── calls useTemplate() (uses cached ["template-items"] query — no new fetch)
└── returns { isFirstRun: boolean, loading: boolean }
isFirstRun = categories.length === 0 || items.length === 0
src/i18n/en.json } add "presets" top-level key
src/i18n/de.json } add "presets" top-level key
```
### Recommended Project Structure (additions only)
```
src/
├── data/
│ └── presets.ts # NEW: preset budget item library
├── hooks/
│ └── useFirstRunState.ts # NEW: first-run detection hook
└── i18n/
├── en.json # ADD: presets.* keys
└── de.json # ADD: presets.* keys
supabase/migrations/
├── 006_uniqueness_constraints.sql # NEW
└── 007_setup_completed.sql # NEW
```
### Pattern 1: Safe Deduplication Before Unique Constraint
**What:** Delete all but the oldest row per unique key before adding the constraint, wrapped in a transaction.
**When to use:** Any migration adding a unique constraint on a table that may have existing duplicates.
```sql
-- Source: [VERIFIED: standard PostgreSQL CTE deduplication pattern]
BEGIN;
-- Keep only the oldest budget per (user_id, start_date)
DELETE FROM budgets
WHERE id NOT IN (
SELECT DISTINCT ON (user_id, start_date) id
FROM budgets
ORDER BY user_id, start_date, created_at ASC
);
ALTER TABLE budgets
ADD CONSTRAINT budgets_user_month_unique UNIQUE (user_id, start_date);
-- Keep only the oldest category per (user_id, name)
DELETE FROM categories
WHERE id NOT IN (
SELECT DISTINCT ON (user_id, name) id
FROM categories
ORDER BY user_id, name, created_at ASC
);
ALTER TABLE categories
ADD CONSTRAINT categories_user_name_unique UNIQUE (user_id, name);
COMMIT;
```
### Pattern 2: ADD COLUMN with Default + Immediate Backfill
**What:** Add a boolean column with a default, then immediately UPDATE to backfill existing rows.
**When to use:** Column needs a non-null default for new rows, but existing rows need a different value.
```sql
-- Source: [VERIFIED: standard PostgreSQL ALTER TABLE pattern]
ALTER TABLE profiles
ADD COLUMN setup_completed boolean NOT NULL DEFAULT false;
-- Backfill: existing users who have categories are considered set up
UPDATE profiles
SET setup_completed = true
WHERE id IN (SELECT DISTINCT user_id FROM categories);
```
**Important:** `DEFAULT false` in the `ALTER TABLE` statement means the column is added atomically with `false` for all existing rows *before* the UPDATE runs. The UPDATE then flips the qualifying rows. Order matters here. [VERIFIED: PostgreSQL behavior]
### Pattern 3: Derived State Hook (no extra network call)
**What:** Build a hook that computes a boolean from two already-cached queries.
**When to use:** When state can be inferred from data already loaded by sibling hooks.
```typescript
// Source: [VERIFIED: matches useCategories.ts + useTemplate.ts patterns in codebase]
import { useCategories } from "@/hooks/useCategories"
import { useTemplate } from "@/hooks/useTemplate"
export function useFirstRunState() {
const { categories, loading: catLoading } = useCategories()
const { items, loading: tmplLoading } = useTemplate()
return {
isFirstRun: categories.length === 0 || items.length === 0,
loading: catLoading || tmplLoading,
}
}
```
**Key insight:** `useCategories` caches under `["categories"]` and `useTemplate` caches under `["template"]` + `["template-items"]`. If those queries have already been called (e.g., by mounted pages), `useFirstRunState` returns instantly from cache — no extra Supabase round-trip. [VERIFIED: React Query staleTime default behavior]
### Pattern 4: Preset Data File Shape
**What:** Static TypeScript module exporting typed preset items.
**When to use:** Read-only reference data consumed by the wizard UI (Phase 7).
```typescript
// Source: [ASSUMED — no existing presets.ts to verify against; shape inferred from types.ts]
export interface PresetItem {
slug: string // used to build i18n key: presets.{type}.{slug}
type: CategoryType // from src/lib/types.ts
defaultAmount: number // EUR, round number
item_tier: "fixed" | "variable"
}
export const PRESETS: PresetItem[] = [
// income (4)
{ slug: "salary", type: "income", defaultAmount: 3000, item_tier: "fixed" },
{ slug: "freelance", type: "income", defaultAmount: 500, item_tier: "variable" },
{ slug: "rental_income", type: "income", defaultAmount: 800, item_tier: "fixed" },
{ slug: "other_income", type: "income", defaultAmount: 200, item_tier: "variable" },
// bill (4)
{ slug: "rent", type: "bill", defaultAmount: 1000, item_tier: "fixed" },
{ slug: "electricity", type: "bill", defaultAmount: 80, item_tier: "fixed" },
{ slug: "internet", type: "bill", defaultAmount: 40, item_tier: "fixed" },
{ slug: "phone", type: "bill", defaultAmount: 30, item_tier: "fixed" },
// variable_expense (5)
{ slug: "groceries", type: "variable_expense", defaultAmount: 400, item_tier: "variable" },
{ slug: "transport", type: "variable_expense", defaultAmount: 100, item_tier: "variable" },
{ slug: "dining_out", type: "variable_expense", defaultAmount: 150, item_tier: "variable" },
{ slug: "health", type: "variable_expense", defaultAmount: 50, item_tier: "variable" },
{ slug: "clothing", type: "variable_expense", defaultAmount: 100, item_tier: "variable" },
// debt (2)
{ slug: "loan_repayment", type: "debt", defaultAmount: 200, item_tier: "fixed" },
{ slug: "credit_card", type: "debt", defaultAmount: 100, item_tier: "fixed" },
// saving (2)
{ slug: "emergency_fund", type: "saving", defaultAmount: 200, item_tier: "fixed" },
{ slug: "vacation", type: "saving", defaultAmount: 100, item_tier: "fixed" },
// investment (2)
{ slug: "etf", type: "investment", defaultAmount: 200, item_tier: "fixed" },
{ slug: "pension", type: "investment", defaultAmount: 100, item_tier: "fixed" },
]
```
### Pattern 5: i18n Key Structure for Presets
The existing i18n files use a flat nested structure. Add a `"presets"` top-level key, nested by `category_type`, then `slug`. [VERIFIED: matches en.json structure]
```json
// en.json addition
{
"presets": {
"income": {
"salary": "Salary",
"freelance": "Freelance Income",
"rental_income": "Rental Income",
"other_income": "Other Income"
},
"bill": {
"rent": "Rent",
"electricity": "Electricity",
"internet": "Internet",
"phone": "Phone"
},
"variable_expense": {
"groceries": "Groceries",
"transport": "Transport",
"dining_out": "Dining Out",
"health": "Health & Pharmacy",
"clothing": "Clothing"
},
"debt": {
"loan_repayment": "Loan Repayment",
"credit_card": "Credit Card"
},
"saving": {
"emergency_fund": "Emergency Fund",
"vacation": "Vacation Fund"
},
"investment": {
"etf": "ETF / Index Fund",
"pension": "Pension"
}
}
}
```
### Anti-Patterns to Avoid
- **Adding UNIQUE constraint without deduplication first:** Will fail with `duplicate key value violates unique constraint` on any DB with existing duplicate rows.
- **Separate transaction for cleanup and constraint:** If cleanup succeeds but constraint ADD fails (e.g., missed a duplicate), the DB is left partially modified. Always wrap both in one `BEGIN/COMMIT`.
- **isFirstRun computed at render without loading guard:** Returns `true` spuriously while queries are still in-flight (both lengths are 0). Always gate on `loading` before acting on `isFirstRun`.
- **Hardcoding 'EUR' in presets.ts:** The preset amounts are EUR, but the label/currency displayed in the wizard must come from `profiles.currency`, not from presets.ts. Keep amounts as plain numbers.
---
## Don't Hand-Roll
| Problem | Don't Build | Use Instead | Why |
|---------|-------------|-------------|-----|
| Duplicate row prevention | Application-level upsert logic with SELECT-then-INSERT | PostgreSQL UNIQUE constraint | Race condition between SELECT and INSERT; DB constraint is atomic |
| Query caching for derived state | Manual state tracking / local useState | React Query (already installed) | useCategories + useTemplate already cache — just consume the cached data |
| i18n key resolution | Custom translation lookup | Existing i18n framework already in use | Check how `t()` is called in existing components and replicate |
---
## Common Pitfalls
### Pitfall 1: DISTINCT ON Requires ORDER BY on the Same Columns
**What goes wrong:** `SELECT DISTINCT ON (user_id, start_date)` without `ORDER BY user_id, start_date` throws a PostgreSQL error.
**Why it happens:** PostgreSQL requires the DISTINCT ON expressions to be the leftmost ORDER BY expressions.
**How to avoid:** Always write `ORDER BY user_id, start_date, created_at ASC` (or whichever tiebreaker). [VERIFIED: PostgreSQL docs behavior]
**Warning signs:** `ERROR: SELECT DISTINCT ON expressions must match initial ORDER BY expressions`
### Pitfall 2: isFirstRun is True During Loading
**What goes wrong:** `categories.length === 0 || items.length === 0` is `true` while data is still loading (both arrays are empty defaults). If Phase 7 wizard triggers on `isFirstRun`, it fires on every page load while data fetches.
**Why it happens:** `useCategories` returns `[]` as default; hook consumers see `isFirstRun = true` before the query resolves.
**How to avoid:** Export `loading` from `useFirstRunState`. Callers must check `!loading && isFirstRun` before acting. [VERIFIED: useCategories.ts returns `query.data ?? []`]
**Warning signs:** Wizard flashes on every load for users who have data.
### Pitfall 3: Backfill Misses Users Without Categories
**What goes wrong:** The backfill SQL sets `setup_completed = true` only for users who have categories. A v1.0 user who created a template but no categories would remain `false` and see the wizard on first v2.0 login.
**Why it happens:** The backfill uses `categories` as the signal; it's possible (though unlikely in v1.0) to have a template with no categories.
**How to avoid:** The agreed logic (zero categories OR zero template items = first run) means a user with template items but no categories is legitimately not set up. Verify that v1.0 users always created categories before template items. If uncertain, widen the backfill:
```sql
UPDATE profiles SET setup_completed = true
WHERE id IN (
SELECT DISTINCT user_id FROM categories
UNION
SELECT t.user_id FROM templates t
INNER JOIN template_items ti ON ti.template_id = t.id
);
```
**Warning signs:** v1.0 users reporting wizard appearing unexpectedly.
### Pitfall 4: Profile Type Missing setup_completed
**What goes wrong:** After migration 007 adds `setup_completed`, the TypeScript `Profile` interface in `src/lib/types.ts` still lacks the field. Any code reading `profile.setup_completed` gets a TypeScript error or `undefined`.
**Why it happens:** Migrations and TypeScript types are manually kept in sync — there is no auto-generation in this project.
**How to avoid:** Include updating `src/lib/types.ts` as an explicit task in the plan. Add `setup_completed: boolean` to the `Profile` interface. [VERIFIED: types.ts inspected — field absent]
**Warning signs:** TypeScript compiler error on `profile.setup_completed`.
### Pitfall 5: Migration File Ordering
**What goes wrong:** A migration named `006_...` that runs after one named `007_...` (or vice versa) due to filename sort.
**Why it happens:** Supabase CLI applies migrations in lexicographic filename order.
**How to avoid:** Uniqueness constraints must come in `006_...` and setup_completed in `007_...` because the backfill in 007 reads from `categories` — which needs to exist and be constraint-safe first. The order is correct as specified. [VERIFIED: existing migrations 001005 confirm naming convention]
---
## Code Examples
### Confirmed: Category Type Enum Values
From `002_categories.sql` and `src/lib/types.ts` [VERIFIED]:
```
'income' | 'bill' | 'variable_expense' | 'debt' | 'saving' | 'investment'
```
Preset items must use these exact string values as `type`.
### Confirmed: profiles Table Columns (before migration 007)
From `001_profiles.sql` [VERIFIED]:
```
id, display_name, locale, currency, created_at, updated_at
```
No `setup_completed` column exists yet. Migration 007 adds it.
### Confirmed: budgets Table (before migration 006)
From `004_budgets.sql` [VERIFIED]:
- No unique constraint on `(user_id, start_date)`.
- `start_date date not null`, `end_date date not null` — both present.
### Confirmed: categories Table (before migration 006)
From `002_categories.sql` [VERIFIED]:
- No unique constraint on `(user_id, name)`.
- Only a `categories_user_id_idx` index exists.
---
## State of the Art
| Old Approach | Current Approach | When Changed | Impact |
|--------------|------------------|--------------|--------|
| Application-level duplicate checks | DB-level UNIQUE constraint | This phase | Eliminates race conditions; constraint error surfaces as Supabase PostgREST error code `23505` |
| No first-run concept | `setup_completed` + `useFirstRunState` | This phase | Enables Phase 7 wizard to show only to new users |
---
## Assumptions Log
| # | Claim | Section | Risk if Wrong |
|---|-------|---------|---------------|
| A1 | `item_tier: "one_off"` is excluded from presets (only "fixed" and "variable") | Pattern 4 | If wizard allows one_off presets, the type needs updating — but `template_items.item_tier` check constraint already limits to `('fixed', 'variable')` so this is safe |
| A2 | No existing duplicate budgets or categories in production data | Migration 006 | If duplicates exist the DELETE+CONSTRAINT pattern handles them; risk is low, the cleanup step is exactly for this |
| A3 | The i18n library in use supports nested key access via dot notation (e.g., `t('presets.bill.rent')`) | i18n pattern | If it uses a flat key format, key structure needs adjustment — check existing `t()` calls in components before writing keys |
---
## Open Questions
1. **How does the app call `t()`?**
- What we know: en.json and de.json use nested objects (e.g., `categories.types.income`).
- What's unclear: Whether translation is `t('categories.types.income')` (dot-path) or `t('categories')['types']['income']`. Most react-i18next setups use dot-path.
- Recommendation: Before writing i18n keys, grep one existing `t()` call in the codebase to confirm syntax. Plan task should include this verification.
2. **Are there any existing v1.0 users in production?**
- What we know: The blocker in STATE.md says "existing v1.0 users must not see the wizard on first v2.0 login."
- What's unclear: Whether production has real user rows in `profiles` or if this is a personal/dev-only app.
- Recommendation: The migration is written defensively regardless — backfill runs on all qualifying rows, so there's no harm if the table is empty.
---
## Environment Availability
Step 2.6: SKIPPED (no new external dependencies — all tools are existing: Supabase CLI, PostgreSQL, Node/TypeScript toolchain already in use by the project).
---
## Validation Architecture
### Test Framework
| Property | Value |
|----------|-------|
| Framework | None detected — no vitest.config.*, jest.config.*, or test scripts in package.json |
| Config file | None — Wave 0 must create if tests are written |
| Quick run command | N/A |
| Full suite command | N/A |
### Phase Requirements → Test Map
| Req ID | Behavior | Test Type | Automated Command | File Exists? |
|--------|----------|-----------|-------------------|-------------|
| AUTO-01 | `useFirstRunState` returns `isFirstRun=true` when categories=[] | unit | `vitest run src/hooks/useFirstRunState.test.ts` | ❌ Wave 0 |
| AUTO-01 | `useFirstRunState` returns `isFirstRun=false` when categories and items present | unit | `vitest run src/hooks/useFirstRunState.test.ts` | ❌ Wave 0 |
| AUTO-01 | `useFirstRunState` returns `loading=true` while queries in flight | unit | `vitest run src/hooks/useFirstRunState.test.ts` | ❌ Wave 0 |
| SETUP-02 | `PRESETS` exports exactly 19 items | unit | `vitest run src/data/presets.test.ts` | ❌ Wave 0 |
| SETUP-02 | Each preset has valid `type` from CategoryType enum | unit | `vitest run src/data/presets.test.ts` | ❌ Wave 0 |
| SETUP-02 | Each preset has `item_tier` of `fixed` or `variable` (not `one_off`) | unit | `vitest run src/data/presets.test.ts` | ❌ Wave 0 |
| AUTO-03 | `Profile.setup_completed` TypeScript type is boolean | compile-time | `tsc --noEmit` | ❌ Wave 0 (after types.ts update) |
| DB constraints | Unique constraint SQL — not unit-testable without Supabase local instance | manual | Supabase local dev + insert duplicate | N/A |
### Sampling Rate
- **Per task commit:** `tsc --noEmit` (type safety at minimum)
- **Per wave merge:** `vitest run` (once vitest is set up)
- **Phase gate:** All passing before `/gsd-verify-work`
### Wave 0 Gaps
- [ ] `vitest` not installed — install: `npm install -D vitest @vitest/ui`
- [ ] `src/hooks/useFirstRunState.test.ts` — covers AUTO-01 loading guard and isFirstRun logic
- [ ] `src/data/presets.test.ts` — covers SETUP-02 count, type validity, item_tier validity
- [ ] `vitest.config.ts` — framework config (or add `"test"` to `vite.config.ts`)
---
## Security Domain
### Applicable ASVS Categories
| ASVS Category | Applies | Standard Control |
|---------------|---------|-----------------|
| V2 Authentication | no | — |
| V3 Session Management | no | — |
| V4 Access Control | yes | Supabase RLS already enabled on all tables — new constraints do not bypass RLS |
| V5 Input Validation | no | No new user-facing input in this phase |
| V6 Cryptography | no | — |
### Known Threat Patterns
| Pattern | STRIDE | Standard Mitigation |
|---------|--------|---------------------|
| Duplicate budget creation via parallel requests | Tampering | UNIQUE constraint on `(user_id, start_date)` — DB rejects second insert atomically |
| First-run flag manipulation (client sets setup_completed) | Elevation of privilege | RLS policy `"Users can update own profile"` — user can update their own row; acceptable since setup_completed is not a security gate, only a UX flag |
---
## Sources
### Primary (HIGH confidence)
- `supabase/migrations/001_profiles.sql` — profiles table schema, trigger, no setup_completed column confirmed
- `supabase/migrations/002_categories.sql` — categories table schema, no unique constraint on (user_id, name) confirmed
- `supabase/migrations/004_budgets.sql` — budgets table schema, no unique constraint on (user_id, start_date) confirmed
- `src/hooks/useCategories.ts` — hook pattern, query key ["categories"], default returns []
- `src/hooks/useTemplate.ts` — hook pattern, query keys, items default []
- `src/lib/types.ts` — CategoryType values, Profile interface (no setup_completed), all confirmed
- `src/i18n/en.json`, `de.json` — i18n structure and nesting pattern confirmed
- `.planning/config.json` — nyquist_validation: true confirmed
### Secondary (MEDIUM confidence)
- PostgreSQL DISTINCT ON + ORDER BY requirement — standard behavior, well-documented
### Tertiary (LOW confidence)
- A3: i18n dot-path notation — inferred from JSON structure; needs grep verification
---
## Metadata
**Confidence breakdown:**
- Standard stack: HIGH — all libraries verified as already installed
- Architecture: HIGH — all schema details verified against actual migration files and hook source
- Pitfalls: HIGH — derived from direct inspection of existing code and standard PostgreSQL semantics
- Preset content: MEDIUM — exact amounts and slugs are at Claude's discretion; structure is HIGH confidence
**Research date:** 2026-04-20
**Valid until:** 2026-07-20 (stable domain — PostgreSQL constraints and React Query patterns are not fast-moving)

View File

@@ -0,0 +1,140 @@
---
phase: 06-preset-data-first-run-detection-and-db-safety
verified: 2026-04-20T19:15:00Z
status: human_needed
score: 5/5
overrides_applied: 0
human_verification:
- test: "Attempt duplicate budget INSERT for same (user_id, start_date) via Supabase SQL editor"
expected: "INSERT fails with unique constraint violation error 23505"
why_human: "Requires a running Supabase instance with live DB to test constraint enforcement"
- test: "Attempt duplicate category INSERT for same (user_id, name) via Supabase SQL editor"
expected: "INSERT fails with unique constraint violation error 23505"
why_human: "Requires a running Supabase instance with live DB to test constraint enforcement"
- test: "Check profiles table for existing v1.0 user rows — confirm setup_completed = true"
expected: "All users who had categories or template items before migration show setup_completed = true"
why_human: "Requires inspecting live database state after backfill"
---
# Phase 6: Preset Data, First-Run Detection, and DB Safety Verification Report
**Phase Goal:** The data layer is safe and ready -- duplicate budget/category writes are impossible at the DB level, and the app correctly identifies first-run users
**Verified:** 2026-04-20T19:15:00Z
**Status:** human_needed
**Re-verification:** No -- initial verification
## Goal Achievement
### Observable Truths
| # | Truth | Status | Evidence |
|---|-------|--------|----------|
| 1 | Attempting to create two budgets for the same user and month is rejected at the DB level | VERIFIED | `006_uniqueness_constraints.sql` contains `ADD CONSTRAINT budgets_user_month_unique UNIQUE (user_id, start_date)` wrapped in BEGIN/COMMIT. User confirmed DB push completed successfully. |
| 2 | Attempting to create two categories with the same name for the same user is rejected at the DB level | VERIFIED | `006_uniqueness_constraints.sql` contains `ADD CONSTRAINT categories_user_name_unique UNIQUE (user_id, name)` with safe deduplication DELETE. User confirmed DB push completed. |
| 3 | All existing v1.0 users have `profiles.setup_completed = true` after backfill | VERIFIED | `007_setup_completed.sql` adds column `boolean NOT NULL DEFAULT false` then runs UPDATE with UNION covering both `categories` and `template_items` tables. User confirmed DB push applied. |
| 4 | `useFirstRunState` hook returns `true` only for users with zero categories or zero template items | VERIFIED | `src/hooks/useFirstRunState.ts` exports function returning `{ isFirstRun: categories.length === 0 \|\| items.length === 0, loading: catLoading \|\| tmplLoading }`. Derives from `useCategories()` and `useTemplate()` caches. `tsc --noEmit` passes. |
| 5 | `src/data/presets.ts` contains ~15-20 curated budget items with i18n translation keys | VERIFIED | 19 items (4 income, 4 bill, 5 variable_expense, 2 debt, 2 saving, 2 investment). `en.json` and `de.json` both have `presets` key with 19 slugs across 6 type categories. Both JSON files parse cleanly. |
**Score:** 5/5 truths verified
### Deferred Items
Items not yet met but explicitly addressed in later milestone phases.
| # | Item | Addressed In | Evidence |
|---|------|-------------|----------|
| 1 | useFirstRunState not yet consumed by any component | Phase 7 | Phase 7 SC 1: "A new user is automatically redirected to /setup on their first login" -- requires useFirstRunState |
| 2 | PRESETS/PresetItem not yet imported by any component | Phase 7 | Phase 7 SC 2: "recurring items step shows ~15-20 pre-filled common items" -- consumes PRESETS array |
### Required Artifacts
| Artifact | Expected | Status | Details |
|----------|----------|--------|---------|
| `supabase/migrations/006_uniqueness_constraints.sql` | Atomic deduplication + unique constraint DDL | VERIFIED | 29 lines. BEGIN/COMMIT transaction. 2 DISTINCT ON dedup DELETEs. 2 ADD CONSTRAINT statements. |
| `supabase/migrations/007_setup_completed.sql` | ALTER TABLE + backfill UPDATE | VERIFIED | 18 lines. ADD COLUMN setup_completed boolean NOT NULL DEFAULT false. UPDATE with UNION backfill. |
| `src/lib/types.ts` | Profile interface with setup_completed | VERIFIED | Line 16: `setup_completed: boolean` present in Profile interface. |
| `src/data/presets.ts` | PresetItem interface + PRESETS array | VERIFIED | Exports PresetItem interface and PRESETS array with 19 items. No one_off tier values. Pure static module. |
| `src/i18n/en.json` | English preset translations | VERIFIED | Top-level `presets` key with 6 type groups, 19 total slugs. Valid JSON. |
| `src/i18n/de.json` | German preset translations | VERIFIED | Top-level `presets` key with 6 type groups, 19 total slugs. Valid JSON. |
| `src/hooks/useFirstRunState.ts` | Derived first-run state hook | VERIFIED | 28 lines. Exports `useFirstRunState()` returning `{ isFirstRun, loading }`. No direct Supabase calls. |
### Key Link Verification
| From | To | Via | Status | Details |
|------|----|-----|--------|---------|
| `007_setup_completed.sql` | profiles table | ALTER TABLE ADD COLUMN | WIRED | `setup_completed boolean NOT NULL DEFAULT false` present |
| `src/lib/types.ts` | Profile interface | TypeScript field | WIRED | `setup_completed: boolean` on line 16 |
| `src/data/presets.ts` | `src/lib/types.ts` | `import type { CategoryType }` | WIRED | Line 1 imports CategoryType from types |
| `src/i18n/en.json` | presets.{type}.{slug} | react-i18next dot-path | WIRED | `"presets"` key present with nested type/slug structure |
| `src/hooks/useFirstRunState.ts` | `src/hooks/useCategories.ts` | useCategories() call | WIRED | Line 1 import + line 21 invocation |
| `src/hooks/useFirstRunState.ts` | `src/hooks/useTemplate.ts` | useTemplate() call | WIRED | Line 2 import + line 22 invocation |
### Data-Flow Trace (Level 4)
| Artifact | Data Variable | Source | Produces Real Data | Status |
|----------|--------------|--------|-------------------|--------|
| `src/hooks/useFirstRunState.ts` | categories, items | useCategories() cache, useTemplate() cache | Yes -- upstream hooks query Supabase | FLOWING |
| `src/data/presets.ts` | PRESETS | Static array literal | Yes -- 19 hardcoded items (intentionally static) | FLOWING |
### Behavioral Spot-Checks
| Behavior | Command | Result | Status |
|----------|---------|--------|--------|
| TypeScript compiles cleanly | `npx tsc --noEmit` | Zero errors (no output) | PASS |
| Migration 006 has 2 constraints | `grep -c "ADD CONSTRAINT" 006_uniqueness_constraints.sql` | 2 | PASS |
| Migration 006 is transactional | `grep -c "BEGIN" 006_uniqueness_constraints.sql` | 1 | PASS |
| Migration 007 has column add | `grep "ADD COLUMN setup_completed" 007_setup_completed.sql` | 1 match | PASS |
| Migration 007 has backfill | `grep "UPDATE profiles" 007_setup_completed.sql` | 1 match | PASS |
| Presets has 19 items | `grep -c '{ slug:' src/data/presets.ts` | 19 | PASS |
| No one_off in presets | `grep "one_off" src/data/presets.ts` | 0 matches | PASS |
| en.json has 19 preset slugs | node JSON parse + count | 19 | PASS |
| de.json has 19 preset slugs | node JSON parse + count | 19 | PASS |
| useFirstRunState exports function | `grep "export function useFirstRunState"` | 1 match | PASS |
### Requirements Coverage
| Requirement | Source Plan | Description | Status | Evidence |
|-------------|-----------|-------------|--------|----------|
| AUTO-01 | 06-01, 06-03 | Auto-budget uses template on first month visit | SATISFIED (Phase 6 portion) | Budgets unique constraint prevents duplicates; useFirstRunState detects first-run. Full auto-creation in Phase 8. |
| AUTO-03 | 06-01, 06-02 | Auto-creation uses user's configured currency | SATISFIED (Phase 6 portion) | Preset amounts are plain EUR numbers with no currency symbol. Profile has currency field. Full currency usage in Phase 8. |
| SETUP-01 | 06-01, 06-03 | New user guided through wizard | SATISFIED (Phase 6 portion) | setup_completed column + backfill identifies existing users. useFirstRunState hook detects new users. Wizard UI in Phase 7. |
| SETUP-02 | 06-02 | User sees pre-filled common budget items | SATISFIED (Phase 6 portion) | 19 preset items in PRESETS array with en/de translations. Wizard display in Phase 7. |
No orphaned requirements found -- all 4 IDs (AUTO-01, AUTO-03, SETUP-01, SETUP-02) appear in plan frontmatter and are traced to REQUIREMENTS.md.
### Anti-Patterns Found
| File | Line | Pattern | Severity | Impact |
|------|------|---------|----------|--------|
| (none) | - | - | - | No anti-patterns detected in any phase 6 artifact |
### Human Verification Required
### 1. Budget Unique Constraint Enforcement
**Test:** In Supabase SQL editor, INSERT two budget rows with the same `user_id` and `start_date`.
**Expected:** Second INSERT fails with error code 23505 (unique_violation).
**Why human:** Requires running Supabase instance with live DB. Note: User already confirmed DB push succeeded, but runtime constraint rejection is a behavioral check.
### 2. Category Unique Constraint Enforcement
**Test:** In Supabase SQL editor, INSERT two category rows with the same `user_id` and `name`.
**Expected:** Second INSERT fails with error code 23505 (unique_violation).
**Why human:** Requires running Supabase instance with live DB.
### 3. Backfill Correctness for Existing Users
**Test:** In Supabase Table Editor, check `profiles` rows for users who existed before migration 007.
**Expected:** Any user with existing categories or template items has `setup_completed = true`. New test users have `setup_completed = false`.
**Why human:** Requires inspecting live database state.
### Gaps Summary
No gaps found. All 5 roadmap success criteria are verified at the code/artifact level. Two artifacts (useFirstRunState hook and PRESETS array) are intentionally orphaned -- they are consumed by Phase 7 (Setup Wizard), which is the next phase.
Three items require human verification against the live database: budget constraint enforcement, category constraint enforcement, and backfill correctness. These are behavioral checks that cannot be verified by static code analysis alone.
---
_Verified: 2026-04-20T19:15:00Z_
_Verifier: Claude (gsd-verifier)_

View File

@@ -0,0 +1,461 @@
---
phase: 07-setup-wizard
plan: 01
type: execute
wave: 1
depends_on: []
files_modified:
- src/pages/SetupPage.tsx
- src/hooks/useWizardState.ts
- src/components/setup/WizardStepper.tsx
- src/components/setup/IncomeStep.tsx
- src/components/setup/AllocationBar.tsx
- src/components/setup/CategoryGroupHeader.tsx
- src/components/setup/PresetItemRow.tsx
- src/components/setup/RecurringItemsStep.tsx
- src/i18n/en.json
- src/i18n/de.json
autonomous: true
requirements: [SETUP-01, SETUP-02, SETUP-04]
must_haves:
truths:
- "SetupPage renders a centered card with WizardStepper showing 3 steps"
- "useWizardState persists wizard data to localStorage keyed by userId"
- "IncomeStep shows a number input pre-filled with 3000 and profile currency"
- "RecurringItemsStep shows all 19 PRESETS grouped by type with checkboxes"
- "AllocationBar shows live remaining = income - sum(checked amounts)"
- "Bills and variable_expense items are pre-checked by default"
- "All wizard i18n keys exist in both en.json and de.json"
artifacts:
- path: "src/pages/SetupPage.tsx"
provides: "Wizard page orchestrator with step rendering"
min_lines: 40
- path: "src/hooks/useWizardState.ts"
provides: "localStorage-synced wizard state management"
exports: ["useWizardState"]
- path: "src/components/setup/WizardStepper.tsx"
provides: "Horizontal 1-2-3 stepper bar"
exports: ["WizardStepper"]
- path: "src/components/setup/IncomeStep.tsx"
provides: "Step 1 income input"
exports: ["IncomeStep"]
- path: "src/components/setup/RecurringItemsStep.tsx"
provides: "Step 2 grouped checklist"
exports: ["RecurringItemsStep"]
- path: "src/components/setup/AllocationBar.tsx"
provides: "Sticky remaining balance bar"
exports: ["AllocationBar"]
- path: "src/components/setup/PresetItemRow.tsx"
provides: "Single checkbox row with amount input"
exports: ["PresetItemRow"]
- path: "src/components/setup/CategoryGroupHeader.tsx"
provides: "Section header with colored dot"
exports: ["CategoryGroupHeader"]
key_links:
- from: "src/pages/SetupPage.tsx"
to: "src/hooks/useWizardState.ts"
via: "useWizardState(userId) hook call"
pattern: "useWizardState"
- from: "src/components/setup/RecurringItemsStep.tsx"
to: "src/data/presets.ts"
via: "import PRESETS"
pattern: "import.*PRESETS.*from.*presets"
---
<objective>
Build the setup wizard page shell, state management hook, and all UI components for the 3-step wizard (income, recurring items with live allocation, review placeholder).
Purpose: Establishes the wizard's visual structure, localStorage persistence, and all interactive components. Plan 02 will add the ReviewStep and completion/redirect logic on top of this foundation.
Output: A navigable 3-step wizard at /setup (not yet routed) with working state persistence and live allocation calculation.
</objective>
<execution_context>
@$HOME/.claude/get-shit-done/workflows/execute-plan.md
@$HOME/.claude/get-shit-done/templates/summary.md
</execution_context>
<context>
@.planning/PROJECT.md
@.planning/ROADMAP.md
@.planning/STATE.md
@.planning/phases/07-setup-wizard/07-CONTEXT.md
@.planning/phases/07-setup-wizard/07-RESEARCH.md
@.planning/phases/07-setup-wizard/07-PATTERNS.md
@.planning/phases/07-setup-wizard/07-UI-SPEC.md
<interfaces>
From src/lib/types.ts:
```typescript
export type CategoryType = "income" | "bill" | "variable_expense" | "debt" | "saving" | "investment"
export type ItemTier = "fixed" | "variable" | "one_off"
export interface Profile { id: string; display_name: string | null; locale: string; currency: string; setup_completed: boolean; ... }
```
From src/data/presets.ts:
```typescript
export interface PresetItem {
slug: string
type: CategoryType
defaultAmount: number
item_tier: "fixed" | "variable"
}
export const PRESETS: PresetItem[] = [ /* 19 items: 4 income, 4 bill, 5 variable_expense, 2 debt, 2 saving, 2 investment */ ]
```
From src/hooks/useAuth.ts:
```typescript
// Returns { user, profile, loading, signIn, signOut, signUp }
// profile.currency = "EUR" | "USD" | "CHF" etc.
```
From src/hooks/useCategories.ts:
```typescript
export function useCategories(): { categories: Category[]; loading: boolean; create: UseMutationResult; ... }
// create.mutateAsync({ name: string, type: CategoryType, icon?: string }) => Category
```
From src/hooks/useTemplate.ts:
```typescript
export function useTemplate(): { template: Template | null; items: TemplateItem[]; loading: boolean; createItem: UseMutationResult; ... }
// createItem.mutateAsync({ category_id: string, item_tier: "fixed"|"variable", budgeted_amount: number }) => TemplateItem
```
</interfaces>
</context>
<tasks>
<task type="auto">
<name>Task 1: Install shadcn checkbox + create useWizardState hook + add i18n keys</name>
<read_first>
- src/i18n/en.json
- src/i18n/de.json
- src/data/presets.ts
- src/hooks/useAuth.ts
</read_first>
<files>src/hooks/useWizardState.ts, src/i18n/en.json, src/i18n/de.json</files>
<action>
1. Install shadcn checkbox:
```bash
npx shadcn@latest add checkbox
```
2. Create `src/hooks/useWizardState.ts`:
```typescript
import { useState, useEffect } from "react"
import { PRESETS } from "@/data/presets"
export interface WizardState {
currentStep: 1 | 2 | 3
income: number
selectedItems: Record<string, { checked: boolean; amount: number }>
}
const STORAGE_KEY = (userId: string) => `setup-wizard-${userId}`
function getDefaultState(): WizardState {
const selectedItems: Record<string, { checked: boolean; amount: number }> = {}
for (const preset of PRESETS) {
selectedItems[preset.slug] = {
checked: preset.type === "bill" || preset.type === "variable_expense",
amount: preset.defaultAmount,
}
}
return { currentStep: 1, income: 3000, selectedItems }
}
export function useWizardState(userId: string) {
const [state, setState] = useState<WizardState>(() => {
try {
const saved = localStorage.getItem(STORAGE_KEY(userId))
if (saved) {
const parsed = JSON.parse(saved)
// Validate shape
if (parsed && typeof parsed.currentStep === "number" && typeof parsed.income === "number" && parsed.selectedItems) {
return parsed as WizardState
}
}
} catch { /* ignore corrupt data */ }
return getDefaultState()
})
useEffect(() => {
localStorage.setItem(STORAGE_KEY(userId), JSON.stringify(state))
}, [state, userId])
const setStep = (step: 1 | 2 | 3) => setState(s => ({ ...s, currentStep: step }))
const setIncome = (income: number) => setState(s => ({ ...s, income }))
const toggleItem = (slug: string) => setState(s => ({
...s,
selectedItems: {
...s.selectedItems,
[slug]: { ...s.selectedItems[slug], checked: !s.selectedItems[slug].checked },
},
}))
const setItemAmount = (slug: string, amount: number) => setState(s => ({
...s,
selectedItems: {
...s.selectedItems,
[slug]: { ...s.selectedItems[slug], amount },
},
}))
const clearState = () => {
localStorage.removeItem(STORAGE_KEY(userId))
}
return { state, setStep, setIncome, toggleItem, setItemAmount, clearState }
}
```
3. Add i18n keys to `src/i18n/en.json` — add a `"setup"` object at the top level:
```json
"setup": {
"title": "Set up your budget",
"step1": {
"title": "Monthly Income",
"description": "How much do you earn each month?",
"incomeLabel": "Monthly net income",
"helper": "Enter your total monthly take-home pay",
"validation": "Please enter a positive income amount"
},
"step2": {
"title": "Recurring Items",
"description": "Select your regular monthly expenses",
"remaining": "Remaining to allocate"
},
"step3": {
"title": "Review",
"description": "Confirm your budget template",
"incomeLabel": "Monthly income",
"totalLabel": "Total expenses",
"remainingLabel": "Remaining",
"empty": "No items selected. You can add items to your template later."
},
"steps": {
"1": "Income",
"2": "Items",
"3": "Review"
},
"next": "Next Step",
"back": "Go Back",
"skip": "Skip Step",
"skipSetup": "Skip setup",
"complete": "Complete Setup",
"toast": {
"success": "Template created! Your first budget will appear automatically.",
"error": "Could not save your template. Please try again.",
"partialError": "Some items could not be saved. Check your template page."
}
}
```
4. Add equivalent German keys to `src/i18n/de.json`:
```json
"setup": {
"title": "Budget einrichten",
"step1": {
"title": "Monatliches Einkommen",
"description": "Wie viel verdienst du pro Monat?",
"incomeLabel": "Monatliches Nettoeinkommen",
"helper": "Gib dein monatliches Nettoeinkommen ein",
"validation": "Bitte gib einen positiven Betrag ein"
},
"step2": {
"title": "Wiederkehrende Posten",
"description": "Wahle deine regelmaigen monatlichen Ausgaben",
"remaining": "Verbleibend zu verteilen"
},
"step3": {
"title": "Ubersicht",
"description": "Bestatige deine Budgetvorlage",
"incomeLabel": "Monatliches Einkommen",
"totalLabel": "Gesamtausgaben",
"remainingLabel": "Verbleibend",
"empty": "Keine Posten ausgewahlt. Du kannst spater Posten zu deiner Vorlage hinzufugen."
},
"steps": {
"1": "Einkommen",
"2": "Posten",
"3": "Ubersicht"
},
"next": "Nachster Schritt",
"back": "Zuruck",
"skip": "Schritt uberspringen",
"skipSetup": "Einrichtung uberspringen",
"complete": "Einrichtung abschlieen",
"toast": {
"success": "Vorlage erstellt! Dein erstes Budget wird automatisch erscheinen.",
"error": "Vorlage konnte nicht gespeichert werden. Bitte versuche es erneut.",
"partialError": "Einige Posten konnten nicht gespeichert werden. Prufe deine Vorlagenseite."
}
}
```
</action>
<verify>
<automated>grep -q "useWizardState" src/hooks/useWizardState.ts && grep -q '"setup"' src/i18n/en.json && grep -q '"setup"' src/i18n/de.json && ls src/components/ui/checkbox.tsx</automated>
</verify>
<acceptance_criteria>
- src/hooks/useWizardState.ts contains `export function useWizardState(userId: string)`
- src/hooks/useWizardState.ts contains `setup-wizard-${userId}`
- src/hooks/useWizardState.ts contains `getDefaultState`
- src/i18n/en.json contains `"setup.title"` nested under `"setup": { "title":`
- src/i18n/en.json contains `"setup.toast.success"` with value "Template created!"
- src/i18n/de.json contains `"setup": { "title": "Budget einrichten"`
- src/components/ui/checkbox.tsx exists (shadcn installed)
</acceptance_criteria>
<done>useWizardState hook created with localStorage sync, all setup i18n keys in EN+DE, shadcn checkbox component installed</done>
</task>
<task type="auto">
<name>Task 2: Create all wizard UI components and SetupPage</name>
<read_first>
- src/pages/LoginPage.tsx
- src/components/dashboard/SummaryStrip.tsx
- src/pages/SettingsPage.tsx
- src/data/presets.ts
- src/hooks/useWizardState.ts
- src/components/ui/checkbox.tsx
</read_first>
<files>src/components/setup/WizardStepper.tsx, src/components/setup/IncomeStep.tsx, src/components/setup/AllocationBar.tsx, src/components/setup/CategoryGroupHeader.tsx, src/components/setup/PresetItemRow.tsx, src/components/setup/RecurringItemsStep.tsx, src/pages/SetupPage.tsx</files>
<action>
Create the following components in `src/components/setup/`:
**1. WizardStepper.tsx:**
- Props: `currentStep: 1|2|3`, `onStepClick: (step: 1|2|3) => void`
- Renders 3 circles in a row connected by lines
- Active step: `bg-primary text-primary-foreground` with number (14px/600)
- Completed step (step < currentStep): `bg-primary text-primary-foreground` with lucide `Check` icon (16px)
- Upcoming step (step > currentStep): `bg-muted text-muted-foreground border border-border`
- Connector line between: `h-px w-16` — completed segment `bg-primary`, upcoming `bg-border`
- Step labels below circles: text-xs font-semibold, active `text-foreground`, others `text-muted-foreground`
- Labels from i18n: `t("setup.steps.1")`, `t("setup.steps.2")`, `t("setup.steps.3")`
- Clicking a completed step or current step calls onStepClick. Future steps: no action, cursor-default.
- Wrap in `role="navigation" aria-label="Setup progress"`
- Circle dimensions: `w-8 h-8` (32px)
- Overall layout: `flex items-center justify-center gap-0` with step groups `flex flex-col items-center gap-1` separated by connector lines
- Margin below: handled by parent (mb-6)
**2. IncomeStep.tsx:**
- Props: `income: number`, `onIncomeChange: (val: number) => void`, `currency: string`, `error: string | null`
- Renders card content for step 1
- Label: `t("setup.step1.incomeLabel")` (14px/600)
- Input row: `flex items-center gap-2`
- Input: `type="number"`, `className="w-full text-right text-lg"`, value={income}, onChange converts to number
- Currency suffix: `<span className="text-muted-foreground text-sm">{currency}</span>`
- Helper text: `t("setup.step1.helper")` in `text-sm text-muted-foreground`
- If `error` is truthy: show `<p className="text-sm text-destructive">{error}</p>` below input
- `aria-describedby` on input pointing to helper and error elements
**3. AllocationBar.tsx:**
- Props: `remaining: number`, `currency: string`
- Layout: `sticky top-0 z-10 flex justify-between items-center py-3 px-4 bg-muted border-b border-border rounded-none`
- Left: `<span className="text-sm font-semibold">{t("setup.step2.remaining")}</span>`
- Right: formatted amount using `Intl.NumberFormat` with currency
- `remaining >= 0`: `className="text-base font-semibold text-on-budget"`
- `remaining < 0`: `className="text-base font-semibold text-destructive"`
- Add `aria-live="polite"` on the amount element
**4. CategoryGroupHeader.tsx:**
- Props: `type: CategoryType`, `label: string`, `count: number`
- Layout: `flex items-center gap-2 pt-4 pb-2`
- Colored dot: `w-2.5 h-2.5 rounded-full` with inline style `backgroundColor: var(--color-${type.replace('_', '-')})`
- Map types to CSS vars: income -> `--color-income`, bill -> `--color-bill`, variable_expense -> `--color-variable-expense`, debt -> `--color-debt`, saving -> `--color-saving`, investment -> `--color-investment`
- Label: `<span className="text-sm font-semibold">{label}</span>`
- Count: `<span className="text-xs text-muted-foreground">({count} items)</span>`
- Below: `<Separator />` from shadcn
**5. PresetItemRow.tsx:**
- Props: `slug: string`, `type: CategoryType`, `checked: boolean`, `amount: number`, `onToggle: () => void`, `onAmountChange: (val: number) => void`
- Layout: `flex items-center gap-3 py-2.5 px-1`
- Checkbox: shadcn `<Checkbox checked={checked} onCheckedChange={onToggle} />`
- Item name: `<span className="flex-1 text-sm">{t(\`presets.${type}.${slug}\`)}</span>`
- Category badge: `<Badge variant="outline" className="text-xs" style={{ borderLeftWidth: '3px', borderLeftColor: \`var(--color-${type.replace('_', '-')})\` }}>{t(\`categories.types.${type}\`)}</Badge>`
- Amount input: `<Input type="number" className="w-24 text-right" value={amount} onChange={...} disabled={!checked} />`
- When disabled: add `bg-muted text-muted-foreground opacity-50` classes
**6. RecurringItemsStep.tsx:**
- Props: `selectedItems: Record<string, { checked: boolean; amount: number }>`, `income: number`, `currency: string`, `onToggle: (slug: string) => void`, `onAmountChange: (slug: string, amount: number) => void`
- Groups PRESETS by type using: `Object.groupBy(PRESETS, (p) => p.type)` — if Object.groupBy not available, use manual reduce
- Order groups: `["income", "bill", "variable_expense", "debt", "saving", "investment"]`
- Renders AllocationBar at top (sticky)
- For each group: CategoryGroupHeader + list of PresetItemRow
- Wrap each group in `<fieldset>` with `<legend className="sr-only">{groupLabel}</legend>`
- Compute remaining: `income - sum of all checked items' amounts`
**7. SetupPage.tsx** (page orchestrator):
- Imports useAuth, useWizardState, useTranslation, WizardStepper, IncomeStep, RecurringItemsStep
- Gets userId from `useAuth()` -> `user.id`
- Gets currency from profile: `profile?.currency ?? "EUR"`
- Uses `useWizardState(userId)` for state management
- Layout: `<div className="flex min-h-screen items-center justify-center bg-background p-4"><div className="w-full max-w-2xl">`
- Renders WizardStepper above the card
- Card: `<Card className="w-full border border-border shadow-sm">`
- CardHeader: step title (heading 20px/600) + step description (body 14px/400 text-muted-foreground)
- CardContent: renders active step component based on `state.currentStep`
- Bottom nav: `flex justify-between items-center pt-4 border-t border-border`
- Left side: Go Back button (variant="ghost", hidden on step 1) + Skip Step button (variant="ghost" text-muted-foreground)
- Right side: Next Step button (variant="default")
- Step 1 Next: validates income > 0, shows error if invalid, otherwise advances to step 2
- Step 2 Next: no validation, advances to step 3
- Step 3: shows placeholder text "Review step coming in next plan" (will be replaced in Plan 02)
- Below card: "Skip setup" link: `<button className="mt-4 text-sm text-muted-foreground underline block mx-auto">{t("setup.skipSetup")}</button>`
- Skip step on step 1: advance to step 2. Skip step on step 2: advance to step 3.
- Clicking completed stepper steps calls `setStep(step)`
</action>
<verify>
<automated>ls src/components/setup/WizardStepper.tsx src/components/setup/IncomeStep.tsx src/components/setup/AllocationBar.tsx src/components/setup/CategoryGroupHeader.tsx src/components/setup/PresetItemRow.tsx src/components/setup/RecurringItemsStep.tsx src/pages/SetupPage.tsx && npx tsc --noEmit 2>&1 | head -30</automated>
</verify>
<acceptance_criteria>
- src/pages/SetupPage.tsx contains `useWizardState` and `max-w-2xl`
- src/pages/SetupPage.tsx contains `currentStep` conditional rendering
- src/components/setup/WizardStepper.tsx contains `role="navigation"` and `aria-label`
- src/components/setup/WizardStepper.tsx contains `w-8 h-8`
- src/components/setup/IncomeStep.tsx contains `type="number"` and `text-lg`
- src/components/setup/AllocationBar.tsx contains `aria-live="polite"` and `sticky top-0`
- src/components/setup/CategoryGroupHeader.tsx contains `w-2.5 h-2.5 rounded-full`
- src/components/setup/PresetItemRow.tsx contains `Checkbox` import and `w-24`
- src/components/setup/RecurringItemsStep.tsx imports `PRESETS` from `@/data/presets`
- TypeScript compiles without errors (`npx tsc --noEmit` exits 0)
</acceptance_criteria>
<done>All 7 wizard UI components render correctly, TypeScript compiles without errors, wizard navigates between steps 1 and 2 with working state persistence</done>
</task>
</tasks>
<threat_model>
## Trust Boundaries
| Boundary | Description |
|----------|-------------|
| localStorage -> component | Persisted wizard data read back into React state |
| client -> Supabase (future Plan 02) | Category/template item creation on completion |
## STRIDE Threat Register
| Threat ID | Category | Component | Disposition | Mitigation Plan |
|-----------|----------|-----------|-------------|-----------------|
| T-07-01 | Tampering | useWizardState localStorage read | mitigate | Validate JSON shape on load: check currentStep is 1-3, income is number, selectedItems is object with expected structure. Fall back to defaults on invalid data. |
| T-07-02 | Information Disclosure | localStorage key | accept | Key includes userId, preventing cross-user data leakage. Data is non-sensitive (income amount, item selections). |
| T-07-03 | Spoofing | Preset data | accept | PRESETS are hardcoded source constants, not user input. i18n keys resolve from bundled JSON, no injection vector. |
</threat_model>
<verification>
- `npx tsc --noEmit` passes (no type errors)
- All 7 component files exist in src/components/setup/ and src/pages/
- useWizardState stores and retrieves state from localStorage
- i18n keys resolve for both "en" and "de" locales
</verification>
<success_criteria>
- SetupPage renders with WizardStepper showing 3 steps
- Step 1 shows income input pre-filled with 3000 and currency suffix
- Step 2 shows all 19 PRESETS grouped by type with checkboxes and editable amounts
- Bills (4) and variable_expense (5) items are checked by default
- AllocationBar shows remaining = 3000 - sum(checked) and turns red when negative
- Navigating between steps preserves state
- Refreshing the page restores wizard at correct step (localStorage)
</success_criteria>
<output>
After completion, create `.planning/phases/07-setup-wizard/07-01-SUMMARY.md`
</output>

View File

@@ -0,0 +1,86 @@
---
phase: 07-setup-wizard
plan: 01
subsystem: frontend/setup-wizard
tags: [wizard, ui, state-management, i18n]
dependency_graph:
requires: [src/data/presets.ts, src/lib/types.ts, src/hooks/useAuth.ts]
provides: [src/hooks/useWizardState.ts, src/pages/SetupPage.tsx, src/components/setup/*]
affects: [src/i18n/en.json, src/i18n/de.json]
tech_stack:
added: [shadcn/checkbox]
patterns: [localStorage-synced-state, multi-step-wizard, grouped-preset-checklist]
key_files:
created:
- src/hooks/useWizardState.ts
- src/components/setup/WizardStepper.tsx
- src/components/setup/IncomeStep.tsx
- src/components/setup/AllocationBar.tsx
- src/components/setup/CategoryGroupHeader.tsx
- src/components/setup/PresetItemRow.tsx
- src/components/setup/RecurringItemsStep.tsx
- src/pages/SetupPage.tsx
- src/components/ui/checkbox.tsx
modified:
- src/i18n/en.json
- src/i18n/de.json
decisions:
- "Profile fetched inline in SetupPage (same pattern as SettingsPage) since useAuth does not expose profile"
- "Used manual reduce for grouping PRESETS by type for broad browser compatibility"
metrics:
duration: 178s
completed: 2026-04-20T19:06:36Z
tasks_completed: 2
tasks_total: 2
files_created: 9
files_modified: 2
---
# Phase 07 Plan 01: Setup Wizard UI Shell Summary
LocalStorage-synced 3-step wizard with income input, grouped preset checklist (19 items), live allocation bar, and horizontal stepper navigation.
## Commits
| Task | Commit | Description |
|------|--------|-------------|
| 1 | bbcb07f | useWizardState hook, i18n keys (EN+DE), shadcn checkbox |
| 2 | e141197 | All 7 wizard UI components and SetupPage orchestrator |
## What Was Built
1. **useWizardState hook** - Manages wizard step, income, and item selections in localStorage keyed by userId. Validates JSON shape on load (T-07-01 mitigation). Bills and variable_expense items pre-checked by default.
2. **WizardStepper** - Horizontal 1-2-3 stepper with circles, connector lines, and step labels. Completed steps are clickable; future steps are disabled.
3. **IncomeStep** - Number input pre-filled with 3000, currency suffix from profile, helper text, and inline validation error display.
4. **AllocationBar** - Sticky bar showing remaining = income - sum(checked amounts). Green when positive, red (destructive) when negative. aria-live="polite" for screen readers.
5. **CategoryGroupHeader** - Colored dot + label + item count for each of the 6 category types.
6. **PresetItemRow** - Checkbox + preset name (i18n) + category badge with colored border + editable amount input (disabled when unchecked).
7. **RecurringItemsStep** - Groups all 19 PRESETS into 6 category sections with AllocationBar at top.
8. **SetupPage** - Page orchestrator: centered card layout (max-w-2xl), loads profile for currency, renders stepper + active step, handles Next/Back/Skip navigation with income validation.
## i18n
All wizard copy added under `setup.*` namespace in both `en.json` and `de.json` (35 keys each). German translations use proper umlauts and natural phrasing.
## Deviations from Plan
None - plan executed exactly as written.
## Known Stubs
| File | Line | Stub | Reason |
|------|------|------|--------|
| src/pages/SetupPage.tsx | Step 3 content | "Review step coming in next plan" placeholder | Plan 02 will implement ReviewStep and completion logic |
| src/pages/SetupPage.tsx | Skip setup button | No-op onClick | Plan 02 will wire skip to mark setup_completed and redirect |
| src/pages/SetupPage.tsx | Complete button | Disabled, no handler | Plan 02 will implement completion sequence |
These stubs are intentional -- Plan 02 explicitly owns the ReviewStep, completion logic, routing, and redirect.
## Self-Check: PASSED

View File

@@ -0,0 +1,392 @@
---
phase: 07-setup-wizard
plan: 02
type: execute
wave: 2
depends_on: [07-01]
files_modified:
- src/components/setup/ReviewStep.tsx
- src/pages/SetupPage.tsx
- src/App.tsx
- src/pages/DashboardPage.tsx
autonomous: true
requirements: [SETUP-01, SETUP-03, SETUP-05]
must_haves:
truths:
- "ReviewStep shows read-only summary of income + selected items grouped by type + totals"
- "/setup route is protected and renders SetupPage outside AppLayout"
- "DashboardPage redirects first-run users to /setup via useFirstRunState"
- "Completing wizard creates categories then template items and redirects to dashboard"
- "Skip setup clears localStorage, marks setup_completed=true, redirects to dashboard"
- "Complete button is disabled during API calls to prevent double-submit"
artifacts:
- path: "src/components/setup/ReviewStep.tsx"
provides: "Read-only summary of wizard selections"
exports: ["ReviewStep"]
- path: "src/App.tsx"
provides: "/setup route registration"
contains: "path=\"/setup\""
- path: "src/pages/DashboardPage.tsx"
provides: "First-run redirect to /setup"
contains: "useFirstRunState"
key_links:
- from: "src/pages/DashboardPage.tsx"
to: "src/hooks/useFirstRunState.ts"
via: "useFirstRunState() -> isFirstRun -> Navigate to /setup"
pattern: "isFirstRun.*Navigate.*setup"
- from: "src/pages/SetupPage.tsx"
to: "src/hooks/useCategories.ts"
via: "create.mutateAsync on wizard completion"
pattern: "create\\.mutateAsync"
- from: "src/pages/SetupPage.tsx"
to: "src/hooks/useTemplate.ts"
via: "createItem.mutateAsync on wizard completion"
pattern: "createItem\\.mutateAsync"
- from: "src/App.tsx"
to: "src/pages/SetupPage.tsx"
via: "Route path=/setup element=SetupPage"
pattern: "path=.*/setup"
---
<objective>
Add the ReviewStep component, wire wizard completion logic (creating categories + template items), add skip functionality, register the /setup route, and add first-run redirect in DashboardPage.
Purpose: Completes the wizard end-to-end — a new user is redirected to /setup, can navigate all 3 steps, and either completes (creating template data) or skips.
Output: Fully functional setup wizard accessible via /setup with working completion and skip flows.
</objective>
<execution_context>
@$HOME/.claude/get-shit-done/workflows/execute-plan.md
@$HOME/.claude/get-shit-done/templates/summary.md
</execution_context>
<context>
@.planning/PROJECT.md
@.planning/ROADMAP.md
@.planning/STATE.md
@.planning/phases/07-setup-wizard/07-CONTEXT.md
@.planning/phases/07-setup-wizard/07-RESEARCH.md
@.planning/phases/07-setup-wizard/07-PATTERNS.md
@.planning/phases/07-setup-wizard/07-UI-SPEC.md
@.planning/phases/07-setup-wizard/07-01-SUMMARY.md
<interfaces>
From src/hooks/useWizardState.ts (created in Plan 01):
```typescript
export interface WizardState {
currentStep: 1 | 2 | 3
income: number
selectedItems: Record<string, { checked: boolean; amount: number }>
}
export function useWizardState(userId: string): {
state: WizardState
setStep: (step: 1 | 2 | 3) => void
setIncome: (income: number) => void
toggleItem: (slug: string) => void
setItemAmount: (slug: string, amount: number) => void
clearState: () => void
}
```
From src/hooks/useCategories.ts:
```typescript
// create.mutateAsync({ name: string, type: CategoryType, icon?: string }) => Category { id, ... }
```
From src/hooks/useTemplate.ts:
```typescript
// createItem.mutateAsync({ category_id: string, item_tier: "fixed"|"variable", budgeted_amount: number }) => TemplateItem
// Template auto-creates on first useTemplate() query
```
From src/hooks/useFirstRunState.ts:
```typescript
export function useFirstRunState(): { isFirstRun: boolean; loading: boolean }
```
From src/data/presets.ts:
```typescript
export const PRESETS: PresetItem[] // 19 items with slug, type, defaultAmount, item_tier
```
</interfaces>
</context>
<tasks>
<task type="auto">
<name>Task 1: Create ReviewStep + wire completion/skip logic into SetupPage</name>
<read_first>
- src/pages/SetupPage.tsx
- src/hooks/useCategories.ts
- src/hooks/useTemplate.ts
- src/hooks/useWizardState.ts
- src/data/presets.ts
- src/lib/supabase.ts
</read_first>
<files>src/components/setup/ReviewStep.tsx, src/pages/SetupPage.tsx</files>
<action>
**1. Create `src/components/setup/ReviewStep.tsx`:**
Props: `income: number`, `selectedItems: Record<string, { checked: boolean; amount: number }>`, `currency: string`
Layout:
- Income row: `flex justify-between py-2` — left: `t("setup.step3.incomeLabel")` (14px/600), right: formatted income (14px/600)
- `<Separator />`
- Group checked items by type (same order: income, bill, variable_expense, debt, saving, investment). Only show groups that have at least one checked item.
- For each group: render CategoryGroupHeader (import from `./CategoryGroupHeader`), then for each checked item in group: `<div className="flex justify-between py-1.5 px-1"><span className="text-sm">{t(\`presets.${type}.${slug}\`)}</span><span className="text-sm text-right">{formattedAmount}</span></div>`
- `<Separator />`
- Totals: `space-y-1 pt-2`
- Total expenses row: `flex justify-between` with label `t("setup.step3.totalLabel")` (14px/600) and sum of checked amounts
- Remaining row: `flex justify-between` with label `t("setup.step3.remainingLabel")` (16px/600), value colored `text-on-budget` if >= 0, `text-destructive` if < 0
- If no items checked: show `<p className="text-sm text-muted-foreground py-4">{t("setup.step3.empty")}</p>` instead of groups
Use `Intl.NumberFormat` with `style: "currency"` and the `currency` prop for all amount formatting.
Import PRESETS from `@/data/presets` to map slugs to types for grouping.
**2. Update `src/pages/SetupPage.tsx` to add:**
a) Import ReviewStep, useCategories, useTemplate, useQueryClient, toast (from sonner), supabase (from @/lib/supabase), Navigate (from react-router-dom), useNavigate
b) Add `completing` state: `const [completing, setCompleting] = useState(false)`
c) Replace the step 3 placeholder with `<ReviewStep income={state.income} selectedItems={state.selectedItems} currency={currency} />`
d) Change the right-side button on step 3 from "Next Step" to "Complete Setup" (`t("setup.complete")`), disabled when `completing`
e) Add completion handler `handleComplete`:
```typescript
async function handleComplete() {
setCompleting(true)
try {
const queryClient = useQueryClient() // already declared at top
const checkedItems = PRESETS.filter(p => state.selectedItems[p.slug]?.checked)
// 1. Determine unique category types needed
const typesNeeded = [...new Set(checkedItems.map(i => i.type))]
// 2. Create one category per type (use i18n label as name)
const categoryMap: Record<string, string> = {}
for (const type of typesNeeded) {
try {
const cat = await create.mutateAsync({ name: t(`categories.types.${type}`), type })
categoryMap[type] = cat.id
} catch (e: any) {
// Unique constraint violation (23505) = category already exists, fetch it
if (e?.code === "23505" || e?.message?.includes("duplicate")) {
const existing = categories.find(c => c.type === type)
if (existing) categoryMap[type] = existing.id
} else {
throw e
}
}
}
// 3. If categories were fetched from cache but not found, refetch
if (Object.keys(categoryMap).length < typesNeeded.length) {
await queryClient.invalidateQueries({ queryKey: ["categories"] })
// Remaining types need fresh data — handled by the existing entries
}
// 4. Create template items for each checked preset
let partialFailure = false
for (const item of checkedItems) {
try {
await createItem.mutateAsync({
category_id: categoryMap[item.type],
item_tier: item.item_tier,
budgeted_amount: state.selectedItems[item.slug].amount,
})
} catch {
partialFailure = true
}
}
// 5. Mark setup complete
await supabase.from("profiles").update({ setup_completed: true }).eq("id", user!.id)
// 6. Clear wizard state
clearState()
// 7. Invalidate queries to prevent redirect loop
await queryClient.invalidateQueries({ queryKey: ["categories"] })
await queryClient.invalidateQueries({ queryKey: ["template-items"] })
// 8. Toast and redirect
if (partialFailure) {
toast.error(t("setup.toast.partialError"))
} else {
toast.success(t("setup.toast.success"))
}
navigate("/", { replace: true })
} catch {
toast.error(t("setup.toast.error"))
} finally {
setCompleting(false)
}
}
```
f) Add skip handler `handleSkipSetup`:
```typescript
async function handleSkipSetup() {
clearState()
await supabase.from("profiles").update({ setup_completed: true }).eq("id", user!.id)
navigate("/", { replace: true })
}
```
g) Wire "Skip setup" button below card to call `handleSkipSetup`
h) Wire "Skip Step" on step 3 to also call `handleSkipSetup` (per UI-SPEC: "On step 3 skip: same as Skip setup")
i) Disable Go Back, Skip Step, and Complete Setup buttons when `completing` is true
j) Add `useCategories()` call at component top level to get `create` mutation and `categories` array. Add `useTemplate()` to ensure template row exists before completion (Pitfall 5).
k) Get `useQueryClient()` at component top level (not inside handler).
</action>
<verify>
<automated>grep -q "ReviewStep" src/components/setup/ReviewStep.tsx && grep -q "handleComplete" src/pages/SetupPage.tsx && grep -q "setup_completed.*true" src/pages/SetupPage.tsx && grep -q "clearState" src/pages/SetupPage.tsx && npx tsc --noEmit 2>&1 | head -20</automated>
</verify>
<acceptance_criteria>
- src/components/setup/ReviewStep.tsx contains `t("setup.step3.incomeLabel")` and `Intl.NumberFormat`
- src/components/setup/ReviewStep.tsx contains `text-on-budget` and `text-destructive` conditional
- src/pages/SetupPage.tsx contains `async function handleComplete`
- src/pages/SetupPage.tsx contains `create.mutateAsync` (category creation)
- src/pages/SetupPage.tsx contains `createItem.mutateAsync` (template item creation)
- src/pages/SetupPage.tsx contains `setup_completed: true` (profile update)
- src/pages/SetupPage.tsx contains `handleSkipSetup` function
- src/pages/SetupPage.tsx contains `setCompleting(true)` (double-click prevention)
- src/pages/SetupPage.tsx contains `toast.success` and `toast.error`
- src/pages/SetupPage.tsx contains `invalidateQueries.*categories` (redirect loop prevention)
- TypeScript compiles without errors
</acceptance_criteria>
<done>ReviewStep renders read-only grouped summary. Completion creates categories + template items, handles duplicates, clears state, marks setup_completed, toasts, and redirects. Skip exits without creating data.</done>
</task>
<task type="auto">
<name>Task 2: Register /setup route in App.tsx + add first-run redirect in DashboardPage</name>
<read_first>
- src/App.tsx
- src/pages/DashboardPage.tsx
- src/hooks/useFirstRunState.ts
</read_first>
<files>src/App.tsx, src/pages/DashboardPage.tsx</files>
<action>
**1. Update `src/App.tsx`:**
Add import at top:
```typescript
import SetupPage from "@/pages/SetupPage"
```
Add the /setup route AFTER the public routes (login, register) and BEFORE the AppLayout route. It must be inside a ProtectedRoute but NOT inside AppLayout:
```typescript
<Route
path="/setup"
element={
<ProtectedRoute>
<SetupPage />
</ProtectedRoute>
}
/>
```
Insert this between the `</Route>` closing the register route (around line 46) and the `<Route element={<ProtectedRoute><AppLayout /></ProtectedRoute>}>` line (around line 47).
**2. Update `src/pages/DashboardPage.tsx`:**
Add imports at top (after existing imports):
```typescript
import { useFirstRunState } from "@/hooks/useFirstRunState"
import { Navigate } from "react-router-dom"
```
Note: `Navigate` may already be imported — check before adding a duplicate.
Inside the DashboardPage component function, add early returns BEFORE any existing logic (before the existing useState/useMemo calls):
```typescript
const { isFirstRun, loading: firstRunLoading } = useFirstRunState()
if (firstRunLoading) return <DashboardSkeleton />
if (isFirstRun) return <Navigate to="/setup" replace />
```
This uses the existing `DashboardSkeleton` component (already imported) as the loading fallback.
</action>
<verify>
<automated>grep -q 'path="/setup"' src/App.tsx && grep -q "SetupPage" src/App.tsx && grep -q "useFirstRunState" src/pages/DashboardPage.tsx && grep -q 'Navigate to="/setup"' src/pages/DashboardPage.tsx && npx tsc --noEmit 2>&1 | head -20</automated>
</verify>
<acceptance_criteria>
- src/App.tsx contains `import SetupPage from "@/pages/SetupPage"`
- src/App.tsx contains `path="/setup"` within a `<ProtectedRoute>` wrapper
- src/App.tsx has /setup route BEFORE the AppLayout route (not nested inside it)
- src/pages/DashboardPage.tsx contains `import { useFirstRunState } from "@/hooks/useFirstRunState"`
- src/pages/DashboardPage.tsx contains `const { isFirstRun, loading: firstRunLoading } = useFirstRunState()`
- src/pages/DashboardPage.tsx contains `if (isFirstRun) return <Navigate to="/setup" replace />`
- src/pages/DashboardPage.tsx contains `if (firstRunLoading) return <DashboardSkeleton />`
- TypeScript compiles without errors
</acceptance_criteria>
<done>/setup route registered as protected standalone page. First-run users are redirected from dashboard to /setup. Existing users with categories/template data see the normal dashboard.</done>
</task>
<task type="checkpoint:human-verify" gate="blocking">
<what-built>Complete 3-step setup wizard with income entry, recurring items checklist (19 presets), review step, completion logic (category + template creation), skip functionality, and first-run redirect from dashboard.</what-built>
<how-to-verify>
1. Create a new test user (or clear an existing user's categories and template items in Supabase)
2. Log in with the test user — should be redirected to `/setup`
3. Step 1: Verify income input shows 3000 pre-filled with EUR suffix. Try Next with empty/0 value (should show validation error). Enter 4000, click Next.
4. Step 2: Verify Bills (4) and Variable Expenses (5) are pre-checked. Verify allocation bar shows "Remaining to allocate: X" (4000 - sum of checked). Uncheck an item — verify amount updates. Check an item — verify it enables the amount input.
5. Step 3: Verify read-only summary shows income, grouped checked items, totals, and remaining.
6. Click "Complete Setup" — verify toast appears, redirected to dashboard, template page shows created items.
7. Refresh dashboard — should NOT redirect back to /setup (setup_completed=true, and categories exist).
8. Test "Skip setup" link — create another fresh user, click "Skip setup" from step 1. Verify redirect to dashboard with no data created.
9. Test localStorage persistence: start wizard, enter income, advance to step 2, refresh page — verify wizard resumes at step 2 with entered income.
</how-to-verify>
<resume-signal>Type "approved" or describe any issues found</resume-signal>
</task>
</tasks>
<threat_model>
## Trust Boundaries
| Boundary | Description |
|----------|-------------|
| client -> Supabase | Category and template item inserts on completion |
| localStorage -> component | Wizard state restoration (validated in Plan 01) |
| React Query cache -> redirect logic | isFirstRun depends on cache freshness |
## STRIDE Threat Register
| Threat ID | Category | Component | Disposition | Mitigation Plan |
|-----------|----------|-----------|-------------|-----------------|
| T-07-04 | Denial of Service | handleComplete double-click | mitigate | `completing` state disables button immediately on click. DB unique constraints on categories prevent duplicate rows. |
| T-07-05 | Tampering | Supabase profile update (setup_completed) | accept | RLS policy restricts updates to own profile row. Client can only set own setup_completed. |
| T-07-06 | Elevation of Privilege | /setup route access | mitigate | Route wrapped in ProtectedRoute — unauthenticated users redirected to /login. |
| T-07-07 | Denial of Service | Redirect loop (dashboard <-> /setup) | mitigate | After completion, invalidate ["categories"] and ["template-items"] queries before redirect. useFirstRunState will read fresh data showing isFirstRun=false. |
</threat_model>
<verification>
- `npx tsc --noEmit` passes
- Navigating to /setup while unauthenticated redirects to /login
- A user with zero categories sees /setup after login
- Completing wizard creates categories + template items in database
- Skipping wizard sets setup_completed=true without creating data
- Refreshing mid-wizard restores state from localStorage
- No redirect loop after completion
</verification>
<success_criteria>
- New user flow: login -> auto-redirect to /setup -> 3 steps -> complete -> dashboard with template
- Skip flow: /setup -> skip -> dashboard (no data created, setup_completed=true)
- Existing user flow: login -> dashboard (no redirect to /setup)
- No duplicate categories on repeated completion attempts
- No infinite redirect loop between dashboard and /setup
</success_criteria>
<output>
After completion, create `.planning/phases/07-setup-wizard/07-02-SUMMARY.md`
</output>

View File

@@ -0,0 +1,74 @@
---
phase: 07-setup-wizard
plan: 02
subsystem: frontend/setup-wizard
tags: [wizard, completion, routing, first-run-redirect]
dependency_graph:
requires: [src/hooks/useWizardState.ts, src/hooks/useCategories.ts, src/hooks/useTemplate.ts, src/hooks/useFirstRunState.ts, src/data/presets.ts]
provides: [src/components/setup/ReviewStep.tsx, /setup route, first-run redirect]
affects: [src/pages/SetupPage.tsx, src/App.tsx, src/pages/DashboardPage.tsx]
tech_stack:
added: []
patterns: [wizard-completion-flow, category-dedup-on-constraint, query-invalidation-before-redirect]
key_files:
created:
- src/components/setup/ReviewStep.tsx
modified:
- src/pages/SetupPage.tsx
- src/App.tsx
- src/pages/DashboardPage.tsx
decisions:
- "Moved hook calls above early returns in DashboardPage to comply with React rules of hooks"
- "Skip on step 3 calls same handleSkipSetup as global skip (per UI-SPEC)"
metrics:
duration: 145s
completed: 2026-04-20T19:10:45Z
tasks_completed: 2
tasks_total: 2
files_created: 1
files_modified: 3
---
# Phase 07 Plan 02: Setup Wizard Completion and Routing Summary
ReviewStep with grouped read-only summary, wizard completion logic (category + template item creation with duplicate handling), skip flow, /setup route registration, and first-run redirect from dashboard.
## Commits
| Task | Commit | Description |
|------|--------|-------------|
| 1 | 396d342 | ReviewStep component and wizard completion/skip logic |
| 2 | 6b75f14 | Register /setup route and add first-run redirect |
## What Was Built
1. **ReviewStep** - Read-only summary component showing income, grouped checked items by category type, total expenses, and remaining balance. Uses Intl.NumberFormat for currency formatting. Remaining is colored green (text-on-budget) when positive, red (text-destructive) when negative.
2. **Wizard Completion Logic** - handleComplete creates one category per needed type (handles 23505 duplicate constraint), creates template items for all checked presets, marks profiles.setup_completed=true, clears localStorage wizard state, invalidates React Query cache, shows toast, and redirects to dashboard.
3. **Skip Flow** - handleSkipSetup clears localStorage, marks setup_completed=true without creating any data, and redirects to dashboard.
4. **Double-submit Prevention** - `completing` state disables all buttons during API calls (T-07-04 mitigation).
5. **/setup Route** - Registered in App.tsx as a protected standalone page (inside ProtectedRoute, outside AppLayout). Unauthenticated users are redirected to /login (T-07-06 mitigation).
6. **First-run Redirect** - DashboardPage uses useFirstRunState to detect users with no categories/template items and redirects them to /setup. Shows DashboardSkeleton during loading.
7. **Redirect Loop Prevention** - Query invalidation for ["categories"] and ["template-items"] after completion ensures useFirstRunState reads fresh data showing isFirstRun=false (T-07-07 mitigation).
## Deviations from Plan
### Auto-fixed Issues
**1. [Rule 1 - Bug] Fixed React hooks rule violation in DashboardPage**
- **Found during:** Task 2
- **Issue:** Plan instructed placing early returns before useMonthParam/useBudgets calls, which violates React rules of hooks (hooks cannot be called conditionally)
- **Fix:** Moved all hook calls (useMonthParam, useBudgets, useMemo) above the early return statements
- **Files modified:** src/pages/DashboardPage.tsx
- **Commit:** 6b75f14
## Known Stubs
None - all stubs from Plan 01 have been resolved.
## Self-Check: PASSED

View File

@@ -0,0 +1,103 @@
# Phase 7: Setup Wizard - Context
**Gathered:** 2026-04-20
**Status:** Ready for planning
<domain>
## Phase Boundary
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. The wizard auto-redirects first-run users (detected by useFirstRunState), creates categories and template items on completion, persists state across refreshes, and supports skip at any point. Bilingual (EN/DE) via existing i18n system.
</domain>
<decisions>
## Implementation Decisions
### Wizard Layout & Navigation
- Numbered horizontal stepper (1-2-3 bar at top) — minimal, clear progress indicator
- Centered card layout (max-w-2xl) on clean background — consistent with auth pages
- Next/Back buttons at bottom + step indicator is clickable for going back
- Same centered card on mobile, full-width breakpoint — project is desktop-first
### Income Step (Step 1)
- Single "monthly net income" number input — simplest mental model
- Pre-filled with 3000 (PRESETS salary default), user can clear and type their own
- Show user's profile currency (EUR) from useAuth/profile next to input
- Required field, must be > 0, numeric only — can't proceed without income entered
### Recurring Items Step (Step 2)
- Full checklist: all 19 PRESETS shown, grouped by category type, with item name + category badge + editable amount per row
- Bills (4) + variable_expense (5) pre-checked by default — focuses on spending categories the wizard is about
- Income/debt/saving/investment items unchecked by default
- Sticky bar at top: "Remaining to allocate: Income - sum(checked) = X" — turns red when negative
- Inline number input per item, only editable when item is checked
### Review Step & Completion (Step 3)
- Read-only summary card: income at top, grouped checked items with amounts below, total and remaining at bottom
- "Complete" creates categories (from checked item types that don't already exist) + template items (from checked items with amounts)
- Does NOT create first month's budget (Phase 8 handles auto-budget creation)
- After completion: redirect to `/` (dashboard) with success toast "Template created! Your first budget will appear automatically."
### Skip & State Persistence
- "Skip" button on each step + global "Skip setup" to exit wizard entirely without creating data
- Wizard state persisted in localStorage keyed by user_id — survives page refresh
- On complete or skip: clear localStorage, mark profiles.setup_completed = true
- Refreshing mid-wizard restores the wizard at the correct step
### Claude's Discretion
- Exact component decomposition (how many sub-components for the wizard)
- Animation/transition between steps (if any)
- Exact styling of category badges and grouping headers
- Toast message wording variations
- Error handling UX for failed API calls during completion
</decisions>
<code_context>
## Existing Code Insights
### Reusable Assets
- `src/hooks/useFirstRunState.ts` — detects first-run users (isFirstRun + loading)
- `src/hooks/useCategories.ts` — CRUD for categories (create method available)
- `src/hooks/useTemplate.ts` — CRUD for template items (createItem method available)
- `src/hooks/useAuth.ts` — profile access (currency, locale)
- `src/data/presets.ts` — 19 PresetItem entries with slug, type, defaultAmount, item_tier
- `src/components/ui/card.tsx` — Card component
- `src/components/ui/button.tsx` — Button component
- `src/components/ui/input.tsx` — Input component
- `src/components/ui/badge.tsx` — Badge component (for category type indicators)
- `src/components/ui/sonner.tsx` — Toast notifications
- `src/i18n/en.json` + `de.json` — presets.* keys already translated
### Established Patterns
- Pages are in `src/pages/*.tsx`, routed via React Router
- Hooks use React Query with Supabase client
- Category types: income, bill, variable_expense, debt, saving, investment
- UI uses Tailwind + shadcn/ui components with OKLCH pastel design tokens
- Auth-protected routes via layout wrapper
### Integration Points
- Router: Add `/setup` route, redirect logic in dashboard or layout
- `useFirstRunState()` — gate for redirect (check !loading && isFirstRun)
- `useCategories().create` — create categories on wizard completion
- `useTemplate().createItem` — create template items on wizard completion
- `profiles.setup_completed` — mark true on completion/skip via Supabase update
</code_context>
<specifics>
## Specific Ideas
- Pre-filled common items come from the existing PRESETS array (19 items, already i18n'd)
- The "remaining to allocate" balance = income entered in step 1 minus sum of checked item amounts in step 2
- Wizard must not create duplicate categories if user already has some (edge case: user skipped wizard, manually created categories, then somehow re-enters wizard)
- Phase 6 decisions: round EUR amounts, backfill existing users to setup_completed=true (they never see wizard)
</specifics>
<deferred>
## Deferred Ideas
None — discussion stayed within phase scope.
</deferred>

View File

@@ -0,0 +1,284 @@
# Phase 7: Setup Wizard - Pattern Map
**Mapped:** 2026-04-20
**Files analyzed:** 9
**Analogs found:** 9 / 9
## File Classification
| New/Modified File | Role | Data Flow | Closest Analog | Match Quality |
|-------------------|------|-----------|----------------|---------------|
| `src/pages/SetupPage.tsx` | page | request-response | `src/pages/LoginPage.tsx` | exact |
| `src/components/setup/WizardStepper.tsx` | component | transform | `src/components/dashboard/SummaryStrip.tsx` | role-match |
| `src/components/setup/IncomeStep.tsx` | component | request-response | `src/pages/SettingsPage.tsx` (form section) | role-match |
| `src/components/setup/RecurringItemsStep.tsx` | component | transform | `src/pages/DashboardPage.tsx` (grouped data) | partial |
| `src/components/setup/ReviewStep.tsx` | component | transform | `src/components/dashboard/SummaryStrip.tsx` | role-match |
| `src/components/setup/AllocationBar.tsx` | component | transform | `src/components/dashboard/StatCard.tsx` | role-match |
| `src/components/setup/PresetItemRow.tsx` | component | request-response | `src/components/dashboard/CategorySection.tsx` | partial |
| `src/App.tsx` (modify) | route | request-response | `src/App.tsx` (existing) | exact |
| `src/pages/DashboardPage.tsx` (modify) | page | request-response | `src/pages/DashboardPage.tsx` (existing) | exact |
## Pattern Assignments
### `src/pages/SetupPage.tsx` (page, request-response)
**Analog:** `src/pages/LoginPage.tsx`
**Imports pattern** (lines 1-9):
```typescript
import { useState } from "react"
import { Link, useNavigate } from "react-router-dom"
import { useTranslation } from "react-i18next"
import { useAuth } from "@/hooks/useAuth"
import { Button } from "@/components/ui/button"
import { Input } from "@/components/ui/input"
import { Label } from "@/components/ui/label"
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"
```
**Page layout pattern** (lines 34-36):
```typescript
// Standalone centered card outside AppLayout -- same pattern as LoginPage
return (
<div className="flex min-h-screen items-center justify-center bg-muted/60 p-4">
<Card className="w-full max-w-sm border-t-4 border-t-primary shadow-lg">
```
**Async action with loading state** (lines 20-31):
```typescript
const [loading, setLoading] = useState(false)
async function handleSubmit(e: React.FormEvent) {
e.preventDefault()
setError("")
setLoading(true)
try {
await signIn(email, password)
navigate("/")
} catch (err) {
setError(err instanceof Error ? err.message : t("common.error"))
} finally {
setLoading(false)
}
}
```
**Key adaptation:** SetupPage uses `max-w-2xl` (not `max-w-sm`) per CONTEXT decision. It manages multi-step state internally with useState + localStorage sync.
---
### `src/components/setup/IncomeStep.tsx` (component, request-response)
**Analog:** `src/pages/SettingsPage.tsx` (form input section)
**Form field pattern** (lines 88-96):
```typescript
<div className="space-y-2">
<Label>{t("settings.displayName")}</Label>
<Input
value={profile?.display_name ?? ""}
onChange={(e) =>
setProfile((p) => p && { ...p, display_name: e.target.value })
}
/>
</div>
```
**Button with disabled state** (line 133):
```typescript
<Button onClick={handleSave} disabled={saving}>
{t("settings.save")}
</Button>
```
---
### `src/components/setup/WizardStepper.tsx` (component, transform)
**Analog:** `src/components/dashboard/SummaryStrip.tsx`
**Presentational component pattern** (lines 1-16):
```typescript
// Props interface with clear typing, named export, no hooks beyond props
interface SummaryStripProps {
income: { value: string; budgeted: string }
expenses: { value: string; budgeted: string }
balance: { value: string; isPositive: boolean }
t: (key: string) => string
}
export function SummaryStrip({ income, expenses, balance, t }: SummaryStripProps) {
return (
<div className="grid gap-4 sm:grid-cols-2 lg:grid-cols-3">
{/* child components */}
</div>
)
}
```
**Key adaptation:** WizardStepper accepts `currentStep: 1|2|3` and `onStepClick: (step) => void` props. Renders 3 numbered circles with connecting lines.
---
### `src/components/setup/RecurringItemsStep.tsx` (component, transform)
**Analog:** `src/pages/DashboardPage.tsx` (grouped items pattern)
**Grouping by category type** (lines 138-155):
```typescript
const groupedSections = useMemo(() =>
CATEGORY_TYPES_ALL
.map((type) => {
const groupItems = items.filter((i) => i.category?.type === type)
if (groupItems.length === 0) return null
return {
type,
label: t(`categories.types.${type}`),
items: groupItems,
}
})
.filter((g): g is NonNullable<typeof g> => g !== null),
[items, t]
)
```
**Key adaptation:** Groups PRESETS by `type` field. Each group has a header and list of PresetItemRow components.
---
### `src/components/setup/AllocationBar.tsx` (component, transform)
**Analog:** `src/components/dashboard/SummaryStrip.tsx`
**Conditional color class pattern** (line 47):
```typescript
valueClassName={balance.isPositive ? "text-on-budget" : "text-over-budget"}
```
**Key adaptation:** Displays "Remaining: {amount}" with red text when negative. Uses sticky positioning.
---
### `src/App.tsx` (modify - add /setup route)
**Existing routing pattern** (lines 28-65):
```typescript
export default function App() {
return (
<Routes>
<Route path="/login" element={<PublicRoute><LoginPage /></PublicRoute>} />
<Route path="/register" element={<PublicRoute><RegisterPage /></PublicRoute>} />
{/* Add /setup here -- protected but outside AppLayout */}
<Route element={<ProtectedRoute><AppLayout /></ProtectedRoute>}>
<Route index element={<DashboardPage />} />
...
</Route>
<Route path="*" element={<Navigate to="/" replace />} />
</Routes>
)
}
```
**New route insertion point** -- after public routes, before AppLayout route:
```typescript
<Route path="/setup" element={<ProtectedRoute><SetupPage /></ProtectedRoute>} />
```
---
### `src/pages/DashboardPage.tsx` (modify - add first-run redirect)
**Pattern to add** (at top of DashboardPage component, before existing logic):
```typescript
// Source: useFirstRunState hook (src/hooks/useFirstRunState.ts)
import { useFirstRunState } from "@/hooks/useFirstRunState"
import { Navigate } from "react-router-dom"
// Inside component body, early return:
const { isFirstRun, loading: firstRunLoading } = useFirstRunState()
if (firstRunLoading) return <DashboardSkeleton />
if (isFirstRun) return <Navigate to="/setup" replace />
```
---
## Shared Patterns
### Toast Notifications
**Source:** `src/pages/SettingsPage.tsx` lines 4, 56-59
**Apply to:** SetupPage (on completion and on error)
```typescript
import { toast } from "sonner"
// Success:
toast.success(t("settings.saved"))
// Error:
toast.error(t("common.error"))
```
### Supabase Profile Update
**Source:** `src/pages/SettingsPage.tsx` lines 44-62
**Apply to:** SetupPage (marking setup_completed = true)
```typescript
import { supabase } from "@/lib/supabase"
const { error } = await supabase
.from("profiles")
.update({ setup_completed: true })
.eq("id", user.id)
```
### useCategories Mutation
**Source:** `src/hooks/useCategories.ts` lines 21-38
**Apply to:** SetupPage completion logic
```typescript
const { create } = useCategories()
// Usage: create.mutateAsync({ name, type })
const cat = await create.mutateAsync({ name: t(`categories.types.${type}`), type })
// Returns Category with .id for linking template items
```
### React Query Invalidation After Completion
**Source:** `src/hooks/useCategories.ts` line 37
**Apply to:** SetupPage (prevent redirect loop after completion)
```typescript
import { useQueryClient } from "@tanstack/react-query"
const queryClient = useQueryClient()
// After creating categories + template items:
await queryClient.invalidateQueries({ queryKey: ["categories"] })
await queryClient.invalidateQueries({ queryKey: ["template-items"] })
```
### i18n Translation Pattern
**Source:** `src/pages/LoginPage.tsx` lines 3, 12, 39
**Apply to:** All setup components
```typescript
import { useTranslation } from "react-i18next"
const { t } = useTranslation()
// Usage: t("setup.stepTitle") or t(`presets.${type}.${slug}`) for preset names
```
### PRESETS Data Access
**Source:** `src/data/presets.ts`
**Apply to:** RecurringItemsStep, ReviewStep, SetupPage state initialization
```typescript
import { PRESETS } from "@/data/presets"
// Group by type:
const grouped = Object.groupBy(PRESETS, (p) => p.type)
// Or filter: PRESETS.filter(p => p.type === "bill")
```
## No Analog Found
| File | Role | Data Flow | Reason |
|------|------|-----------|--------|
| `src/components/setup/PresetItemRow.tsx` | component | request-response | No existing checkbox-list-row pattern; closest is CategorySection but quite different. Use shadcn Checkbox + Input + Badge inline. |
| `src/components/setup/CategoryGroupHeader.tsx` | component | transform | Simple heading; trivial enough to not need an analog. |
## Metadata
**Analog search scope:** `src/pages/`, `src/components/`, `src/hooks/`, `src/data/`
**Files scanned:** 40+
**Pattern extraction date:** 2026-04-20

View File

@@ -0,0 +1,433 @@
# Phase 7: Setup Wizard - Research
**Researched:** 2026-04-20
**Domain:** React multi-step wizard UI with localStorage persistence, Supabase writes
**Confidence:** HIGH
## Summary
Phase 7 builds a 3-step setup wizard that guides first-run users through budget template creation. The phase is primarily a frontend UI task: no new DB schema changes are needed (Phase 6 delivered `setup_completed`, presets, and `useFirstRunState`). The wizard must render a new `/setup` route outside the AppLayout (standalone page like login/register), persist state to localStorage, and on completion create categories + template items via existing hooks.
The codebase already provides every data layer primitive needed: `useFirstRunState` for redirect gating, `useCategories().create` for category creation, `useTemplate().createItem` for template item creation, `PRESETS` array with 19 items, and full i18n keys for preset names. The work is purely component authoring, routing, and orchestration.
**Primary recommendation:** Build the wizard as a standalone page component with internal step state management using React useState + localStorage sync. No additional libraries needed -- the existing stack (React 19, React Router 7, shadcn/ui, Tailwind, React Query, Supabase) handles everything.
<user_constraints>
## User Constraints (from CONTEXT.md)
### Locked Decisions
- Numbered horizontal stepper (1-2-3 bar at top) -- minimal, clear progress indicator
- Centered card layout (max-w-2xl) on clean background -- consistent with auth pages
- Next/Back buttons at bottom + step indicator is clickable for going back
- Single "monthly net income" number input pre-filled with 3000, required > 0
- Full checklist: all 19 PRESETS shown, grouped by category type, with editable amounts
- Bills (4) + variable_expense (5) pre-checked by default
- Sticky bar: "Remaining to allocate: Income - sum(checked) = X" -- turns red when negative
- Read-only review step with grouped summary
- "Complete" creates categories + template items. Does NOT create first month's budget.
- After completion: redirect to `/` with success toast
- "Skip" on each step + global "Skip setup" to exit entirely
- localStorage keyed by user_id for persistence across refresh
- On complete or skip: clear localStorage, mark profiles.setup_completed = true
- No animated transitions between steps (instant swap)
### Claude's Discretion
- Exact component decomposition (how many sub-components for the wizard)
- Animation/transition between steps (decided: none)
- Exact styling of category badges and grouping headers
- Toast message wording variations
- Error handling UX for failed API calls during completion
### Deferred Ideas (OUT OF SCOPE)
None -- discussion stayed within phase scope.
</user_constraints>
<phase_requirements>
## Phase Requirements
| ID | Description | Research Support |
|----|-------------|------------------|
| SETUP-01 | New user is guided through a 3-step wizard: income, recurring items, review | useFirstRunState hook for redirect gating, /setup route outside AppLayout |
| SETUP-02 | User sees pre-filled common budget items with sensible default amounts (~15-20 items) | PRESETS array (19 items) with defaultAmount + i18n keys already exist |
| SETUP-03 | User can skip any wizard step or the entire wizard | Skip Step per step + Skip setup global link, marks setup_completed=true |
| SETUP-04 | User sees a live "remaining to allocate" balance updating as items are selected | Computed from useState: income - sum(checked items amounts), re-renders on change |
| SETUP-05 | User's template is created from wizard selections on completion | useCategories().create + useTemplate().createItem mutations in sequence |
</phase_requirements>
## Architectural Responsibility Map
| Capability | Primary Tier | Secondary Tier | Rationale |
|------------|-------------|----------------|-----------|
| Wizard UI & navigation | Browser / Client | -- | Pure client-side multi-step form, no SSR |
| State persistence | Browser / Client | -- | localStorage for mid-session persistence |
| First-run redirect | Browser / Client | -- | useFirstRunState reads cached React Query data |
| Category + template creation | API / Backend (Supabase) | Browser / Client | Supabase handles insert; client calls via existing hooks |
| setup_completed flag update | API / Backend (Supabase) | Browser / Client | Direct Supabase update from client |
## Standard Stack
### Core (already installed)
| Library | Version | Purpose | Why Standard |
|---------|---------|---------|--------------|
| React | ^19.2.4 | Component rendering | Project framework [VERIFIED: package.json] |
| React Router DOM | ^7.13.1 | /setup route, Navigate redirect | Project router [VERIFIED: package.json] |
| @tanstack/react-query | ^5.90.21 | Data fetching/mutations via hooks | Project data layer [VERIFIED: package.json] |
| @supabase/supabase-js | ^2.99.1 | DB writes (categories, template_items, profiles) | Project backend [VERIFIED: package.json] |
| react-i18next | ^16.5.8 | Bilingual copy (EN/DE) | Project i18n [VERIFIED: package.json] |
| sonner | ^2.0.7 | Toast notifications on completion/error | Project toast library [VERIFIED: package.json] |
| lucide-react | ^0.577.0 | Check icon for stepper | Project icon library [VERIFIED: package.json] |
### Supporting (already installed)
| Library | Version | Purpose | When to Use |
|---------|---------|---------|-------------|
| radix-ui | ^1.4.3 | Checkbox primitive (via shadcn) | Step 2 item selection |
| tailwind-merge + clsx + cva | various | Conditional styling | All components |
### New shadcn Component to Install
| Component | Purpose |
|-----------|---------|
| checkbox | Item selection in step 2 (not yet in /src/components/ui/) |
**Installation:**
```bash
npx shadcn@latest add checkbox
```
### Alternatives Considered
| Instead of | Could Use | Tradeoff |
|------------|-----------|----------|
| useState + localStorage | react-hook-form + persist | Overkill for 2 fields (income + selections); useState simpler |
| Custom stepper | @shadcn/stepper or third-party | Not available in shadcn registry; custom is trivial for 3 steps |
| Zustand for wizard state | useState + localStorage | No global state needed; wizard is single-page isolated |
## Architecture Patterns
### System Architecture Diagram
```
[First Login] --> [AppLayout / DashboardPage]
|
useFirstRunState() --> isFirstRun?
| |
NO YES
| |
Dashboard <Navigate to="/setup">
|
[SetupWizard Page]
|
localStorage read --> restore step & data
|
+----------+----------+----------+
| | | |
Step 1 Step 2 Step 3 Skip Setup
(Income) (Items) (Review) |
| | | |
+----------+----------+ |
| |
[Complete] [Skip]
| |
create categories clear localStorage
create template items set setup_completed=true
clear localStorage redirect to /
set setup_completed=true
redirect to / with toast
```
### Recommended Project Structure
```
src/
├── pages/
│ └── SetupPage.tsx # Page component, orchestrates wizard
├── components/
│ └── setup/
│ ├── WizardStepper.tsx # Horizontal 1-2-3 stepper bar
│ ├── IncomeStep.tsx # Step 1: income input
│ ├── RecurringItemsStep.tsx # Step 2: checklist with amounts
│ ├── ReviewStep.tsx # Step 3: read-only summary
│ ├── AllocationBar.tsx # Sticky remaining balance
│ ├── PresetItemRow.tsx # Single checkbox row
│ └── CategoryGroupHeader.tsx # Section divider with colored dot
```
### Pattern 1: Wizard State in localStorage
**What:** Single useState object synced to localStorage on every change
**When to use:** Multi-step forms that must survive page refresh
**Example:**
```typescript
// Source: project convention + React docs
interface WizardState {
currentStep: 1 | 2 | 3
income: number
selectedItems: Record<string, { checked: boolean; amount: number }>
}
const STORAGE_KEY = (userId: string) => `setup-wizard-${userId}`
function useWizardState(userId: string) {
const [state, setState] = useState<WizardState>(() => {
const saved = localStorage.getItem(STORAGE_KEY(userId))
if (saved) return JSON.parse(saved)
return getDefaultState() // builds from PRESETS defaults
})
useEffect(() => {
localStorage.setItem(STORAGE_KEY(userId), JSON.stringify(state))
}, [state, userId])
return [state, setState] as const
}
```
### Pattern 2: Completion Sequence (Category + Template Item Creation)
**What:** Sequential creation of categories then template items, handling duplicates
**When to use:** Wizard completion step
**Example:**
```typescript
// Source: existing useCategories + useTemplate hooks
async function completeWizard(
selectedItems: SelectedItem[],
income: number,
createCategory: MutateAsync,
createItem: MutateAsync,
) {
// 1. Determine unique category types needed
const typesNeeded = [...new Set(selectedItems.map(i => i.type))]
// 2. Create categories (skip if already exist -- DB has unique constraint)
const categoryMap: Record<string, string> = {}
for (const type of typesNeeded) {
try {
const cat = await createCategory({ name: categoryLabel(type), type })
categoryMap[type] = cat.id
} catch (e) {
// Unique constraint violation = category exists, fetch it
// Handle gracefully
}
}
// 3. Create template items for each selected preset
for (const item of selectedItems) {
await createItem({
category_id: categoryMap[item.type],
item_tier: item.item_tier,
budgeted_amount: item.amount,
})
}
}
```
### Pattern 3: Route Structure (Standalone Page Outside AppLayout)
**What:** /setup route as a sibling to login/register, not nested in AppLayout
**When to use:** Wizard must be full-screen without sidebar nav
**Example:**
```typescript
// Source: existing App.tsx routing pattern
<Routes>
{/* Public routes */}
<Route path="/login" element={<PublicRoute><LoginPage /></PublicRoute>} />
<Route path="/register" element={<PublicRoute><RegisterPage /></PublicRoute>} />
{/* Setup wizard -- protected but outside AppLayout */}
<Route path="/setup" element={<ProtectedRoute><SetupPage /></ProtectedRoute>} />
{/* Main app layout */}
<Route element={<ProtectedRoute><AppLayout /></ProtectedRoute>}>
<Route index element={<DashboardPage />} />
...
</Route>
</Routes>
```
### Anti-Patterns to Avoid
- **Nested wizard inside AppLayout:** Wizard must be standalone (no sidebar). Keep it as a separate protected route.
- **Creating template without categories first:** Template items require `category_id` -- categories must be created first in completion flow.
- **Using mutateAsync without error handling:** Each Supabase insert can fail. Wrap in try/catch, show partial-error toast if some items fail.
- **Reading profile.setup_completed for redirect:** Use `useFirstRunState` (checks categories/template data), not setup_completed flag. The flag is set on completion, not read for gating.
## Don't Hand-Roll
| Problem | Don't Build | Use Instead | Why |
|---------|-------------|-------------|-----|
| Checkbox UI | Custom div with click handlers | shadcn Checkbox (Radix) | Keyboard accessibility, aria states, focus ring |
| Toast notifications | Custom alert/banner | sonner (already integrated) | Consistent with app, auto-dismiss, queue |
| Number formatting | Manual toFixed/locale | Intl.NumberFormat with profile currency | Handles EUR/USD/CHF, locale-aware separators |
| i18n key resolution | String concatenation | `t(\`presets.${type}.${slug}\`)` | Already set up in en.json/de.json |
**Key insight:** Every UI primitive and data operation is already available in the project. This phase is purely about composition and orchestration.
## Common Pitfalls
### Pitfall 1: Redirect Loop on Dashboard
**What goes wrong:** User completes wizard, lands on dashboard, `useFirstRunState` still returns `isFirstRun=true` because React Query cache is stale.
**Why it happens:** Categories/template items just created but query cache not invalidated yet.
**How to avoid:** After completion, invalidate both `["categories"]` and `["template-items"]` query keys before redirecting. Or use `setup_completed` flag for the redirect condition (check profiles table).
**Warning signs:** User bounces between dashboard and /setup infinitely.
### Pitfall 2: Category Name Collision on Completion
**What goes wrong:** User already has a "Bills" category (edge case: skipped wizard, created manually, re-enters). DB unique constraint rejects the insert.
**Why it happens:** Phase 6 added `UNIQUE(user_id, name)` constraint on categories.
**How to avoid:** Use upsert or catch constraint violation errors and fetch existing category ID instead. The completion logic must handle "category already exists" gracefully.
**Warning signs:** Wizard completion fails silently or shows generic error.
### Pitfall 3: localStorage Orphan After Logout
**What goes wrong:** User starts wizard, logs out, different user logs in -- sees previous user's wizard state.
**Why it happens:** localStorage key must include user_id.
**How to avoid:** Key is `setup-wizard-${userId}` (already specified in CONTEXT). Always validate userId matches on load.
**Warning signs:** Wrong income/selections appearing for a different user.
### Pitfall 4: Race Condition in Completion
**What goes wrong:** User double-clicks "Complete Setup" and creates duplicate template items.
**Why it happens:** Button not disabled during async operation.
**How to avoid:** Disable Complete button immediately on click, show spinner. Use a `completing` state flag.
**Warning signs:** Duplicate rows in template_items table.
### Pitfall 5: useTemplate() Needs Template to Exist Before createItem
**What goes wrong:** `createItem` throws "Template not loaded" because `templateId` is undefined.
**Why it happens:** `useTemplate()` auto-creates a template row on first query, but the query must complete before `createItem` works.
**How to avoid:** Ensure `useTemplate()` is called early in the wizard (mount time) so the template row exists by completion time. Or call `getOrCreateTemplate()` directly in the completion flow.
**Warning signs:** "Template not loaded" error on wizard completion.
## Code Examples
### Redirect Logic in Dashboard (or AppLayout)
```typescript
// Source: existing useFirstRunState pattern + CONTEXT decisions
import { useFirstRunState } from "@/hooks/useFirstRunState"
import { Navigate } from "react-router-dom"
// Inside DashboardPage or a redirect wrapper:
const { isFirstRun, loading } = useFirstRunState()
if (loading) return <Skeleton /> // or null
if (isFirstRun) return <Navigate to="/setup" replace />
```
### Updating setup_completed on Skip/Complete
```typescript
// Source: existing SettingsPage pattern for profile updates
import { supabase } from "@/lib/supabase"
async function markSetupComplete(userId: string) {
await supabase
.from("profiles")
.update({ setup_completed: true })
.eq("id", userId)
}
```
### Live Allocation Calculation
```typescript
// Source: derived from CONTEXT decisions
function computeRemaining(income: number, items: Record<string, { checked: boolean; amount: number }>) {
const totalExpenses = Object.values(items)
.filter(i => i.checked)
.reduce((sum, i) => sum + i.amount, 0)
return income - totalExpenses
}
```
### Default Selected Items State
```typescript
// Source: CONTEXT + PRESETS data structure
import { PRESETS } from "@/data/presets"
function getDefaultSelectedItems(): Record<string, { checked: boolean; amount: number }> {
const result: Record<string, { checked: boolean; amount: number }> = {}
for (const preset of PRESETS) {
result[preset.slug] = {
checked: preset.type === "bill" || preset.type === "variable_expense",
amount: preset.defaultAmount,
}
}
return result
}
```
## State of the Art
| Old Approach | Current Approach | When Changed | Impact |
|--------------|------------------|--------------|--------|
| Multi-page wizard with URL-per-step | Single-page with internal state | Standard for SPA wizards | Simpler routing, better state control |
| Form library (react-hook-form) for wizards | useState for simple forms | When forms have < 5 fields | Less boilerplate for simple cases |
| Redux/Zustand for wizard state | localStorage + useState | For isolated flows | No global store pollution |
## Assumptions Log
| # | Claim | Section | Risk if Wrong |
|---|-------|---------|---------------|
| A1 | shadcn checkbox installs via `npx shadcn@latest add checkbox` | Standard Stack | Low -- standard shadcn CLI pattern, easily correctable |
| A2 | Category names for auto-creation should use i18n labels (e.g., t("categories.types.bill")) | Patterns | Medium -- if hardcoded English names used, DE users get English category names |
## Open Questions
1. **Category naming on creation**
- What we know: Categories need a `name` field. Presets are grouped by `type`.
- What's unclear: Should each preset create its own category (19 categories) or one category per type (6 categories)?
- Recommendation: One category per type (6 max). The CONTEXT says "Create categories (from checked item types that don't already exist)" -- this confirms one-per-type. Multiple template items share the same category.
2. **Where to place the first-run redirect**
- What we know: `useFirstRunState` returns `isFirstRun` based on categories/template data.
- What's unclear: Should redirect live in DashboardPage, AppLayout, or a wrapper component?
- Recommendation: Place in DashboardPage (the index route) since that's where first-run users land. Avoids affecting other routes.
## Validation Architecture
### Test Framework
| Property | Value |
|----------|-------|
| Framework | None detected (no test config or test files found) |
| Config file | none -- Wave 0 must create |
| Quick run command | N/A |
| Full suite command | N/A |
### Phase Requirements to Test Map
| Req ID | Behavior | Test Type | Automated Command | File Exists? |
|--------|----------|-----------|-------------------|-------------|
| SETUP-01 | First-run user sees wizard, 3 steps | manual | Manual browser test | N/A |
| SETUP-02 | 19 pre-filled items with amounts | manual | Visual verification | N/A |
| SETUP-03 | Skip step/wizard works | manual | Click through wizard | N/A |
| SETUP-04 | Remaining balance updates live | manual | Check/uncheck items | N/A |
| SETUP-05 | Template created from selections | manual | Complete wizard, check /template | N/A |
### Wave 0 Gaps
No test framework exists in this project. All verification is manual/visual. This is acceptable per the project's established pattern -- no test files exist anywhere in `src/`.
## Security Domain
### Applicable ASVS Categories
| ASVS Category | Applies | Standard Control |
|---------------|---------|-----------------|
| V2 Authentication | no | Already handled by ProtectedRoute |
| V3 Session Management | no | Supabase session management |
| V4 Access Control | yes | RLS policies on categories/template_items (already in place) |
| V5 Input Validation | yes | Income > 0 validation, amounts must be positive numbers |
| V6 Cryptography | no | No crypto needed |
### Known Threat Patterns for This Phase
| Pattern | STRIDE | Standard Mitigation |
|---------|--------|---------------------|
| localStorage tampering | Tampering | Validate localStorage data shape on load; sanitize numbers |
| Mass insert abuse (spam completion) | Denial of Service | setup_completed flag prevents re-entry; RLS limits to own user |
| XSS via preset slug injection | Spoofing | Presets are hardcoded in source, not user-input; i18n keys are safe |
## Sources
### Primary (HIGH confidence)
- Project source code: `src/hooks/useFirstRunState.ts`, `src/hooks/useCategories.ts`, `src/hooks/useTemplate.ts`, `src/data/presets.ts`, `src/App.tsx`, `src/lib/types.ts` -- verified via direct file read
- `package.json` -- verified all dependency versions
- Phase 6 outputs: `supabase/migrations/007_setup_completed.sql` -- confirms DB schema ready
### Secondary (MEDIUM confidence)
- UI-SPEC.md (07-UI-SPEC.md) -- authored design contract for this phase
- CONTEXT.md (07-CONTEXT.md) -- user decisions from discuss phase
## Metadata
**Confidence breakdown:**
- Standard stack: HIGH - all dependencies verified in package.json, no new installs except shadcn checkbox
- Architecture: HIGH - follows exact patterns established in existing pages (Login, Register, Settings)
- Pitfalls: HIGH - derived from reading actual hook implementations and understanding race conditions
**Research date:** 2026-04-20
**Valid until:** 2026-05-20 (stable -- no moving targets, all deps are pinned)

View File

@@ -0,0 +1,378 @@
---
phase: 7
slug: setup-wizard
status: draft
shadcn_initialized: true
preset: new-york
created: 2026-04-20
---
# Phase 7 — UI Design Contract
> Visual and interaction contract for the 3-step setup wizard. Generated by gsd-ui-researcher, verified by gsd-ui-checker.
---
## Design System
| Property | Value |
|----------|-------|
| Tool | shadcn (new-york style) |
| Preset | new-york, baseColor neutral, cssVariables true |
| Component library | Radix UI (via shadcn/ui) |
| Icon library | Lucide |
| Font | Inter, ui-sans-serif, system-ui, sans-serif |
---
## Spacing Scale
Declared values (must be multiples of 4):
| Token | Value | Usage |
|-------|-------|-------|
| xs | 4px | Icon gaps, inline padding |
| sm | 8px | Compact element spacing, checkbox-to-label gap |
| md | 16px | Default element spacing, card internal padding |
| lg | 24px | Section padding, stepper step gaps |
| xl | 32px | Layout gaps, card content vertical spacing |
| 2xl | 48px | Step card top/bottom padding |
| 3xl | 64px | Page-level vertical centering offset |
Exceptions: Sticky allocation bar uses 12px vertical padding (py-3) for visual compactness within the card.
---
## Typography
| Role | Size | Weight | Line Height |
|------|------|--------|-------------|
| Body | 14px | 400 (regular) | 1.5 |
| Label | 14px | 600 (semibold) | 1.4 |
| Heading | 20px | 600 (semibold) | 1.2 |
| Display | 28px | 600 (semibold) | 1.2 |
Only two weights are used: 400 (regular) for body text and 600 (semibold) for labels, headings, and display. No medium (500) weight exists in this contract.
Usage in wizard:
- **Display (28px/600):** Wizard page title "Set up your budget" (step 1 heading area)
- **Heading (20px/600):** Step card titles ("Monthly Income", "Recurring Items", "Review")
- **Label (14px/600):** Category group headers (e.g., "Bills", "Variable Expenses"), stepper step labels, "Remaining to allocate" label, form field labels
- **Body (14px/400):** Preset item names, amounts, helper text, step descriptions
---
## Color
| Role | Value | Usage |
|------|-------|-------|
| Dominant (60%) | `oklch(0.98 0.01 260)` (--background) | Page background behind wizard card |
| Secondary (30%) | `oklch(1 0 0)` (--card) | Wizard card surface, review summary card |
| Accent (10%) | `oklch(0.55 0.15 260)` (--primary) | Active stepper step indicator, primary CTA buttons, step number circles (active) |
| Destructive | `oklch(0.6 0.2 25)` (--destructive) | Negative "remaining to allocate" text, validation error text |
**Focal point:** The primary CTA button ("Next Step" / "Complete Setup") in the bottom-right of the card is the single focal point on every step. It is the only large accent-colored element in the viewport, drawing the eye to the next action.
Accent reserved for:
- Active step circle in the stepper (filled primary background)
- "Next Step" and "Complete Setup" primary buttons
- Income input focus ring
- Completed step checkmark icon color
Additional semantic colors used (existing tokens):
- `--color-income` (`oklch(0.55 0.17 155)`): Income category group header dot and badge
- `--color-bill` (`oklch(0.55 0.17 25)`): Bill category group header dot and badge
- `--color-variable-expense` (`oklch(0.58 0.16 50)`): Variable expense category group header dot and badge
- `--color-debt` (`oklch(0.52 0.18 355)`): Debt category group header dot and badge
- `--color-saving` (`oklch(0.55 0.16 220)`): Saving category group header dot and badge
- `--color-investment` (`oklch(0.55 0.16 285)`): Investment category group header dot and badge
- `--color-on-budget` (`oklch(0.50 0.17 155)`): Positive "remaining to allocate" text (green)
---
## Component Inventory
### New shadcn Components to Install
| Component | Purpose |
|-----------|---------|
| `checkbox` | Preset item selection in step 2 |
### Existing Components Used
| Component | Where |
|-----------|-------|
| `Card`, `CardHeader`, `CardContent` | Wizard step container, review summary |
| `Button` | Next Step, Go Back, Skip Step, Skip setup, Complete Setup |
| `Input` | Income amount (step 1), per-item amount editing (step 2) |
| `Badge` | Category type indicators next to preset items |
| `Label` | Form field labels |
| `Separator` | Between category groups in step 2 and review step |
### Custom Components to Build
| Component | Description |
|-----------|-------------|
| `SetupWizard` | Page-level orchestrator: holds wizard state, renders stepper + active step |
| `WizardStepper` | Horizontal numbered stepper bar (1-2-3) with clickable completed steps |
| `IncomeStep` | Step 1: single income input with currency indicator |
| `RecurringItemsStep` | Step 2: grouped checklist of 19 presets with editable amounts |
| `ReviewStep` | Step 3: read-only summary of selections |
| `AllocationBar` | Sticky bar showing "Remaining to allocate" with live calculation |
| `PresetItemRow` | Single checklist row: checkbox + name + category badge + amount input |
| `CategoryGroupHeader` | Section header with colored dot + category type label + item count |
---
## Layout Contract
### Page Shell
```
Full viewport height, centered content:
- Container: flex min-h-screen items-center justify-center bg-background p-4
- No sidebar, no app nav — standalone page like login/register
- Content wrapper: w-full max-w-2xl (672px) with vertical flex layout
```
### Stepper Bar
```
Position: Above the card, inside the content wrapper
Layout: flex items-center justify-center gap-8
Each step:
- Circle: 32px (w-8 h-8), centered number text (14px/600)
- Active: bg-primary text-primary-foreground
- Completed: bg-primary text-primary-foreground with Check icon (16px)
- Upcoming: bg-muted text-muted-foreground border border-border
- Connector line between steps: h-px w-16 bg-border (completed: bg-primary)
- Step label below circle: text-xs font-semibold text-muted-foreground (active: text-foreground)
Clickable: Completed steps and current step only (not future steps)
Margin below stepper: 24px (mb-6) before the card
```
### Step Card
```
Card: w-full border border-border shadow-sm
CardHeader: pb-2
- Step title: heading (20px/600)
- Step description: body (14px/400) text-muted-foreground, 1 line
CardContent: space-y-6
Bottom navigation row (inside CardContent, at the bottom):
- flex justify-between items-center pt-4 border-t border-border
- Left: Go Back button (variant="ghost", hidden on step 1) + Skip Step button (variant="ghost", text-muted-foreground)
- Right: Next Step button (variant="default", primary) or Complete Setup button (step 3)
```
### Step 1 — Income
```
Card content:
- Label: "Monthly net income" (14px/600)
- Input row: flex items-center gap-2
- Input: type="number", w-full, text-right, text-lg (18px), pre-filled "3000"
- Currency suffix: text-muted-foreground text-sm, shows profile currency (e.g., "EUR")
- Helper text below: "Enter your total monthly take-home pay" (14px/400, text-muted-foreground)
- Validation: if empty or <= 0 on Next Step click, show destructive text below input: "Please enter a positive income amount"
```
### Step 2 — Recurring Items
```
Allocation bar (sticky):
- Position: sticky top-0 z-10, inside the card content area
- Layout: flex justify-between items-center py-3 px-4 bg-muted border-b border-border
- Left: "Remaining to allocate" (14px/600)
- Right: formatted amount (16px/600)
- Positive or zero: text-on-budget (green)
- Negative: text-destructive (red)
- Updates live on every check/uncheck and amount edit
Category groups (6 groups, ordered: income, bill, variable_expense, debt, saving, investment):
- CategoryGroupHeader: flex items-center gap-2 pt-4 pb-2
- Colored dot: w-2.5 h-2.5 (10px) circle using category color token
- Group label: label (14px/600) using categoryLabels from palette.ts
- Item count badge: text-xs text-muted-foreground "(4 items)"
- Separator below header: border-border
PresetItemRow (per item):
- Layout: flex items-center gap-3 py-2.5 px-1
- Checkbox: shadcn checkbox (16px square, sharp corners via radius-0)
- Item name: body (14px/400), flex-1
- Uses i18n key: t(`presets.${type}.${slug}`)
- Category badge: Badge variant="outline", text-xs, styled with category color border-left (3px)
- Amount input: w-24 text-right, type="number"
- Enabled only when checkbox is checked
- Disabled state: bg-muted text-muted-foreground opacity-50
- Pre-filled with preset defaultAmount
Default checked state:
- bill (4 items): ALL checked
- variable_expense (5 items): ALL checked
- income, debt, saving, investment: ALL unchecked
```
### Step 3 — Review
```
Card content:
- Read-only summary, no editable fields
- Income row: flex justify-between py-2
- "Monthly income" (14px/600)
- Formatted amount (14px/600)
- Separator
- Selected items grouped by category type (same order as step 2)
- CategoryGroupHeader (same component, no checkbox)
- Per item: flex justify-between py-1.5 px-1
- Item name (14px/400)
- Amount (14px/400, text-right)
- Separator
- Totals section: space-y-1 pt-2
- "Total expenses" row: flex justify-between, 14px/600
- "Remaining" row: flex justify-between, 16px/600
- Positive: text-on-budget
- Negative: text-destructive
- If no items selected: show muted message "No items selected. You can add items to your template later."
```
### Skip Controls
```
Per-step skip: Ghost button "Skip Step" in the bottom-left nav area
- Advances to next step without saving current step data
- On step 3 skip: same as "Skip setup" (exits wizard)
Global skip: "Skip setup" link/button
- Position: below the card, centered, text-sm text-muted-foreground underline
- Margin top: 16px below card
- Action: clears localStorage, sets profiles.setup_completed = true, redirects to dashboard
- No confirmation dialog (non-destructive — user can still manually set up template)
```
---
## Interaction Contract
### Step Navigation
| Action | Behavior |
|--------|----------|
| Click "Next Step" (step 1) | Validate income > 0. If valid, transition to step 2. If invalid, show inline error. |
| Click "Next Step" (step 2) | No validation required (0 items selected is valid). Transition to step 3. |
| Click "Go Back" | Return to previous step. Preserve all entered data. |
| Click stepper circle (completed) | Navigate to that step. Preserve all data. |
| Click stepper circle (future) | No action. Cursor: default. |
| Click "Complete Setup" (step 3) | Create categories + template items via API. On success: clear localStorage, set setup_completed=true, redirect to dashboard with toast. |
| Click "Skip Step" (per-step) | Advance to next step without current step data. Step 1 skip: income stays at default or last entered value. Step 2 skip: uncheck all items. |
| Click "Skip setup" (global) | Exit wizard entirely. Clear localStorage. Mark setup_completed=true. Redirect to dashboard. No toast. |
| Page refresh mid-wizard | Restore wizard at the same step with all entered data from localStorage. |
### State Persistence (localStorage)
```
Key: `setup-wizard-${userId}`
Value: JSON object
{
currentStep: 1 | 2 | 3,
income: number,
selectedItems: Record<string, { checked: boolean, amount: number }>,
// keyed by preset slug
}
Cleared on: wizard completion OR skip setup
```
### Loading & Error States
| State | Behavior |
|-------|----------|
| Wizard loading (useFirstRunState pending) | Show centered Skeleton matching card dimensions (max-w-2xl, h-64) |
| Completion API in progress | "Complete Setup" button shows spinner + disabled. Go Back/Skip Step also disabled. |
| Completion API failure | Toast (sonner, variant destructive): "Could not save your template. Please try again." Button re-enables. Data preserved. |
| Partial completion failure | If categories created but template items fail: toast with "Some items could not be saved. Check your template page." Redirect to dashboard anyway. |
### Transitions Between Steps
No animated transitions between steps. Instant swap of step content within the card. The stepper bar updates synchronously.
---
## Copywriting Contract
All copy must have i18n keys in both `en.json` and `de.json`. Keys live under a `setup` namespace.
| Element | EN Copy | i18n Key |
|---------|---------|----------|
| Page title (step 1) | Set up your budget | `setup.title` |
| Step 1 title | Monthly Income | `setup.step1.title` |
| Step 1 description | How much do you earn each month? | `setup.step1.description` |
| Step 1 label | Monthly net income | `setup.step1.incomeLabel` |
| Step 1 helper | Enter your total monthly take-home pay | `setup.step1.helper` |
| Step 1 validation | Please enter a positive income amount | `setup.step1.validation` |
| Step 2 title | Recurring Items | `setup.step2.title` |
| Step 2 description | Select your regular monthly expenses | `setup.step2.description` |
| Allocation bar label | Remaining to allocate | `setup.step2.remaining` |
| Step 3 title | Review | `setup.step3.title` |
| Step 3 description | Confirm your budget template | `setup.step3.description` |
| Step 3 income label | Monthly income | `setup.step3.incomeLabel` |
| Step 3 total label | Total expenses | `setup.step3.totalLabel` |
| Step 3 remaining label | Remaining | `setup.step3.remainingLabel` |
| Step 3 empty | No items selected. You can add items to your template later. | `setup.step3.empty` |
| Stepper labels | Income / Items / Review | `setup.steps.1` / `setup.steps.2` / `setup.steps.3` |
| Next button | Next Step | `setup.next` |
| Back button | Go Back | `setup.back` |
| Skip button | Skip Step | `setup.skip` |
| Skip setup link | Skip setup | `setup.skipSetup` |
| Complete button | Complete Setup | `setup.complete` |
| Success toast | Template created! Your first budget will appear automatically. | `setup.toast.success` |
| Error toast | Could not save your template. Please try again. | `setup.toast.error` |
| Partial error toast | Some items could not be saved. Check your template page. | `setup.toast.partialError` |
---
## Registry Safety
| Registry | Blocks Used | Safety Gate |
|----------|-------------|-------------|
| shadcn official | checkbox | not required |
No third-party registries declared.
---
## Accessibility Contract
| Concern | Implementation |
|---------|----------------|
| Stepper semantics | `role="navigation"` with `aria-label="Setup progress"`. Each step: `role="tab"`, `aria-selected` for active, `aria-disabled` for future. |
| Step content | `role="tabpanel"` with `aria-labelledby` pointing to the active step tab. |
| Checkbox group | Each category group is a `fieldset` with `legend` (visually styled as CategoryGroupHeader). |
| Income input | `aria-describedby` pointing to helper text and validation error (when shown). |
| Allocation bar | `aria-live="polite"` so screen readers announce remaining amount changes. |
| Skip links | Visible, keyboard-focusable. Not hidden behind hover. |
| Focus management | On step transition, focus moves to the step card heading. |
---
## Responsive Behavior
| Breakpoint | Behavior |
|------------|----------|
| >= 768px (md) | max-w-2xl card centered, stepper horizontal with labels below circles |
| < 768px (sm) | Card becomes full-width (mx-4). Stepper collapses: show circles only, hide step labels. Amount inputs remain w-24. |
| < 480px (xs) | PresetItemRow: badge hidden, amount input w-20. Category group headers wrap naturally. |
---
## Checker Sign-Off
- [ ] Dimension 1 Copywriting: PASS
- [ ] Dimension 2 Visuals: PASS
- [ ] Dimension 3 Color: PASS
- [ ] Dimension 4 Typography: PASS
- [ ] Dimension 5 Spacing: PASS
- [ ] Dimension 6 Registry Safety: PASS
**Approval:** pending

View File

@@ -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 <Navigate to="/setup" replace />`, 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)_

View File

@@ -1,452 +1,545 @@
# Architecture Research
**Domain:** Personal finance dashboard UI — React SPA overhaul
**Researched:** 2026-03-16
**Confidence:** HIGH (existing codebase is fully inspected; patterns are grounded in Radix/shadcn/Recharts official docs)
**Domain:** Personal budget dashboard — v2.0 UX simplification with wizard setup, auto-budget creation, inline add-from-library, design system rework
**Researched:** 2026-04-02
**Confidence:** HIGH (based on full codebase inspection; all claims verified against source files)
---
## Standard Architecture
## Existing Architecture Baseline
### System Overview
This is a subsequent milestone. The section below describes what EXISTS today, then each sub-section documents exactly what changes and what stays the same.
The existing three-tier architecture (Pages → Hooks → Supabase) is sound and must be preserved. The UI overhaul introduces a new layer of **dashboard-specific view components** that sit between pages and the primitive shadcn/ui atoms. Nothing touches hooks or the library layer.
### Current System Layout
```
┌───────────────────────────────────────────────────────────────┐
Pages Layer
DashboardPage CategoriesPage BudgetDetailPage ...
(routing, data loading, layout composition)
───────────────────────────────────────────────────────────────┤
View Components Layer [NEW]
┌─────────────────┐ ┌──────────────┐ ┌─────────────────┐
│ DashboardContent│ │CategorySection│ │ ChartPanel │
│ (hybrid layout) │ │(collapsible) │ │ (chart wrappers)│
└─────────────────┘ └──────────────┘ └─────────────────┘
┌─────────────────┐ ┌──────────────┐ ┌─────────────────┐
│ SummaryStrip │ BudgetTable PageShell
│ (KPI cards row) │ │ (line items) │ │ (consistent
└─────────────────┘ └──────────────┘ │ header+CTA) │
└─────────────────┘
├───────────────────────────────────────────────────────────────┤
Primitive UI Layer (shadcn/ui)
Card Button Table Dialog Select Collapsible Badge ...
├───────────────────────────────────────────────────────────────┤
Hooks Layer [UNCHANGED]
useBudgets useBudgetDetail useCategories useAuth ...
───────────────────────────────────────────────────────────────┤
Library Layer [UNCHANGED] │
│ supabase.ts types.ts format.ts palette.ts utils.ts │
index.css (@theme tokens — EXTEND for new color tokens)
└───────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────────────
React 19 SPA (Vite + TypeScript)
Auth Layer App Layer (ProtectedRoute + AppLayout)
│ ┌───────────────┐ ┌─────────────────────────────────────────┐ │
│ LoginPage │ SidebarProvider > Sidebar > SidebarInset│
│ RegisterPage │ │ 6 nav items → 6 protected page routes │
└───────────────┘ └─────────────────────────────────────────┘
Pages (each uses PageShell + direct hook calls):
DashboardPage CategoriesPage TemplatePage BudgetListPage
BudgetDetailPage QuickAddPage SettingsPage
Hooks (TanStack Query v5, direct supabase-js client):
useAuth useCategories useTemplate useBudgets useQuickAdd
│ useMonthParam useBudgetDetail │
Design layer:
│ index.css @theme inline → OKLCH tokens → Tailwind 4 utility classes│
lib/palette.ts → categoryColors (CSS var references only)
shadcn/ui (radix-ui primitives + generated component files)
└─────────────────────────┬───────────────────────────────────────────
│ @supabase/supabase-js v2 (REST + RLS)
┌─────────────────────────▼───────────────────────────────────────────┐
Supabase (PostgreSQL 16 + Auth + Row Level Security)
│ Tables: profiles, categories, templates, template_items, │
│ budgets, budget_items, quick_add_items │
└─────────────────────────────────────────────────────────────────────┘
```
**The constraint is strict:** hooks and library are read-only during this milestone. All UI overhaul changes land in `src/pages/`, `src/components/`, and `src/index.css` only.
### Key Existing Patterns (Carry Forward Unchanged)
| Pattern | Location | Keep? |
|---------|----------|-------|
| PageShell header wrapper | `components/shared/PageShell.tsx` | YES |
| DashboardContent inner component keyed by budgetId | `DashboardPage.tsx` | YES — key prop pattern prevents stale state on month change |
| useMonthParam URL search param | `hooks/useMonthParam.ts` | YES |
| getOrCreateTemplate (auto-creates template row) | `hooks/useTemplate.ts` | YES |
| generateFromTemplate mutation | `hooks/useBudgets.ts` | YES — v2.0 triggers it automatically |
| Two-tier OKLCH color tokens (text ~0.55L, fill ~0.68L) | `index.css` | YES — values tuned, names unchanged |
| categoryColors CSS var references | `lib/palette.ts` | YES — names unchanged |
| Direction-aware diff (income under = bad, spending over = bad) | `BudgetDetailPage.tsx`, `CategorySection.tsx` | YES |
| TanStack Query cache invalidation per resource key | All mutation hooks | YES |
---
### Component Responsibilities
## v2.0 Architecture Changes
| Component | Responsibility | Typical Implementation |
|-----------|----------------|------------------------|
| `DashboardPage` | Find current month budget, render shell | Unchanged outer page; delegates to `DashboardContent` |
| `DashboardContent` | Hybrid layout orchestration | Calls `useBudgetDetail`; computes derived data with `useMemo`; renders SummaryStrip + charts + CategorySections |
| `SummaryStrip` | Three KPI cards (income, expenses, balance) | Grid of `StatCard` components; color-coded balance |
| `StatCard` | Single KPI display unit | shadcn Card with title, large number, optional trend indicator |
| `ChartPanel` | Houses all charts in responsive grid | Two-column grid on desktop: income bar chart left, expense donut right, spend horizontal bar full-width below |
| `IncomeBarChart` | Budgeted vs actual income vertical bar | Recharts `BarChart` wrapped in `ChartContainer` with `ChartConfig` |
| `ExpenseDonutChart` | Expense category breakdown donut | Recharts `PieChart` with `innerRadius`/`outerRadius` + custom legend |
| `SpendBarChart` | Horizontal budget vs actual by category type | Recharts `BarChart layout="vertical"` |
| `CategorySection` | Collapsible group for one category type | Radix `Collapsible.Root` wrapping a header row + `BudgetLineItems` |
| `CategorySectionHeader` | Always-visible row: type label, color dot, group totals, chevron | Trigger for the collapsible; shows budgeted/actual/diff inline |
| `BudgetLineItems` | Table of individual line items inside a section | shadcn `Table`; thin wrapper around existing `InlineEditCell` / `DifferenceCell` atoms |
| `PageShell` | Consistent page header with title + primary CTA | Reusable wrapper used by every page; enforces padding, heading size, CTA slot |
| `AppLayout` | Sidebar navigation shell | Minor visual refresh only; structure unchanged |
### 1. First-Run Detection and Wizard Routing
---
**Problem:** New users land on Dashboard with empty categories, no template, no budget. The blank state offers no guidance.
## Recommended Project Structure
**Solution:** A `useFirstRunState` hook detects first-run status. A `WizardRoute` guard in `App.tsx` redirects first-run users to `/setup` (a dedicated wizard page) before they can reach any other protected route.
The existing structure is well-organized. The overhaul adds a `dashboard/` subfolder and a `shared/` subfolder under components — no reorganization of hooks or lib.
**New hook — `src/hooks/useFirstRunState.ts`:**
```
src/
├── components/
│ ├── ui/ # shadcn primitives (do not modify)
│ │ └── collapsible.tsx # ADD — Radix Collapsible primitive
│ ├── dashboard/ # ADD — dashboard-specific view components
│ │ ├── DashboardContent.tsx # hybrid layout orchestrator
│ │ ├── SummaryStrip.tsx # KPI cards row
│ │ ├── StatCard.tsx # single KPI card
│ │ ├── ChartPanel.tsx # chart grid container
│ │ ├── IncomeBarChart.tsx # budgeted vs actual income bar
│ │ ├── ExpenseDonutChart.tsx # donut + legend
│ │ ├── SpendBarChart.tsx # horizontal budget vs actual
│ │ ├── CategorySection.tsx # collapsible category group
│ │ └── BudgetLineItems.tsx # line-item table inside section
│ ├── shared/ # ADD — cross-page reusable components
│ │ └── PageShell.tsx # consistent page header + CTA slot
│ ├── AppLayout.tsx # MODIFY — visual refresh only
│ └── QuickAddPicker.tsx # unchanged
├── pages/ # MODIFY — swap DashboardContent import; apply PageShell
│ ├── DashboardPage.tsx
│ ├── BudgetDetailPage.tsx
│ ├── BudgetListPage.tsx
│ ├── CategoriesPage.tsx
│ ├── TemplatePage.tsx
│ ├── QuickAddPage.tsx
│ ├── SettingsPage.tsx
│ ├── LoginPage.tsx
│ └── RegisterPage.tsx
├── hooks/ # UNCHANGED
├── lib/
│ ├── palette.ts # UNCHANGED — CSS vars already defined
│ └── ... # everything else unchanged
├── i18n/
│ ├── en.json # ADD new translation keys
│ └── de.json # ADD new translation keys
└── index.css # ADD semantic color tokens if needed
```
### Structure Rationale
- **`components/dashboard/`:** All dashboard-specific view components are co-located. They have no meaning outside the dashboard, so they do not belong in `shared/`. Avoids polluting the top-level components directory.
- **`components/shared/`:** `PageShell` is the one genuinely cross-page component introduced by this milestone. Keeping it separate signals that it is intentionally reusable, not page-specific.
- **`components/ui/collapsible.tsx`:** The Radix Collapsible primitive is not yet in the project (inspected file list confirms absence). It must be added via `npx shadcn@latest add collapsible` before building `CategorySection`.
---
## Architectural Patterns
### Pattern 1: Derived Data via `useMemo` in DashboardContent
**What:** All computed values — category group totals, chart data arrays, KPI numbers — are derived in one place (`DashboardContent`) using `useMemo`, then passed as plain props to presentational child components. Child components never call hooks or perform calculations themselves.
**When to use:** Any time a value depends on `items` array from `useBudgetDetail`. Centralizing derivation means one cache invalidation (after a budget item update) triggers one recalculation, and all children rerender from the same consistent snapshot.
**Trade-offs:** Slightly more props-passing verbosity. Benefit: children are trivially testable pure components.
**Example:**
```typescript
// DashboardContent.tsx
const { budget, items } = useBudgetDetail(budgetId)
const totals = useMemo(() => {
const income = items
.filter(i => i.category?.type === "income")
.reduce((sum, i) => sum + i.actual_amount, 0)
const expenses = items
.filter(i => i.category?.type !== "income")
.reduce((sum, i) => sum + i.actual_amount, 0)
return { income, expenses, balance: income - expenses + (budget?.carryover_amount ?? 0) }
}, [items, budget?.carryover_amount])
const groupedItems = useMemo(() =>
CATEGORY_TYPES.map(type => ({
type,
items: items.filter(i => i.category?.type === type),
budgeted: items.filter(i => i.category?.type === type).reduce((s, i) => s + i.budgeted_amount, 0),
actual: items.filter(i => i.category?.type === type).reduce((s, i) => s + i.actual_amount, 0),
})).filter(g => g.items.length > 0),
[items])
// Pass totals and groupedItems as props; child components are pure
// Returns { needsSetup: boolean, loading: boolean }
// needsSetup = true when: categories.length === 0 OR template_items.length === 0
// Uses existing useCategories() and useTemplate() — no new DB queries
export function useFirstRunState(): { needsSetup: boolean; loading: boolean }
```
### Pattern 2: Collapsible Category Sections via Radix Collapsible
**Route change — `src/App.tsx`:**
**What:** Each category group (income, bills, variable expenses, debt, savings, investment) is wrapped in a `Collapsible.Root`. The always-visible trigger row shows the category label, color dot, and group-level budget/actual/difference totals. The collapsible content reveals the individual line-item table.
```
// Add /setup route
// Add WizardRoute guard that wraps the existing ProtectedRoute subtree:
// if needsSetup && path !== "/setup" → redirect to /setup
// if !needsSetup && path === "/setup" → redirect to /
**When to use:** The dashboard hybrid view — users need the summary at a glance without scrolling through every line item. Opening a section is an explicit drill-down action.
<Route path="/setup" element={<ProtectedRoute><SetupWizardPage /></ProtectedRoute>} />
```
**Trade-offs:** Adds `open` state per section. Use `useState` per section (not global state — there are at most 6 sections). Do not persist open state in localStorage for v1; the sections should open fresh on each visit so the summary view is the default.
**Wizard state — local `useState` only in `SetupWizardPage`:**
**Example:**
```typescript
// CategorySection.tsx
import { Collapsible, CollapsibleContent, CollapsibleTrigger }
from "@/components/ui/collapsible"
import { ChevronDown } from "lucide-react"
import { useState } from "react"
interface CategorySectionProps {
type: CategoryType
budgeted: number
actual: number
items: BudgetItem[]
currency: string
}
export function CategorySection({ type, budgeted, actual, items, currency }: CategorySectionProps) {
const [open, setOpen] = useState(false)
const { t } = useTranslation()
return (
<Collapsible open={open} onOpenChange={setOpen}>
<CollapsibleTrigger asChild>
<button className="flex w-full items-center gap-3 rounded-lg border px-4 py-3 hover:bg-muted/40">
<span className="size-3 shrink-0 rounded-full"
style={{ backgroundColor: categoryColors[type] }} />
<span className="font-medium">{t(`categories.types.${type}`)}</span>
<span className="ml-auto tabular-nums text-sm text-muted-foreground">
{formatCurrency(actual, currency)} / {formatCurrency(budgeted, currency)}
</span>
<ChevronDown className={`size-4 transition-transform ${open ? "rotate-180" : ""}`} />
</button>
</CollapsibleTrigger>
<CollapsibleContent>
<BudgetLineItems items={items} currency={currency} type={type} />
</CollapsibleContent>
</Collapsible>
)
type WizardState = {
step: 1 | 2 | 3
selectedPresets: string[] // preset IDs chosen in step 1
amounts: Record<string, number> // presetId → budgeted amount (step 2)
}
```
### Pattern 3: shadcn ChartContainer + ChartConfig for All Charts
Wizard state is ephemeral. It lives in the page component and is discarded on unmount. No context, no global store.
**What:** Wrap every Recharts chart in shadcn's `ChartContainer` component. Define colors and labels in a `ChartConfig` object that references existing CSS variable tokens from `index.css` (`var(--color-income)`, `var(--color-bill)`, etc.). Do not hardcode hex values inside chart components.
**Completion flow:** `handleFinish()` in `SetupWizardPage` runs:
1. `useCategories().create` × N (create one category row per selected preset)
2. `useTemplate().createItem` × N (create template items, each linked to the new categories)
3. `navigate("/")` — DashboardPage loads, `useFirstRunState` returns `needsSetup=false`
**When to use:** All three chart types (bar, horizontal bar, donut). This ensures charts automatically theme with the design system and dark mode works at zero extra cost.
**Preset data — `src/data/presets.ts`:** Static array of common budget items (rent, salary, groceries, car insurance, etc.) with suggested amounts and category types. No DB table needed — this is compile-time data.
**Trade-offs:** Requires adding the shadcn `chart` component (`npx shadcn@latest add chart`). Minor wrapper overhead, but the CSS variable binding and tooltip consistency is worth it.
**No new DB migration.** Wizard writes to existing `categories` and `template_items` tables.
**New files:**
- `src/hooks/useFirstRunState.ts`
- `src/pages/SetupWizardPage.tsx`
- `src/components/wizard/WizardStep.tsx`
- `src/components/wizard/CategoryDefaults.tsx`
- `src/components/wizard/TemplateDefaults.tsx`
- `src/data/presets.ts`
**Modified files:**
- `src/App.tsx` — add `/setup` route + WizardRoute guard
---
### 2. Auto-Budget Creation on Month Visit
**Problem:** Visiting the dashboard for a new month shows an empty state with two manual buttons ("Create Budget", "Generate from Template"). This friction contradicts the "just works" goal.
**Solution:** Auto-trigger `generateFromTemplate` inside a `useEffect` in `DashboardPage` when no budget exists for the current month and the user's template has items.
**Integration point — `src/pages/DashboardPage.tsx`:**
Add `useTemplate()` call alongside the existing `useBudgets()` call. Add a `useEffect` with these guards:
**Example:**
```typescript
// IncomeBarChart.tsx
import { ChartContainer, ChartTooltip, ChartTooltipContent }
from "@/components/ui/chart"
import { BarChart, Bar, XAxis, YAxis, CartesianGrid } from "recharts"
const { items: templateItems } = useTemplate()
const hasTemplateItems = templateItems.length > 0
const isCurrentMonth = month === currentMonth // currentMonth from useMonthParam baseline
const attempted = useRef(false)
const chartConfig = {
budgeted: { label: "Budgeted", color: "var(--color-income)" },
actual: { label: "Actual", color: "var(--color-income)" },
} satisfies ChartConfig
// data: [{ month: "March", budgeted: 3000, actual: 2850 }]
export function IncomeBarChart({ data, currency }: Props) {
return (
<ChartContainer config={chartConfig} className="min-h-[200px] w-full">
<BarChart data={data}>
<CartesianGrid vertical={false} />
<XAxis dataKey="month" />
<YAxis tickFormatter={v => formatCurrency(v, currency)} />
<ChartTooltip content={<ChartTooltipContent />} />
<Bar dataKey="budgeted" fill="var(--color-income)" radius={4} />
<Bar dataKey="actual" fill="var(--color-income)" fillOpacity={0.6} radius={4} />
</BarChart>
</ChartContainer>
)
useEffect(() => {
if (
!loading &&
!currentBudget &&
hasTemplateItems &&
isCurrentMonth &&
!attempted.current &&
!generateFromTemplate.isPending
) {
attempted.current = true
generateFromTemplate.mutate({ month: parsedMonth, year: parsedYear, currency })
}
}, [loading, currentBudget, hasTemplateItems, isCurrentMonth])
```
### Pattern 4: PageShell for Consistent Page Headers
**Currency source:** The `generateFromTemplate` mutation currently accepts `currency` as a param. Pull the user's preferred currency from the profile via a `useProfile` hook or extend `useAuth` to expose it. If `useProfile` is not yet implemented, fall back to reading from the most recent budget's `currency` field, or default to the settings page value.
**What:** A `PageShell` component accepts `title`, `description` (optional), and `action` (optional ReactNode slot for a primary CTA button). Every page wraps its top section in `PageShell`. This enforces a consistent heading size, spacing, and CTA placement across the entire app refresh.
**No new API endpoint.** The `generateFromTemplate` mutation in `useBudgets.ts` already handles the full create + seed flow server-side. This is a pure frontend trigger change.
**When to use:** All 9 pages in the overhaul. Any new page added in future milestones should also use it.
**Edge cases handled by the guards:**
- Template has 0 items → `hasTemplateItems=false` → skip auto-create, show prompt to configure template
- Budget already exists → `!currentBudget=false` → skip
- Past/future month navigation → `isCurrentMonth=false` → skip (only auto-create for today's month)
- Multiple renders before mutation completes → `attempted` ref prevents double-fire
**Trade-offs:** Adds one wrapper per page. The benefit is that a single visual change to the page header propagates everywhere without hunting through 9 files.
**Modified files:**
- `src/pages/DashboardPage.tsx` — add useTemplate(), useEffect trigger, currency source
---
### 3. Inline Add-from-Category-Library (Replaces QuickAdd Page)
**Problem:** QuickAdd is a separate nav page (`/quick-add`), a separate table (`quick_add_items`), and a Popover on the Dashboard. Three disconnected surfaces for one concept. The mental model is unclear.
**Solution:** Replace the QuickAdd Popover with an `AddOneOffSheet` component (a shadcn Sheet/side panel) available directly on BudgetDetailPage and Dashboard. It shows the user's category list grouped by type. The user picks a category, enters an amount, and a `one_off` budget item is created. The `quick_add_items` table remains intact but is removed from the primary workflow.
**New component — `src/components/budget/AddOneOffSheet.tsx`:**
**Example:**
```typescript
// shared/PageShell.tsx
interface PageShellProps {
title: string
description?: string
action?: React.ReactNode
children: React.ReactNode
interface AddOneOffSheetProps {
budgetId: string
open: boolean
onOpenChange: (open: boolean) => void
}
// Uses: useCategories() + useBudgets().createItem
// On save: createItem.mutate({ budgetId, category_id, budgeted_amount, actual_amount, notes, item_tier: "one_off" })
```
export function PageShell({ title, description, action, children }: PageShellProps) {
return (
<div className="flex flex-col gap-6">
<div className="flex items-start justify-between gap-4">
<div>
<h1 className="text-2xl font-semibold tracking-tight">{title}</h1>
{description && (
<p className="text-sm text-muted-foreground mt-1">{description}</p>
)}
</div>
{action && <div className="shrink-0">{action}</div>}
</div>
{children}
</div>
)
}
This replaces `QuickAddPicker.tsx` at both call sites. The existing `useBudgets().createItem` mutation is unchanged — it already inserts `item_tier: "one_off"` budget items.
**QuickAdd page fate:** Remove from `AppLayout.tsx` nav items array. Keep the route and page file in place (backwards compat, existing data). Do NOT drop the `quick_add_items` table or `useQuickAdd` hook.
**Modified files:**
- `src/components/AppLayout.tsx` — remove QuickAdd from `navItems` array
- `src/pages/DashboardPage.tsx` — replace `<QuickAddPicker>` with `<AddOneOffSheet>`
- `src/pages/BudgetDetailPage.tsx` — replace `<QuickAddPicker>` with `<AddOneOffSheet>`
**New files:**
- `src/components/budget/AddOneOffSheet.tsx`
**No DB migration needed.** `one_off` budget items already exist in `budget_items` with `item_tier = 'one_off'`.
---
### 4. Dashboard Simplification
**Problem:** The current dashboard renders three chart types (donut + two bar charts) in a 3-column grid plus collapsible sections. This is dense and the charts don't clearly reflect user-entered data. v2.0 goal: "this month's budget at a glance."
**Solution:** Remove the 3-column chart grid from `DashboardContent`. Keep `SummaryStrip` (3 KPI cards) and `CollapsibleSections`. The chart components stay in the codebase — they are correct — but are removed from the Dashboard layout.
**Modified files:**
- `src/pages/DashboardPage.tsx` — remove chart grid `<div>` and the three chart imports from `DashboardContent`
**Dashboard data correctness:** The aggregation logic (`totalIncome`, `totalExpenses`, `budgetedIncome`, `budgetedExpenses`) is already correct in `DashboardContent`. The perceived "data not reflecting input" issue is caused by the auto-create flow not existing yet — once a budget exists and items are populated, the existing calculations are accurate. No aggregation logic changes needed.
**Empty state after removing charts:** The removed chart area frees vertical space. Collapsible sections become the primary view. The `SummaryStrip` at the top provides the quick-glance summary. Consider adding a single "at a glance" progress indicator to `SummaryStrip` to compensate for the removed chart density.
---
### 5. Design System Token Rework
**Problem:** `--radius: 0.625rem` produces rounded corners everywhere. The palette has high chroma values that read as saturated rather than pastel.
**Solution:** Lower the radius token and tune OKLCH lightness/chroma in `index.css`. All shadcn/ui components reference `--radius` via `rounded-[--radius]` — a single value change propagates everywhere.
**The only changed file: `src/index.css`**
Key changes:
```css
/* Sharp edges */
--radius: 0.125rem; /* was 0.625rem */
/* Background: warmer, closer to pure white */
--color-background: oklch(0.99 0.003 260); /* was 0.98 0.005 260 */
/* Softer border */
--color-border: oklch(0.91 0.008 260); /* was 0.88 0.01 260 */
/* Category pastels: increase lightness slightly, keep chroma */
/* e.g. --color-income-fill: oklch(0.72 0.14 155) → 0.78 0.12 155 */
```
**What does NOT change:**
- Token names (e.g., `--color-income`, `--color-bill`) — `palette.ts` references these by name
- Two-tier pattern (text tokens at ~0.55L, fill tokens at ~0.680.78L)
- Category color identities (income=green, bill=orange-red, etc.)
- The `@theme inline` structure
**shadcn component customization:** Zero component-file changes required. Radius change propagates automatically. Color changes propagate via CSS var resolution.
---
## Updated System Layout (v2.0)
```
┌─────────────────────────────────────────────────────────────────────┐
│ React 19 SPA │
│ │
│ Auth Layer App Layer │
│ ┌───────────────┐ ┌─────────────────────────────────────────┐ │
│ │ LoginPage │ │ WizardRoute (NEW) │ │
│ │ RegisterPage │ │ └─ ProtectedRoute + AppLayout (MOD) │ │
│ └───────────────┘ │ Sidebar (5 nav items, -QuickAdd) │ │
│ └─────────────────────────────────────────┘ │
│ │
│ New route /setup: │
│ SetupWizardPage (NEW) → 3 steps → writes categories + template │
│ │
│ Modified pages: │
│ DashboardPage (MOD: auto-create, -charts, AddOneOffSheet) │
│ BudgetDetailPage (MOD: AddOneOffSheet replaces QuickAddPicker) │
│ │
│ Unchanged pages: │
│ CategoriesPage TemplatePage BudgetListPage SettingsPage │
│ QuickAddPage (hidden from nav, route kept) │
│ │
│ New components: │
│ wizard/WizardStep wizard/CategoryDefaults wizard/TemplateDefaults│
│ budget/AddOneOffSheet │
│ │
│ New hooks: │
│ useFirstRunState │
│ │
│ New data: │
│ src/data/presets.ts (static, no DB) │
└─────────────────────────┬───────────────────────────────────────────┘
│ @supabase/supabase-js v2 (unchanged)
┌─────────────────────────▼───────────────────────────────────────────┐
│ Supabase (unchanged schema, no new migrations) │
│ All new features write to existing tables │
└─────────────────────────────────────────────────────────────────────┘
```
---
## Data Flow
### Dashboard Read Flow
## Component Boundary Map (v2.0)
```
DashboardPage renders
useBudgets() → finds current month budget → passes budgetId prop
DashboardContent mounts
useBudgetDetail(budgetId) → TanStack Query cache or Supabase fetch
↓ data arrives
useMemo recalculates: totals, groupedItems, chartData
Props flow DOWN to pure presentational children:
SummaryStrip(totals)
ChartPanel(chartData, currency)
├── IncomeBarChart(barData)
├── ExpenseDonutChart(pieData)
── SpendBarChart(horizontalData)
CategorySection[] (groupedItems, per-type items)
── BudgetLineItems(items, currency)
App.tsx
├── /login → LoginPage
├── /register → RegisterPage
├── /setup → ProtectedRoute > SetupWizardPage (NEW)
│ ├── WizardStep (NEW)
├── step 1: CategoryDefaults (NEW) — checkboxes from presets.ts
│ └── step 2: TemplateDefaults (NEW) — amount inputs per selected preset
└── /* → WizardRoute > ProtectedRoute > AppLayout (MODIFIED: -QuickAdd nav)
├── / → DashboardPage (MODIFIED)
│ ├── MonthNavigator
│ ├── DashboardContent (MODIFIED: no chart grid)
│ │ ├── SummaryStrip (unchanged)
│ │ ├── CollapsibleSections (unchanged)
│ │ └── AddOneOffSheet (NEW, replaces QuickAddPicker)
├── /categories → CategoriesPage (unchanged)
── /template → TemplatePage (unchanged)
├── /budgets → BudgetListPage (unchanged)
── /budgets/:id → BudgetDetailPage (MODIFIED)
│ └── AddOneOffSheet (NEW, replaces QuickAddPicker)
├── /quick-add → QuickAddPage (hidden from nav, route kept)
└── /settings → SettingsPage (unchanged)
```
### Budget Item Edit Flow (unchanged, flows back up)
---
## Data Flow Changes
### First-Run + Wizard Completion Flow
```
InlineEditCell: user types new actual_amount
New user lands on any protected route
onCommit → updateItem.mutateAsync({ id, budgetId, actual_amount })
WizardRoute: useFirstRunState() → needsSetup=true
Supabase updates budget_items row
redirect /setup
onSuccess: queryClient.invalidateQueries(["budgets", budgetId, "items"])
SetupWizardPage renders (step 1)
User checks preset categories (Rent, Salary, Groceries, ...)
↓ [Next]
step 2: User adjusts amounts per selected category
↓ [Finish] → handleFinish()
useBudgetDetail re-fetches items
useCategories().create × N → INSERT categories (N rows)
↓ await
useTemplate().createItem × N → INSERT template_items (N rows)
↓ await
navigate("/")
DashboardContent useMemo recalculates all derived values
ALL children rerender with consistent new data
DashboardPage: useFirstRunState() → needsSetup=false
Auto-create effect fires (see below)
```
### State Management (what lives where)
### Auto-Budget Creation Flow
| State | Location | Why |
|-------|----------|-----|
| Budget and items data | TanStack Query cache | Server state, must survive component unmounts |
| Collapsible open/closed | `useState` in each `CategorySection` | Purely local UI state; 6 booleans maximum |
| Chart tooltip hover | Recharts internal | Library-managed interaction state |
| Dialog open/closed | `useState` in page components | Unchanged from current pattern |
| Currency, locale | `Profile` via Supabase → hooks | Read from `budget.currency`; no separate state |
```
DashboardPage mounts (month = "2026-04", current month)
useBudgets() → budgets list → currentBudget = undefined
useTemplate() → items → hasTemplateItems = true
useEffect fires:
!loading && !currentBudget && hasTemplateItems && isCurrentMonth && !attempted
generateFromTemplate.mutate({ month: 4, year: 2026, currency: "EUR" })
Supabase:
1. INSERT budgets (start_date=2026-04-01, end_date=2026-04-30)
2. SELECT template_items WHERE template_id = user's template
3. INSERT budget_items × N (actual_amount=0 per item)
onSuccess: invalidate ["budgets"], ["budgets", id], ["budgets", id, "items"]
DashboardPage rerenders: currentBudget = new budget
DashboardContent mounts (keyed by budgetId)
SummaryStrip + CollapsibleSections render with template-populated data
```
### Inline Add-One-Off Flow
```
DashboardPage or BudgetDetailPage
"Add one-off" button → AddOneOffSheet opens (Sheet side panel)
useCategories() provides category list (grouped by type)
User picks category, enters amount, optional notes
[Add] → useBudgets().createItem.mutate({
budgetId,
category_id,
budgeted_amount: amount,
actual_amount: amount, // one-off: budget = actual at time of entry
notes,
item_tier: "one_off"
})
onSuccess: invalidate ["budgets", budgetId, "items"]
Sheet closes → item appears in appropriate CollapsibleSection
```
---
## Scaling Considerations
## New vs Modified File Summary
This is a personal finance app for a single authenticated user at a time. Scale is not a concern for rendering. The relevant concern is **perceived performance** on the dashboard when `items` is large (100+ line items).
### New Files
| Scale | Architecture Adjustment |
|-------|--------------------------|
| <50 items (normal) | No optimization needed — current useMemo pattern is fast |
| 50-200 items | useMemo already handles this — O(n) passes are negligible |
| 200+ items | Consider React.memo on CategorySection to skip unchanged sections; still no virtualization needed |
| Dashboard load time | TanStack Query 5-min staleTime means instant rerender on navigate-back; no change required |
| File | Purpose |
|------|---------|
| `src/hooks/useFirstRunState.ts` | Detect first-run: categories=0 OR template_items=0 |
| `src/data/presets.ts` | Static preset category list with suggested amounts |
| `src/pages/SetupWizardPage.tsx` | Multi-step first-run wizard (local state, 3 steps) |
| `src/components/wizard/WizardStep.tsx` | Step wrapper with step indicator / progress |
| `src/components/wizard/CategoryDefaults.tsx` | Preset category checkbox picker (step 1) |
| `src/components/wizard/TemplateDefaults.tsx` | Amount inputs per selected preset (step 2) |
| `src/components/budget/AddOneOffSheet.tsx` | Sheet-based one-off item adder (replaces QuickAddPicker) |
### Modified Files
| File | What Changes |
|------|-------------|
| `src/App.tsx` | Add `/setup` route; add WizardRoute guard |
| `src/components/AppLayout.tsx` | Remove QuickAdd from `navItems` array |
| `src/pages/DashboardPage.tsx` | Add useTemplate(); add auto-create useEffect; remove chart grid; swap AddOneOffSheet for QuickAddPicker |
| `src/pages/BudgetDetailPage.tsx` | Swap AddOneOffSheet for QuickAddPicker |
| `src/index.css` | Lower `--radius`; tune OKLCH pastel token values |
| `src/i18n/en.json` | Add wizard i18n keys; remove/rename quick-add nav key |
| `src/i18n/de.json` | Same additions as en.json (bilingual requirement) |
### Unchanged Files (confirmed)
`useBudgets.ts`, `useTemplate.ts`, `useCategories.ts`, `useQuickAdd.ts`, `useAuth.ts`, `useMonthParam.ts`, `lib/types.ts`, `lib/palette.ts`, `lib/format.ts`, `lib/supabase.ts` — all hooks and library files are read-only for this milestone.
---
## Anti-Patterns
## Build Order (Dependency-Aware)
### Anti-Pattern 1: Deriving Chart Data Inside Chart Components
Phase dependencies must be respected. Build bottom-up.
**What people do:** Put `items.filter(...).reduce(...)` directly inside `IncomeBarChart` or `ExpenseDonutChart`, passing the raw `items` array from `useBudgetDetail` as a prop.
**Phase 1: Design Tokens (no deps)**
- `src/index.css` — lower `--radius`, refine OKLCH pastel values
- Verify all 9 existing pages render correctly; no logic changes
- Fast and reversible — do this first to establish visual baseline
**Why it's wrong:** Each chart component recalculates from scratch. If `items` reference changes (after a mutation), all three charts recalculate independently. Chart components become impure, harder to test, and cannot be reused with different data shapes without changing their internals.
**Phase 2: Preset Data + First-Run Hook (no deps)**
- `src/data/presets.ts` — static data, no imports needed
- `src/hooks/useFirstRunState.ts` — depends on existing `useCategories` + `useTemplate`; no UI yet
**Do this instead:** Derive all chart data in `DashboardContent` with `useMemo`. Pass prepared `barData`, `pieData`, `horizontalData` arrays to each chart. Charts receive typed data arrays and render only.
**Phase 3: Setup Wizard (depends on Phase 2)**
- `src/components/wizard/WizardStep.tsx` — pure presentational
- `src/components/wizard/CategoryDefaults.tsx` — depends on presets.ts
- `src/components/wizard/TemplateDefaults.tsx` — depends on presets.ts
- `src/pages/SetupWizardPage.tsx` — assembles wizard components + useFirstRunState + mutation hooks
- `src/App.tsx` — wire `/setup` route + WizardRoute guard
**Phase 4: Auto-Budget Creation (depends on Phase 3 — template must be populatable)**
- `src/pages/DashboardPage.tsx` — add `useTemplate()` import + auto-create `useEffect`
- Test: wizard → dashboard → budget auto-creates → SummaryStrip shows template data
**Phase 5: Inline Add-One-Off + Dashboard Simplification (depends on Phase 4)**
- `src/components/budget/AddOneOffSheet.tsx` — depends on `useCategories` + `useBudgets` (both existing)
- `src/pages/DashboardPage.tsx` — remove chart grid; wire AddOneOffSheet
- `src/pages/BudgetDetailPage.tsx` — wire AddOneOffSheet
- `src/components/AppLayout.tsx` — remove QuickAdd nav item
---
### Anti-Pattern 2: Hardcoding Colors Inside Chart Components
## Anti-Patterns to Avoid
**What people do:** Paste hex values like `fill="#4ade80"` into `<Bar>` and `<Cell>` components to match the design.
### Anti-Pattern 1: Global State for Wizard
**Why it's wrong:** The existing `index.css` already defines category colors as OKLCH CSS variables (`--color-income`, `--color-bill`, etc.) and `palette.ts` maps them to `var(--color-income)` etc. Hardcoding breaks dark mode adaptation, creates a second source of truth, and means a palette change requires editing multiple files.
**What people do:** Store wizard state in a React context, Zustand store, or TanStack Query mutation cache.
**Why it's wrong:** Wizard runs once, on first login. Global state persists unnecessarily and creates cleanup complexity.
**Do this instead:** Local `useState` in `SetupWizardPage`. When the page unmounts (after `navigate("/")`), state is automatically cleaned up.
**Do this instead:** Always reference `categoryColors[type]` from `palette.ts` (which returns the CSS variable string) for both chart fills and UI color dots. For shadcn `ChartContainer`, pass `color: categoryColors[type]` in the `ChartConfig` object.
### Anti-Pattern 2: Auto-Create Without Template Guard
**What people do:** Trigger `generateFromTemplate` whenever `!currentBudget`, regardless of template state.
**Why it's wrong:** If a user skips the wizard or has an empty template, an empty budget gets silently created. This is worse than the empty state — it looks like a bug, not a fresh start.
**Do this instead:** Guard with `hasTemplateItems && isCurrentMonth`. Show a helpful CTA to configure the template if template is empty.
### Anti-Pattern 3: Dropping the quick_add_items Table
**What people do:** Add a migration to drop `quick_add_items` when the QuickAdd nav item is removed.
**Why it's wrong:** Existing users have data there. The DB migration is irreversible. The table costs nothing to keep.
**Do this instead:** Remove the nav item and surface only. Leave the table, `useQuickAdd` hook, and `/quick-add` route in place. Schedule a cleanup migration in a future milestone after confirming no users rely on it.
### Anti-Pattern 4: Renaming Design Token CSS Variables
**What people do:** Rename tokens during the design rework (e.g., `--color-income``--category-color-income`) to make the naming more semantic.
**Why it's wrong:** `palette.ts` references token names as strings: `var(--color-income)`. All chart components use `var(--color-income-fill)`. Renaming causes silent CSS failures — no TypeScript error, no build error, just missing colors.
**Do this instead:** Change only the VALUES of existing tokens. Add new token names only for net-new concepts.
### Anti-Pattern 5: Wizard as Modal Overlay
**What people do:** Show the wizard as a Dialog or Sheet over the main app layout on first load.
**Why it's wrong:** No URL, so refresh drops the user back to the start or the main app with incomplete setup. Focus management in a full-screen modal is complex. Back button behavior is broken.
**Do this instead:** Dedicated `/setup` route. `WizardRoute` handles redirect logic. The browser URL reflects wizard state, refresh works, and no special cleanup is needed.
### Anti-Pattern 6: Adding useEffect Dependencies by Feel
**What people do:** Add `generateFromTemplate` itself to the `useEffect` deps array.
**Why it's wrong:** Mutation objects from TanStack Query are re-created on every render, causing the effect to re-run in a loop.
**Do this instead:** Use a `useRef` guard (`attempted.current`) and gate on stable primitive values (`!loading`, `!currentBudget`, `hasTemplateItems`). Do not include the mutation object in the dependency array.
---
### Anti-Pattern 3: One Monolithic DashboardContent Component
## Supabase / DB Notes (v2.0)
**What people do:** Add all new dashboard sections — summary cards, three charts, six collapsible sections, QuickAdd button — directly into one large `DashboardContent.tsx` that becomes 400+ lines.
**No new migrations required.** All v2.0 features write to existing tables:
**Why it's wrong:** The existing `DashboardContent` is already 200 lines with just two charts and progress bars. A full hybrid dashboard with three chart types and six collapsible sections will exceed 600 lines inline, making it impossible to review, test, or modify individual sections without reading the whole file.
| Feature | Writes To | Via |
|---------|-----------|-----|
| Wizard | `categories`, `template_items` | existing `useCategories().create`, `useTemplate().createItem` |
| Auto-budget | `budgets`, `budget_items` | existing `useBudgets().generateFromTemplate` |
| Inline one-off | `budget_items` | existing `useBudgets().createItem` |
| Design tokens | — | CSS only |
**Do this instead:** Extract into the component tree defined above. `DashboardContent` orchestrates layout and owns derived data. Each distinct visual section (`SummaryStrip`, `ChartPanel`, `CategorySection`) is its own file. The rule: if a block of JSX has a distinct visual purpose, it gets its own component.
The `quick_add_items` table becomes read-only from the primary UI flow. No rows deleted, no schema change.
---
### Anti-Pattern 4: Using shadcn Accordion Instead of Collapsible for Category Sections
## Integration Points: New vs Existing
**What people do:** Reach for the `Accordion` component (which is already in some shadcn setups) to build collapsible category sections because it looks similar.
**Why it's wrong:** Accordion by default enforces "only one open at a time" (type="single") or requires explicit `type="multiple"` with `collapsible` prop to allow free open/close. For budget sections, users may want to compare two categories side-by-side with both open simultaneously. Using individual `Collapsible` per section gives full independent control without fighting Accordion's root-state coordination.
**Do this instead:** Use Radix `Collapsible` (shadcn wrapper) on each `CategorySection` with independent `useState`. Six independent booleans are trivially managed.
---
### Anti-Pattern 5: Modifying Hooks or Supabase Queries
**What people do:** Add derived fields or aggregations to the `useBudgetDetail` return value, or add new Supabase query fields, because it seems convenient during the UI overhaul.
**Why it's wrong:** Explicitly out of scope (PROJECT.md: "No Supabase schema changes — UI-only modifications"). Any hook changes risk breaking `BudgetDetailPage` and other consumers. The data model is sufficient — all needed aggregations can be computed with `useMemo` from the existing `items` array.
**Do this instead:** Keep hooks read-only. All computation lives in the presentation layer via `useMemo`.
---
## Integration Points
### External Services
| Service | Integration | Notes |
|---------|-------------|-------|
| Supabase | Unchanged — hooks layer handles all DB calls | No new RPC calls, no schema changes |
| Recharts | Chart primitives — wrap with `ChartContainer` | Requires adding shadcn `chart` component |
| Radix UI | `Collapsible` primitive — add via shadcn CLI | Not yet in project; must be added before CategorySection work |
| i18next | All new UI text needs keys in `en.json` and `de.json` | Add keys before rendering any new text; no runtime fallback acceptable |
### Internal Boundaries
| Boundary | Communication | Notes |
|----------|---------------|-------|
| `DashboardContent` ↔ chart components | Props only — typed data arrays + currency string | Charts are pure; they do not call hooks |
| `DashboardContent``CategorySection` | Props only — grouped items, budgeted/actual totals, currency, mutation handlers | Mutation handlers passed down from `DashboardContent` which owns `useBudgets()` mutations |
| `CategorySection``BudgetLineItems` | Props only — items array, currency, type | `BudgetLineItems` is a thin table wrapper; all mutations are callbacks from parent |
| `PageShell` ↔ all pages | Props (title, action slot, children) | No state shared; purely compositional |
| `index.css` @theme tokens ↔ components | CSS variables via `var(--color-X)` and `palette.ts` | Single source of truth for all color; never duplicate in component style props |
---
## Build Order Implications
Components have dependencies that dictate implementation order:
1. **`components/ui/collapsible.tsx`** — Add via `npx shadcn@latest add collapsible`. Required by `CategorySection`. Do first.
2. **`components/ui/chart.tsx`** — Add via `npx shadcn@latest add chart`. Required by all chart components. Do first.
3. **`shared/PageShell.tsx`** — No dependencies. Build early; apply to all pages as each is refreshed.
4. **`StatCard` + `SummaryStrip`** — Only depends on `formatCurrency` and Tailwind. Build second after primitives.
5. **Chart components** (`IncomeBarChart`, `ExpenseDonutChart`, `SpendBarChart`) — Depend on `ChartContainer`. Build after step 2.
6. **`ChartPanel`** — Composes the three chart components. Build after step 5.
7. **`BudgetLineItems`** — Refactored from existing `BudgetDetailPage` table code; existing `InlineEditCell` and `DifferenceCell` are reusable as-is.
8. **`CategorySection`** — Depends on `Collapsible` primitive and `BudgetLineItems`. Build after steps 1 and 7.
9. **`DashboardContent`** — Orchestrates everything. Build last, wiring together all children. Replace the existing `DashboardContent` function in `DashboardPage.tsx`.
10. **Non-dashboard page refreshes** — Apply `PageShell` + visual refresh to remaining 7 pages. Independent of dashboard work; can be done in any order.
| New Feature | Existing Hooks/Mutations Used | New Additions |
|-------------|------------------------------|---------------|
| First-run wizard | `useCategories().create`, `useTemplate().createItem` | `useFirstRunState`, `presets.ts`, wizard components |
| Auto-budget creation | `useBudgets().generateFromTemplate` (already exists) | `useEffect` trigger in DashboardPage, `hasTemplateItems` guard |
| Inline one-off add | `useBudgets().createItem` (already exists), `useCategories()` | `AddOneOffSheet` component |
| Dashboard simplification | `useBudgetDetail`, `useMonthParam`, `SummaryStrip`, `CollapsibleSections` | Remove 3-column chart grid from DashboardContent |
| Design tokens | All existing components consume tokens automatically | Token value adjustments in `index.css` only |
---
## Sources
- Radix UI Collapsible: https://www.radix-ui.com/primitives/docs/components/collapsible (HIGH confidence — official docs)
- shadcn/ui Chart component: https://ui.shadcn.com/docs/components/radix/chart (HIGH confidence — official docs)
- shadcn/ui Accordion: https://ui.shadcn.com/docs/components/radix/accordion (HIGH confidence — official docs)
- Tailwind CSS v4 @theme tokens: https://tailwindcss.com/docs/theme (HIGH confidence — official docs)
- React useMemo: https://react.dev/reference/react/useMemo (HIGH confidence — official docs)
- Existing codebase: inspected `src/` fully — `DashboardPage.tsx`, `BudgetDetailPage.tsx`, `CategoriesPage.tsx`, `AppLayout.tsx`, `palette.ts`, `types.ts`, `index.css`, `useBudgets.ts` (HIGH confidence — primary source)
- Full codebase inspection (April 2026):
- `src/App.tsx`, `src/components/AppLayout.tsx`
- `src/pages/DashboardPage.tsx`, `src/pages/TemplatePage.tsx`, `src/pages/BudgetDetailPage.tsx`
- `src/hooks/useTemplate.ts`, `src/hooks/useBudgets.ts`, `src/hooks/useQuickAdd.ts`, `src/hooks/useMonthParam.ts`
- `src/components/QuickAddPicker.tsx`, `src/components/shared/PageShell.tsx`
- `src/lib/types.ts`, `src/lib/palette.ts`
- `src/index.css`, `src/i18n/en.json`
- `supabase/migrations/002_categories.sql` through `005_quick_add.sql`
- Confidence: HIGH — all claims are grounded in verified source code, not assumptions
---
*Architecture research for: SimpleFinanceDash UI overhaul — React + Tailwind + shadcn/ui + Recharts*
*Researched: 2026-03-16*
*Architecture research for: SimpleFinanceDash v2.0 — wizard setup, auto-budget, inline add, design rework*
*Researched: 2026-04-02*

View File

@@ -1,16 +1,24 @@
# Feature Research
**Domain:** Personal finance budget dashboard (UI presentation layer overhaul)
**Researched:** 2026-03-16
**Confidence:** HIGH — grounded in competitor analysis (YNAB, Empower), industry design guides, and direct codebase inspection
**Domain:** Personal budget app — wizard-driven setup, auto-budget creation, simplified monthly tracking UX
**Researched:** 2026-04-02
**Confidence:** MEDIUM — grounded in competitor analysis (YNAB, Monarch, EveryDollar, Actual Budget, Quicken Simplifi, Copilot) and UX/fintech design literature. Some specifics are inferred from behavioral patterns; no first-party user testing data.
---
## Context
This research covers the **presentation layer** only. Backend schema and data model are frozen. The question is: what UI/UX features make a personal finance dashboard feel polished rather than basic, and which of those apply to this project's existing data model (income, bills, variable expenses, debt, savings, investments — budgeted vs actual)?
This research covers v2.0 UX Simplification. The existing app already has all the data infrastructure — categories (6 types), template system, monthly budget generation, quick-add library, dashboard with charts. The problem is cognitive: too many disconnected concepts, friction in getting a budget running, and no guided experience for new users.
The existing stack is React 19 + Tailwind CSS 4 + Recharts + shadcn/ui. All chart capabilities already exist in Recharts; this research identifies how to use them well.
The research question: **How do personal budget apps handle first-run wizard setup, auto-creation from template, and simplified monthly views?** What is table stakes, what differentiates, and what should be avoided?
Existing features that remain and are not re-researched here:
- Category CRUD
- Template item management
- Budget detail with inline editing
- Charts (donut, bar, horizontal bar)
- Collapsible dashboard sections
- Settings (locale, currency)
---
@@ -18,23 +26,18 @@ The existing stack is React 19 + Tailwind CSS 4 + Recharts + shadcn/ui. All char
### Table Stakes (Users Expect These)
Features users assume exist. Missing these = product feels incomplete.
Features users assume exist. Missing these = product feels incomplete or broken.
| Feature | Why Expected | Complexity | Notes |
|---------|--------------|------------|-------|
| Summary KPI cards at the top | Every finance dashboard leads with top-line numbers (income, total spend, balance). Users scan these first — it's the entry point to understanding the month. | LOW | Already exists but needs richer visual treatment: larger numbers, colored icons, clearer hierarchy |
| Green/red semantic color coding for over/under budget | Finance convention: green = on track, red = over budget. Violating this creates cognitive friction. | LOW | Already exists on progress bars and difference cells; must be consistent across all new chart types |
| Donut/pie chart for expense category breakdown | Standard visualization for "how is spending distributed." Users expect to see the breakdown at a glance. | LOW | Existing pie is plain; needs inner radius (donut), center total label, and richer color fills |
| Budget vs actual per category | The core comparison every budget tool offers. Users come here specifically to compare what they planned to what they actually spent. | MEDIUM | Existing progress bars satisfy this minimally; new grouped/horizontal bar charts will fulfill it properly |
| Inline value editing on budget detail | Users need to log actuals inline — no one wants a separate form for every line item. | LOW | Already implemented in BudgetDetailPage as InlineEditCell; keep and refine |
| Loading state that reflects page structure | If the page renders blank or flashes, users distrust the data or think it's broken. | LOW | Currently returns `null` during load — skeleton cards matching the final layout are expected |
| Empty state with actionable guidance | A blank dashboard for a new month should tell the user what to do next, not just show nothing. | LOW | Currently shows plain muted text; needs a CTA card pattern |
| Tabular-numeral formatting throughout | Financial amounts must use tabular (monospaced number) alignment so columns read correctly. | LOW | Already applied via `tabular-nums`; extend to all new components |
| Color-coded category identity | Users build a mental map: bills are orange, savings are blue. Consistent color per category type is required everywhere — charts, tables, badges. | LOW | Palette already defined in `index.css` and `palette.ts`; extend consistently to new components |
| Collapsible / grouped sections per category type | Budget detail and dashboard both group items by type. Users expect to expand/collapse groups, especially with many line items. | MEDIUM | BudgetDetailPage already groups by type; dashboard needs collapsible inline sections as new feature |
| Month navigation on the dashboard | Users want to check a prior month without navigating away. "Looking at last month" is a top-3 use case for any budget tool. | MEDIUM | Not in current dashboard (auto-resolves current month only); needs month selector |
| Totals row / footer per section | Standard pattern from spreadsheets. Each category group needs a sub-total visible without counting rows. | LOW | Already in BudgetDetailPage table footer; needs equivalent on dashboard sections |
| Consistent design language across all pages | Auth pages, settings, categories, and budget list must feel like the same product as the dashboard. Inconsistency signals amateur work. | HIGH | Currently only dashboard is styled; all other pages need the same card/color/typography treatment |
| Wizard-style first-run setup | Every modern app (YNAB, EveryDollar, Monarch) guides new users through initial setup — no blank-slate drop. Blank-state is a known retention killer for budget apps. | MEDIUM | Multi-step flow: income → recurring items → review. Must be skippable per step. |
| Pre-filled category items with common defaults | Users expect "rent," "groceries," "car insurance" to already be there — not to type everything from scratch. YNAB's Beginner Template and Quicken Simplifi both provide starter category lists. | LOW | Pre-seed the wizard with a curated list of ~15-20 common items grouped by type. User selects/deselects, edits amounts. |
| Auto-created budget on first month visit | After setup, users expect a budget to exist for the current month without a separate "generate budget" step. The manual trigger pattern is a v1-era pattern that creates friction. Quicken Simplifi does this with its Spending Plan. | MEDIUM | Trigger auto-generation server-side when a user visits the current month and no budget exists. |
| Ability to skip setup and start minimal | Power users and returning users want to start blank or skip ahead. Forcing everyone through a wizard is patronizing. | LOW | Each wizard step needs a "Skip" option. Entire wizard skippable via "I'll set this up later." |
| Inline add-from-library on the budget view | Users expect to add a one-off expense from their familiar item list without navigating away. The current separate Quick-Add page is a disconnect. Spendee and Actual Budget surface this inline. | MEDIUM | Replace Quick-Add page with an inline panel/sheet triggered from the budget view. Category + item picker, amount field, confirm. |
| Monthly budget shows budgeted vs actual, grouped | The core interaction loop: open budget, see what's in each category, enter actuals. Every app (YNAB, EveryDollar, Actual Budget) organizes this as grouped rows with a budgeted amount and an actuals field. | LOW | Already exists in the current BudgetDetailPage. Table stakes means this must work correctly and clearly — not changed, just verified. |
| Dashboard = this month's budget at a glance | Users want to open the app and immediately know their status: income, spending, balance. Not a chart gallery. Monarch and Copilot both lead with a "current month" summary card. | LOW | Dashboard must surface current month's data prominently — summary cards first, then detail. Already partially true; needs data correctness fix. |
| Empty state with clear call to action | If no template is set up, the app must explain what to do — not just show a blank page. "Set up your budget template" with a single action button. | LOW | Applies to: empty template page, empty budget view, empty dashboard. |
### Differentiators (Competitive Advantage)
@@ -42,16 +45,12 @@ Features that set the product apart. Not required, but valued.
| Feature | Value Proposition | Complexity | Notes |
|---------|-------------------|------------|-------|
| Grouped bar chart: income budgeted vs actual | Directly answers "Did I earn what I expected this month?" in a single visual. Most basic dashboards skip this, showing only expense charts. | MEDIUM | Recharts `BarChart` with two `Bar` components (budgeted / actual); use category colors |
| Horizontal bar chart: spend by category type (budget vs actual) | Lets users scan over-budget categories at a glance. Horizontal orientation makes labels readable without rotation. | MEDIUM | Recharts `BarChart layout="vertical"` with `XAxis type="number"` and `YAxis type="category"` |
| Donut chart with center total label | Center label turns the chart from decorative into informational — shows total spend while the ring shows distribution. YNAB and Empower both do this. | LOW | Recharts `Label` component inside `Pie` using `viewBox` coordinates for positioned text |
| Active sector hover highlight on donut | Hovering a slice expands it slightly and shows the category name + amount in a tooltip. Feels interactive and polished vs a static chart. | LOW | Recharts `activeShape` with expanded `outerRadius` — supported natively |
| Variance indicator (delta arrows) | Show "▲ 12% over" or "▼ 5% under" beside actual amounts on summary cards and section headers. Transforms raw numbers into directional insight. | LOW | Computed from budgeted/actual; render as small colored badge or arrow icon |
| Accent-colored card borders / icon containers | Rich visual style: each category section gets its palette color as a left border accent or icon container fill. Breaks the sea-of-grey-cards look. | LOW | Tailwind `border-l-4` or `bg-[color]/10` container with category CSS variable |
| Section collapse persisted in localStorage | Remembering which sections are open avoids users re-expanding the same sections every visit. Small touch that signals quality. | LOW | Simple `useState` + `localStorage` read/write; wrap in a `useCollapse` hook |
| Carryover amount visible on dashboard | The budget model already tracks `carryover_amount`. Showing it alongside the available balance makes the "running total" story clear. | LOW | Surface as a fourth summary card or sub-label on the balance card |
| Skeleton loading that mirrors the real layout | Animated skeleton cards/charts during load feel like the app is fast and predictable. Blank screens feel broken. | LOW | shadcn/ui `Skeleton` component already available; wrap summary cards and chart containers |
| Page header with budget month name | Every page in the app should show context: "March 2026 Budget." Users confirm they're looking at the right period immediately. | LOW | Format `budget.start_date` as "Month YYYY" in the page heading |
| Smart amount suggestions during wizard setup | Rather than blank amount fields, prefill with sensible defaults (e.g., $1,500 for rent, $400 for groceries) that users can override. Reduces the "I don't know what to put here" paralysis. Most apps leave this blank. | LOW | Can be static defaults (not AI). Store suggested amounts per item type in a constant/config. User edits freely. |
| "Start from your income" wizard framing | Frame setup as: "First, how much do you earn each month?" then "Here are common expenses people like you track." Income-first anchoring mirrors zero-based budgeting mental model (YNAB's core concept) and makes subsequent amounts feel grounded. | LOW | First wizard step = income amount. Subsequent steps show remaining balance updating as items are added — "you have $X left to allocate." |
| Running balance display during wizard | As the user adds items in the wizard, show "Remaining to allocate: $X" updating live. Makes it immediately obvious if they're over-allocating. This is YNAB's core interaction loop, applied to setup. | LOW | Derived from: income total minus sum of bill/expense/debt/saving/investment items. Frontend computation only. |
| Persistent sidebar "this month" widget on dashboard | A small always-visible card showing remaining balance for the month, top 2-3 categories near limit, and a "View full budget" link. Eliminates the need to navigate away to check status. Copilot uses this pattern. | MEDIUM | Requires current month budget query always running. Can be a sticky sidebar panel on the dashboard page rather than a global element. |
| Auto-create silently, notify only on first creation | First-time users see a brief notification "Your March budget was created from your template." Subsequent months: silently created, no notification. This is the right default — zero friction for users who've set up their template. | LOW | Backend: check if budget for current month exists on page load; create if not. Frontend: show a toast only if a new budget was just created. |
| Template edit directly accessible from monthly view | If a user wants to permanently change a recurring item (e.g., rent went up), they should be able to jump to the template from the budget view without hunting through the nav. | LOW | An "Edit template" link on the budget page or a per-item "Save to template" action. Single nav jump, no modal complexity. |
### Anti-Features (Commonly Requested, Often Problematic)
@@ -59,91 +58,87 @@ Features that seem good but create problems in this context.
| Feature | Why Requested | Why Problematic | Alternative |
|---------|---------------|-----------------|-------------|
| Trend / multi-month charts | Users always ask "can I see my spending over 6 months?" | Requires multi-budget data aggregation, a new query shape, and a new chart layout — out of scope for a UI-only overhaul. Adding it half-baked is worse than not adding it. | Explicitly defer to a future milestone. Put a placeholder card with "Coming soon" if needed. |
| Dark mode toggle | Professional apps always have a dark mode. | Tailwind CSS 4 dark mode via class strategy is possible, but requires auditing every component's contrast, chart colors, and skeleton states. Doing it properly doubles testing surface. The OKLCH color system is set up with dark mode in mind, but no dark palette is currently defined. | Define as a future phase deliverable. Keep the existing light-only approach consistent and polished first. |
| Real-time sync / live updates | "What if two tabs are open?" | No backend changes allowed this milestone. Supabase realtime would require schema changes and subscription setup. The current TanStack Query polling pattern is sufficient. | Rely on query invalidation on mutation — already in place. |
| Drag-to-reorder line items | Power users want custom sort order | Category `sort_order` field exists, but updating it requires PATCH calls and animation logic. No backend changes in scope. | Keep current `sort_order` from DB; do not expose drag handles this milestone. |
| Glassmorphism / heavy blur effects | Trendy, visually striking | `backdrop-blur` on many elements is GPU-heavy and can degrade performance on lower-end machines. Also risks reducing text readability on charts. Misapplied, it obscures data rather than enhancing it. | Use solid cards with subtle colored-border accents instead. Reserve `backdrop-blur` for a single hero element if at all. |
| AI / natural language budget insights | Feels modern, seen in apps like Copilot | Requires an AI backend, a new API integration, and user data being sent to a third-party service — none of which are part of a UI-only overhaul. | Surface static insights from computed data instead: "You spent 15% more on bills than budgeted this month." Computed in the frontend, no AI needed. |
| Infinite scroll on budget list | "I have many months of budgets" | Adds complexity to the budget list query and requires scroll position management. The budget list is unlikely to have more than 24 entries in a year of use. | Standard paginated or full list with a search/filter input is sufficient. |
| AI-suggested amounts based on spending history | "Smart defaults should learn from me over time" | Requires enough historical data (users don't have it at setup), an ML model or LLM call, and privacy tradeoffs. The payoff is low when static defaults work fine for first-run. | Static curated defaults per item type. After 3+ months of use, a "Review your template" prompt is sufficient. |
| Mandatory wizard (no escape) | "Force users to complete setup so they have a working budget" | Patronizing for returning users; creates frustration for users who want to explore before committing. YNAB's old onboarding got negative feedback for being too locked-in; they added a flexible checklist in Oct 2025 for this reason. | Skippable wizard with a prominent resume-later CTA. Show a "Complete setup" banner if template is empty. |
| Auto-sync with bank accounts | "Automatically populate actuals from transactions" | Plaid/bank integrations add significant infrastructure cost, security scope, and maintenance burden. Out of scope for a self-hosted personal tool. | Manual actual entry (inline editing, already implemented) with optional import as a future feature. |
| Complex wizard with 6+ steps | "Guide the user through every aspect of budgeting" | Drop-off increases sharply with each step beyond 3. Users who see step 4 of 7 abandon setup entirely. | Max 3 steps: (1) Income, (2) Recurring items, (3) Review + confirm. Everything else is editable post-setup. |
| Per-item recurrence configuration in wizard | "Let users set whether each item is weekly, monthly, etc." | Adds decision burden during setup. The app model is monthly budgeting — every item is implicitly monthly. Edge cases (weekly, biweekly) should be post-setup configuration. | Monthly-only assumption during wizard. Users can edit frequency on the template page after setup. |
| Gamification / streaks for budget tracking | "Engage users to check in daily" | Budget apps that add gamification often feel gimmicky for a personal finance tool. The target user is tracking a spreadsheet replacement — they want data, not achievements. | Progress indicators (spent X% of budget) provide motivation without game mechanics. |
| Duplicate "Quick Add" page alongside inline add | "Keep the existing page and add inline too" | Two ways to do the same thing creates confusion about which to use. The standalone Quick Add page has no added value over an inline approach. | Replace entirely with inline add-from-library on the budget view. Remove the nav link for the old Quick Add page. |
---
## Feature Dependencies
```
Donut Chart with Center Label
└──requires──> Category color system (already exists)
└──requires──> Recharts Label component in Pie (Recharts native)
Wizard Setup
└──requires──> Pre-seeded library items (common defaults in DB or seed data)
└──requires──> Template CRUD (already exists)
└──produces──> Populated template (unlocks auto-creation)
└──enhances──> Smart amount suggestions (display layer only)
└──enhances──> Running balance during wizard (computed from income + items)
Horizontal Bar Chart (budget vs actual by type)
└──requires──> Category color system (already exists)
└──requires──> Grouped data by category type (already in DashboardContent)
Auto-Budget Creation
└──requires──> Populated template (wizard must complete, or manual template setup)
└──requires──> Backend trigger logic (check if budget for month exists; create if not)
└──produces──> Current month budget (unlocks simplified budget view)
└──enhances──> Silent creation toast (frontend notification, optional)
Grouped Bar Chart (income budget vs actual)
└──requires──> Income items filtered from BudgetItems (already in DashboardContent)
Simplified Budget View (inline add from library)
└──requires──> Current month budget exists (auto-creation must fire first)
└──requires──> Category library with quick-add items (already exists as quick_add_items table)
└──replaces──> Standalone Quick Add page (remove from nav)
└──enhances──> Budget detail (adds inline picker panel alongside existing inline editing)
Collapsible Dashboard Sections
└──requires──> Category group data (already derived)
└──enhances──> Section collapse persistence (localStorage)
└──enhances──> Totals row per section (already exists in BudgetDetailPage)
Dashboard = This Month at a Glance
└──requires──> Current month budget exists (auto-creation must fire first)
└──requires──> Budget data correctness fix (tracked separately)
└──depends-on──> Simplified budget view (users need to be able to add actuals quickly)
Skeleton Loading
└──requires──> Final layout structure (must design layout first)
└──depends-on──> Summary cards layout (build cards first, then wrap in Skeleton)
Month Navigation on Dashboard
└──requires──> Budgets list query (already in useBudgets)
└──conflicts──> Auto-resolve current month (replace with explicit selection)
Consistent Design Language (all pages)
└──depends-on──> Dashboard redesign being finished first (establishes the design token/component pattern)
└──applies-to──> LoginPage, RegisterPage, CategoriesPage, TemplatePage, BudgetListPage, BudgetDetailPage, QuickAddPage, SettingsPage
Variance Indicators (delta arrows)
└──requires──> budgeted_amount and actual_amount both available (already on BudgetItem)
└──enhances──> Summary cards (add % change sub-label)
└──enhances──> Collapsible section headers (show group variance at a glance)
Template Edit from Budget View
└──requires──> Template page (already exists)
└──enhances──> Simplified budget view (provides escape hatch to change recurring items)
```
### Dependency Notes
- **Skeleton loading requires final layout:** Don't implement skeleton states until the target card/chart layout is finalized — skeleton shape must mirror real content shape.
- **All-pages redesign depends on dashboard:** The dashboard establishes the color system application patterns (accent borders, card styles, typography scale) that all other pages will inherit.
- **Month navigation conflicts with auto-resolve:** The current pattern auto-finds the budget for the current calendar month. Adding a selector means the dashboard must hold local `selectedBudgetId` state rather than computing it.
- **Donut center label requires Recharts Label:** shadcn/ui's chart system supports this natively via the `Label` component inside `Pie` using `viewBox` coordinates. No new library needed.
- **Wizard depends on pre-seeded library:** The wizard presents pre-filled common items. These must exist in the database (or a constants file) before the wizard can show them. This is the foundational data concern for v2.0.
- **Auto-creation depends on template having content:** If the user skips the wizard entirely, auto-creation generates an empty budget (no items). The UI must handle this gracefully — show empty-state with "Set up your template" CTA.
- **Inline add replaces Quick Add page:** This is a replacement, not an addition. The Quick Add page should be removed from the nav. The backend endpoint it uses can be repurposed or kept as the inline add trigger.
- **Dashboard correctness is a prerequisite:** The "dashboard = this month at a glance" feature is only meaningful if the data it displays is accurate. Data correctness fix must happen before or alongside the dashboard simplification.
---
## MVP Definition
This is a UI overhaul milestone, not a greenfield product. "MVP" here means: what must ship for the redesign to feel complete and polished?
This is v2.0 of an existing working app. "MVP" here means: what is the minimum set of changes that delivers the simplified UX without regressions?
### Launch With (v1 — Dashboard Overhaul)
### Launch With (v2.0 — Core UX Simplification)
- [ ] Summary cards with richer visual treatment (larger numbers, semantic color on balance, variance badge) — foundation of the dashboard
- [ ] Donut chart with center total label and active sector hover — replaces existing flat pie
- [ ] Horizontal bar chart (budget vs actual by category type) — new chart, satisfies the key "am I on track" question
- [ ] Grouped bar chart (income budget vs actual) — completes the three-chart suite from the reference
- [ ] Collapsible inline sections per category group on dashboard (with line items + group totals) — replaces current progress bars
- [ ] Skeleton loading states for cards and charts — removes the jarring blank-then-rendered experience
- [ ] Month navigation control (budget period selector) on dashboard — without this the dashboard is locked to current month only
- [ ] Wizard-style template setup — 3-step flow: income → common items (pre-filled, editable) → review — skippable
- [ ] Pre-seeded library with ~15-20 common items grouped by category type (rent, car insurance, groceries, utilities, car payment, etc.)
- [ ] Smart amount defaults in wizard (static sensible values per item — not AI)
- [ ] Running balance during wizard (income minus sum of selected items)
- [ ] Auto-create current month budget from template on first visit (backend trigger, silent)
- [ ] Toast notification on first auto-creation only ("Your April budget was created from your template")
- [ ] Inline add-from-library on the budget view (replaces Quick Add page)
- [ ] Remove Quick Add from navigation
- [ ] Dashboard summary cards correctly reflect current month budget data
- [ ] Empty state CTAs for: empty template, empty dashboard, empty budget
### Add After Dashboard Phase (v1.x — Full App Polish)
### Add After Core Ships (v2.x)
- [ ] Consistent card/color design applied to BudgetDetailPage — users navigate here from the dashboard; it must match
- [ ] Consistent design applied to BudgetListPage — entry point from nav, feels disconnected from dashboard without polish
- [ ] Consistent design applied to CategoriesPage and TemplatePage — setup pages; lower urgency but visible gap
- [ ] Consistent design applied to LoginPage and RegisterPage — first impression; polish matters
- [ ] Consistent design applied to QuickAddPage and SettingsPage — utility pages; can ship slightly after core flows
- [ ] Section collapse state persisted to localStorage — nice-to-have UX polish
- [ ] "Edit template" shortcut from budget view — once core flow is working, add the escape hatch
- [ ] Persistent "this month" summary widget on dashboard — adds value once data is correct
- [ ] "Complete setup" banner for users who skipped wizard but have empty template
- [ ] Wizard resume-later state (save partial wizard progress) — only needed if drop-off is observed
### Future Consideration (v2+)
### Future Consideration (v3+)
- [ ] Trend charts over multiple months — deferred explicitly in PROJECT.md out-of-scope
- [ ] Dark mode — foundational work (OKLCH variables) exists but needs full audit and dark palette definition
- [ ] AI-derived spending insights — requires backend changes; no scope here
- [ ] Drag-to-reorder categories — requires sort_order mutation support
- [ ] Income-based spending recommendations (percentages by category type)
- [ ] "Review your template" prompt after 3 months of use
- [ ] CSV/bank import for actuals — mentioned as future feature in PROJECT.md
- [ ] Recurring transaction automation — mentioned as future in PROJECT.md
---
@@ -151,94 +146,116 @@ This is a UI overhaul milestone, not a greenfield product. "MVP" here means: wha
| Feature | User Value | Implementation Cost | Priority |
|---------|------------|---------------------|----------|
| Summary cards — richer visual treatment | HIGH | LOW | P1 |
| Donut chart with center label + active hover | HIGH | LOW | P1 |
| Horizontal bar chart (spend vs budget by type) | HIGH | MEDIUM | P1 |
| Grouped bar chart (income budget vs actual) | HIGH | MEDIUM | P1 |
| Collapsible dashboard sections with line items | HIGH | MEDIUM | P1 |
| Skeleton loading states | MEDIUM | LOW | P1 |
| Month navigation on dashboard | HIGH | MEDIUM | P1 |
| Consistent design on BudgetDetailPage | HIGH | MEDIUM | P1 |
| Consistent design on BudgetListPage | MEDIUM | LOW | P2 |
| Variance indicators (delta arrows/badges) | MEDIUM | LOW | P2 |
| Accent-colored category section borders | MEDIUM | LOW | P2 |
| Carryover amount visible on dashboard | MEDIUM | LOW | P2 |
| Consistent design on auth/settings/utility pages | LOW | MEDIUM | P2 |
| Section collapse persisted in localStorage | LOW | LOW | P3 |
| Empty state with action guidance | MEDIUM | LOW | P2 |
| Wizard setup (3-step, skippable) | HIGH | MEDIUM | P1 |
| Pre-seeded library items (15-20 defaults) | HIGH | LOW | P1 |
| Smart amount defaults in wizard | MEDIUM | LOW | P1 |
| Running balance during wizard | HIGH | LOW | P1 |
| Auto-create budget on month visit | HIGH | MEDIUM | P1 |
| Dashboard data correctness fix | HIGH | MEDIUM | P1 |
| Inline add-from-library on budget view | HIGH | MEDIUM | P1 |
| Remove Quick Add page from nav | MEDIUM | LOW | P1 |
| Empty state CTAs (template, dashboard, budget) | MEDIUM | LOW | P1 |
| Silent creation with first-time toast | MEDIUM | LOW | P2 |
| "Edit template" link from budget view | MEDIUM | LOW | P2 |
| Persistent "this month" dashboard widget | MEDIUM | MEDIUM | P2 |
| "Complete setup" banner for empty template | LOW | LOW | P2 |
| Wizard resume-later persistence | LOW | MEDIUM | P3 |
**Priority key:**
- P1: Must have for the overhaul to feel complete
- P2: Should have; include in same milestone if effort allows
- P3: Nice to have; add as polish after core delivery
- P1: Must ship for v2.0 to feel complete
- P2: Should have; include if effort allows
- P3: Nice to have; future consideration
---
## Competitor Feature Analysis
| Feature | YNAB | Empower (formerly Personal Capital) | Our Approach |
|---------|------|--------------------------------------|--------------|
| Summary KPI cards | Yes — "Available" balance prominent | Yes — net worth headline | 3 cards: Income / Expenses / Balance |
| Budget vs actual bars | Yes — horizontal category bars with color (green/yellow/red) | Cash flow bars | Horizontal bar chart per category type |
| Donut / pie chart | No (YNAB uses different visualization) | Yes — allocation donut for investments | Donut with center total, colored by category type |
| Collapsible grouped sections | Yes — master categories expand to show sub-categories | No — flat list | Collapsible per category type (income, bills, etc.) |
| Inline editing | Yes — click amount to edit | No | Keep existing InlineEditCell pattern, refine styling |
| Color-coded categories | Yes — status colors (green/yellow/red) | Category colors for accounts | Per-type semantic color (income=green, debt=red/pink, etc.) |
| Month/period navigation | Yes — budget period selector in sidebar | Yes — date range selector | Month selector on dashboard |
| Skeleton loading | Yes — YNAB shows skeleton on load | Yes | Skeleton cards + chart placeholders |
| Variance / delta indicators | Yes — shows "over by $X" inline | Yes — shows gain/loss % | Variance badge on summary cards and section headers |
| Feature | YNAB | Monarch Money | EveryDollar | Quicken Simplifi | Our Approach |
|---------|------|---------------|-------------|------------------|--------------|
| First-run wizard | Flexible checklist (Oct 2025 update); Beginner Template to import categories | Guided category setup on signup; AI auto-categorizes after account link | Wizard-style setup; named "best for newbies" | Template import + Spending Plan auto-setup | 3-step wizard: income → items → review |
| Pre-filled defaults | Beginner Template with common categories (mortgage, groceries, vacation) | Default category list; user trims | Pre-loaded category list | Category templates to import | ~15-20 curated items, editable in wizard |
| Auto-budget creation | Manual monthly allocation required ("assign every dollar") | Spending Plan auto-projects from past data + recurring detected | Manual each month; no auto-create | Spending Plan auto-calculates and updates | Auto-create from template on month visit; silent |
| Add expense inline vs separate | Inline per category row; no separate page | Inline transaction entry | Separate transaction entry form | Inline via Spending Plan category rows | Inline panel on budget view; Quick Add page removed |
| Dashboard focus | "To be budgeted" balance + category status | Monthly spending summary + goals | Zero-based plan + remaining | Spending Plan summary + bills calendar | Summary cards (income/expense/balance) + current month budget |
| Skippable setup | Yes (since Oct 2025 checklist) | Yes | Limited | Yes | Yes — every step skippable |
---
## Chart Design Notes (Recharts-Specific)
## Wizard Flow Design Notes
These translate research findings into concrete implementation guidance for the Recharts stack.
Based on research into YNAB, EveryDollar, and UX onboarding best practices, the recommended wizard structure is:
**Donut chart:**
- Use `innerRadius={60}` to `innerRadius={72}` for a modern ring look (not too thin)
- Place center total using `<Label>` with `content` prop inside `<Pie>` using `viewBox` cx/cy coordinates
- Use `activeShape` with `outerRadius + 10` for hover expansion
- Add `isAnimationActive` to respect `prefers-reduced-motion`
- Legend as a separate `<ul>` below the chart (not Recharts built-in legend) for full styling control
**Step 1 — Income**
- Single question: "What's your monthly take-home income?"
- Single number input + currency formatting
- Skip option: "I'll add this later"
- Sets the anchor for running balance in step 2
**Horizontal bar chart (budget vs actual by type):**
- `<BarChart layout="vertical">` with `<XAxis type="number">` and `<YAxis type="category">`
- Two `<Bar>` components — one for budgeted (muted/secondary color) and one for actual (category color)
- Set `barSize` to keep bars compact; use `barCategoryGap` for breathing room
- `<LabelList position="right">` for actual amounts visible on bar ends
- Never start X axis at a non-zero value
**Step 2 — Recurring Items**
- Pre-loaded list of common items grouped by type (bills, variable expenses, debts, savings, investments)
- Each item has a checkbox (on by default for high-likelihood items, off for lower-likelihood)
- Editable amount field per item (prefilled with static sensible default)
- Running balance updates live: "Remaining to allocate: $X"
- "Add custom item" inline for items not in the list
- Skip option: "I'll set this up manually"
**Grouped bar chart (income budget vs actual):**
- Standard `<BarChart>` with `layout="horizontal"` (default)
- Two `<Bar>` groups: budgeted (muted fill) and actual (category color)
- `<CartesianGrid vertical={false}>` to reduce visual noise
- Custom `<ChartTooltip>` showing both values with currency formatting
**Step 3 — Review**
- Summary of selected items by group
- Total income, total allocated, remaining
- "Create my template" CTA — writes to the template table
- "Go back" link to step 2
**Color system:**
- All charts must consume CSS variables from the existing OKLCH palette (`var(--color-income)`, etc.)
- Never hardcode hex values in chart components — use the `categoryColors` map from `palette.ts`
- Green/red semantic colors for over/under-budget states must be distinct from category colors
**Post-wizard:**
- Auto-create current month budget from template (immediate)
- Show toast: "Your [Month] budget has been created"
- Land on budget view for current month
**Confidence:** MEDIUM — pattern validated by YNAB (beginner template import), EveryDollar (wizard-style), and UX onboarding research. 3-step max is validated by drop-off research (complexity above 3 steps correlates with abandonment).
---
## Inline Add-From-Library Design Notes
The existing Quick Add page uses a library of one-off items (`quick_add_items` table). In v2.0, this interaction moves inline to the budget view.
**Recommended pattern (based on fintech UX research):**
- Trigger: "Add item" button in each category section header on the budget view
- Mechanism: A slide-in panel or modal sheet (not a full page navigation)
- Contents: Category pre-selected (from which section was clicked); searchable list of library items for that category type; amount field; description field
- On confirm: Item added to budget for the month, totals update immediately
- On dismiss: Panel closes, no navigation
**Why panel/sheet over modal:**
- Modals block background context; users lose their place in the budget
- A slide-in sheet (shadcn/ui Sheet component) keeps the budget visible alongside the picker
- Smashing Magazine (2026): "modals work for quick confirmations; sheets work for contextual data entry tasks"
**Why not keep the separate Quick Add page:**
- Two surfaces for the same action creates confusion (which should I use?)
- The separate page breaks the flow — user must navigate away, losing their place
- Inline keeps the budget view as the single place for monthly budget work
---
## Sources
- [Fintech design guide with patterns that build trust — Eleken (2026)](https://www.eleken.co/blog-posts/modern-fintech-design-guide)
- [Finance Dashboard Design Best Practices — F9 Finance](https://www.f9finance.com/dashboard-design-best-practices/)
- [Budget vs Actual Dashboard — Bold BI](https://www.boldbi.com/dashboard-examples/finance/budget-vs-actual-dashboard/)
- [7 Essential Financial Charts for Personal Finance Visualization — Syncfusion](https://www.syncfusion.com/blogs/post/financial-charts-visualization)
- [Fintech dashboard design — Merge Rocks](https://merge.rocks/blog/fintech-dashboard-design-or-how-to-make-data-look-pretty)
- [Dashboard Design UX Patterns Best Practices — Pencil & Paper](https://www.pencilandpaper.io/articles/ux-pattern-analysis-data-dashboards)
- [shadcn/ui Charts — Donut with center text, Bar charts](https://ui.shadcn.com/charts)
- [Bar Charts Best Practices — Nastengraph / Medium](https://nastengraph.medium.com/bar-charts-best-practices-5e81ebc7b340)
- [Best Color Palettes for Financial Dashboards — Phoenix Strategy Group](https://www.phoenixstrategy.group/blog/best-color-palettes-for-financial-dashboards)
- [The Role of Color Theory in Finance Dashboard Design — Extej / Medium](https://medium.com/@extej/the-role-of-color-theory-in-finance-dashboard-design-d2942aec9fff)
- [Skeleton loading screen design — LogRocket](https://blog.logrocket.com/ux-design/skeleton-loading-screen-design/)
- [Empty state UX examples — Eleken](https://www.eleken.co/blog-posts/empty-state-ux)
- [YNAB / Mint / Empower comparison — The State of Personal Finance Apps 2025](https://bountisphere.com/blog/personal-finance-apps-2025-review)
- [Recharts documentation — recharts.org](https://recharts.github.io/en-US/api/Bar/)
- [YNAB Beginner Template and category setup](https://www.ynab.com/templates)
- [YNAB new flexible checklist for mobile (Oct 2025)](https://www.ynab.com/whats-new)
- [YNAB vs Copilot AI comparison 2025 — ZenFinanceAI](https://zenfinanceai.com/ynab-vs-copilot-ai/)
- [Monarch Money budget creation documentation](https://help.monarch.com/hc/en-us/articles/360048883631-Creating-Your-Budget-in-Monarch)
- [Monarch vs EveryDollar comparison — BudgetCoachUSA](https://budgetcoachusa.com/monarch-vs-everydollar/)
- [Top Personal Finance Apps with Customizable Budget Categories 2026 — Quicken](https://www.quicken.com/blog/top-personal-finance-apps-with-customizable-budget-categories/)
- [Best Budget Apps 2026 — NerdWallet](https://www.nerdwallet.com/finance/learn/best-budget-apps)
- [Best Budget Apps 2026 — Engadget](https://www.engadget.com/apps/best-budgeting-apps-120036303.html)
- [How Great Budget App Design Increases User Retention — Onething Design](https://www.onething.design/post/budget-app-design)
- [UX Onboarding Best Practices 2025 — UX Design Institute](https://www.uxdesigninstitute.com/blog/ux-onboarding-best-practices-guide/)
- [Budget App Design Tips from Fintech Experts — Eleken](https://www.eleken.co/blog-posts/budget-app-design)
- [Modal vs. Separate Page: UX Decision Tree — Smashing Magazine](https://www.smashingmagazine.com/2026/03/modal-separate-page-ux-decision-tree/)
- [Actual Budget — self-hosted open source](https://actualbudget.org/)
- [App Onboarding Guide 2026 — UXCam](https://uxcam.com/blog/10-apps-with-great-user-onboarding/)
- [Fintech App Top 20 Financial UX Dos and Don'ts — UXDA](https://theuxda.com/blog/top-20-financial-ux-dos-and-donts-to-boost-customer-experience)
---
*Feature research for: SimpleFinanceDash UI overhaul — presentation layer*
*Researched: 2026-03-16*
*Feature research for: SimpleFinanceDash v2.0 — wizard setup, auto-budget creation, simplified monthly tracking UX*
*Researched: 2026-04-02*

View File

@@ -1,182 +1,202 @@
# Pitfalls Research
**Domain:** Personal finance dashboard UI overhaul (React SPA)
**Researched:** 2026-03-16
**Confidence:** HIGH (most findings verified against official docs, Recharts issues tracker, and Tailwind v4 official docs)
**Domain:** Adding wizard setup, auto-budget creation, design system rework, and page consolidation to an existing personal budget app (React + Supabase + TanStack Query)
**Researched:** 2026-04-02
**Confidence:** HIGH (based on direct codebase analysis + known patterns for wizard state, auto-creation concurrency, and design system rework in existing apps)
---
## Critical Pitfalls
### Pitfall 1: Recharts Re-renders Every Parent State Change
### Pitfall 1: Duplicate Budget Creation on Concurrent Auto-Create Calls
**What goes wrong:**
The existing `DashboardPage.tsx` computes `pieData` and `progressGroups` directly in the render body — no `useMemo`. Every unrelated state change (e.g., a tooltip hover, a loading flag flip, QuickAddPicker opening) re-runs these array transforms and causes Recharts to diff its entire virtual DOM tree. Adding two more charts (bar chart, horizontal bar) multiplies this cost by 3x. With a large budget, each O(n) filter+reduce runs six times per render for each chart type.
The v2.0 goal is "auto-create this month's budget on first visit." The current `generateFromTemplate` mutation in `useBudgets.ts` has no deduplication guard — it creates a budget row unconditionally. If the dashboard mounts, checks for a current-month budget, finds none, and fires the auto-create, there is a race: if the component re-renders (e.g., auth state settles, React Strict Mode double-invokes effects) or the user has two tabs open, two budget rows get created for the same month. Both have the same `start_date`/`end_date` and `user_id`, but different UUIDs. There is no unique constraint on `(user_id, start_date)` in the current `004_budgets.sql` migration.
**Why it happens:**
The existing single-chart dashboard is fast enough that the missing memoization is invisible. During the overhaul, three chart instances are added to the same render tree, and the dashboard becomes visually complex enough that parent re-renders happen more frequently (collapsible state toggles, hover events on multiple chart tooltips).
Auto-create logic placed in a React component or effect reacts to data absence, but TanStack Query's `enabled` flag and mutation guards don't prevent double-invocation in Strict Mode or multi-tab scenarios. The "check then create" pattern is an inherently non-atomic operation in the current client-side architecture.
**How to avoid:**
- Wrap all chart data derivations in `useMemo` with explicit deps arrays:
```tsx
const pieData = useMemo(() =>
EXPENSE_TYPES.map(type => { ... }).filter(d => d.value > 0),
[items, t]
)
```
- Wrap formatter callbacks passed to `<Tooltip formatter={...}>` in `useCallback`. New function references on every render force Recharts to re-render tooltip internals.
- Extract each chart into its own memoized sub-component (`React.memo`) so only the chart whose data changed re-renders.
- Create a category index Map once (in a hook or useMemo) and look up by key rather than `.filter()` per item across three charts.
- Add a database unique constraint: `UNIQUE (user_id, start_date)` on the `budgets` table via a new migration. This makes duplicate creation fail at the DB level rather than silently succeeding.
- In the auto-create logic, use an upsert (INSERT ... ON CONFLICT DO NOTHING) rather than a plain INSERT, so concurrent calls are idempotent.
- Use TanStack Query's mutation state to gate the auto-create: only fire if `mutation.isIdle` and no existing budget is found, never fire inside a `useEffect` without a ref guard.
- After auto-create, immediately invalidate the budgets list query so the new budget is fetched in the same round-trip.
**Warning signs:**
- React DevTools Profiler shows `DashboardContent` re-rendering on tooltip mouseover
- Multiple chart tooltips fighting each other (Recharts issues #281 / #1770)
- "ResizeObserver loop limit exceeded" console errors when multiple `ResponsiveContainer` instances mount simultaneously
- Two budget entries appear for the same month on the BudgetListPage after first visit
- `console.error` shows a Supabase `23505 unique_violation` if the constraint is added and the race is triggered
- Dashboard shows "Budget already exists" error toasts intermittently on page load
**Phase to address:** Dashboard redesign phase (charts implementation)
**Phase to address:** Auto-budget creation phase — add the DB constraint first, implement upsert-based creation second. Do not build the auto-create UI trigger before the constraint exists.
---
### Pitfall 2: CSS Variable Scope — Recharts Cannot Read Tailwind `@theme inline` Variables
### Pitfall 2: Wizard State Lost on Browser Back/Refresh — No Persistence Strategy
**What goes wrong:**
The existing `palette.ts` already uses `var(--color-income)` etc. as chart fill values. This works correctly because Tailwind v4's `@theme inline` inlines these as true CSS custom properties on `:root`. However, the risk is subtle: if any chart color is set via a Tailwind utility class string (e.g., `fill-[var(...)]`) rather than through the `style` prop or a direct CSS variable reference, Recharts SVG elements — which render outside the standard DOM paint context — may not resolve them correctly in all browsers.
Additionally, dark mode: the current CSS has no dark-mode overrides for `--color-income` through `--color-investment`. If the overhaul adds a dark mode toggle, all chart colors will remain light-mode pastel on dark backgrounds, creating very poor contrast.
A multi-step wizard (step 1: pick categories, step 2: set amounts, step 3: confirm) built with local React state (`useState`) loses all progress if the user navigates away, refreshes, or presses the browser back button. For a setup wizard that may have 35 steps and requires selecting 1020 template items with amounts, this is a critical UX failure on first run. The user loses all work and must restart from step 0.
**Why it happens:**
Tailwind v4's `@theme inline` block defines variables at `:root` scope, but the dark mode variant uses `.dark` class scoping. Theme variables defined only in `@theme inline` are not automatically duplicated under `.dark {}`. Dark-mode overrides for semantic colors (background, foreground) exist in shadcn's generated block, but category colors were custom-added without dark variants.
The natural implementation is `const [step, setStep] = useState(0)` and `const [selections, setSelections] = useState([])` inside the wizard component. React state is ephemeral — it does not survive unmount. This works fine for modals but fails for a first-run setup wizard that the user may pause mid-way.
**How to avoid:**
- Pass all Recharts color values via JavaScript (the `fill={categoryColors[type]}` pattern is correct — maintain it).
- If dark mode is added in the overhaul: add a `.dark {}` block in `index.css` that overrides `--color-income`, `--color-bill`, etc. with darker/brighter variants appropriate for dark backgrounds.
- Never attempt to pass Tailwind utility class strings as Recharts `fill` props. Recharts `Cell`, `Bar`, `Line` props require resolved color values (hex, oklch string, or `var()` reference).
- Test chart colors in both light and dark modes before marking a phase complete.
- Persist wizard state to `localStorage` keyed by user ID (e.g., `wizard_state_${userId}`) — read on mount, write on every step change, clear on completion/skip.
- Use a simple serializable state shape: `{ step: number, selections: { categoryId, amount, tier }[] }`.
- On wizard mount: check localStorage first; if partial state exists, resume from the saved step with a "Continue where you left off" prompt.
- On wizard completion or explicit skip: clear the localStorage key.
- Do NOT use URL params to store full wizard state (too much data); use URL only to track the current step number (e.g., `?setup-step=2`) for browser back/forward support.
**Warning signs:**
- Chart fills show as `oklch(...)` literal text in DOM attributes instead of resolved colors
- Colors are invisible or white-on-white on one theme variant
- Browser DevTools shows SVG `fill` as unresolved `var(--color-income)` with no computed value
- Wizard always starts at step 1 even after the user had reached step 3
- User reports losing selected categories after an accidental page reload
- No `localStorage` keys being set/read during wizard interaction
**Phase to address:** Design token / theming phase (early); dashboard charts phase (verification)
**Phase to address:** Wizard setup phase — define the persistence strategy before building any step components. The storage format must be finalized before the first step is wired.
---
### Pitfall 3: Collapsible Sections Causing Layout Shift and CLS Jank
### Pitfall 3: Design Token Rework Breaks Existing Pages Silently
**What goes wrong:**
The planned hybrid dashboard includes collapsible inline sections for each category group (income, bills, variable expenses, debt, savings). If these are implemented by toggling `display: none` / `display: block` or by animating the `height` CSS property from `0` to `auto`, the result is either: (a) instant snap with no animation, or (b) jank where the browser triggers full layout recalculations on every animation frame. With five collapsible sections and charts above them, collapsing a section causes the charts to resize (their `ResponsiveContainer` detects parent width change), triggering a cascade of resize events.
The v2.0 design system rework changes CSS variables in `index.css` (border-radius tokens from rounded to sharp, color palette from current OKLCH pastels to sharper/clearer ones, spacing adjustments). Because every existing page consumes these global tokens, any change to `--radius`, `--background`, `--foreground`, `--border`, or the six category color variables cascades to all 9 pages simultaneously. Changing `--radius` from `0.5rem` to `0px` sharps every Button, Card, Input, and Badge across the app in one line — but it also breaks charts (Recharts SVG `rx` attributes don't follow CSS variables) and any component that had visual design crafted around rounded corners.
**Why it happens:**
Animating `height` from `0` to `auto` is a known browser limitation — you cannot CSS-transition to `height: auto`. Common naive workarounds (JavaScript measuring `scrollHeight` on every frame) cause layout thrashing. Radix UI's `Collapsible` component handles this correctly via CSS custom properties for height, but requires the `data-state` attribute pattern and the correct CSS transition on the inner `CollapsibleContent` element.
The current system uses shadcn/ui's CSS variable convention which is explicitly global-scope. Every component that uses `rounded-lg` (which resolves to `var(--radius)`) will change simultaneously. Pages that were "done" in v1.0 become visually broken the moment a global token changes.
**How to avoid:**
- Use Radix UI `Collapsible` (already available via shadcn) — it sets `--radix-collapsible-content-height` as a CSS variable during open/close, enabling smooth CSS-only transition:
```css
[data-state='open'] > .collapsible-content {
animation: slideDown 200ms ease-out;
}
[data-state='closed'] > .collapsible-content {
animation: slideUp 200ms ease-out;
}
@keyframes slideDown {
from { height: 0 }
to { height: var(--radix-collapsible-content-height) }
}
```
- Add `debounce={50}` to all `ResponsiveContainer` instances to prevent rapid resize recalculations when parent containers animate.
- Use `padding` instead of `margin` inside collapsible children — margin collapsing causes jump artifacts on some browsers.
- Never animate `height`, `padding`, or `margin` directly with JavaScript setInterval; use CSS animations or Radix primitives.
- Before touching any tokens, audit which existing pages use `--radius`, `--border`, and `--background` implicitly (via Tailwind utilities like `rounded-md`, `border`, `bg-background`). This is every page.
- Change tokens in isolation with a visual regression pass on ALL 9 pages before touching any page's component code. The token change should be one commit; the per-page fixup should be separate commits.
- For the category color variables (`--color-income` through `--color-investment`), verify Recharts SVG fills still resolve after the change — these are passed as `fill={var(--color-income)}` in JS and require testing in both the browser DOM and printed output.
- Do not land the token rework mid-phase alongside page component changes — treat it as its own atomic commit.
**Warning signs:**
- Charts visually "snap" to a narrower width and back when a section above them is toggled
- Frame rate drops to under 30fps when expanding/collapsing sections (visible in DevTools Performance panel)
- `ResizeObserver loop limit exceeded` errors spike after section toggle
- Auth pages (login/register) have wrong border-radius after a `--radius` token change
- Chart SVG fills appear correct in DevTools computed styles but wrong visually on screen
- Any page that was marked "done" in v1.0 shows new visual regressions after token PR merges
**Phase to address:** Dashboard collapsible sections phase
**Phase to address:** Design system foundation phase — the first phase of v2.0. Token rework must land before any page is rebuilt. Requires an explicit visual regression check of all existing pages immediately after the token commit.
---
### Pitfall 4: Color Accessibility Failures in Financial Semantic Colors
### Pitfall 4: Quick-Add Page Removal Breaks Existing User Data and Nav References
**What goes wrong:**
The most dangerous pattern in the existing dashboard is using pure green / red to signal positive / negative balance:
```tsx
const balanceColor = availableBalance >= 0
? "text-green-600 dark:text-green-400"
: "text-red-600 dark:text-red-400"
```
And in the progress bar:
```tsx
const barColor = group.overBudget
? "bg-red-500 dark:bg-red-400"
: "bg-green-500 dark:bg-green-400"
```
The `quick_add_items` table and `QuickAddPage` exist in production. Existing users have data in this table (names, icons, sort_order). If the page is simply removed from routing and the nav (deleting `<Route path="quick-add" />` and the nav item in `AppLayout.tsx`) without a data migration or a clear deprecation path, those users:
1. Lose access to their quick-add items (no UI)
2. Have orphaned `quick_add_items` rows in the database that no longer serve any purpose
3. May hit broken bookmarks or history entries for `/quick-add`
Pure green (#00FF00) has a contrast ratio of only 1.4:1 against white — catastrophically below WCAG AA's 4.5:1 minimum for text. Even `green-600` (#16a34a) must be verified. Additionally, pie chart adjacent slice colors must maintain 3:1 contrast against each other (WCAG 2.1 SC 1.4.11 Non-text Contrast) — the existing six category colors are all similar lightness (OKLCH L ≈ 0.650.72), meaning they may be hard to distinguish for colorblind users or when printed.
The new v2.0 model replaces quick-add with "add one-offs from category library directly in budget detail." This is a different data shape — category library items are categories, not quick_add_items. If a user had quick-add items that conceptually map to categories, that mapping is lost.
**Why it happens:**
Designers focus on making the palette "look rich" during an overhaul without running contrast checks. The redesign goal is "rich, colorful visual style" — this is a direct risk factor for accessibility regressions. Color-alone encoding (green = good, red = bad) violates WCAG 1.4.1 Use of Color, which requires that color not be the sole means of conveying information.
Page removal feels like a simple delete-the-route operation. The data persistence and existing user considerations are invisible during development because the developer's test account may have no quick-add data.
**How to avoid:**
- Run every text color against its background through a WCAG contrast checker (target 4.5:1 for normal text, 3:1 for large text and UI components). Use the Tailwind oklch values — compute with tools like https://webaim.org/resources/contrastchecker/
- For semantic colors (balance positive/negative, over-budget): supplement color with an icon or text label, not color alone. Example: a checkmark icon + green for positive balance; an exclamation icon + red for over-budget.
- For pie/donut chart slices: ensure adjacent colors have at least 3:1 contrast, or add a visible stroke separator (1px white/black stroke between slices provides a natural contrast boundary).
- For the 6 category colors: vary hue and lightness, not just hue. Consider making the OKLCH lightness values more spread (e.g., 0.55 to 0.80 range) so colors are distinguishable at reduced color sensitivity.
- Do not rely on `dark:text-green-400` having passed contrast automatically — verify each dark mode color pair independently.
- Audit: Does any existing user data in `quick_add_items` map to something meaningful in the new model? If quick-add items are just named shortcuts and the new model uses categories instead, the migration path is: surface existing quick-add items in the new "category library" flow, or clearly communicate to users that this data is being retired.
- For the route: add a redirect `<Route path="quick-add" element={<Navigate to="/budgets" replace />} />` rather than leaving `/quick-add` as a 404. This handles bookmarks and history.
- Remove the nav link in `AppLayout.tsx` at the same time as the redirect is added — never before.
- Add a DB migration only if you decide to drop or repurpose the `quick_add_items` table. If keeping the table dormant, document why. If dropping it, confirm no FK references exist (none in the current schema — `budget_items` does not reference `quick_add_items`).
**Warning signs:**
- All six category pie slices are clearly distinguishable to the developer but indistinguishable when the browser's "Emulate vision deficiency" filter is applied in DevTools
- Running `window.getComputedStyle` on a colored element and checking its OKLCH L value — if multiple semantic colors cluster at the same lightness, colorblind users see identical grays
- Developer tests removal on a fresh account with no quick-add data, misses the issue
- Browser history entries for `/quick-add` result in a blank or redirect-looping page
- `useQuickAdd` hook is still imported somewhere but the page is gone, causing a dead import
**Phase to address:** Design token / visual language phase (establish accessible palette before building components); then verify in each component phase
**Phase to address:** Page consolidation phase (when BudgetDetailPage gets inline add-from-library). Remove the page only after the replacement flow is functional and tested with existing user data.
---
### Pitfall 5: i18n Key Regressions When Renaming or Adding UI Sections
### Pitfall 5: Auto-Budget Creation Ignores User Currency Setting
**What goes wrong:**
The current translation files (`en.json`, `de.json`) have flat keys per page section. The overhaul adds new dashboard sections (bar chart, horizontal bar chart, collapsible income/bill/expense groups, richer donut legend). Each new label, section header, tooltip, and ARIA label needs a corresponding key in both files. During rapid UI iteration, developers commonly add `t("dashboard.incomeSection")` to the JSX, forget to add it to `de.json`, and only notice when the German locale shows the raw key string — or worse, the i18next fallback silently shows the English value and the German regression goes undetected.
The current `generateFromTemplate` mutation in `useBudgets.ts` accepts `currency?: string` with a default of `"EUR"`. If the auto-create logic fires without reading the user's profile `currency` field first, every auto-created budget will be denominated in EUR regardless of the user's settings. A user who has set their currency to USD or GBP in Settings will get EUR-denominated budgets. The `formatCurrency` calls will then display amounts in the wrong currency until the user manually edits the budget.
**Why it happens:**
`i18next` with `fallbackLng: 'en'` (the existing config) silently falls back to English when a German key is missing. There is no visible failure. The project has no i18n linting step and no build-time key extraction check. The `debug: false` production config makes this invisible.
The auto-create is triggered by checking if a budget exists for the current month and calling `generateFromTemplate({ month, year })` — the `currency` parameter is optional and defaults silently. During development on a EUR-default account, this works fine and the bug is invisible.
**How to avoid:**
- When adding a new UI section, add its keys to **both** `en.json` and `de.json` in the same commit — never split across commits.
- Use `i18next-cli` or `i18next-scanner` (npm package) to extract all `t("...")` call keys from source and diff against the JSON files. Run this as a pre-commit check or part of the build.
- In development, consider setting `debug: true` in `i18n.ts` — i18next logs `missingKey` warnings to console for every untranslated key in the non-fallback language.
- Use a TypeScript-typed i18n setup (e.g., `i18next-typescript`) so that `t("dashboard.nonExistentKey")` produces a type error at compile time.
- Before marking any phase complete, manually switch locale to German and click through every changed screen.
- The auto-create trigger must first load the user's profile (from the `profiles` table, `currency` column) and pass that value explicitly: `generateFromTemplate({ month, year, currency: profile.currency })`.
- The `useProfile` or `useAuth` hook should be resolved before the auto-create mutation fires. Use TanStack Query's `enabled` flag to chain the dependency: only auto-create when both the budgets list AND the profile are loaded.
- Add an assertion in the mutation: if `currency` is undefined, throw rather than silently default.
**Warning signs:**
- German UI text contains raw dot-notation strings (e.g., `dashboard.barChart.title`)
- `console.warn` messages containing `i18next::translator: missingKey de`
- `de.json` has fewer top-level keys than `en.json` after a phase's changes
- Auto-created budgets always show EUR symbol even when user has set USD in Settings
- The profile `currency` is not read anywhere in the auto-create code path
- Test passes for EUR users only; USD/GBP users never tested
**Phase to address:** Every phase that adds new UI text; establish the key-parity check process in the first phase of the overhaul
**Phase to address:** Auto-budget creation phase — the profile dependency must be resolved as part of the auto-create implementation, not as a follow-up fix.
---
### Pitfall 6: Design Inconsistency Across Page Refreshes (The "Island Redesign" Problem)
### Pitfall 6: Wizard Creates Categories and Template Items Without Idempotency — Re-run Corrupts Data
**What goes wrong:**
The overhaul covers all pages, but if phases are structured page-by-page, early pages get the richest design attention and later pages get inconsistency or fatigue-driven shortcuts. The most common failure mode: the dashboard uses a specific card style (colored header accent, icon in corner), but the Categories page — redesigned two weeks later — uses a subtly different card variant. Buttons on the Budget Detail page use different spacing than on the Template page. The result is a design that looks cohesive in screenshots of individual pages but feels broken when navigating between them.
The setup wizard pre-fills common items (rent, groceries, car insurance, etc.) and on completion creates: (a) category rows in `categories`, (b) template_items in `template_items`. If the user runs the wizard, quits mid-way, then re-runs it, or if the wizard's "complete" step fires twice due to a network retry, duplicate categories and template items are created. The `categories` table has no unique constraint on `(user_id, name)`. The user ends up with "Rent" appearing twice as a category and twice as a template item.
**Why it happens:**
There is no design system enforced at the component level. shadcn/ui components are used directly in pages without project-specific wrappers. When the overhaul introduces new visual patterns (e.g., a colored icon badge, a section divider style), they are implemented inline in the first page that needs them and then drift in subsequent pages as developers make minor "feels close enough" adaptations.
Wizard completion is typically a single "save all" mutation. If the user navigates back to step 1 and completes again, or if a network error causes a retry, the entire creation sequence runs again. Category creation has no deduplication.
**How to avoid:**
- Before redesigning any pages, establish a small shared component library of new visual primitives (e.g., `<SectionHeader>`, `<StatCard>`, `<CategoryBadge>`) with fixed prop interfaces. All page redesigns consume these components — they never re-implement them inline.
- Define the full color palette and spacing scale in the first phase, not incrementally. The `index.css` `@theme` block is the single source of truth — no hardcoded hex values anywhere else.
- Create a visual spec (even a quick screenshot grid) of what each page will look like before coding begins, so inconsistencies are caught at design time not code review time.
- In code review: any new Tailwind classes that don't use design tokens (e.g., `text-[#6b21a8]`, `p-[13px]`) should be flagged as violations.
- Add a database unique constraint on `categories (user_id, name)` (or at minimum check for existence before insert). Use upsert for category creation in the wizard flow.
- Gate the wizard's final "create" step behind a `isFirstRun` flag stored in the user's `profiles` table (e.g., a `setup_completed` boolean). Once `true`, the wizard's create mutation is a no-op.
- Use a two-phase completion approach: "Preview what will be created" → "Confirm" — this prevents accidental double-submission.
- If using localStorage for wizard state, clear it atomically when the server-side creation succeeds, not before.
**Warning signs:**
- Two pages use different visual patterns for "section with a list of items" (one uses a table, one uses cards)
- Color values appear as raw hex or oklch literals in component files instead of semantic tokens
- shadcn Card component is used in 3 different ways across 3 pages (no wrapper abstraction)
- Running the wizard twice results in duplicated category rows in the Categories page
- Template page shows duplicate items with identical names
- A Supabase unique constraint error on `categories` fires if the constraint is added after the wizard is built
**Phase to address:** Design foundation phase (first phase of overhaul) before any page work begins
**Phase to address:** Wizard setup phase — idempotency requirements must be specified as acceptance criteria before any wizard mutation code is written.
---
### Pitfall 7: CSS Variable Scope Rework Breaks Recharts SVG Fill Resolution
**What goes wrong:**
v1.0 established that category colors are passed to Recharts as CSS variable references resolved in JavaScript (`var(--color-income)` etc. via `categoryColors` in `palette.ts`). If the v2.0 design token rework renames these variables (e.g., from `--color-income` to `--category-income`, or changes the OKLCH values such that the Recharts SVG `fill` attributes show visually different colors than intended), charts break silently — the SVG renders but fills are wrong.
Additionally, Recharts SVG elements operate outside the standard CSS cascade for some browsers. If OKLCH values are changed to be very light (high L) in pursuit of "clearer pastels," SVG fills may become nearly invisible on white chart backgrounds because SVG doesn't inherit `background` opacity in the same way HTML elements do.
**Why it happens:**
Design token rework focuses on HTML components and Tailwind utility class output. Recharts SVG fills are wired through `palette.ts` as literal CSS variable strings — not Tailwind classes — so they are easy to miss in a token audit.
**How to avoid:**
- After any `index.css` token change, explicitly open the dashboard and inspect all three charts (donut, bar, horizontal bar) to verify fill colors match intention.
- Keep `palette.ts` as the single source of truth for chart colors — do not duplicate color definitions in component files.
- If renaming CSS variable names (not just changing values), grep the entire codebase for the old variable name before deleting it.
- Test chart fill visibility against the new `--background` value — lighter backgrounds require slightly more saturated or darker chart fills to maintain visibility.
**Warning signs:**
- Chart fills appear white or very faint after a design token change
- `palette.ts` still references `--color-income` after a rename to `--category-income`
- Charts look correct in Storybook/isolation but wrong on the actual dashboard
**Phase to address:** Design system foundation phase (when tokens change) AND dashboard phase (verification).
---
### Pitfall 8: "Template Empty" Edge Case Breaks Auto-Budget and New-User Wizard
**What goes wrong:**
The auto-budget creation flow depends on the template having items. The current `generateFromTemplate` code handles an empty template gracefully — it creates an empty budget. But the v2.0 UX intent is that visiting the dashboard for the first time should show a useful budget, not an empty one. If the wizard is bypassed (user skips setup), or if wizard completion fails silently, the auto-created budget has zero items, and the dashboard shows nothing meaningful.
A second edge case: a user who completed v1.0 setup manually (has categories + template items) visits v2.0 for the first time. The wizard should not re-run — but if the "has template items" check is the gate, and they had template items before, the wizard is skipped, and the auto-create fires correctly. If that check is wrong (e.g., checking `template.name === "My Monthly Template"` instead of `template_items.length > 0`), existing users get redirected into the wizard.
**Why it happens:**
The first-run detection logic is complex: it must distinguish between (a) brand new user with no data, (b) existing user who set up manually in v1.0, (c) user who started wizard but didn't finish, (d) user who completed wizard. Each case needs different behavior and the logic branches are easy to conflate.
**How to avoid:**
- Define the first-run gate explicitly using the `profiles.setup_completed` boolean (recommended in Pitfall 6) — this is the single authoritative signal, not inferred from data shape.
- For existing v1.0 users: write a migration or a one-time check that sets `setup_completed = true` for any user who already has template items. This prevents the wizard from showing for users who have already configured their template.
- Test all four user cases explicitly before shipping the wizard.
**Warning signs:**
- Existing users (who set up in v1.0) see the setup wizard on their next login
- New users who skip the wizard get a blank dashboard with no explanation
- The `setup_completed` flag is never set to `true` for existing users via migration
**Phase to address:** Wizard setup phase — the first-run gate and existing-user migration must be defined as part of the wizard's acceptance criteria, not as an afterthought.
---
@@ -184,12 +204,13 @@ There is no design system enforced at the component level. shadcn/ui components
| Shortcut | Immediate Benefit | Long-term Cost | When Acceptable |
|----------|-------------------|----------------|-----------------|
| Inline chart data transforms in render | Faster to write | Re-renders on every state change; adding more charts multiplies the cost | Never — always `useMemo` for chart data |
| Hardcoded color classes `text-green-600` for semantic states | Familiar Tailwind pattern | Dark mode variants need to be manually maintained in two places; fails contrast checks | Only for truly non-semantic colors (e.g., a green checkmark icon that is always green) |
| Copying shadcn component patterns across pages without abstraction | Faster per-page development | Design drift guarantees inconsistency; changes to shared patterns require hunting all usages | MVP only, with explicit note to abstract before more pages are built |
| Adding English i18n keys without German equivalent | Unblocks development | Silent regression in German locale; accumulates debt that is hard to audit later | Never in this project — add both languages in the same commit |
| Using `ResponsiveContainer` without `debounce` | Default behavior, no extra code | Multiple containers trigger simultaneous resize cascades when sections open/close | Acceptable for single-chart pages; set `debounce={50}` on all multi-chart layouts |
| Implementing collapsible with `display: none` toggle | Simplest implementation | No animation; abrupt layout shift; screen readers cannot detect intermediate states | Never for primary dashboard sections; acceptable for debug/dev-only UI |
| No `UNIQUE (user_id, start_date)` constraint on `budgets` — skip the migration | Saves one migration | Duplicate budgets on concurrent auto-create; data corruption that is painful to clean | Never — add the constraint before any auto-create code ships |
| Auto-create logic in a `useEffect` | Familiar React pattern | Double-invocation in Strict Mode, fires on re-render, race conditions | Never for write operations; use TanStack Query `useQuery` with `initialData` or a mutation gated on query result |
| Wizard state in component `useState` only | Simplest to write | Lost on refresh; user frustration on first run | Only for wizards that complete in under 30 seconds and have no network steps |
| Skipping the `profiles.setup_completed` flag and inferring first-run from data shape | No migration needed | Complex conditional logic; wrong inference for edge-case users; breaks if data shape changes | Never — explicit flag is always more reliable than inferred state |
| Removing `/quick-add` route without a redirect | One less route to maintain | Broken bookmarks, broken history, 404 for any hardcoded link | Never — always add a redirect when removing a route |
| CSS token rework and page component rework in the same PR | Ships faster | Impossible to attribute regressions; review is overwhelming; rollback is all-or-nothing | Never for design-system-wide token changes — tokens must land as their own commit |
| Using the `quick_add_items` table schema for the new category library | Reuses existing table and hooks | Conflates two different concepts; data model becomes unclear; future features referencing categories become harder | Only if category library is purely a UI concern with no persistence — but it needs persistence, so use categories table |
---
@@ -197,11 +218,13 @@ There is no design system enforced at the component level. shadcn/ui components
| Integration | Common Mistake | Correct Approach |
|-------------|----------------|------------------|
| Recharts + Tailwind CSS variables | Passing Tailwind utility strings (e.g., `"text-blue-500"`) as chart `fill` or `stroke` props | Pass `var(--color-income)` or a resolved hex/oklch string via JS. Recharts SVG does not process Tailwind class strings. |
| Recharts + `ResponsiveContainer` | Placing `ResponsiveContainer` inside a flex/grid parent without an explicit height | The container measures `0px` height. Always wrap in a `<div style={{ height: 240 }}>` or give the parent an explicit height class. |
| shadcn `Collapsible` + Recharts | Placing charts inside collapsible sections without `debounce` | When the collapsible opens, the chart container resizes and triggers `ResizeObserver` rapidly. Add `debounce={50}` to `ResponsiveContainer`. |
| Tailwind v4 `@theme inline` + dark mode | Defining category colors only in `@theme inline` without a `.dark {}` override block | Category colors remain light-mode pastels on dark backgrounds. Define dark variants in a `.dark {}` block in `index.css`. |
| i18next + new UI sections | Adding `t("new.key")` JSX without adding the key to `de.json` | Silently falls back to English in German locale. Always update both files simultaneously. |
| Supabase + auto-create budget | Plain INSERT in a client-side effect, no deduplication | Use INSERT ... ON CONFLICT DO NOTHING with a unique constraint on `(user_id, start_date)` |
| TanStack Query + auto-create mutation | Firing mutation inside `useEffect` with data dependency | Use `useQuery` to check existence, then fire mutation via user action or a stable effect with ref guard |
| localStorage + wizard state | Storing state without user-scoping — one user's wizard state leaks to another on shared device | Key all localStorage entries with `${userId}` prefix |
| Supabase RLS + category library pre-population | Inserting pre-filled categories from client-side wizard without user_id | `user_id` must be set to `auth.uid()` on all inserts; Supabase RLS policy will reject rows with wrong user_id |
| Recharts + new design tokens | Assuming token rename in `index.css` auto-updates SVG fill values | `palette.ts` references CSS variable names explicitly — any rename requires updating `palette.ts` too |
| React Router + wizard steps | Using browser back button to go "back" in wizard while step is tracked only in state | Use URL search params (`?step=2`) so browser back/forward navigate wizard steps correctly |
| TanStack Query + profile currency dependency | Auto-create fires before profile query resolves; uses default currency | Use `enabled: profileLoaded && budgetMissing` to chain query dependencies |
---
@@ -209,11 +232,20 @@ There is no design system enforced at the component level. shadcn/ui components
| Trap | Symptoms | Prevention | When It Breaks |
|------|----------|------------|----------------|
| Unmemoized chart data on a multi-chart dashboard | Tooltip hover causes all three charts to re-render simultaneously; visible lag | `useMemo` for all data transforms, `useCallback` for formatter props, `React.memo` on chart sub-components | Noticeable with 50+ budget items; subtle with 1020 |
| O(n) category lookup per budget item across 3 charts | CPU spike when dashboard loads; slow initial paint | Build a `Map<id, Category>` once in the hook layer, O(1) lookup in components | Becomes visible at ~100 budget items |
| Multiple `ResponsiveContainer` without `debounce` | Rapid resize loop on section toggle; "ResizeObserver loop" errors | Add `debounce={50}` to all `ResponsiveContainer` instances on the dashboard | Any time two or more containers are mounted simultaneously |
| Animating collapsible height with JavaScript | Dropped frames during expand/collapse; chart reflow cascade | Use Radix `Collapsible` with CSS `@keyframes` on `--radix-collapsible-content-height` | Every interaction on the dashboard |
| TanStack Query unbounded cache growth | Long browser session consumes excessive memory | Set `gcTime` and `staleTime` on QueryClient config | After ~30 minutes of active use without page reload |
| Wizard pre-populates 20+ categories in one bulk insert without optimistic UI | Wizard "complete" step hangs for 23 seconds; no feedback to user | Show a loading state immediately; use `mutate` with `onMutate` for optimistic feedback | Every user on wizard completion |
| Auto-create budget fires on every dashboard mount during loading state | Multiple budget rows created; duplicate toasts; TanStack Query cache stale | Gate auto-create on `budgets.isSuccess` (not `isLoading`), and use a ref to prevent repeat fires | Any fast page navigation that remounts the dashboard |
| Category library rendered as a flat list with 50+ items and no virtualization | Picker feels slow and sluggish when inline in BudgetDetailPage | Virtualize the list with TanStack Virtual or paginate by category type | Not an issue at 10 items; noticeable at 30+; problematic at 50+ |
| Re-fetching template items on every wizard step navigation | Network calls on every back/forward in wizard; slow perceived performance | Cache template items in TanStack Query with a long `staleTime`; prefetch on wizard mount | Noticeable on slow connections even with 5 template items |
---
## Security Mistakes
| Mistake | Risk | Prevention |
|---------|------|------------|
| Wizard inserts categories without user_id from auth.uid() | Categories created with wrong or null user_id bypass RLS or are inaccessible | Always derive user_id from `supabase.auth.getUser()` inside the mutation; never pass it from client state |
| Setup wizard marks `setup_completed = true` client-side before DB write succeeds | User appears "set up" but has no data if the write fails; auto-create never triggers again | Mark `setup_completed = true` only in the mutation's `onSuccess` callback |
| Exposing wizard pre-fill library (category names + amounts) as a static client bundle | Not a critical risk for personal finance app, but hardcoded amounts (e.g., "Groceries: $500") are visible in source | Acceptable for this use case; note it is not PII |
---
@@ -221,25 +253,27 @@ There is no design system enforced at the component level. shadcn/ui components
| Pitfall | User Impact | Better Approach |
|---------|-------------|-----------------|
| Color as the only signal for budget overrun (red progress bar) | Colorblind users cannot distinguish over-budget from on-track | Add an icon (exclamation mark) or text indicator alongside the color change |
| Hiding line items behind collapsible sections with no affordance | Users don't discover that sections are expandable; they think the dashboard is incomplete | Use an explicit chevron icon with visible state change; consider first-time-open hint |
| Chart tooltips showing raw numbers without currency formatting | Users see "1234.5" instead of "$1,234.50" — especially jarring in a financial app | Always pass `formatCurrency(value, currency)` in the Recharts `formatter` prop |
| Summary cards showing totals without context (no comparison to last month or budget) | Numbers without context are harder to interpret; users don't know if $1,200 expenses is good or bad | Show budget vs actual delta or a "vs budget" sub-label on cards |
| Five-section collapsible dashboard that defaults to all-collapsed | Users land on a nearly empty dashboard and are confused | Default the primary sections (income, bills) to open on first load |
| Progress bar clamped to 100% without showing actual overage amount | Users cannot see how much they are over budget from the bar alone | Show the actual percentage (e.g., "132%") in the label even when the bar is clamped |
| Wizard with "skip" that results in empty dashboard | User skips setup, sees blank dashboard, doesn't know why nothing is there | If user skips, show a non-empty empty state with a clear "Set up your template" CTA |
| Auto-created budget with no items (empty template) silently creates an empty budget | Dashboard appears to "work" but shows zeros; user confused why their categories aren't there | Check if template has items before auto-creating; if not, show a "complete your template setup" prompt |
| Removing quick-add nav item without explanation | Users who relied on quick-add can't find the feature; assume it's broken | Add a deprecation note or in-app transition message ("Quick-add is now available inline in your budget") |
| Wizard "back" button erases selections made in the later step | User goes back to change one thing and loses all subsequent work | Wizard back/forward must preserve all step state, not reset forward steps |
| Auto-created budget uses wrong month if user's timezone differs from server | User visiting on Dec 31 in UTC+11 gets a January budget auto-created | Derive month from the client's local timezone, not the server's |
| Category library in BudgetDetailPage shows all categories including types that contradict the budget context | Income categories shown when adding a one-off expense item; confusing | Filter the inline picker by relevant category types for the context (expense-only for one-off adds) |
---
## "Looks Done But Isn't" Checklist
- [ ] **Charts:** Verify all three chart types (donut, bar, horizontal bar) render correctly when `items` is empty — Recharts renders a blank SVG that can overlap other content if dimensions are not handled
- [ ] **Dark mode:** Switch to dark theme (if implemented) and verify all category colors, chart fills, and semantic state colors (green/red) have sufficient contrast — light-mode testing only is the most common gap
- [ ] **German locale:** Navigate every redesigned page in German and verify no raw key strings appear — `de.json` parity check
- [ ] **Collapsible sections:** Toggle each collapsible section open and closed rapidly three times — verify no layout shift in charts above/below, no "ResizeObserver loop" errors in console
- [ ] **Empty states:** Load the dashboard with a budget that has zero actual amounts — verify charts handle `pieData.length === 0` and empty bar data without rendering broken empty SVGs
- [ ] **Long category names:** Enter a category named "Wiederkehrende monatliche Haushaltsausgaben" (long German string) — verify it doesn't overflow card boundaries or truncate without tooltip
- [ ] **Currency formatting:** Verify EUR formatting (€1.234,56) and USD formatting ($1,234.56) both display correctly in chart tooltips and summary cards when locale is switched in Settings
- [ ] **Responsive at 1024px:** View the dashboard at exactly 1024px viewport width — the breakpoint where desktop layout switches — verify no horizontal overflow or chart sizing issues
- [ ] **Auto-create:** Verify that visiting the dashboard twice in quick succession (e.g., double-clicking the nav link) creates exactly one budget, not two — check the budgets list after each scenario
- [ ] **Auto-create currency:** Create a test account with currency set to USD in Settings, then visit the dashboard — verify the auto-created budget shows USD, not EUR
- [ ] **Wizard re-run:** Complete the wizard on a fresh account, then manually navigate back to the wizard URL — verify it does not create duplicate categories
- [ ] **Existing user path:** Log in with an account that has v1.0 template items configured — verify the wizard does NOT appear, the existing template is preserved, and a budget is auto-created correctly
- [ ] **Wizard refresh:** Start the wizard, reach step 3, refresh the browser — verify state is restored from localStorage and the wizard resumes at step 3
- [ ] **Quick-add redirect:** Navigate directly to `/quick-add` after the page is removed — verify a redirect to `/budgets` (or equivalent) occurs, not a blank page or 404
- [ ] **Empty template budget:** Remove all items from the template, then navigate to the dashboard — verify no crash, a meaningful empty state is shown, and no empty budget is silently created
- [ ] **Token rework regression:** After changing `--radius` or category color tokens, navigate through all 9 pages (dashboard, categories, template, budget list, budget detail, settings, login, register, and any wizard page) — verify no visual regressions
- [ ] **German locale wizard:** Complete the entire wizard flow in German locale — verify no raw translation keys appear and all pre-filled item names are localized
- [ ] **Design consistency:** Navigate between the newly redesigned pages and the pages not yet touched in the current phase — verify no jarring visual inconsistencies at page transitions
---
@@ -247,12 +281,12 @@ There is no design system enforced at the component level. shadcn/ui components
| Pitfall | Recovery Cost | Recovery Steps |
|---------|---------------|----------------|
| Chart re-render performance discovered in production | LOW | Add `useMemo` wrappers to chart data transforms; wrap chart components in `React.memo`; requires no visual changes |
| Color accessibility failures discovered post-launch | MEDIUM | Audit all semantic color uses with WCAG checker; update `index.css` CSS variable values; may require minor component changes for icon-supplement approach |
| i18n key regressions across multiple pages | MEDIUM | Run `i18next-scanner` to enumerate all missing German keys; systematically add translations; no code changes needed |
| Design inconsistency across pages after all pages are shipped | HIGH | Requires extracting shared component abstractions retroactively and refactoring all pages — avoid by establishing components in first phase |
| `height: 0 → auto` collapsible causing jank discovered mid-phase | LOW | Replace toggle logic with Radix `Collapsible` and add CSS keyframe animation — isolated to the collapsible component, no broader refactor needed |
| `ResponsiveContainer` ResizeObserver loop in multi-chart layout | LOW | Add `debounce={50}` prop to each `ResponsiveContainer` — one-line fix per chart instance |
| Duplicate budgets from concurrent auto-create | MEDIUM | Write a cleanup query to find duplicate `(user_id, start_date)` pairs and delete the empty duplicates; add the unique constraint; patch the auto-create to use upsert |
| Wizard created duplicate categories | MEDIUM | Deduplicate categories by `(user_id, name)` — merge any budget_items or template_items pointing to the duplicate, then delete the duplicate category rows |
| `setup_completed` flag never set for v1.0 users — wizard shows on login | LOW | Write a Supabase migration that sets `setup_completed = true` for any user with `template_items.count > 0`; deploy before releasing v2.0 |
| Token rework broke 3 pages discovered post-merge | MEDIUM | Revert the token commit if pages are too broken to patch quickly, or fix page-by-page with a visual regression pass; establish page-level snapshot tests |
| Quick-add route removed without redirect — users hitting 404 | LOW | Add `<Route path="quick-add" element={<Navigate to="/budgets" replace />} />` — one-line fix; deploy immediately |
| Auto-budget uses wrong currency for existing users | LOW | Add a one-time correction query: update budgets created since v2.0 launch that have EUR currency to the user's profile currency where they differ; patch the auto-create to read profile currency |
---
@@ -260,36 +294,28 @@ There is no design system enforced at the component level. shadcn/ui components
| Pitfall | Prevention Phase | Verification |
|---------|------------------|--------------|
| Recharts re-render on every parent state change | Dashboard charts phase — add memoization before wiring data | React DevTools Profiler: chart sub-components should not appear in flame graph on tooltip hover |
| CSS variable scope / dark mode chart color gaps | Design tokens phase (first) | Inspect SVG `fill` in DevTools; toggle dark mode and visually verify all chart colors resolve |
| Collapsible layout shift and ResizeObserver cascade | Dashboard collapsible sections phase | Toggle all sections rapidly; check console for ResizeObserver errors; check DevTools Performance for layout thrash |
| Color accessibility failures | Design tokens phase — define accessible palette upfront | Run each color pair through WCAG contrast checker; use DevTools "Emulate vision deficiency" filter |
| i18n key regressions | Every phase — enforce dual-language commit rule from the start | Run `i18next-scanner` before marking any phase complete; switch to German locale and navigate all changed pages |
| Design inconsistency across page refreshes | Design foundation phase — create shared components before any page work | Code review: flag any Tailwind color/spacing classes that are not semantic tokens; check that all pages use shared `<SectionHeader>` / `<StatCard>` etc. |
| Duplicate budget creation on concurrent auto-create | Auto-budget creation phase — add DB unique constraint before any auto-create code | Verify `(user_id, start_date)` unique constraint exists in migration; test double-navigation scenario |
| Wizard state lost on refresh | Wizard setup phase — define localStorage persistence strategy in design | Refresh browser at step 3; verify wizard resumes at step 3 |
| Design token rework breaks existing pages | Design system foundation phase — token commit is isolated and followed by full-app visual pass | All 9 pages visually checked after every token change |
| Quick-add removal breaks nav/bookmarks | Page consolidation phase — redirect added in same commit as route removal | Navigate to `/quick-add` directly; verify redirect |
| Auto-budget ignores user currency | Auto-budget creation phase — profile dependency in auto-create spec | Test with USD-configured account; verify budget currency |
| Wizard creates duplicate categories on re-run | Wizard setup phase — idempotency specified as acceptance criteria | Run wizard twice; verify no duplicates in Categories page |
| CSS variable rename breaks Recharts fills | Design system foundation phase — grep for all variable references before rename | Open dashboard after any token rename; inspect all chart fills |
| Empty template edge case shows empty dashboard | Auto-budget + wizard phases — explicit first-run gate with `setup_completed` | Test "skip wizard" path; verify empty state shown, not silent empty budget |
| First-run gate triggers for existing v1.0 users | Wizard setup phase — migration to set `setup_completed` for users with existing template items | Log in with a v1.0 account; verify wizard is skipped |
---
## Sources
- [Recharts performance guide (official)](https://recharts.github.io/en-US/guide/performance/)
- [Recharts deep-compare issue #281](https://github.com/recharts/recharts/issues/281)
- [Recharts ResizeObserver loop issue #1770](https://github.com/recharts/recharts/issues/1770)
- [Recharts ResponsiveContainer API](https://recharts.github.io/en-US/api/ResponsiveContainer/)
- [Improving Recharts performance (Belchior)](https://belchior.hashnode.dev/improving-recharts-performance-clp5w295y000b0ajq8hu6cnmm)
- [Tailwind v4 dark mode docs](https://tailwindcss.com/docs/dark-mode)
- [shadcn/ui Tailwind v4 guide](https://ui.shadcn.com/docs/tailwind-v4)
- [Tailwind v4 migration breaking changes discussion](https://github.com/tailwindlabs/tailwindcss/discussions/16517)
- [shadcn theming with Tailwind v4 and CSS variables (Goins)](https://medium.com/@joseph.goins/theming-shadcn-with-tailwind-v4-and-css-variables-d602f6b3c258)
- [WCAG 2.1 SC 1.4.11 Non-text Contrast](https://www.w3.org/WAI/WCAG21/Understanding/non-text-contrast.html)
- [WCAG SC 1.4.3 Contrast Minimum](https://www.w3.org/WAI/WCAG21/Understanding/contrast-minimum.html)
- [WebAIM contrast checker](https://webaim.org/resources/contrastchecker/)
- [Radix UI Collapsible primitive](https://www.radix-ui.com/primitives/docs/components/collapsible)
- [i18next missing key detection discussion](https://github.com/i18next/i18next/discussions/2088)
- [Fintech dashboard design (Merge Rocks)](https://merge.rocks/blog/fintech-dashboard-design-or-how-to-make-data-look-pretty)
- [Dashboard UX design principles (Smashing Magazine)](https://www.smashingmagazine.com/2025/09/ux-strategies-real-time-dashboards/)
- Existing codebase analysis: `src/pages/DashboardPage.tsx`, `src/lib/palette.ts`, `src/index.css`, `.planning/codebase/CONCERNS.md`
- Direct codebase analysis: `src/hooks/useBudgets.ts` (generateFromTemplate), `src/hooks/useTemplate.ts` (getOrCreateTemplate), `supabase/migrations/004_budgets.sql`, `supabase/migrations/005_quick_add.sql`, `src/lib/types.ts`, `src/App.tsx`, `src/components/AppLayout.tsx`
- TanStack Query mutation patterns: known double-invocation behavior in React 18 Strict Mode (`useEffect` firing twice)
- Supabase upsert documentation: INSERT ... ON CONFLICT DO NOTHING / DO UPDATE pattern
- React Router v6 redirect patterns for deprecated routes
- localStorage-based wizard state persistence: common pattern in onboarding flow implementations
- PostgreSQL unique constraint behavior on concurrent inserts
---
*Pitfalls research for: SimpleFinanceDash UI overhaul (React + Recharts + Tailwind v4 + shadcn/ui)*
*Researched: 2026-03-16*
*Pitfalls research for: SimpleFinanceDash v2.0 — wizard setup, auto-budget creation, design system rework, page consolidation*
*Researched: 2026-04-02*

View File

@@ -1,234 +1,277 @@
# Stack Research
**Domain:** Personal finance dashboard UI overhaul — React SPA
**Researched:** 2026-03-16
**Domain:** Personal finance dashboard — v2.0 wizard setup, auto-budget creation, sharp pastel design system
**Researched:** 2026-04-02
**Confidence:** HIGH
---
## Context: What Already Exists
## Context: What Already Exists (Do Not Re-Research)
This is a subsequent-milestone research document. The stack is **locked**. The project uses:
Actual installed versions from `package.json` (not the prior research document, which had aspirational versions):
| Package | Installed Version | Status |
|---------|------------------|--------|
| React | 19.2.4 | Locked |
| Vite | 8.0.0 | Locked |
| Package | Actual Installed Version | Notes |
|---------|-------------------------|-------|
| React | ^19.2.4 | Locked |
| Vite | ^8.0.0 | Locked |
| TypeScript | ~5.9.3 | Locked |
| Tailwind CSS | 4.2.1 | Locked |
| Recharts | **3.8.0** | Locked — already on latest |
| Radix UI (via `radix-ui`) | 1.4.3 | Locked |
| Lucide React | 0.577.0 | Locked |
| next-themes | 0.4.6 | Locked |
| TanStack Query | 5.90.21 | Locked |
| Tailwind CSS | ^4.2.1 | Locked |
| Recharts | **2.15.4** | Locked — NOT 3.x (prior research was wrong) |
| radix-ui | ^1.4.3 | Unified post-June 2025 package |
| lucide-react | ^0.577.0 | Locked |
| next-themes | ^0.4.6 | Locked |
| TanStack Query | ^5.90.21 | Locked |
| react-router-dom | ^7.13.1 | Locked |
| sonner | ^2.0.7 | Locked |
| @supabase/supabase-js | ^2.99.1 | Backend is Supabase, not custom Go |
| i18next + react-i18next | ^25.8.18 / ^16.5.8 | Locked |
The `index.css` already defines a complete OKLCH `@theme inline` color system with category-specific colors (`--color-income`, `--color-bill`, etc.) and chart colors (`--color-chart-1` through `--color-chart-5`). The project uses the `radix-ui` unified package (post-June 2025 migration).
**Backend reality check:** Despite the milestone context referencing "Go 1.25 backend", the project is a Supabase-backed React SPA. There is no Go source code. All backend work happens via Supabase migrations (SQL) and the `@supabase/supabase-js` client. This is authoritative — verified from `package.json` and `supabase/migrations/`.
**No new frameworks or backend dependencies.** This research covers only what to add or lean into for the UI overhaul.
**Form handling reality check:** Current forms (login, register, template items) use vanilla `useState` + `React.FormEvent`. No react-hook-form or zod are installed.
**Design token reality check:** `--radius: 0.625rem` is applied globally and is the source of the "clunky rounded" look. Sharp redesign requires overriding this token.
---
## Recommended Stack: Additions and Patterns
## New Dependencies Required
### shadcn/ui Components to Add
### 1. react-hook-form + zod — Wizard Form Validation
The project has shadcn/ui components already (card, button, input, etc.) but is missing two critical primitives for the redesign.
The wizard-style template setup requires multi-step form state that persists across steps, per-step validation before advancing, and type-safe schema enforcement. Vanilla `useState` breaks down across 4+ wizard steps with interdependent validation.
| Component | Install Command | Purpose | Why |
|-----------|----------------|---------|-----|
| `chart` | `npx shadcn@latest add chart` | `ChartContainer` + `ChartTooltipContent` wrappers | Provides theme-aware chart wrappers that read from CSS variables. Eliminates boilerplate for consistent chart theming across all chart types. Copy-paste into `src/components/ui/chart.tsx`. |
| `accordion` | `npx shadcn@latest add accordion` | Collapsible category sections on dashboard | Built on Radix UI Accordion primitive. WAI-ARIA compliant, keyboard navigable, supports `type="multiple"` to keep multiple groups open. |
| `collapsible` | `npx shadcn@latest add collapsible` | Single collapsible toggle pattern | Alternative to Accordion when only one independent section needs to expand/collapse (simpler than full Accordion). |
**Use react-hook-form 7.72.0 + zod 4.3.6 + @hookform/resolvers 5.2.2.**
**CRITICAL: Recharts v3 + shadcn chart.tsx compatibility.** The project is on Recharts 3.8.0. The official shadcn/ui chart PR (#8486) for Recharts v3 support is not yet merged (as of March 2026). After running `npx shadcn@latest add chart`, the generated `chart.tsx` may need manual fixes:
| Package | Version | Purpose | Why |
|---------|---------|---------|-----|
| `react-hook-form` | 7.72.0 | Multi-step form state, per-field validation | Industry standard for React forms; tiny bundle (9.3kb); uncontrolled inputs avoid re-render storms across wizard steps |
| `zod` | 4.3.6 | Schema validation with TypeScript inference | Zod 4 is stable (released 2025, latest 4.3.6); 14x faster than v3; subpath exports `zod/v4` enable coexistence if needed |
| `@hookform/resolvers` | 5.2.2 | Bridge between zod schemas and react-hook-form | v5.2.2 supports both Zod v3 and v4 with automatic runtime detection |
1. The `ChartContainer` may log `"width(-1) and height(-1) of chart should be greater than 0"` warnings — fix by adding `initialDimension={{ width: 320, height: 200 }}` to the `ResponsiveContainer` inside `chart.tsx`.
2. If TypeScript errors appear on `TooltipProps`, update the import to use `TooltipProps` from `recharts` directly.
3. Community-verified workaround exists in shadcn-ui/ui issue #9892.
**Zod v4 import note:** Use `import { z } from "zod"` (root export maps to v4) unless you need v3 compatibility, then use `import { z } from "zod/v4"` explicitly. The `zodResolver` from `@hookform/resolvers/zod` handles both transparently.
**Confidence: HIGH** — PR #8486 and issue #9892 are the authoritative sources; the fix is a small patch to one file.
**Known issue:** @hookform/resolvers 5.2.1+ has reported edge-case type errors with specific Zod v4 configurations (GitHub issue #813). Use `5.2.2` (published ~February 2026) which addresses this. If type errors appear, verify the import path is `@hookform/resolvers/zod` not a sub-subpath.
**Confidence: HIGH** — Versions verified via npm search results (react-hook-form 7.72.0 published April 2026; zod 4.3.6; @hookform/resolvers 5.2.2). Integration pattern is the standard shadcn/ui documented approach.
---
### Core Charting Patterns (Recharts 3.8.0)
### 2. Wizard/Stepper UI — Custom Component (No External Library)
No new charting libraries are needed. Recharts 3.8.0 is the current stable release and supports all required chart types natively. Three chart types are needed for the dashboard redesign:
shadcn/ui does not include a stepper or wizard component in its official core library. The discussion thread #1422 requesting it has been open for years. However, shadcn/ui's blocks library now includes stepper patterns (as of March 2026 update) built purely with shadcn/ui `Button`, `Badge`, and Tailwind — **no external npm package needed**.
**1. Donut Chart (expense category breakdown)**
**Recommendation: Build a custom `<WizardStepper>` component from shadcn/ui primitives.**
This approach:
- Requires zero new npm packages
- Matches the existing design system exactly (token-driven styling)
- Is 5080 lines of TypeScript — not complex
- Avoids third-party stepper library churn (none are dominant; most are abandoned within 1-2 years)
Pattern:
```tsx
// Already in use. Enrich by:
// - Increasing innerRadius to ~60, outerRadius to ~100 for visual weight
// - Adding paddingAngle={3} for visible segment separation
// - Using stroke="none" (replaces removed blendStroke in v3)
// - Rendering a center label via custom activeShape or absolute-positioned div
<PieChart>
<Pie
data={pieData}
dataKey="value"
cx="50%"
cy="50%"
innerRadius={60}
outerRadius={100}
paddingAngle={3}
stroke="none"
>
{pieData.map((entry) => (
<Cell key={entry.type} fill={categoryColors[entry.type]} />
))}
</Pie>
<Tooltip content={<ChartTooltipContent />} />
</PieChart>
```
// src/components/shared/WizardStepper.tsx
// Steps indicator: array of step objects → renders numbered circles + connecting lines
// Active step gets primary color; completed steps get checkmark icon
// Controlled via `currentStep: number` prop passed down from wizard page
Note: In Recharts v3, `Cell` is deprecated in favor of the `shape` prop and `activeShape`/`inactiveShape` are deprecated in favor of `shape`. Existing `Cell` usage still works; migration is not required for this milestone.
**2. Vertical Bar Chart (income budget vs actual)**
```tsx
<BarChart data={incomeData}>
<CartesianGrid vertical={false} strokeDasharray="3 3" />
<XAxis dataKey="name" />
<YAxis />
<Bar dataKey="budgeted" radius={[4, 4, 0, 0]} fill="var(--color-muted)" />
<Bar dataKey="actual" radius={[4, 4, 0, 0]} fill="var(--color-income)" />
<Tooltip content={<ChartTooltipContent />} />
</BarChart>
```
**3. Horizontal Bar Chart (spend by category type)**
```tsx
// layout="vertical" turns BarChart into a horizontal bar chart
<BarChart data={categoryData} layout="vertical">
<XAxis type="number" hide />
<YAxis type="category" dataKey="name" width={130} />
<Bar dataKey="budgeted" radius={[0, 4, 4, 0]} fill="var(--color-muted)" />
<Bar dataKey="actual" radius={[0, 4, 4, 0]} fill="var(--color-primary)" />
<Tooltip content={<ChartTooltipContent />} />
</BarChart>
```
**Confidence: HIGH** — All three patterns verified against Recharts official examples and docs.
---
### Tailwind CSS 4 Color System Patterns
The existing `index.css` is already correctly structured with `@theme inline`. The overhaul needs to extend it with:
**1. Richer category colors (more vibrant for charts)**
The current category colors are defined but conservative. For the rich visual style target, increase chroma:
```css
/* Recommended: bump chroma from ~0.14 to ~0.18+ for visual richness */
--color-income: oklch(0.68 0.19 145); /* vivid green */
--color-bill: oklch(0.65 0.19 25); /* vivid orange-red */
--color-variable-expense: oklch(0.70 0.18 55); /* vivid amber */
--color-debt: oklch(0.62 0.20 355); /* vivid rose */
--color-saving: oklch(0.68 0.18 220); /* vivid blue */
--color-investment: oklch(0.65 0.18 285); /* vivid purple */
```
**2. Semantic status tokens for budget comparison**
```css
--color-over-budget: oklch(0.62 0.20 25); /* red-orange for overspend */
--color-on-budget: oklch(0.68 0.19 145); /* green for on-track */
--color-budget-bar-bg: oklch(0.92 0.01 260); /* neutral track for progress bars */
```
**3. Dark theme token set**
The current CSS has no dark mode overrides. With `next-themes` v0.4.6 already installed, dark mode works by toggling `.dark` on `<html>`. Add a dark block:
```css
.dark {
@theme inline {
--color-background: oklch(0.13 0.02 260);
--color-foreground: oklch(0.95 0.005 260);
--color-card: oklch(0.18 0.02 260);
/* ...etc — mirror the light tokens with dark values */
interface Step {
id: string
label: string
}
interface WizardStepperProps {
steps: Step[]
currentStep: number // 0-based index
}
```
This is optional for the current milestone (desktop-first, dark mode not listed as a goal), but the token structure is already set up for it.
State management: hold `currentStep` in the wizard page component with `useState`. Each step's validation runs via `react-hook-form`'s `trigger(fieldNames)` before `setCurrentStep(n + 1)`.
**Confidence: HIGH**Tailwind CSS 4 `@theme inline` pattern verified against official Tailwind v4 docs.
**Confidence: HIGH**shadcn/ui blocks page confirms stepper patterns are available as copy-paste blocks with no external dependencies (verified March 2026). Zero external library is the correct choice.
---
### Typography Patterns
### 3. shadcn/ui Components to Add
Already uses Inter via `--font-sans`. No new font installations needed. Apply these patterns consistently:
The wizard needs two additional shadcn/ui components not currently installed:
| Pattern | CSS / Tailwind | Where to Use |
|---------|---------------|--------------|
| Tabular numbers | `tabular-nums` (already used in DashboardPage) | All currency amounts, percentages |
| Monospace amounts | `font-mono` | Dense data tables where column alignment matters |
| Numeric font features | `font-feature-settings: "tnum" 1` | When `tabular-nums` alone is insufficient |
| Large metric emphasis | `text-3xl font-bold tracking-tight` | Summary card primary values |
| Muted labels | `text-sm text-muted-foreground` | Section headers, stat labels |
| Component | Install Command | Purpose | Notes |
|-----------|----------------|---------|-------|
| `progress` | `npx shadcn@latest add progress` | Optional step progress bar within wizard header | Built on Radix UI Progress; already themed via CSS vars. Use if linear progress indicator preferred over dot/circle steps. |
| `checkbox` | `npx shadcn@latest add checkbox` | Select/deselect template items in wizard step | Built on Radix UI Checkbox; WAI-ARIA compliant. |
| `scroll-area` | `npx shadcn@latest add scroll-area` | Scrollable category library panel in budget view | Built on Radix UI ScrollArea; consistent cross-browser scrollbar styling. |
The codebase already uses `tabular-nums` on currency values — this is correct and should be applied everywhere financial numbers appear.
The existing `dialog.tsx`, `input.tsx`, `button.tsx`, `select.tsx`, `badge.tsx`, and `skeleton.tsx` are already present and sufficient for the wizard steps and inline library picker.
**Confidence: HIGH**Pattern matches current codebase and Shopify Polaris / Datawrapper typography standards.
**Confidence: HIGH**Verified against current component list in `src/components/ui/`.
---
### Layout Patterns
## Design Token Changes — Sharp Minimal Pastel System
**Summary card grid:**
No new packages are needed. All changes are CSS variable overrides in `src/index.css`.
```tsx
// 4 cards on desktop, 2x2 on tablet, stacked on mobile
<div className="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4">
### Border Radius — The Core Change
The v1.0 design feels "clunky and rounded" because `--radius: 0.625rem` (10px) is applied everywhere. The v2.0 "sharp minimal" direction requires:
```css
/* Sharp edges — change ONE token, affects all shadcn/ui components */
--radius: 0.125rem; /* 2px — sharp but not perfectly square */
/* Alternative: 0rem for fully square (more aggressive) */
```
**Chart row:**
This single change propagates through every shadcn/ui component because they all use `rounded-[var(--radius)]` or similar. No individual component changes needed.
```tsx
// Charts side-by-side on desktop, stacked on mobile
<div className="grid grid-cols-1 gap-6 lg:grid-cols-2">
### Pastel Color Recalibration
The current category colors use L~0.55 (text-weight, too dark for fills and backgrounds). "Clear pastels" in a sharp minimal design system need a two-tier system:
- **Surface pastel** (card backgrounds, highlights): L~0.93-0.96, C~0.04-0.06
- **Accent pastel** (borders, tags, icons): L~0.75-0.80, C~0.10-0.12
- **Text** (labels, amounts): L~0.40-0.50, C~0.15-0.18 (existing values are correct for this)
```css
/* New: pastel surface colors for wizard step indicators, category cards */
--color-income-surface: oklch(0.95 0.04 155);
--color-bill-surface: oklch(0.95 0.04 25);
--color-variable-expense-surface: oklch(0.95 0.04 50);
--color-debt-surface: oklch(0.95 0.05 355);
--color-saving-surface: oklch(0.95 0.04 220);
--color-investment-surface: oklch(0.95 0.04 285);
/* New: accent pastel (for badges, step indicators, borders) */
--color-income-accent: oklch(0.80 0.10 155);
--color-bill-accent: oklch(0.80 0.10 25);
--color-variable-expense-accent: oklch(0.80 0.10 50);
--color-debt-accent: oklch(0.80 0.11 355);
--color-saving-accent: oklch(0.80 0.10 220);
--color-investment-accent: oklch(0.80 0.10 285);
```
**Collapsible category section:**
The existing text-weight category colors (`--color-income`, etc.) remain unchanged — they're already correct for text/icon usage and pass WCAG 4.5:1.
```tsx
// Using shadcn Accordion — one group per CategoryType
<Accordion type="multiple" defaultValue={["income", "bill"]}>
<AccordionItem value="income">
<AccordionTrigger>
{/* Summary row: label + budgeted + actual + delta */}
</AccordionTrigger>
<AccordionContent>
{/* Line item rows */}
</AccordionContent>
</AccordionItem>
</Accordion>
### Minimal Layout Tokens
```css
/* Reduce visual weight for card borders — sharp design reads better with subtle borders */
--color-border: oklch(0.90 0.008 260); /* slightly lighter than current 0.88 */
/* Tighter card padding via CSS custom property (used in PageShell / StatCard) */
/* No token needed — use Tailwind p-4 consistently instead of p-6 */
```
Use `type="multiple"` so users can expand multiple sections simultaneously. Default expand income and variable_expense as the most-checked categories.
**Confidence: HIGH** — Standard shadcn/ui pattern, verified against official docs.
**Confidence: HIGH** — Based on OKLCH perceptual uniformity properties; the lightness/chroma values follow the Evil Martians OKLCH guide for pastel palette design.
---
## What NOT to Use
## Backend Changes — Supabase (Auto-Budget Creation + Template Seeding)
### Auto-Budget Creation
The feature "auto-create monthly budgets from template on first visit" requires:
1. **A Supabase RPC function** (PostgreSQL function called via `.rpc()`) to atomically create a budget + copy template items in a single round-trip. Application-layer logic (JavaScript calling multiple inserts) is fragile across network failures.
```sql
-- New migration: create_budget_from_template(user_id, month_date)
-- Returns the new budget_id
-- Idempotent: if budget for that month already exists, returns existing id
create or replace function create_budget_from_template(
p_user_id uuid,
p_month date -- first day of the target month
)
returns uuid
language plpgsql
security definer -- needed to bypass RLS for the INSERT
as $$
declare
v_template_id uuid;
v_budget_id uuid;
begin
-- Get user's template
select id into v_template_id from templates where user_id = p_user_id limit 1;
if v_template_id is null then return null; end if;
-- Idempotency: return existing budget for this month
select id into v_budget_id
from budgets
where user_id = p_user_id
and start_date = date_trunc('month', p_month)::date
limit 1;
if v_budget_id is not null then return v_budget_id; end if;
-- Create new budget
insert into budgets (user_id, start_date, end_date, currency)
values (
p_user_id,
date_trunc('month', p_month)::date,
(date_trunc('month', p_month) + interval '1 month' - interval '1 day')::date,
(select currency from profiles where id = p_user_id limit 1)
)
returning id into v_budget_id;
-- Copy template items to budget items
insert into budget_items (budget_id, category_id, budgeted_amount, item_tier)
select v_budget_id, ti.category_id, ti.budgeted_amount, ti.item_tier
from template_items ti
where ti.template_id = v_template_id;
return v_budget_id;
end;
$$;
```
Frontend call:
```typescript
const { data: budgetId } = await supabase.rpc('create_budget_from_template', {
p_user_id: user.id,
p_month: `${year}-${month}-01`
})
```
**Why RPC not application layer:** A single RPC is atomic (no partial state if network drops mid-sequence), runs in 1 round-trip instead of 3-4, and the idempotency guard prevents duplicate budgets from double-calls (React StrictMode double-invocation, fast navigation, etc.).
### Template Seeding (Wizard First-Run)
The wizard "pre-filled common items" require a static list seeded client-side — no backend change needed. The wizard presents checkboxes for ~15 common items (Rent, Salary, Car Insurance, Groceries, etc.) with pre-populated amounts. On wizard completion, one batch `insert` creates the template + template_items. The existing `templates` and `template_items` tables support this without schema changes.
**Categories pre-seeding:** Categories (income, bill, variable_expense, etc.) are per-user, not system-wide. The wizard must also insert default categories before template items can reference them. Order: insert default categories → insert template → insert template_items.
This can also be an RPC (`setup_user_template`) or application-layer batch — the wizard runs once, so network failure risk is acceptable at client-side orchestration.
### Category Library (Inline Add-from-Library)
The `quick_add_items` table stores name + icon only — no amount or category_type. For the inline category library in budget view (replacing the QuickAdd page), the library needs category_type to know which budget section to add to.
**Schema addition needed:**
```sql
-- New migration: add category_type to quick_add_items
alter table quick_add_items
add column category_type category_type, -- existing enum
add column default_amount numeric(12,2) default 0;
```
This enables the library to show items grouped by type and pre-fill amounts when adding to a budget.
**Confidence: MEDIUM** — RPC pattern is well-established in Supabase. Schema addition is straightforward. The exact RPC SQL above is a starting point and may need adjustment based on profiles table structure (currency field). Flag for verification in planning phase.
---
## What NOT to Add
| Avoid | Why | Use Instead |
|-------|-----|-------------|
| Nivo | Adds a large bundle, different component API, requires adapting all existing chart code | Recharts 3.8.0 — already installed, sufficient |
| ApexCharts / ECharts | New library dependency, no benefit over Recharts for this scope | Recharts 3.8.0 |
| react-financial-charts | Designed for candlestick / OHLC trading charts, not budget dashboards | Recharts 3.8.0 |
| Recharts 2.x | Project is already on v3.8.0 — never downgrade | Stay on 3.8.0 |
| shadcn `npx shadcn@latest add` for chart without reading the output | The generated chart.tsx requires a manual Recharts v3 patch | Run the add command, then apply the `initialDimension` fix to `ChartContainer` |
| CSS-in-JS for theming | Tailwind v4 `@theme inline` already handles all theming via CSS variables | Extend `index.css` `@theme inline` block |
| Custom progress bar libraries | Raw Tailwind divs with `style={{ width: X% }}` are already used and are sufficient | Keep existing progress bar pattern, improve styling only |
| Framer Motion | Adds bundle weight; CSS transitions via `transition-all duration-200` cover needed animations | Tailwind transition utilities |
| React Grid Layout | Drag/resize dashboards are out of scope for this milestone | Standard CSS Grid |
| External stepper library (react-use-wizard, react-step-wizard, stepperize) | None is dominant; all add bundle weight for what is 50 lines of custom code; APIs change | Custom `<WizardStepper>` using shadcn/ui Button + Badge + Tailwind |
| Zod v3 (avoid if installing fresh) | v4 is stable and 14x faster; no reason to use v3 for new code | `zod@4.3.6` |
| Framer Motion for wizard step transitions | 28kb gzip; CSS `transition-opacity duration-200` is sufficient for step fade | Tailwind transition utilities |
| Recharts upgrade to 3.x in this milestone | 2.15.4 is working; v3 migration guide lists breaking changes that would require updating all existing charts; out of scope | Stay on 2.15.4 for v2.0 milestone; plan upgrade separately |
| CSS-in-JS for new design tokens | Tailwind v4 `@theme inline` in `index.css` already handles all theming | Extend `index.css` `@theme inline` block |
| Zustand for wizard state | TanStack Query + useState is already the state pattern in this app; wizard state is local and short-lived | `useState` in wizard page component |
| Supabase Edge Functions for auto-budget | PostgreSQL function (RPC) runs in the same DB transaction; simpler, no Deno runtime | Supabase RPC (pg function) |
---
@@ -236,10 +279,26 @@ Use `type="multiple"` so users can expand multiple sections simultaneously. Defa
| Recommended | Alternative | When to Use Alternative |
|-------------|-------------|-------------------------|
| Recharts 3.8.0 (stay) | Nivo | If you needed animated, visually opinionated charts with server-side rendering — not applicable here |
| shadcn Accordion | KendoReact PanelBar | If the project used KendoReact's broader component suite — it doesn't |
| Tailwind `tabular-nums` | Geist Mono font | Use Geist Mono only if building a dense trading-style table where column alignment is a core feature, not a budget dashboard |
| shadcn chart.tsx (copy-paste) | Direct Recharts usage | Acceptable — the project's existing dashboard already uses Recharts directly. shadcn wrappers add theme-aware tooltips and config-based colors but are not mandatory |
| Custom WizardStepper | `react-use-wizard` (npm) | If wizard logic were complex (branching paths, async steps with external dependencies) — this wizard is linear with simple validation |
| Zod 4 | Valibot | If bundle size were critical (Valibot is ~1kb vs Zod's ~14kb) — not a concern here |
| Supabase RPC for auto-budget | Application-layer multi-insert | Acceptable if you tolerate partial failure risk and handle retry logic — RPC is cleaner |
| Two-tier OKLCH pastel tokens | Single token set | If the design only needed chart colors — the wizard and library UI need surface pastels that the existing single-tier system doesn't provide |
---
## Installation
```bash
# Wizard form validation (new packages)
bun add react-hook-form@7.72.0 zod@4.3.6 @hookform/resolvers@5.2.2
# New shadcn/ui components
npx shadcn@latest add progress
npx shadcn@latest add checkbox
npx shadcn@latest add scroll-area
```
No other npm/bun installs needed. All other new functionality (wizard stepper UI, design token changes, Supabase RPC, schema migration) is implemented via local code and SQL.
---
@@ -247,43 +306,59 @@ Use `type="multiple"` so users can expand multiple sections simultaneously. Defa
| Package | Version | Compatible With | Notes |
|---------|---------|-----------------|-------|
| Recharts | 3.8.0 | React 19 | Requires `react-is` peer dependency override for React 19 |
| shadcn chart.tsx | CLI generated | Recharts 3.8.0 | Apply `initialDimension` fix to `ChartContainer` after generation |
| Tailwind CSS | 4.2.1 | `@theme inline` | Use `@theme inline` (not bare `@theme`) when referencing other CSS vars |
| next-themes | 0.4.6 | React 19 | Compatible; dark mode toggled via `.dark` class on `<html>` |
| radix-ui | 1.4.3 | Post-June 2025 migration | shadcn CLI add commands now generate imports from `radix-ui`, not `@radix-ui/react-*` |
| react-hook-form | 7.72.0 | React 19 | Fully compatible; hooks-based, no legacy API |
| zod | 4.3.6 | TypeScript ~5.9.3 | Requires TypeScript 4.5+; project is on 5.9.3 — fine |
| @hookform/resolvers | 5.2.2 | react-hook-form 7.x + zod 4.x | Automatic v3/v4 Zod detection |
| Recharts | 2.15.4 | React 19 | Stays on v2; DO NOT upgrade in this milestone |
| Tailwind CSS | 4.2.1 | `@theme inline` | Sharp radius via `--radius: 0.125rem` in `@theme inline` block |
| radix-ui | 1.4.3 | shadcn new-york style | New shadcn add commands generate `radix-ui` imports (unified package), not `@radix-ui/*` |
---
## Installation
## Integration Points
```bash
# Add shadcn chart primitives (then apply Recharts v3 fix to chart.tsx)
npx shadcn@latest add chart
### Wizard → Template → Budget Flow
# Add Accordion for collapsible dashboard sections
npx shadcn@latest add accordion
```
WizardPage (new route: /setup)
└─ react-hook-form (FormProvider wrapping all steps)
└─ WizardStepper component (step indicator)
└─ Step 1: Pick categories (checkbox + default amounts)
└─ Step 2: Adjust fixed items (input fields, pre-filled)
└─ Step 3: Adjust variable items
└─ Step 4: Review + confirm
└─ onSubmit → batch insert categories + template + template_items
└─ redirect to /dashboard
# Add Collapsible if single-section toggles are needed
npx shadcn@latest add collapsible
DashboardPage (existing)
└─ on mount: check if budget exists for current month
└─ if not: call supabase.rpc('create_budget_from_template', { month })
└─ render budget data (existing pattern, improved display)
BudgetDetailPage (existing, enhanced)
└─ inline category library panel (uses scroll-area + checkbox/button)
└─ add one-off items directly from library
```
No npm/bun package installs needed — Recharts 3.8.0 is already installed and sufficient.
### Design Token Change Impact
The `--radius` change in `index.css` requires no component-level changes — all shadcn/ui components use the token automatically. The new surface/accent OKLCH tokens need to be applied explicitly in new components (wizard steps, category library cards); existing components are unaffected.
---
## Sources
- [Recharts GitHub Releases](https://github.com/recharts/recharts/releases) — version 3.8.0 confirmed latest stable (March 2025)
- [Recharts 3.0 Migration Guide](https://github.com/recharts/recharts/wiki/3.0-migration-guide) — breaking changes from v2 to v3
- [shadcn/ui Chart Docs](https://ui.shadcn.com/docs/components/chart) — ChartContainer, ChartConfig, ChartTooltip patterns
- [shadcn-ui/ui PR #8486](https://github.com/shadcn-ui/ui/pull/8486) — Recharts v3 chart.tsx upgrade (open as of March 2026)
- [shadcn-ui/ui Issue #9892](https://github.com/shadcn-ui/ui/issues/9892) — Community-verified Recharts v3 chart.tsx fix
- [shadcn/ui Accordion Docs](https://ui.shadcn.com/docs/components/radix/accordion) — component API verified
- [Tailwind CSS v4 Theme Docs](https://tailwindcss.com/docs/theme) — `@theme inline`, CSS variables, OKLCH palette
- [npm recharts](https://www.npmjs.com/package/recharts) — 3.8.0 current, 7M weekly downloads, healthy maintenance
- npm search results (April 2026) — react-hook-form 7.72.0, zod 4.3.6, @hookform/resolvers 5.2.2
- [zod.dev/v4](https://zod.dev/v4) — Zod 4 stable release notes, versioning strategy
- [shadcn/ui blocks page](https://ui.shadcn.com/blocks) — Confirmed no native stepper component; patterns available as copy-paste blocks (no npm dep)
- [shadcn-ui/ui Discussion #1422](https://github.com/shadcn-ui/ui/discussions/1422) — Feature request for stepper (still open as of April 2026)
- [react-hook-form/resolvers GitHub](https://github.com/react-hook-form/resolvers/releases) — v5.2.2 Zod v4 support
- [github.com/recharts/recharts/wiki/3.0-migration-guide](https://github.com/recharts/recharts/wiki/3.0-migration-guide) — v3 breaking changes confirming upgrade is out of scope for this milestone
- [evilmartians.com — Better dynamic themes with OKLCH](https://evilmartians.com/chronicles/better-dynamic-themes-in-tailwind-with-oklch-color-magic) — OKLCH lightness/chroma guidance for pastel systems
- `package.json` in project root — authoritative source for actual installed versions (Recharts 2.15.4, not 3.x as prior research stated)
- `supabase/migrations/` — authoritative source confirming Supabase backend, existing schema
---
*Stack research for: SimpleFinanceDash UI Overhaul*
*Researched: 2026-03-16*
*Stack research for: SimpleFinanceDash v2.0 — Wizard Setup, Auto-Budget, Sharp Pastel Design*
*Researched: 2026-04-02*

View File

@@ -1,200 +1,183 @@
# Project Research Summary
**Project:** SimpleFinanceDash — UI/UX Overhaul Milestone
**Domain:** Personal finance budget dashboard (React SPA, UI-only redesign)
**Researched:** 2026-03-16
**Project:** SimpleFinanceDash v2.0 — Wizard Setup, Auto-Budget Creation, Sharp Pastel Design
**Domain:** Personal finance dashboard React SPA with Supabase backend
**Researched:** 2026-04-02
**Confidence:** HIGH
## Executive Summary
This milestone is a pure UI/UX overhaul of an existing working application. The backend (Supabase schema, hooks, queries) is frozen. The stack is already in place — React 19, Vite 8, Tailwind CSS 4, Recharts 3.8.0, shadcn/ui, TanStack Query — and no new framework dependencies are needed. The overhaul adds three shadcn/ui primitives (`chart`, `accordion`/`collapsible`), extends the existing OKLCH color system, and introduces a structured component hierarchy for the dashboard. The core transformation is from a flat single-chart dashboard to a rich hybrid layout: summary KPI cards, three chart types (donut, vertical bar, horizontal bar), and collapsible per-category line-item sections.
SimpleFinanceDash v2.0 is a UX simplification milestone on top of a fully working v1.0 app. All data infrastructure already exists — categories, templates, budget generation, charts, collapsible sections. The central problem is cognitive: new users land on a blank dashboard with no guidance, monthly budget creation requires a manual trigger, and the Quick Add feature lives on a disconnected page. The recommended approach is a three-part simplification: (1) a 3-step first-run wizard that seeds a usable template from curated defaults, (2) automatic monthly budget creation on dashboard visit when a template is populated, and (3) inline item-adding directly from the budget view to replace the isolated Quick Add page. Paired with a design system token rework (sharp radius, clearer pastels), these changes transform the app from a data entry tool into a coherent, guided experience.
The recommended approach is to establish design foundations first (tokens, shared components, build order primitives) before touching any page. Every visual decision — color, spacing, card style — must originate from `index.css` `@theme inline` tokens and a small set of shared components (`PageShell`, `StatCard`, `CategorySection`). Without this discipline, a multi-page overhaul will produce "island redesign" inconsistency: each page looks polished individually but the app feels fragmented during navigation. The dashboard phase comes second, followed by extending the design system to all remaining pages.
The stack is locked and healthy. The only new dependencies are react-hook-form 7.72.0, zod 4.3.6, and @hookform/resolvers 5.2.2 for multi-step form validation in the wizard. Three additional shadcn/ui components are needed (progress, checkbox, scroll-area). All other work — the wizard stepper UI, design token changes, auto-budget triggering — is implemented through local code changes and SQL with no additional packages. Critically, no new DB migrations are required for features: all wizard and auto-budget writes go to existing `categories`, `template_items`, `budgets`, and `budget_items` tables via existing hooks and mutations. Two DB constraint migrations are required for safety (unique constraint on `budgets(user_id, start_date)` and `categories(user_id, name)`), and a one-time migration to set `profiles.setup_completed = true` for existing v1.0 users.
The highest-risk technical area is the Recharts + shadcn `chart.tsx` integration: the official shadcn PR for Recharts v3 is not yet merged, so the generated `chart.tsx` requires a known manual patch (add `initialDimension` to `ResponsiveContainer`). A close second risk is collapsible section layout shift — Recharts `ResponsiveContainer` instances react to parent height changes, and multiple instances on one page require `debounce={50}` and Radix `Collapsible` (not raw `display:none` toggle) to prevent ResizeObserver cascade errors. Both risks have documented fixes and are LOW recovery cost if addressed proactively.
---
The primary risks are concurrency-related and data-integrity-related, not technical. Auto-budget creation via a client-side `useEffect` can fire multiple times (React StrictMode double-invocation, multi-tab, fast navigation), producing duplicate budget rows without a DB-level unique constraint. The wizard completion sequence is non-idempotent without explicit guards — a re-run creates duplicate categories and template items. The design token rework is a third systemic risk: changing global CSS variables (`--radius`, OKLCH color tokens) affects all 9 existing pages simultaneously. All three risks have clear, low-cost mitigations that must be applied before the relevant features ship, not after.
## Key Findings
### Recommended Stack
The stack is locked; no new npm packages are required. Three shadcn/ui components must be installed via CLI: `chart` (Recharts theme-aware wrappers), `collapsible` (Radix primitive for category sections), and optionally `accordion`. After running `npx shadcn@latest add chart`, a manual one-line fix to `chart.tsx` is required: add `initialDimension={{ width: 320, height: 200 }}` to the inner `ResponsiveContainer` (see shadcn-ui/ui issue #9892). The existing OKLCH color palette in `index.css` needs only two additions: richer chroma on category colors (bump from ~0.14 to ~0.18+) and semantic status tokens (`--color-over-budget`, `--color-on-budget`, `--color-budget-bar-bg`).
The project runs on React 19 + Vite 8 + TypeScript 5.9 + Tailwind CSS 4 + Recharts 2.15.4 + TanStack Query v5 + Supabase (PostgreSQL + Auth + RLS). These versions are locked and must not be changed in this milestone. Note: prior research incorrectly listed Recharts 3.x — the actual installed version is 2.15.4 per `package.json`, and upgrading to v3 is explicitly out of scope due to breaking changes. The backend is Supabase, not a Go service — there is no Go source code in the repository.
**Core technologies and their roles for this milestone:**
- **Recharts 3.8.0** — all three chart types (donut, bar, horizontal bar) are supported natively; stay on current version, do not introduce alternative chart libraries
- **shadcn `chart.tsx`** — `ChartContainer` + `ChartTooltipContent` wrappers provide CSS-variable-aware theming for all Recharts instances; required patch documented in issue #9892
- **shadcn `Collapsible`** — Radix UI primitive that animates height via CSS custom property `--radix-collapsible-content-height`; the correct tool for per-category collapsible sections
- **Tailwind CSS 4 `@theme inline`** — single source of truth for all color tokens; all component color values must reference CSS variables, never hardcoded hex
- **`useMemo` in DashboardContent** — all chart data derivations must be memoized centrally; child chart components receive pre-computed data arrays and render only
**Critical version note:** Recharts 3 deprecated `Cell` in favor of `shape` prop, and removed `blendStroke` — use `stroke="none"` instead. Existing `Cell` usage still works but should not be extended.
**Core technologies (new additions only):**
- `react-hook-form 7.72.0` + `zod 4.3.6` + `@hookform/resolvers 5.2.2` — multi-step wizard form validation; industry standard, 9.3kb bundle, handles per-step validation before advancing
- `shadcn checkbox`, `progress`, `scroll-area` — three new shadcn components needed for wizard and inline add panel
- Custom `<WizardStepper>` built from shadcn/ui `Button` + `Badge` + Tailwind — no external stepper library; none are dominant and all add bundle weight for 50 lines of local code
- OKLCH two-tier pastel token system in `src/index.css` — surface tokens at L~0.95 for backgrounds, accent tokens at L~0.80 for borders/badges, existing text tokens at L~0.55 unchanged
### Expected Features
Research grounded in competitor analysis (YNAB, Empower) and fintech UX standards. The full feature list lives in `FEATURES.md`.
**Must have (table stakes — v2.0 launch):**
- 3-step first-run wizard: income → common items (pre-filled, editable, with live running balance) → review — skippable per step and as a whole
- Pre-seeded library of ~15-20 curated items grouped by category type with static sensible default amounts
- Auto-create current month's budget from template on dashboard visit — silent, no manual trigger
- First-creation toast notification only ("Your April budget was created from your template"); silent for all subsequent months
- Inline add-from-library on budget view as a shadcn Sheet panel — replaces the standalone Quick Add page
- Quick Add removed from sidebar navigation; route kept with redirect to `/budgets`
- Dashboard summary cards correctly reflecting current month budget data
- Empty state CTAs for: empty template page, empty dashboard, empty budget view
**Must have (table stakes — users expect these):**
- Summary KPI cards (income / expenses / balance) with colored semantics and variance badges
- Donut chart with center total label and active hover expand
- Horizontal bar chart: budget vs actual per category type
- Grouped bar chart: income budgeted vs actual
- Collapsible per-category sections with line items and group totals
- Skeleton loading states that mirror the real layout structure
- Month navigation control on the dashboard (currently locked to current month)
- Consistent design language across all pages — the dashboard sets the pattern, all other pages must inherit it
**Should have (competitive differentiators — v2.x):**
- "Edit template" shortcut link from budget view for quick access to change recurring items
- Persistent "this month" summary widget on the dashboard sidebar
- "Complete setup" banner for users who skipped the wizard but have an empty template
- Running balance updating live during wizard item selection (income minus sum of selected items; frontend computation only)
**Should have (differentiators, high value for low cost):**
- Variance indicators (delta arrows/badges) on summary cards and section headers
- Accent-colored category section borders (`border-l-4` with category CSS variable)
- Empty state with actionable CTA for new months
- Carryover amount surfaced on the dashboard balance card
- Section collapse state preserved in localStorage (P3 polish)
**Defer to v2+:**
- Trend / multi-month charts — requires new query shape and chart layout; explicitly out of scope
- Dark mode — OKLCH infrastructure is ready but requires full contrast audit; doubles testing surface
- AI-derived insights — backend dependency; no scope here
- Drag-to-reorder categories — requires `sort_order` mutation support
**Defer (v3+):**
- AI-suggested amounts based on spending history — requires historical data and ML infrastructure; static defaults are sufficient
- CSV/bank import for actuals — already noted as a future feature in PROJECT.md
- Mandatory wizard / forced onboarding — explicitly an anti-feature; skippable is always correct
- Complex 6+ step wizard — drop-off increases sharply beyond step 3; confirmed by YNAB's own Oct 2025 update to shorten their onboarding
### Architecture Approach
The existing three-tier architecture (Pages → Hooks → Supabase) is preserved intact. The overhaul introduces a **View Components layer** that sits between pages and shadcn/ui primitives, and a small **Shared Components layer** for cross-page patterns. Hooks and library files are read-only during this milestone; all computation lives in the presentation layer via `useMemo`.
The v2.0 architecture is additive, not structural. A new `WizardRoute` guard wraps the existing `ProtectedRoute` subtree in `App.tsx`. A new `/setup` route renders `SetupWizardPage` as a dedicated page (not a modal overlay — dedicated URL prevents broken refresh/back behavior). The wizard completes by writing to existing tables via existing hooks. Auto-budget creation is a `useEffect` trigger added to `DashboardPage` that calls the already-existing `generateFromTemplate` mutation. Inline add replaces `QuickAddPicker` with a new `AddOneOffSheet` component at both call sites. Dashboard simplification removes the 3-column chart grid from `DashboardContent` (charts stay in the codebase but are removed from the Dashboard layout). All existing hooks and mutations (`useBudgets.ts`, `useTemplate.ts`, `useCategories.ts`, etc.) are read-only for this milestone.
**New components and their responsibilities:**
**New files:**
1. `src/hooks/useFirstRunState.ts` — detects first-run: `categories.length === 0 OR template_items.length === 0`
2. `src/data/presets.ts` — static preset category list with suggested amounts (compile-time data, no DB table)
3. `src/pages/SetupWizardPage.tsx` — 3-step wizard, local `useState` only, localStorage persistence
4. `src/components/wizard/WizardStep.tsx`, `CategoryDefaults.tsx`, `TemplateDefaults.tsx` — wizard UI pieces
5. `src/components/budget/AddOneOffSheet.tsx` — Sheet-based one-off item adder (replaces QuickAddPicker)
| Component | Location | Responsibility |
|-----------|----------|----------------|
| `DashboardContent` | `components/dashboard/` | Orchestrator: owns `useMemo` derivations, passes typed props to all children |
| `SummaryStrip` + `StatCard` | `components/dashboard/` | KPI cards row with semantic color and variance badge |
| `ChartPanel` | `components/dashboard/` | Two-column responsive grid containing all three chart instances |
| `IncomeBarChart` | `components/dashboard/` | Budgeted vs actual income vertical bar, wrapped in `ChartContainer` |
| `ExpenseDonutChart` | `components/dashboard/` | Expense breakdown donut with center total and custom legend |
| `SpendBarChart` | `components/dashboard/` | Horizontal budget vs actual by category type |
| `CategorySection` | `components/dashboard/` | Radix `Collapsible` wrapping header row + `BudgetLineItems` |
| `BudgetLineItems` | `components/dashboard/` | Line-item table reusing existing `InlineEditCell` / `DifferenceCell` atoms |
| `PageShell` | `components/shared/` | Cross-page consistent header with title, optional description, CTA slot |
**Build order is strictly dependency-driven** (see Architecture section for full sequence): install shadcn primitives first, then `PageShell` and `StatCard`, then chart components, then `CategorySection`, then `DashboardContent` as final orchestrator, then all remaining page refreshes.
**Modified files:** `src/App.tsx`, `src/components/AppLayout.tsx`, `src/pages/DashboardPage.tsx`, `src/pages/BudgetDetailPage.tsx`, `src/index.css`, `src/i18n/en.json`, `src/i18n/de.json`
### Critical Pitfalls
All six pitfalls in `PITFALLS.md` are rated HIGH confidence with verified fixes. The top five to actively prevent:
1. **Duplicate budget creation on concurrent auto-create** — Add `UNIQUE (user_id, start_date)` constraint to `budgets` table via migration AND use `INSERT ... ON CONFLICT DO NOTHING` in `generateFromTemplate` before any auto-create code ships. Use a `useRef(false)` guard in the `useEffect` to prevent double-fire from React StrictMode.
1. **Unmemoized chart data triggers triple re-renders** — every `items.filter().reduce()` in `DashboardContent` must be wrapped in `useMemo`. Adding three chart instances to a non-memoized render body multiplies re-render cost 3x and causes tooltip hover lag. Recovery cost is LOW but disrupts delivered work if caught late.
2. **Wizard creates duplicate categories on re-run** — Add `UNIQUE (user_id, name)` constraint to `categories` table; use upsert for category creation. Add `profiles.setup_completed` boolean; set to `true` in `onSuccess` only. Write a migration to backfill `setup_completed = true` for all v1.0 users with existing template items before shipping.
2. **shadcn `chart.tsx` incompatibility with Recharts 3** — the generated `chart.tsx` from `npx shadcn@latest add chart` will produce `width(-1) and height(-1)` warnings and potential layout failures. Apply the `initialDimension` fix to `ChartContainer` immediately after generation. This is a one-line fix with a documented workaround (issue #9892), but if skipped it causes all charts to silently render at zero dimensions.
3. **Design token rework breaks all 9 pages silently** — Token changes must be one isolated commit followed immediately by a full visual regression pass on all pages before any component code is touched. Never mix token changes and component changes in the same commit.
3. **Collapsible sections trigger ResizeObserver cascade on charts** — using `display:none` toggle or raw `height` animation on category sections causes Recharts `ResponsiveContainer` instances above/below to rapidly resize. Fix: use Radix `Collapsible` with CSS `@keyframes` on `--radix-collapsible-content-height`, and add `debounce={50}` to all `ResponsiveContainer` instances.
4. **Auto-budget defaults to wrong currency** — The `generateFromTemplate` mutation defaults to `"EUR"`. Auto-create must read `profile.currency` first and chain via TanStack Query's `enabled` flag: only auto-create after both the budgets list and user profile are loaded.
4. **Color accessibility regression during "rich visual" overhaul** — the redesign goal of rich colors is a direct risk factor for WCAG contrast failures. The existing `text-green-600` / `text-red-600` pattern must be audited (green-600 is borderline). All six category pie slice colors cluster at similar OKLCH lightness (~0.650.72) — vary lightness as well as hue. Supplement color with icons for status indicators; color alone is never sufficient.
5. **i18n key regressions**`i18next` silently falls back to English when German keys are missing (`fallbackLng: 'en'`). Every new UI text key must be added to both `en.json` and `de.json` in the same commit. Run `i18next-scanner` or manually switch to German locale before marking any phase complete.
**Sixth pitfall to prevent at the outset:** Design inconsistency across page refreshes. If shared components (`StatCard`, `CategorySection` header pattern, card border accents) are not extracted before page work begins, each page will develop subtle visual drift that is expensive to correct retroactively.
---
5. **Wizard state lost on browser refresh** — Persist wizard state to `localStorage` keyed by `wizard_state_${userId}` on every step change; read on mount; clear on completion or skip. Use URL search params (`?step=2`) for browser back/forward support.
## Implications for Roadmap
Research points to a clear four-phase structure. The ordering is driven by: (1) the build dependency chain in ARCHITECTURE.md, (2) the "design foundation before page work" principle from PITFALLS.md, and (3) the feature dependency graph in FEATURES.md.
Research points to a clear five-phase structure derived from the dependency chain in ARCHITECTURE.md, the feature dependency graph in FEATURES.md, and the phase-to-pitfall mapping in PITFALLS.md.
### Phase 1: Design Foundation and Primitives
**Rationale:** Multiple pitfalls converge on the same root cause — design tokens and shared components must exist before any page work begins. Design drift (Pitfall 6) and color accessibility failures (Pitfall 4) both require the palette and shared component abstractions to be established first. This phase has no external dependencies and produces the building blocks every subsequent phase consumes.
**Delivers:** Extended `index.css` color tokens (richer chroma, semantic status tokens), installed shadcn primitives (`chart.tsx` with Recharts v3 patch applied, `collapsible.tsx`), `PageShell`, `StatCard` / `SummaryStrip` components.
**Addresses:** Summary KPI cards (table stakes), accent-colored category borders, semantic color system, skeleton components
**Avoids:** Design inconsistency pitfall, color accessibility regression, CSS variable scope issues
**Research flag:** Standard patternsno additional research needed. Tailwind v4 `@theme inline` and WCAG contrast requirements are well-documented.
### Phase 1: Design System Token Rework
**Rationale:** Token changes cascade globally to all 9 existing pages. This must land first, in isolation, establishing the visual baseline before any page component is built or modified. Mixing token changes with component changes makes regressions impossible to attribute.
**Delivers:** `--radius: 0.125rem` (sharp edges), refined OKLCH pastel surface/accent tokens, warmer background, softer border — applied in `src/index.css` only, zero component-file changes.
**Addresses:** Sharp minimal aesthetic direction; OKLCH two-tier pastel system for category colors
**Avoids:** Pitfall 3 (token rework breaks pages silently) — full visual pass on all 9 pages is the acceptance criterion before this phase closes.
**Research flag:** Standard pattern — CSS custom property overrides in Tailwind v4 `@theme inline` are fully documented. No deeper research needed.
### Phase 2: Dashboard Charts and Layout
**Rationale:** Charts depend on `chart.tsx` from Phase 1. The dashboard is the highest-value page and establishes the full visual language for all subsequent pages. Month navigation must be included here (not deferred) because it changes how `DashboardContent` holds state — retrofitting it after collapsible sections are built is more disruptive than including it upfront.
**Delivers:** `DashboardContent` orchestrator with `useMemo` data derivations, `ChartPanel` with all three chart types (`IncomeBarChart`, `ExpenseDonutChart`, `SpendBarChart`), month navigation control, skeleton loading for charts and cards.
**Addresses:** Donut chart (table stakes), horizontal bar chart (P1), grouped income bar chart (P1), skeleton loading (P1), month navigation (P1)
**Avoids:** Unmemoized chart data pitfall (use `useMemo` from the start), `chart.tsx` Recharts v3 patch (apply in Phase 1 before this phase begins)
**Research flag:** Standard patterns — Recharts 3.8.0 chart implementations are fully documented. The specific `chart.tsx` fix is documented in issue #9892.
### Phase 2: Preset Data, First-Run Detection, and DB Safety Constraints
**Rationale:** Both the wizard and auto-budget creation depend on knowing whether this is a first-run user and on DB constraints that prevent duplicate data. Static data and detection hook have no UI dependencies and can be built and tested in isolation. The DB constraints must exist before any write mutations are triggered.
**Delivers:** `src/data/presets.ts`, `src/hooks/useFirstRunState.ts`, DB migration for `UNIQUE (user_id, start_date)` on `budgets`, DB migration for `UNIQUE (user_id, name)` on `categories`, DB migration for `profiles.setup_completed` flag with backfill for v1.0 users.
**Addresses:** Accurate first-run detection; protection against duplicate data at the DB layer
**Avoids:** Pitfall 1 (duplicate budgets), Pitfall 6 (duplicate categories), Pitfall 8 (first-run gate triggers for existing users)
**Research flag:** Standard pattern. The `setup_completed` backfill migration needs a SQL audit of the `profiles` table structure before writing — low-effort verification.
### Phase 3: Collapsible Dashboard Sections
**Rationale:** `CategorySection` depends on `Collapsible` primitive (Phase 1) and `BudgetLineItems` (which reuses existing `InlineEditCell` atoms). This phase brings the dashboard to full feature completeness. Separating it from Phase 2 keeps each phase focused and ensures chart layout is stable before section collapse animations interact with chart resize behavior.
**Delivers:** `CategorySection` components with Radix `Collapsible`, `BudgetLineItems` table, group totals row, variance indicators in section headers, carryover amount on balance card.
**Addresses:** Collapsible sections with line items (P1), totals per section (table stakes), variance indicators (P2), carryover amount (P2)
**Avoids:** Collapsible layout shift pitfall — use Radix `Collapsible` with CSS keyframe animation and `debounce={50}` on all `ResponsiveContainer` instances; never `display:none` toggle
**Research flag:** Standard patterns — Radix Collapsible API is well-documented. The `--radix-collapsible-content-height` animation pattern is the established approach.
### Phase 3: Setup Wizard
**Rationale:** Depends on Phase 2 (presets data, first-run hook, DB constraints). The wizard is the core new-user experience. Building it after the data layer and constraints ensures the completion flow has correct idempotency guards from the start rather than retrofitting them later.
**Delivers:** `/setup` route, `SetupWizardPage` (3 steps: income → items → review), wizard components, `WizardRoute` guard in `App.tsx`, localStorage state persistence, bilingual i18n keys for all wizard text.
**Addresses:** Wizard-style first-run setup, pre-filled category items, skippable steps, running balance display
**Avoids:** Pitfall 2 (wizard state lost on refresh) and Pitfall 6 (duplicate categories on re-run via idempotency guards)
**Uses:** `react-hook-form` + `zod` + `@hookform/resolvers` (new dependencies), `checkbox` shadcn component
**Research flag:** `react-hook-form` + `zod` integration is the standard shadcn/ui documented form pattern. Custom `WizardStepper` using shadcn primitives is a copy-paste block. No deeper research needed.
### Phase 4: Full-App Design Consistency
**Rationale:** The dashboard establishes the design token application patterns. All other pages inherit from it. This phase is sequenced last because it depends on `PageShell` and the card/color patterns being proven on the dashboard first. FEATURES.md dependency graph makes this explicit: "all-pages redesign depends on dashboard being finished first."
**Delivers:** `PageShell` applied to all 9 pages, consistent card/color/typography treatment on `BudgetDetailPage` (highest urgency — users navigate here directly from dashboard), `BudgetListPage`, `CategoriesPage`, `TemplatePage`, `LoginPage`, `RegisterPage`, `QuickAddPage`, `SettingsPage`. Empty state pattern for new months.
**Addresses:** Consistent design language (table stakes), BudgetDetailPage polish (P1), remaining page polish (P2), empty states (P2)
**Avoids:** i18n key regressionsswitch to German locale and run key parity check before completing each sub-page
**Research flag:** Standard patterns — `PageShell` wrapper is straightforward. The main risk is thoroughness (9 pages), not technical complexity.
### Phase 4: Auto-Budget Creation
**Rationale:** Depends on Phase 3 — a populated template must be possible before auto-creation is meaningful. Also depends on Phase 2 DB constraints being in place. The profile currency dependency must be resolved here, not deferred.
**Delivers:** Auto-create `useEffect` in `DashboardPage` (with `useRef` guard), profile currency read (verify `profiles` table schema), upsert-based budget creation, first-creation toast notification via `sonner`.
**Addresses:** Auto-created budget on first month visit, correct currency denomination for all users, silent creation for all subsequent months
**Avoids:** Pitfall 1 (concurrent duplicate creation — DB constraint + ON CONFLICT guard) and Pitfall 5 (wrong currency — profile dependency resolved before mutation fires)
**Research flag:** Verify the `profiles` table schema for the currency column name before writing the auto-create code. STACK.md flags this as needing confirmation. Low-effort: check `supabase/migrations/` directly.
### Phase 5: Inline Add-from-Library and Dashboard Simplification
**Rationale:** Depends on Phase 4 — inline add is only meaningful when a budget exists for the current month. Dashboard simplification (removing the chart grid) is deferred until auto-creation is working so there is no regression window where the dashboard shows only empty state. Quick Add deprecation with redirect belongs in the same phase as the replacement being functional.
**Delivers:** `AddOneOffSheet` component replacing `QuickAddPicker` at both call sites, removal of QuickAdd from sidebar nav, redirect from `/quick-add` to `/budgets`, removal of 3-column chart grid from `DashboardContent`, `scroll-area` shadcn component.
**Addresses:** Inline add-from-library on budget view, Quick Add page consolidation, dashboard "at a glance" simplification, empty state for removed chart area
**Avoids:** Pitfall 4 (Quick Add removal breaks nav/bookmarks — redirect added in same commit as nav removal)
**Research flag:** Standard component replacement pattern. No deeper research needed.
### Phase Ordering Rationale
- **Foundation before features:** Pitfall 6 (design inconsistency) has a HIGH recovery cost. Establishing `index.css` tokens and shared components in Phase 1 prevents the most expensive failure mode.
- **Dashboard before other pages:** FEATURES.md dependency graph is explicit — the dashboard establishes the patterns all pages inherit. Building it second (after foundation) lets Phase 4 apply proven patterns.
- **Charts before collapsibles:** `ChartPanel` layout must be stable before collapsible sections are added beneath it. The ResizeObserver pitfall (Pitfall 3) is easiest to test and fix when charts are the only moving part.
- **Sections in their own phase:** The collapsible + ResizeObserver interaction is the trickiest technical integration. Isolating it in Phase 3 limits blast radius if issues arise.
- **Tokens first** because they are global-scope — any token change touches all pages. Establishing them before page work begins means every page built afterward is already on the correct visual foundation.
- **Data + constraints before UI** because the wizard's correctness depends on DB-level deduplication and accurate first-run detection. Building the wizard UI first and adding guards later is the most common cause of data corruption in this pattern.
- **Wizard before auto-budget** because auto-budget is only meaningful when there is a template to generate from. The wizard is the mechanism that creates the template. E2E testing of auto-budget requires a wizard-populated template.
- **Auto-budget before inline add** because inline add requires a current-month budget to exist. The auto-creation flow provides that guarantee.
- This ordering satisfies all 9 pitfall prevention phases documented in PITFALLS.md.
### Research Flags
Phases with standard, well-documented patterns (skip `/gsd:research-phase`):
- **Phase 1:** Tailwind v4 `@theme inline`, OKLCH color tokens, and WCAG contrast requirements are all from official documentation with no ambiguity.
- **Phase 2:** Recharts 3.8.0 chart implementations and the `chart.tsx` fix are fully documented. Month navigation via `useBudgets` hook is a straightforward state change in `DashboardContent`.
- **Phase 3:** Radix Collapsible primitive is well-documented. The animation pattern with `--radix-collapsible-content-height` is the standard approach.
- **Phase 4:** `PageShell` application and page-by-page refresh are repetitive pattern application, not novel implementation.
Phases needing specific verification at planning time:
- **Phase 4 (Auto-Budget Creation):** Verify the `profiles` table schema — specifically the `currency` column name and whether `useProfile` or `useAuth` is the correct hook to read it from. STACK.md flags this as a "verify in planning" item. Action: check `supabase/migrations/001_profiles.sql` before writing the auto-create spec.
No phases require pre-execution research. All major decisions are resolved by this research.
---
Phases with standard patterns (skip research-phase):
- **Phase 1:** Tailwind v4 `@theme inline` and OKLCH token overrides — fully documented, established pattern in this codebase.
- **Phase 2:** Static data file, boolean flag migration, unique constraint migrations — no novel patterns.
- **Phase 3:** `react-hook-form` + `zod` is the standard shadcn/ui form pattern; wizard stepper is a shadcn/ui blocks copy-paste.
- **Phase 5:** Component replacement using existing hooks and shadcn Sheet — established pattern within this codebase.
## Confidence Assessment
| Area | Confidence | Notes |
|------|------------|-------|
| Stack | HIGH | Stack is locked and fully inspected. The one uncertainty (shadcn `chart.tsx` + Recharts v3 compatibility) has a documented fix in issue #9892. |
| Features | HIGH | Grounded in competitor analysis (YNAB, Empower) and fintech UX standards. Feature prioritization is opinionated and defensible. |
| Architecture | HIGH | Based on full codebase inspection. Component boundaries and build order are derived from actual file structure and import dependencies. |
| Pitfalls | HIGH | Most pitfalls verified against official docs and open Recharts/shadcn issues. Recovery strategies and warning signs documented for each. |
| Stack | HIGH | Verified against `package.json` and `supabase/migrations/`; actual installed versions confirmed; new dependencies verified via npm (April 2026); prior research's Recharts 3.x claim corrected |
| Features | MEDIUM | Grounded in competitor analysis (YNAB, Monarch, EveryDollar, Quicken Simplifi) and UX onboarding literature; no first-party user testing data for this specific app's users |
| Architecture | HIGH | Based on full codebase inspection; all hook names, mutation signatures, component locations, and file paths verified against source files |
| Pitfalls | HIGH | Direct codebase analysis for each pitfall; React StrictMode double-invocation and TanStack Query mutation patterns are well-understood; DB constraint behaviors are standard PostgreSQL |
**Overall confidence: HIGH**
**Overall confidence:** HIGH
### Gaps to Address
- **shadcn `chart.tsx` patch (issue #9892):** The `initialDimension` fix is community-verified but not yet merged into the official shadcn CLI output. Apply manually after generation and verify with a smoke test (render one chart, confirm no `width(-1)` warnings in console) before proceeding with Phase 2.
- **WCAG contrast on category colors:** The recommended OKLCH values in STACK.md (chroma bumped to ~0.18+) have not been run through a contrast checker. During Phase 1, verify each category color pair against its background at the target luminance levels. Adjust chroma or lightness if any pair fails 3:1 (non-text) or 4.5:1 (text) thresholds.
- **i18n key count baseline:** Before starting the overhaul, run `i18next-scanner` (or manually audit `en.json` vs `de.json`) to establish a baseline parity count. This makes regression detection in each subsequent phase mechanical rather than manual.
- **`BudgetListPage` data shape:** Research did not inspect `BudgetListPage` implementation in detail. Phase 4 may uncover layout decisions that conflict with the dashboard's card pattern. Plan for one iteration pass on `BudgetListPage` specifically.
- **`profiles` table currency column:** STACK.md's RPC SQL assumes a `currency` column on `profiles`. PITFALLS.md flags that auto-create defaults to EUR without reading it. Verify column name before Phase 4 begins — check `supabase/migrations/001_profiles.sql`. Low-effort, one-minute check.
---
- **`setup_completed` backfill migration:** This migration must ship before or simultaneously with Phase 3 to prevent existing v1.0 users from hitting the wizard on their first v2.0 login. Write and test it in Phase 2; it is a prerequisite for Phase 3 deployment.
- **i18n for pre-filled wizard item names:** The ~15-20 preset items in `presets.ts` have English names (Rent, Groceries, Car Insurance, etc.). German translations must exist in `de.json` before the wizard ships. Define translation keys directly in `presets.ts` at data-definition time to make the i18n requirement explicit and auditable.
- **`quick_add_items` user data consideration:** Existing users may have data in `quick_add_items` that no longer surfaces in the UI after Phase 5. The new inline add uses `categories`, not `quick_add_items`. No migration is planned to bridge these. Acceptable risk for a personal/single-user app, but worth noting in user-facing release notes if the app has multiple users.
- **TanStack Query v5 `useEffect` mutation pattern:** PITFALLS.md recommends against firing mutations inside `useEffect` with data dependencies. ARCHITECTURE.md uses exactly this pattern (with a `useRef` guard). Verify the `useRef(false)` guard is sufficient for TanStack Query v5's mutation lifecycle — specifically that `mutate` called on an already-pending mutation is silently ignored (it is, per TQ v5 docs, but confirm in implementation).
## Sources
### Primary (HIGH confidence — official documentation)
- [Recharts 3.0 Migration Guide](https://github.com/recharts/recharts/wiki/3.0-migration-guide) — v3 breaking changes, `Cell` deprecation, `blendStroke` removal
- [Recharts API: ResponsiveContainer](https://recharts.github.io/en-US/api/ResponsiveContainer/) — `debounce` prop, dimension requirements
- [shadcn/ui Chart Docs](https://ui.shadcn.com/docs/components/chart) — `ChartContainer`, `ChartConfig`, `ChartTooltipContent`
- [shadcn/ui Accordion + Collapsible Docs](https://ui.shadcn.com/docs/components/radix/accordion) — component API, `type="multiple"`, independent state
- [Radix UI Collapsible](https://www.radix-ui.com/primitives/docs/components/collapsible) — `--radix-collapsible-content-height` animation pattern
- [Tailwind CSS v4 Theme Docs](https://tailwindcss.com/docs/theme) — `@theme inline`, CSS variable scoping, dark mode class strategy
- [WCAG 2.1 SC 1.4.11 Non-text Contrast](https://www.w3.org/WAI/WCAG21/Understanding/non-text-contrast.html) — 3:1 minimum for UI components and chart elements
- [WCAG SC 1.4.3 Contrast Minimum](https://www.w3.org/WAI/WCAG21/Understanding/contrast-minimum.html) — 4.5:1 for normal text
- [React useMemo](https://react.dev/reference/react/useMemo) — memoization patterns for derived state
- Existing codebase: full inspection of `src/pages/`, `src/components/`, `src/hooks/`, `src/lib/`, `src/index.css`
### Primary (HIGH confidence)
- `package.json` (project root) — authoritative installed versions; confirmed Recharts 2.15.4 not 3.x
- `supabase/migrations/002_categories.sql` through `005_quick_add.sql` — authoritative schema
- `src/App.tsx`, `src/components/AppLayout.tsx`, `src/pages/DashboardPage.tsx`, `src/pages/BudgetDetailPage.tsx` — confirmed existing routing, nav items, hook usage patterns
- `src/hooks/useBudgets.ts`, `src/hooks/useTemplate.ts`, `src/hooks/useCategories.ts` — confirmed existing mutation signatures
- `src/index.css`, `src/lib/palette.ts`, `src/lib/types.ts` — confirmed token structure and CSS variable names
- npm search results (April 2026) — react-hook-form 7.72.0, zod 4.3.6, @hookform/resolvers 5.2.2
- [shadcn/ui blocks page](https://ui.shadcn.com/blocks) — stepper patterns available as copy-paste blocks, no npm dependency
### Secondary (MEDIUM confidence — community sources, multiple corroborating)
- [shadcn-ui/ui PR #8486](https://github.com/shadcn-ui/ui/pull/8486) — Recharts v3 chart.tsx upgrade (open as of March 2026)
- [shadcn-ui/ui Issue #9892](https://github.com/shadcn-ui/ui/issues/9892) — Community-verified `initialDimension` fix for Recharts v3
- [Recharts performance guide](https://recharts.github.io/en-US/guide/performance/) — memoization guidance
- [Recharts ResizeObserver loop issue #1770](https://github.com/recharts/recharts/issues/1770) — confirmed bug and `debounce` workaround
- [YNAB / Empower competitor analysis](https://bountisphere.com/blog/personal-finance-apps-2025-review) — feature comparison basis
- [Fintech dashboard design best practices — Eleken, Merge Rocks, F9 Finance](https://merge.rocks/blog/fintech-dashboard-design-or-how-to-make-data-look-pretty) — visual design conventions
- [shadcn/ui Charts examples](https://ui.shadcn.com/charts) — Donut with center text, bar chart patterns
### Secondary (MEDIUM confidence)
- YNAB, Monarch Money, EveryDollar, Quicken Simplifi — competitor feature patterns for wizard setup, auto-budget creation, and inline item adding
- [zod.dev/v4](https://zod.dev/v4) — Zod 4 stable release notes and versioning strategy
- [Evil Martians OKLCH guide](https://evilmartians.com/chronicles/better-dynamic-themes-in-tailwind-with-oklch-color-magic) — lightness/chroma values for pastel system design
- UX onboarding literature (UX Design Institute, UXCam, UXDA, Smashing Magazine) — wizard step count drop-off data, sheet vs. modal UX rationale
- [Recharts 3.0 migration guide](https://github.com/recharts/recharts/wiki/3.0-migration-guide) — confirmed breaking changes; basis for "do not upgrade" recommendation
### Tertiary (informing but not authoritative)
- [Skeleton loading UX — LogRocket](https://blog.logrocket.com/ux-design/skeleton-loading-screen-design/) — skeleton mirrors real layout
- [Empty state UX — Eleken](https://www.eleken.co/blog-posts/empty-state-ux) — CTA pattern for empty states
- [Color theory in finance dashboards — Extej/Medium](https://medium.com/@extej/the-role-of-color-theory-in-finance-dashboard-design-d2942aec9fff) — palette chroma recommendations
### Tertiary (LOW confidence — informing but not authoritative)
- TanStack Query v5 Strict Mode double-invocation behavior — inferred from known React 18/19 `useEffect` patterns; verify against TQ v5 mutation docs if unexpected behavior appears during implementation
- PostgreSQL `ON CONFLICT DO NOTHING` behavior on Supabase PostgREST layer — standard DB behavior but confirm the exact upsert syntax works via the `@supabase/supabase-js` v2 client
---
*Research completed: 2026-03-16*
*Research completed: 2026-04-02*
*Ready for roadmap: yes*

805
bun.lock Normal file
View File

@@ -0,0 +1,805 @@
{
"lockfileVersion": 1,
"configVersion": 1,
"workspaces": {
"": {
"name": "simple-finance-dash",
"dependencies": {
"@supabase/supabase-js": "^2.99.1",
"@tanstack/react-query": "^5.90.21",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"i18next": "^25.8.18",
"lucide-react": "^0.577.0",
"next-themes": "^0.4.6",
"radix-ui": "^1.4.3",
"react": "^19.2.4",
"react-dom": "^19.2.4",
"react-i18next": "^16.5.8",
"react-router-dom": "^7.13.1",
"recharts": "2.15.4",
"sonner": "^2.0.7",
"tailwind-merge": "^3.5.0",
},
"devDependencies": {
"@eslint/js": "^9.39.4",
"@tailwindcss/vite": "^4.2.1",
"@types/node": "^24.12.0",
"@types/react": "^19.2.14",
"@types/react-dom": "^19.2.3",
"@vitejs/plugin-react": "^6.0.0",
"eslint": "^9.39.4",
"eslint-plugin-react-hooks": "^7.0.1",
"eslint-plugin-react-refresh": "^0.5.2",
"globals": "^17.4.0",
"tailwindcss": "^4.2.1",
"typescript": "~5.9.3",
"typescript-eslint": "^8.56.1",
"vite": "^8.0.0",
},
},
},
"packages": {
"@babel/code-frame": ["@babel/code-frame@7.29.0", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.28.5", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-9NhCeYjq9+3uxgdtp20LSiJXJvN0FeCtNGpJxuMFZ1Kv3cWUNb6DOhJwUvcVCzKGR66cw4njwM6hrJLqgOwbcw=="],
"@babel/compat-data": ["@babel/compat-data@7.29.0", "", {}, "sha512-T1NCJqT/j9+cn8fvkt7jtwbLBfLC/1y1c7NtCeXFRgzGTsafi68MRv8yzkYSapBnFA6L3U2VSc02ciDzoAJhJg=="],
"@babel/core": ["@babel/core@7.29.0", "", { "dependencies": { "@babel/code-frame": "^7.29.0", "@babel/generator": "^7.29.0", "@babel/helper-compilation-targets": "^7.28.6", "@babel/helper-module-transforms": "^7.28.6", "@babel/helpers": "^7.28.6", "@babel/parser": "^7.29.0", "@babel/template": "^7.28.6", "@babel/traverse": "^7.29.0", "@babel/types": "^7.29.0", "@jridgewell/remapping": "^2.3.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", "json5": "^2.2.3", "semver": "^6.3.1" } }, "sha512-CGOfOJqWjg2qW/Mb6zNsDm+u5vFQ8DxXfbM09z69p5Z6+mE1ikP2jUXw+j42Pf1XTYED2Rni5f95npYeuwMDQA=="],
"@babel/generator": ["@babel/generator@7.29.1", "", { "dependencies": { "@babel/parser": "^7.29.0", "@babel/types": "^7.29.0", "@jridgewell/gen-mapping": "^0.3.12", "@jridgewell/trace-mapping": "^0.3.28", "jsesc": "^3.0.2" } }, "sha512-qsaF+9Qcm2Qv8SRIMMscAvG4O3lJ0F1GuMo5HR/Bp02LopNgnZBC/EkbevHFeGs4ls/oPz9v+Bsmzbkbe+0dUw=="],
"@babel/helper-compilation-targets": ["@babel/helper-compilation-targets@7.28.6", "", { "dependencies": { "@babel/compat-data": "^7.28.6", "@babel/helper-validator-option": "^7.27.1", "browserslist": "^4.24.0", "lru-cache": "^5.1.1", "semver": "^6.3.1" } }, "sha512-JYtls3hqi15fcx5GaSNL7SCTJ2MNmjrkHXg4FSpOA/grxK8KwyZ5bubHsCq8FXCkua6xhuaaBit+3b7+VZRfcA=="],
"@babel/helper-globals": ["@babel/helper-globals@7.28.0", "", {}, "sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw=="],
"@babel/helper-module-imports": ["@babel/helper-module-imports@7.28.6", "", { "dependencies": { "@babel/traverse": "^7.28.6", "@babel/types": "^7.28.6" } }, "sha512-l5XkZK7r7wa9LucGw9LwZyyCUscb4x37JWTPz7swwFE/0FMQAGpiWUZn8u9DzkSBWEcK25jmvubfpw2dnAMdbw=="],
"@babel/helper-module-transforms": ["@babel/helper-module-transforms@7.28.6", "", { "dependencies": { "@babel/helper-module-imports": "^7.28.6", "@babel/helper-validator-identifier": "^7.28.5", "@babel/traverse": "^7.28.6" }, "peerDependencies": { "@babel/core": "^7.0.0" } }, "sha512-67oXFAYr2cDLDVGLXTEABjdBJZ6drElUSI7WKp70NrpyISso3plG9SAGEF6y7zbha/wOzUByWWTJvEDVNIUGcA=="],
"@babel/helper-string-parser": ["@babel/helper-string-parser@7.27.1", "", {}, "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA=="],
"@babel/helper-validator-identifier": ["@babel/helper-validator-identifier@7.28.5", "", {}, "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q=="],
"@babel/helper-validator-option": ["@babel/helper-validator-option@7.27.1", "", {}, "sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg=="],
"@babel/helpers": ["@babel/helpers@7.28.6", "", { "dependencies": { "@babel/template": "^7.28.6", "@babel/types": "^7.28.6" } }, "sha512-xOBvwq86HHdB7WUDTfKfT/Vuxh7gElQ+Sfti2Cy6yIWNW05P8iUslOVcZ4/sKbE+/jQaukQAdz/gf3724kYdqw=="],
"@babel/parser": ["@babel/parser@7.29.0", "", { "dependencies": { "@babel/types": "^7.29.0" }, "bin": "./bin/babel-parser.js" }, "sha512-IyDgFV5GeDUVX4YdF/3CPULtVGSXXMLh1xVIgdCgxApktqnQV0r7/8Nqthg+8YLGaAtdyIlo2qIdZrbCv4+7ww=="],
"@babel/runtime": ["@babel/runtime@7.28.6", "", {}, "sha512-05WQkdpL9COIMz4LjTxGpPNCdlpyimKppYNoJ5Di5EUObifl8t4tuLuUBBZEpoLYOmfvIWrsp9fCl0HoPRVTdA=="],
"@babel/template": ["@babel/template@7.28.6", "", { "dependencies": { "@babel/code-frame": "^7.28.6", "@babel/parser": "^7.28.6", "@babel/types": "^7.28.6" } }, "sha512-YA6Ma2KsCdGb+WC6UpBVFJGXL58MDA6oyONbjyF/+5sBgxY/dwkhLogbMT2GXXyU84/IhRw/2D1Os1B/giz+BQ=="],
"@babel/traverse": ["@babel/traverse@7.29.0", "", { "dependencies": { "@babel/code-frame": "^7.29.0", "@babel/generator": "^7.29.0", "@babel/helper-globals": "^7.28.0", "@babel/parser": "^7.29.0", "@babel/template": "^7.28.6", "@babel/types": "^7.29.0", "debug": "^4.3.1" } }, "sha512-4HPiQr0X7+waHfyXPZpWPfWL/J7dcN1mx9gL6WdQVMbPnF3+ZhSMs8tCxN7oHddJE9fhNE7+lxdnlyemKfJRuA=="],
"@babel/types": ["@babel/types@7.29.0", "", { "dependencies": { "@babel/helper-string-parser": "^7.27.1", "@babel/helper-validator-identifier": "^7.28.5" } }, "sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A=="],
"@emnapi/core": ["@emnapi/core@1.9.0", "", { "dependencies": { "@emnapi/wasi-threads": "1.2.0", "tslib": "^2.4.0" } }, "sha512-0DQ98G9ZQZOxfUcQn1waV2yS8aWdZ6kJMbYCJB3oUBecjWYO1fqJ+a1DRfPF3O5JEkwqwP1A9QEN/9mYm2Yd0w=="],
"@emnapi/runtime": ["@emnapi/runtime@1.9.0", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-QN75eB0IH2ywSpRpNddCRfQIhmJYBCJ1x5Lb3IscKAL8bMnVAKnRg8dCoXbHzVLLH7P38N2Z3mtulB7W0J0FKw=="],
"@emnapi/wasi-threads": ["@emnapi/wasi-threads@1.2.0", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-N10dEJNSsUx41Z6pZsXU8FjPjpBEplgH24sfkmITrBED1/U2Esum9F3lfLrMjKHHjmi557zQn7kR9R+XWXu5Rg=="],
"@eslint-community/eslint-utils": ["@eslint-community/eslint-utils@4.9.1", "", { "dependencies": { "eslint-visitor-keys": "^3.4.3" }, "peerDependencies": { "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" } }, "sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ=="],
"@eslint-community/regexpp": ["@eslint-community/regexpp@4.12.2", "", {}, "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew=="],
"@eslint/config-array": ["@eslint/config-array@0.21.2", "", { "dependencies": { "@eslint/object-schema": "^2.1.7", "debug": "^4.3.1", "minimatch": "^3.1.5" } }, "sha512-nJl2KGTlrf9GjLimgIru+V/mzgSK0ABCDQRvxw5BjURL7WfH5uoWmizbH7QB6MmnMBd8cIC9uceWnezL1VZWWw=="],
"@eslint/config-helpers": ["@eslint/config-helpers@0.4.2", "", { "dependencies": { "@eslint/core": "^0.17.0" } }, "sha512-gBrxN88gOIf3R7ja5K9slwNayVcZgK6SOUORm2uBzTeIEfeVaIhOpCtTox3P6R7o2jLFwLFTLnC7kU/RGcYEgw=="],
"@eslint/core": ["@eslint/core@0.17.0", "", { "dependencies": { "@types/json-schema": "^7.0.15" } }, "sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ=="],
"@eslint/eslintrc": ["@eslint/eslintrc@3.3.5", "", { "dependencies": { "ajv": "^6.14.0", "debug": "^4.3.2", "espree": "^10.0.1", "globals": "^14.0.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", "js-yaml": "^4.1.1", "minimatch": "^3.1.5", "strip-json-comments": "^3.1.1" } }, "sha512-4IlJx0X0qftVsN5E+/vGujTRIFtwuLbNsVUe7TO6zYPDR1O6nFwvwhIKEKSrl6dZchmYBITazxKoUYOjdtjlRg=="],
"@eslint/js": ["@eslint/js@9.39.4", "", {}, "sha512-nE7DEIchvtiFTwBw4Lfbu59PG+kCofhjsKaCWzxTpt4lfRjRMqG6uMBzKXuEcyXhOHoUp9riAm7/aWYGhXZ9cw=="],
"@eslint/object-schema": ["@eslint/object-schema@2.1.7", "", {}, "sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA=="],
"@eslint/plugin-kit": ["@eslint/plugin-kit@0.4.1", "", { "dependencies": { "@eslint/core": "^0.17.0", "levn": "^0.4.1" } }, "sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA=="],
"@floating-ui/core": ["@floating-ui/core@1.7.5", "", { "dependencies": { "@floating-ui/utils": "^0.2.11" } }, "sha512-1Ih4WTWyw0+lKyFMcBHGbb5U5FtuHJuujoyyr5zTaWS5EYMeT6Jb2AuDeftsCsEuchO+mM2ij5+q9crhydzLhQ=="],
"@floating-ui/dom": ["@floating-ui/dom@1.7.6", "", { "dependencies": { "@floating-ui/core": "^1.7.5", "@floating-ui/utils": "^0.2.11" } }, "sha512-9gZSAI5XM36880PPMm//9dfiEngYoC6Am2izES1FF406YFsjvyBMmeJ2g4SAju3xWwtuynNRFL2s9hgxpLI5SQ=="],
"@floating-ui/react-dom": ["@floating-ui/react-dom@2.1.8", "", { "dependencies": { "@floating-ui/dom": "^1.7.6" }, "peerDependencies": { "react": ">=16.8.0", "react-dom": ">=16.8.0" } }, "sha512-cC52bHwM/n/CxS87FH0yWdngEZrjdtLW/qVruo68qg+prK7ZQ4YGdut2GyDVpoGeAYe/h899rVeOVm6Oi40k2A=="],
"@floating-ui/utils": ["@floating-ui/utils@0.2.11", "", {}, "sha512-RiB/yIh78pcIxl6lLMG0CgBXAZ2Y0eVHqMPYugu+9U0AeT6YBeiJpf7lbdJNIugFP5SIjwNRgo4DhR1Qxi26Gg=="],
"@humanfs/core": ["@humanfs/core@0.19.1", "", {}, "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA=="],
"@humanfs/node": ["@humanfs/node@0.16.7", "", { "dependencies": { "@humanfs/core": "^0.19.1", "@humanwhocodes/retry": "^0.4.0" } }, "sha512-/zUx+yOsIrG4Y43Eh2peDeKCxlRt/gET6aHfaKpuq267qXdYDFViVHfMaLyygZOnl0kGWxFIgsBy8QFuTLUXEQ=="],
"@humanwhocodes/module-importer": ["@humanwhocodes/module-importer@1.0.1", "", {}, "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA=="],
"@humanwhocodes/retry": ["@humanwhocodes/retry@0.4.3", "", {}, "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ=="],
"@jridgewell/gen-mapping": ["@jridgewell/gen-mapping@0.3.13", "", { "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.0", "@jridgewell/trace-mapping": "^0.3.24" } }, "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA=="],
"@jridgewell/remapping": ["@jridgewell/remapping@2.3.5", "", { "dependencies": { "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.24" } }, "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ=="],
"@jridgewell/resolve-uri": ["@jridgewell/resolve-uri@3.1.2", "", {}, "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw=="],
"@jridgewell/sourcemap-codec": ["@jridgewell/sourcemap-codec@1.5.5", "", {}, "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og=="],
"@jridgewell/trace-mapping": ["@jridgewell/trace-mapping@0.3.31", "", { "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" } }, "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw=="],
"@napi-rs/wasm-runtime": ["@napi-rs/wasm-runtime@1.1.1", "", { "dependencies": { "@emnapi/core": "^1.7.1", "@emnapi/runtime": "^1.7.1", "@tybys/wasm-util": "^0.10.1" } }, "sha512-p64ah1M1ld8xjWv3qbvFwHiFVWrq1yFvV4f7w+mzaqiR4IlSgkqhcRdHwsGgomwzBH51sRY4NEowLxnaBjcW/A=="],
"@oxc-project/runtime": ["@oxc-project/runtime@0.115.0", "", {}, "sha512-Rg8Wlt5dCbXhQnsXPrkOjL1DTSvXLgb2R/KYfnf1/K+R0k6UMLEmbQXPM+kwrWqSmWA2t0B1EtHy2/3zikQpvQ=="],
"@oxc-project/types": ["@oxc-project/types@0.115.0", "", {}, "sha512-4n91DKnebUS4yjUHl2g3/b2T+IUdCfmoZGhmwsovZCDaJSs+QkVAM+0AqqTxHSsHfeiMuueT75cZaZcT/m0pSw=="],
"@radix-ui/number": ["@radix-ui/number@1.1.1", "", {}, "sha512-MkKCwxlXTgz6CFoJx3pCwn07GKp36+aZyu/u2Ln2VrA5DcdyCZkASEDBTd8x5whTQQL5CiYf4prXKLcgQdv29g=="],
"@radix-ui/primitive": ["@radix-ui/primitive@1.1.3", "", {}, "sha512-JTF99U/6XIjCBo0wqkU5sK10glYe27MRRsfwoiq5zzOEZLHU3A3KCMa5X/azekYRCJ0HlwI0crAXS/5dEHTzDg=="],
"@radix-ui/react-accessible-icon": ["@radix-ui/react-accessible-icon@1.1.7", "", { "dependencies": { "@radix-ui/react-visually-hidden": "1.2.3" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-XM+E4WXl0OqUJFovy6GjmxxFyx9opfCAIUku4dlKRd5YEPqt4kALOkQOp0Of6reHuUkJuiPBEc5k0o4z4lTC8A=="],
"@radix-ui/react-accordion": ["@radix-ui/react-accordion@1.2.12", "", { "dependencies": { "@radix-ui/primitive": "1.1.3", "@radix-ui/react-collapsible": "1.1.12", "@radix-ui/react-collection": "1.1.7", "@radix-ui/react-compose-refs": "1.1.2", "@radix-ui/react-context": "1.1.2", "@radix-ui/react-direction": "1.1.1", "@radix-ui/react-id": "1.1.1", "@radix-ui/react-primitive": "2.1.3", "@radix-ui/react-use-controllable-state": "1.2.2" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-T4nygeh9YE9dLRPhAHSeOZi7HBXo+0kYIPJXayZfvWOWA0+n3dESrZbjfDPUABkUNym6Hd+f2IR113To8D2GPA=="],
"@radix-ui/react-alert-dialog": ["@radix-ui/react-alert-dialog@1.1.15", "", { "dependencies": { "@radix-ui/primitive": "1.1.3", "@radix-ui/react-compose-refs": "1.1.2", "@radix-ui/react-context": "1.1.2", "@radix-ui/react-dialog": "1.1.15", "@radix-ui/react-primitive": "2.1.3", "@radix-ui/react-slot": "1.2.3" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-oTVLkEw5GpdRe29BqJ0LSDFWI3qu0vR1M0mUkOQWDIUnY/QIkLpgDMWuKxP94c2NAC2LGcgVhG1ImF3jkZ5wXw=="],
"@radix-ui/react-arrow": ["@radix-ui/react-arrow@1.1.7", "", { "dependencies": { "@radix-ui/react-primitive": "2.1.3" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-F+M1tLhO+mlQaOWspE8Wstg+z6PwxwRd8oQ8IXceWz92kfAmalTRf0EjrouQeo7QssEPfCn05B4Ihs1K9WQ/7w=="],
"@radix-ui/react-aspect-ratio": ["@radix-ui/react-aspect-ratio@1.1.7", "", { "dependencies": { "@radix-ui/react-primitive": "2.1.3" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-Yq6lvO9HQyPwev1onK1daHCHqXVLzPhSVjmsNjCa2Zcxy2f7uJD2itDtxknv6FzAKCwD1qQkeVDmX/cev13n/g=="],
"@radix-ui/react-avatar": ["@radix-ui/react-avatar@1.1.10", "", { "dependencies": { "@radix-ui/react-context": "1.1.2", "@radix-ui/react-primitive": "2.1.3", "@radix-ui/react-use-callback-ref": "1.1.1", "@radix-ui/react-use-is-hydrated": "0.1.0", "@radix-ui/react-use-layout-effect": "1.1.1" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-V8piFfWapM5OmNCXTzVQY+E1rDa53zY+MQ4Y7356v4fFz6vqCyUtIz2rUD44ZEdwg78/jKmMJHj07+C/Z/rcog=="],
"@radix-ui/react-checkbox": ["@radix-ui/react-checkbox@1.3.3", "", { "dependencies": { "@radix-ui/primitive": "1.1.3", "@radix-ui/react-compose-refs": "1.1.2", "@radix-ui/react-context": "1.1.2", "@radix-ui/react-presence": "1.1.5", "@radix-ui/react-primitive": "2.1.3", "@radix-ui/react-use-controllable-state": "1.2.2", "@radix-ui/react-use-previous": "1.1.1", "@radix-ui/react-use-size": "1.1.1" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-wBbpv+NQftHDdG86Qc0pIyXk5IR3tM8Vd0nWLKDcX8nNn4nXFOFwsKuqw2okA/1D/mpaAkmuyndrPJTYDNZtFw=="],
"@radix-ui/react-collapsible": ["@radix-ui/react-collapsible@1.1.12", "", { "dependencies": { "@radix-ui/primitive": "1.1.3", "@radix-ui/react-compose-refs": "1.1.2", "@radix-ui/react-context": "1.1.2", "@radix-ui/react-id": "1.1.1", "@radix-ui/react-presence": "1.1.5", "@radix-ui/react-primitive": "2.1.3", "@radix-ui/react-use-controllable-state": "1.2.2", "@radix-ui/react-use-layout-effect": "1.1.1" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-Uu+mSh4agx2ib1uIGPP4/CKNULyajb3p92LsVXmH2EHVMTfZWpll88XJ0j4W0z3f8NK1eYl1+Mf/szHPmcHzyA=="],
"@radix-ui/react-collection": ["@radix-ui/react-collection@1.1.7", "", { "dependencies": { "@radix-ui/react-compose-refs": "1.1.2", "@radix-ui/react-context": "1.1.2", "@radix-ui/react-primitive": "2.1.3", "@radix-ui/react-slot": "1.2.3" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-Fh9rGN0MoI4ZFUNyfFVNU4y9LUz93u9/0K+yLgA2bwRojxM8JU1DyvvMBabnZPBgMWREAJvU2jjVzq+LrFUglw=="],
"@radix-ui/react-compose-refs": ["@radix-ui/react-compose-refs@1.1.2", "", { "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-z4eqJvfiNnFMHIIvXP3CY57y2WJs5g2v3X0zm9mEJkrkNv4rDxu+sg9Jh8EkXyeqBkB7SOcboo9dMVqhyrACIg=="],
"@radix-ui/react-context": ["@radix-ui/react-context@1.1.2", "", { "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-jCi/QKUM2r1Ju5a3J64TH2A5SpKAgh0LpknyqdQ4m6DCV0xJ2HG1xARRwNGPQfi1SLdLWZ1OJz6F4OMBBNiGJA=="],
"@radix-ui/react-context-menu": ["@radix-ui/react-context-menu@2.2.16", "", { "dependencies": { "@radix-ui/primitive": "1.1.3", "@radix-ui/react-context": "1.1.2", "@radix-ui/react-menu": "2.1.16", "@radix-ui/react-primitive": "2.1.3", "@radix-ui/react-use-callback-ref": "1.1.1", "@radix-ui/react-use-controllable-state": "1.2.2" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-O8morBEW+HsVG28gYDZPTrT9UUovQUlJue5YO836tiTJhuIWBm/zQHc7j388sHWtdH/xUZurK9olD2+pcqx5ww=="],
"@radix-ui/react-dialog": ["@radix-ui/react-dialog@1.1.15", "", { "dependencies": { "@radix-ui/primitive": "1.1.3", "@radix-ui/react-compose-refs": "1.1.2", "@radix-ui/react-context": "1.1.2", "@radix-ui/react-dismissable-layer": "1.1.11", "@radix-ui/react-focus-guards": "1.1.3", "@radix-ui/react-focus-scope": "1.1.7", "@radix-ui/react-id": "1.1.1", "@radix-ui/react-portal": "1.1.9", "@radix-ui/react-presence": "1.1.5", "@radix-ui/react-primitive": "2.1.3", "@radix-ui/react-slot": "1.2.3", "@radix-ui/react-use-controllable-state": "1.2.2", "aria-hidden": "^1.2.4", "react-remove-scroll": "^2.6.3" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-TCglVRtzlffRNxRMEyR36DGBLJpeusFcgMVD9PZEzAKnUs1lKCgX5u9BmC2Yg+LL9MgZDugFFs1Vl+Jp4t/PGw=="],
"@radix-ui/react-direction": ["@radix-ui/react-direction@1.1.1", "", { "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-1UEWRX6jnOA2y4H5WczZ44gOOjTEmlqv1uNW4GAJEO5+bauCBhv8snY65Iw5/VOS/ghKN9gr2KjnLKxrsvoMVw=="],
"@radix-ui/react-dismissable-layer": ["@radix-ui/react-dismissable-layer@1.1.11", "", { "dependencies": { "@radix-ui/primitive": "1.1.3", "@radix-ui/react-compose-refs": "1.1.2", "@radix-ui/react-primitive": "2.1.3", "@radix-ui/react-use-callback-ref": "1.1.1", "@radix-ui/react-use-escape-keydown": "1.1.1" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-Nqcp+t5cTB8BinFkZgXiMJniQH0PsUt2k51FUhbdfeKvc4ACcG2uQniY/8+h1Yv6Kza4Q7lD7PQV0z0oicE0Mg=="],
"@radix-ui/react-dropdown-menu": ["@radix-ui/react-dropdown-menu@2.1.16", "", { "dependencies": { "@radix-ui/primitive": "1.1.3", "@radix-ui/react-compose-refs": "1.1.2", "@radix-ui/react-context": "1.1.2", "@radix-ui/react-id": "1.1.1", "@radix-ui/react-menu": "2.1.16", "@radix-ui/react-primitive": "2.1.3", "@radix-ui/react-use-controllable-state": "1.2.2" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-1PLGQEynI/3OX/ftV54COn+3Sud/Mn8vALg2rWnBLnRaGtJDduNW/22XjlGgPdpcIbiQxjKtb7BkcjP00nqfJw=="],
"@radix-ui/react-focus-guards": ["@radix-ui/react-focus-guards@1.1.3", "", { "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-0rFg/Rj2Q62NCm62jZw0QX7a3sz6QCQU0LpZdNrJX8byRGaGVTqbrW9jAoIAHyMQqsNpeZ81YgSizOt5WXq0Pw=="],
"@radix-ui/react-focus-scope": ["@radix-ui/react-focus-scope@1.1.7", "", { "dependencies": { "@radix-ui/react-compose-refs": "1.1.2", "@radix-ui/react-primitive": "2.1.3", "@radix-ui/react-use-callback-ref": "1.1.1" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-t2ODlkXBQyn7jkl6TNaw/MtVEVvIGelJDCG41Okq/KwUsJBwQ4XVZsHAVUkK4mBv3ewiAS3PGuUWuY2BoK4ZUw=="],
"@radix-ui/react-form": ["@radix-ui/react-form@0.1.8", "", { "dependencies": { "@radix-ui/primitive": "1.1.3", "@radix-ui/react-compose-refs": "1.1.2", "@radix-ui/react-context": "1.1.2", "@radix-ui/react-id": "1.1.1", "@radix-ui/react-label": "2.1.7", "@radix-ui/react-primitive": "2.1.3" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-QM70k4Zwjttifr5a4sZFts9fn8FzHYvQ5PiB19O2HsYibaHSVt9fH9rzB0XZo/YcM+b7t/p7lYCT/F5eOeF5yQ=="],
"@radix-ui/react-hover-card": ["@radix-ui/react-hover-card@1.1.15", "", { "dependencies": { "@radix-ui/primitive": "1.1.3", "@radix-ui/react-compose-refs": "1.1.2", "@radix-ui/react-context": "1.1.2", "@radix-ui/react-dismissable-layer": "1.1.11", "@radix-ui/react-popper": "1.2.8", "@radix-ui/react-portal": "1.1.9", "@radix-ui/react-presence": "1.1.5", "@radix-ui/react-primitive": "2.1.3", "@radix-ui/react-use-controllable-state": "1.2.2" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-qgTkjNT1CfKMoP0rcasmlH2r1DAiYicWsDsufxl940sT2wHNEWWv6FMWIQXWhVdmC1d/HYfbhQx60KYyAtKxjg=="],
"@radix-ui/react-id": ["@radix-ui/react-id@1.1.1", "", { "dependencies": { "@radix-ui/react-use-layout-effect": "1.1.1" }, "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-kGkGegYIdQsOb4XjsfM97rXsiHaBwco+hFI66oO4s9LU+PLAC5oJ7khdOVFxkhsmlbpUqDAvXw11CluXP+jkHg=="],
"@radix-ui/react-label": ["@radix-ui/react-label@2.1.7", "", { "dependencies": { "@radix-ui/react-primitive": "2.1.3" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-YT1GqPSL8kJn20djelMX7/cTRp/Y9w5IZHvfxQTVHrOqa2yMl7i/UfMqKRU5V7mEyKTrUVgJXhNQPVCG8PBLoQ=="],
"@radix-ui/react-menu": ["@radix-ui/react-menu@2.1.16", "", { "dependencies": { "@radix-ui/primitive": "1.1.3", "@radix-ui/react-collection": "1.1.7", "@radix-ui/react-compose-refs": "1.1.2", "@radix-ui/react-context": "1.1.2", "@radix-ui/react-direction": "1.1.1", "@radix-ui/react-dismissable-layer": "1.1.11", "@radix-ui/react-focus-guards": "1.1.3", "@radix-ui/react-focus-scope": "1.1.7", "@radix-ui/react-id": "1.1.1", "@radix-ui/react-popper": "1.2.8", "@radix-ui/react-portal": "1.1.9", "@radix-ui/react-presence": "1.1.5", "@radix-ui/react-primitive": "2.1.3", "@radix-ui/react-roving-focus": "1.1.11", "@radix-ui/react-slot": "1.2.3", "@radix-ui/react-use-callback-ref": "1.1.1", "aria-hidden": "^1.2.4", "react-remove-scroll": "^2.6.3" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-72F2T+PLlphrqLcAotYPp0uJMr5SjP5SL01wfEspJbru5Zs5vQaSHb4VB3ZMJPimgHHCHG7gMOeOB9H3Hdmtxg=="],
"@radix-ui/react-menubar": ["@radix-ui/react-menubar@1.1.16", "", { "dependencies": { "@radix-ui/primitive": "1.1.3", "@radix-ui/react-collection": "1.1.7", "@radix-ui/react-compose-refs": "1.1.2", "@radix-ui/react-context": "1.1.2", "@radix-ui/react-direction": "1.1.1", "@radix-ui/react-id": "1.1.1", "@radix-ui/react-menu": "2.1.16", "@radix-ui/react-primitive": "2.1.3", "@radix-ui/react-roving-focus": "1.1.11", "@radix-ui/react-use-controllable-state": "1.2.2" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-EB1FktTz5xRRi2Er974AUQZWg2yVBb1yjip38/lgwtCVRd3a+maUoGHN/xs9Yv8SY8QwbSEb+YrxGadVWbEutA=="],
"@radix-ui/react-navigation-menu": ["@radix-ui/react-navigation-menu@1.2.14", "", { "dependencies": { "@radix-ui/primitive": "1.1.3", "@radix-ui/react-collection": "1.1.7", "@radix-ui/react-compose-refs": "1.1.2", "@radix-ui/react-context": "1.1.2", "@radix-ui/react-direction": "1.1.1", "@radix-ui/react-dismissable-layer": "1.1.11", "@radix-ui/react-id": "1.1.1", "@radix-ui/react-presence": "1.1.5", "@radix-ui/react-primitive": "2.1.3", "@radix-ui/react-use-callback-ref": "1.1.1", "@radix-ui/react-use-controllable-state": "1.2.2", "@radix-ui/react-use-layout-effect": "1.1.1", "@radix-ui/react-use-previous": "1.1.1", "@radix-ui/react-visually-hidden": "1.2.3" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-YB9mTFQvCOAQMHU+C/jVl96WmuWeltyUEpRJJky51huhds5W2FQr1J8D/16sQlf0ozxkPK8uF3niQMdUwZPv5w=="],
"@radix-ui/react-one-time-password-field": ["@radix-ui/react-one-time-password-field@0.1.8", "", { "dependencies": { "@radix-ui/number": "1.1.1", "@radix-ui/primitive": "1.1.3", "@radix-ui/react-collection": "1.1.7", "@radix-ui/react-compose-refs": "1.1.2", "@radix-ui/react-context": "1.1.2", "@radix-ui/react-direction": "1.1.1", "@radix-ui/react-primitive": "2.1.3", "@radix-ui/react-roving-focus": "1.1.11", "@radix-ui/react-use-controllable-state": "1.2.2", "@radix-ui/react-use-effect-event": "0.0.2", "@radix-ui/react-use-is-hydrated": "0.1.0", "@radix-ui/react-use-layout-effect": "1.1.1" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-ycS4rbwURavDPVjCb5iS3aG4lURFDILi6sKI/WITUMZ13gMmn/xGjpLoqBAalhJaDk8I3UbCM5GzKHrnzwHbvg=="],
"@radix-ui/react-password-toggle-field": ["@radix-ui/react-password-toggle-field@0.1.3", "", { "dependencies": { "@radix-ui/primitive": "1.1.3", "@radix-ui/react-compose-refs": "1.1.2", "@radix-ui/react-context": "1.1.2", "@radix-ui/react-id": "1.1.1", "@radix-ui/react-primitive": "2.1.3", "@radix-ui/react-use-controllable-state": "1.2.2", "@radix-ui/react-use-effect-event": "0.0.2", "@radix-ui/react-use-is-hydrated": "0.1.0" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-/UuCrDBWravcaMix4TdT+qlNdVwOM1Nck9kWx/vafXsdfj1ChfhOdfi3cy9SGBpWgTXwYCuboT/oYpJy3clqfw=="],
"@radix-ui/react-popover": ["@radix-ui/react-popover@1.1.15", "", { "dependencies": { "@radix-ui/primitive": "1.1.3", "@radix-ui/react-compose-refs": "1.1.2", "@radix-ui/react-context": "1.1.2", "@radix-ui/react-dismissable-layer": "1.1.11", "@radix-ui/react-focus-guards": "1.1.3", "@radix-ui/react-focus-scope": "1.1.7", "@radix-ui/react-id": "1.1.1", "@radix-ui/react-popper": "1.2.8", "@radix-ui/react-portal": "1.1.9", "@radix-ui/react-presence": "1.1.5", "@radix-ui/react-primitive": "2.1.3", "@radix-ui/react-slot": "1.2.3", "@radix-ui/react-use-controllable-state": "1.2.2", "aria-hidden": "^1.2.4", "react-remove-scroll": "^2.6.3" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-kr0X2+6Yy/vJzLYJUPCZEc8SfQcf+1COFoAqauJm74umQhta9M7lNJHP7QQS3vkvcGLQUbWpMzwrXYwrYztHKA=="],
"@radix-ui/react-popper": ["@radix-ui/react-popper@1.2.8", "", { "dependencies": { "@floating-ui/react-dom": "^2.0.0", "@radix-ui/react-arrow": "1.1.7", "@radix-ui/react-compose-refs": "1.1.2", "@radix-ui/react-context": "1.1.2", "@radix-ui/react-primitive": "2.1.3", "@radix-ui/react-use-callback-ref": "1.1.1", "@radix-ui/react-use-layout-effect": "1.1.1", "@radix-ui/react-use-rect": "1.1.1", "@radix-ui/react-use-size": "1.1.1", "@radix-ui/rect": "1.1.1" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-0NJQ4LFFUuWkE7Oxf0htBKS6zLkkjBH+hM1uk7Ng705ReR8m/uelduy1DBo0PyBXPKVnBA6YBlU94MBGXrSBCw=="],
"@radix-ui/react-portal": ["@radix-ui/react-portal@1.1.9", "", { "dependencies": { "@radix-ui/react-primitive": "2.1.3", "@radix-ui/react-use-layout-effect": "1.1.1" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-bpIxvq03if6UNwXZ+HTK71JLh4APvnXntDc6XOX8UVq4XQOVl7lwok0AvIl+b8zgCw3fSaVTZMpAPPagXbKmHQ=="],
"@radix-ui/react-presence": ["@radix-ui/react-presence@1.1.5", "", { "dependencies": { "@radix-ui/react-compose-refs": "1.1.2", "@radix-ui/react-use-layout-effect": "1.1.1" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-/jfEwNDdQVBCNvjkGit4h6pMOzq8bHkopq458dPt2lMjx+eBQUohZNG9A7DtO/O5ukSbxuaNGXMjHicgwy6rQQ=="],
"@radix-ui/react-primitive": ["@radix-ui/react-primitive@2.1.3", "", { "dependencies": { "@radix-ui/react-slot": "1.2.3" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-m9gTwRkhy2lvCPe6QJp4d3G1TYEUHn/FzJUtq9MjH46an1wJU+GdoGC5VLof8RX8Ft/DlpshApkhswDLZzHIcQ=="],
"@radix-ui/react-progress": ["@radix-ui/react-progress@1.1.7", "", { "dependencies": { "@radix-ui/react-context": "1.1.2", "@radix-ui/react-primitive": "2.1.3" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-vPdg/tF6YC/ynuBIJlk1mm7Le0VgW6ub6J2UWnTQ7/D23KXcPI1qy+0vBkgKgd38RCMJavBXpB83HPNFMTb0Fg=="],
"@radix-ui/react-radio-group": ["@radix-ui/react-radio-group@1.3.8", "", { "dependencies": { "@radix-ui/primitive": "1.1.3", "@radix-ui/react-compose-refs": "1.1.2", "@radix-ui/react-context": "1.1.2", "@radix-ui/react-direction": "1.1.1", "@radix-ui/react-presence": "1.1.5", "@radix-ui/react-primitive": "2.1.3", "@radix-ui/react-roving-focus": "1.1.11", "@radix-ui/react-use-controllable-state": "1.2.2", "@radix-ui/react-use-previous": "1.1.1", "@radix-ui/react-use-size": "1.1.1" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-VBKYIYImA5zsxACdisNQ3BjCBfmbGH3kQlnFVqlWU4tXwjy7cGX8ta80BcrO+WJXIn5iBylEH3K6ZTlee//lgQ=="],
"@radix-ui/react-roving-focus": ["@radix-ui/react-roving-focus@1.1.11", "", { "dependencies": { "@radix-ui/primitive": "1.1.3", "@radix-ui/react-collection": "1.1.7", "@radix-ui/react-compose-refs": "1.1.2", "@radix-ui/react-context": "1.1.2", "@radix-ui/react-direction": "1.1.1", "@radix-ui/react-id": "1.1.1", "@radix-ui/react-primitive": "2.1.3", "@radix-ui/react-use-callback-ref": "1.1.1", "@radix-ui/react-use-controllable-state": "1.2.2" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-7A6S9jSgm/S+7MdtNDSb+IU859vQqJ/QAtcYQcfFC6W8RS4IxIZDldLR0xqCFZ6DCyrQLjLPsxtTNch5jVA4lA=="],
"@radix-ui/react-scroll-area": ["@radix-ui/react-scroll-area@1.2.10", "", { "dependencies": { "@radix-ui/number": "1.1.1", "@radix-ui/primitive": "1.1.3", "@radix-ui/react-compose-refs": "1.1.2", "@radix-ui/react-context": "1.1.2", "@radix-ui/react-direction": "1.1.1", "@radix-ui/react-presence": "1.1.5", "@radix-ui/react-primitive": "2.1.3", "@radix-ui/react-use-callback-ref": "1.1.1", "@radix-ui/react-use-layout-effect": "1.1.1" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-tAXIa1g3sM5CGpVT0uIbUx/U3Gs5N8T52IICuCtObaos1S8fzsrPXG5WObkQN3S6NVl6wKgPhAIiBGbWnvc97A=="],
"@radix-ui/react-select": ["@radix-ui/react-select@2.2.6", "", { "dependencies": { "@radix-ui/number": "1.1.1", "@radix-ui/primitive": "1.1.3", "@radix-ui/react-collection": "1.1.7", "@radix-ui/react-compose-refs": "1.1.2", "@radix-ui/react-context": "1.1.2", "@radix-ui/react-direction": "1.1.1", "@radix-ui/react-dismissable-layer": "1.1.11", "@radix-ui/react-focus-guards": "1.1.3", "@radix-ui/react-focus-scope": "1.1.7", "@radix-ui/react-id": "1.1.1", "@radix-ui/react-popper": "1.2.8", "@radix-ui/react-portal": "1.1.9", "@radix-ui/react-primitive": "2.1.3", "@radix-ui/react-slot": "1.2.3", "@radix-ui/react-use-callback-ref": "1.1.1", "@radix-ui/react-use-controllable-state": "1.2.2", "@radix-ui/react-use-layout-effect": "1.1.1", "@radix-ui/react-use-previous": "1.1.1", "@radix-ui/react-visually-hidden": "1.2.3", "aria-hidden": "^1.2.4", "react-remove-scroll": "^2.6.3" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-I30RydO+bnn2PQztvo25tswPH+wFBjehVGtmagkU78yMdwTwVf12wnAOF+AeP8S2N8xD+5UPbGhkUfPyvT+mwQ=="],
"@radix-ui/react-separator": ["@radix-ui/react-separator@1.1.7", "", { "dependencies": { "@radix-ui/react-primitive": "2.1.3" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-0HEb8R9E8A+jZjvmFCy/J4xhbXy3TV+9XSnGJ3KvTtjlIUy/YQ/p6UYZvi7YbeoeXdyU9+Y3scizK6hkY37baA=="],
"@radix-ui/react-slider": ["@radix-ui/react-slider@1.3.6", "", { "dependencies": { "@radix-ui/number": "1.1.1", "@radix-ui/primitive": "1.1.3", "@radix-ui/react-collection": "1.1.7", "@radix-ui/react-compose-refs": "1.1.2", "@radix-ui/react-context": "1.1.2", "@radix-ui/react-direction": "1.1.1", "@radix-ui/react-primitive": "2.1.3", "@radix-ui/react-use-controllable-state": "1.2.2", "@radix-ui/react-use-layout-effect": "1.1.1", "@radix-ui/react-use-previous": "1.1.1", "@radix-ui/react-use-size": "1.1.1" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-JPYb1GuM1bxfjMRlNLE+BcmBC8onfCi60Blk7OBqi2MLTFdS+8401U4uFjnwkOr49BLmXxLC6JHkvAsx5OJvHw=="],
"@radix-ui/react-slot": ["@radix-ui/react-slot@1.2.3", "", { "dependencies": { "@radix-ui/react-compose-refs": "1.1.2" }, "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-aeNmHnBxbi2St0au6VBVC7JXFlhLlOnvIIlePNniyUNAClzmtAUEY8/pBiK3iHjufOlwA+c20/8jngo7xcrg8A=="],
"@radix-ui/react-switch": ["@radix-ui/react-switch@1.2.6", "", { "dependencies": { "@radix-ui/primitive": "1.1.3", "@radix-ui/react-compose-refs": "1.1.2", "@radix-ui/react-context": "1.1.2", "@radix-ui/react-primitive": "2.1.3", "@radix-ui/react-use-controllable-state": "1.2.2", "@radix-ui/react-use-previous": "1.1.1", "@radix-ui/react-use-size": "1.1.1" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-bByzr1+ep1zk4VubeEVViV592vu2lHE2BZY5OnzehZqOOgogN80+mNtCqPkhn2gklJqOpxWgPoYTSnhBCqpOXQ=="],
"@radix-ui/react-tabs": ["@radix-ui/react-tabs@1.1.13", "", { "dependencies": { "@radix-ui/primitive": "1.1.3", "@radix-ui/react-context": "1.1.2", "@radix-ui/react-direction": "1.1.1", "@radix-ui/react-id": "1.1.1", "@radix-ui/react-presence": "1.1.5", "@radix-ui/react-primitive": "2.1.3", "@radix-ui/react-roving-focus": "1.1.11", "@radix-ui/react-use-controllable-state": "1.2.2" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-7xdcatg7/U+7+Udyoj2zodtI9H/IIopqo+YOIcZOq1nJwXWBZ9p8xiu5llXlekDbZkca79a/fozEYQXIA4sW6A=="],
"@radix-ui/react-toast": ["@radix-ui/react-toast@1.2.15", "", { "dependencies": { "@radix-ui/primitive": "1.1.3", "@radix-ui/react-collection": "1.1.7", "@radix-ui/react-compose-refs": "1.1.2", "@radix-ui/react-context": "1.1.2", "@radix-ui/react-dismissable-layer": "1.1.11", "@radix-ui/react-portal": "1.1.9", "@radix-ui/react-presence": "1.1.5", "@radix-ui/react-primitive": "2.1.3", "@radix-ui/react-use-callback-ref": "1.1.1", "@radix-ui/react-use-controllable-state": "1.2.2", "@radix-ui/react-use-layout-effect": "1.1.1", "@radix-ui/react-visually-hidden": "1.2.3" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-3OSz3TacUWy4WtOXV38DggwxoqJK4+eDkNMl5Z/MJZaoUPaP4/9lf81xXMe1I2ReTAptverZUpbPY4wWwWyL5g=="],
"@radix-ui/react-toggle": ["@radix-ui/react-toggle@1.1.10", "", { "dependencies": { "@radix-ui/primitive": "1.1.3", "@radix-ui/react-primitive": "2.1.3", "@radix-ui/react-use-controllable-state": "1.2.2" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-lS1odchhFTeZv3xwHH31YPObmJn8gOg7Lq12inrr0+BH/l3Tsq32VfjqH1oh80ARM3mlkfMic15n0kg4sD1poQ=="],
"@radix-ui/react-toggle-group": ["@radix-ui/react-toggle-group@1.1.11", "", { "dependencies": { "@radix-ui/primitive": "1.1.3", "@radix-ui/react-context": "1.1.2", "@radix-ui/react-direction": "1.1.1", "@radix-ui/react-primitive": "2.1.3", "@radix-ui/react-roving-focus": "1.1.11", "@radix-ui/react-toggle": "1.1.10", "@radix-ui/react-use-controllable-state": "1.2.2" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-5umnS0T8JQzQT6HbPyO7Hh9dgd82NmS36DQr+X/YJ9ctFNCiiQd6IJAYYZ33LUwm8M+taCz5t2ui29fHZc4Y6Q=="],
"@radix-ui/react-toolbar": ["@radix-ui/react-toolbar@1.1.11", "", { "dependencies": { "@radix-ui/primitive": "1.1.3", "@radix-ui/react-context": "1.1.2", "@radix-ui/react-direction": "1.1.1", "@radix-ui/react-primitive": "2.1.3", "@radix-ui/react-roving-focus": "1.1.11", "@radix-ui/react-separator": "1.1.7", "@radix-ui/react-toggle-group": "1.1.11" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-4ol06/1bLoFu1nwUqzdD4Y5RZ9oDdKeiHIsntug54Hcr1pgaHiPqHFEaXI1IFP/EsOfROQZ8Mig9VTIRza6Tjg=="],
"@radix-ui/react-tooltip": ["@radix-ui/react-tooltip@1.2.8", "", { "dependencies": { "@radix-ui/primitive": "1.1.3", "@radix-ui/react-compose-refs": "1.1.2", "@radix-ui/react-context": "1.1.2", "@radix-ui/react-dismissable-layer": "1.1.11", "@radix-ui/react-id": "1.1.1", "@radix-ui/react-popper": "1.2.8", "@radix-ui/react-portal": "1.1.9", "@radix-ui/react-presence": "1.1.5", "@radix-ui/react-primitive": "2.1.3", "@radix-ui/react-slot": "1.2.3", "@radix-ui/react-use-controllable-state": "1.2.2", "@radix-ui/react-visually-hidden": "1.2.3" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-tY7sVt1yL9ozIxvmbtN5qtmH2krXcBCfjEiCgKGLqunJHvgvZG2Pcl2oQ3kbcZARb1BGEHdkLzcYGO8ynVlieg=="],
"@radix-ui/react-use-callback-ref": ["@radix-ui/react-use-callback-ref@1.1.1", "", { "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-FkBMwD+qbGQeMu1cOHnuGB6x4yzPjho8ap5WtbEJ26umhgqVXbhekKUQO+hZEL1vU92a3wHwdp0HAcqAUF5iDg=="],
"@radix-ui/react-use-controllable-state": ["@radix-ui/react-use-controllable-state@1.2.2", "", { "dependencies": { "@radix-ui/react-use-effect-event": "0.0.2", "@radix-ui/react-use-layout-effect": "1.1.1" }, "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-BjasUjixPFdS+NKkypcyyN5Pmg83Olst0+c6vGov0diwTEo6mgdqVR6hxcEgFuh4QrAs7Rc+9KuGJ9TVCj0Zzg=="],
"@radix-ui/react-use-effect-event": ["@radix-ui/react-use-effect-event@0.0.2", "", { "dependencies": { "@radix-ui/react-use-layout-effect": "1.1.1" }, "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-Qp8WbZOBe+blgpuUT+lw2xheLP8q0oatc9UpmiemEICxGvFLYmHm9QowVZGHtJlGbS6A6yJ3iViad/2cVjnOiA=="],
"@radix-ui/react-use-escape-keydown": ["@radix-ui/react-use-escape-keydown@1.1.1", "", { "dependencies": { "@radix-ui/react-use-callback-ref": "1.1.1" }, "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-Il0+boE7w/XebUHyBjroE+DbByORGR9KKmITzbR7MyQ4akpORYP/ZmbhAr0DG7RmmBqoOnZdy2QlvajJ2QA59g=="],
"@radix-ui/react-use-is-hydrated": ["@radix-ui/react-use-is-hydrated@0.1.0", "", { "dependencies": { "use-sync-external-store": "^1.5.0" }, "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-U+UORVEq+cTnRIaostJv9AGdV3G6Y+zbVd+12e18jQ5A3c0xL03IhnHuiU4UV69wolOQp5GfR58NW/EgdQhwOA=="],
"@radix-ui/react-use-layout-effect": ["@radix-ui/react-use-layout-effect@1.1.1", "", { "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-RbJRS4UWQFkzHTTwVymMTUv8EqYhOp8dOOviLj2ugtTiXRaRQS7GLGxZTLL1jWhMeoSCf5zmcZkqTl9IiYfXcQ=="],
"@radix-ui/react-use-previous": ["@radix-ui/react-use-previous@1.1.1", "", { "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-2dHfToCj/pzca2Ck724OZ5L0EVrr3eHRNsG/b3xQJLA2hZpVCS99bLAX+hm1IHXDEnzU6by5z/5MIY794/a8NQ=="],
"@radix-ui/react-use-rect": ["@radix-ui/react-use-rect@1.1.1", "", { "dependencies": { "@radix-ui/rect": "1.1.1" }, "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-QTYuDesS0VtuHNNvMh+CjlKJ4LJickCMUAqjlE3+j8w+RlRpwyX3apEQKGFzbZGdo7XNG1tXa+bQqIE7HIXT2w=="],
"@radix-ui/react-use-size": ["@radix-ui/react-use-size@1.1.1", "", { "dependencies": { "@radix-ui/react-use-layout-effect": "1.1.1" }, "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-ewrXRDTAqAXlkl6t/fkXWNAhFX9I+CkKlw6zjEwk86RSPKwZr3xpBRso655aqYafwtnbpHLj6toFzmd6xdVptQ=="],
"@radix-ui/react-visually-hidden": ["@radix-ui/react-visually-hidden@1.2.3", "", { "dependencies": { "@radix-ui/react-primitive": "2.1.3" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-pzJq12tEaaIhqjbzpCuv/OypJY/BPavOofm+dbab+MHLajy277+1lLm6JFcGgF5eskJ6mquGirhXY2GD/8u8Ug=="],
"@radix-ui/rect": ["@radix-ui/rect@1.1.1", "", {}, "sha512-HPwpGIzkl28mWyZqG52jiqDJ12waP11Pa1lGoiyUkIEuMLBP0oeK/C89esbXrxsky5we7dfd8U58nm0SgAWpVw=="],
"@rolldown/binding-android-arm64": ["@rolldown/binding-android-arm64@1.0.0-rc.9", "", { "os": "android", "cpu": "arm64" }, "sha512-lcJL0bN5hpgJfSIz/8PIf02irmyL43P+j1pTCfbD1DbLkmGRuFIA4DD3B3ZOvGqG0XiVvRznbKtN0COQVaKUTg=="],
"@rolldown/binding-darwin-arm64": ["@rolldown/binding-darwin-arm64@1.0.0-rc.9", "", { "os": "darwin", "cpu": "arm64" }, "sha512-J7Zk3kLYFsLtuH6U+F4pS2sYVzac0qkjcO5QxHS7OS7yZu2LRs+IXo+uvJ/mvpyUljDJ3LROZPoQfgBIpCMhdQ=="],
"@rolldown/binding-darwin-x64": ["@rolldown/binding-darwin-x64@1.0.0-rc.9", "", { "os": "darwin", "cpu": "x64" }, "sha512-iwtmmghy8nhfRGeNAIltcNXzD0QMNaaA5U/NyZc1Ia4bxrzFByNMDoppoC+hl7cDiUq5/1CnFthpT9n+UtfFyg=="],
"@rolldown/binding-freebsd-x64": ["@rolldown/binding-freebsd-x64@1.0.0-rc.9", "", { "os": "freebsd", "cpu": "x64" }, "sha512-DLFYI78SCiZr5VvdEplsVC2Vx53lnA4/Ga5C65iyldMVaErr86aiqCoNBLl92PXPfDtUYjUh+xFFor40ueNs4Q=="],
"@rolldown/binding-linux-arm-gnueabihf": ["@rolldown/binding-linux-arm-gnueabihf@1.0.0-rc.9", "", { "os": "linux", "cpu": "arm" }, "sha512-CsjTmTwd0Hri6iTw/DRMK7kOZ7FwAkrO4h8YWKoX/kcj833e4coqo2wzIFywtch/8Eb5enQ/lwLM7w6JX1W5RQ=="],
"@rolldown/binding-linux-arm64-gnu": ["@rolldown/binding-linux-arm64-gnu@1.0.0-rc.9", "", { "os": "linux", "cpu": "arm64" }, "sha512-2x9O2JbSPxpxMDhP9Z74mahAStibTlrBMW0520+epJH5sac7/LwZW5Bmg/E6CXuEF53JJFW509uP+lSedaUNxg=="],
"@rolldown/binding-linux-arm64-musl": ["@rolldown/binding-linux-arm64-musl@1.0.0-rc.9", "", { "os": "linux", "cpu": "arm64" }, "sha512-JA1QRW31ogheAIRhIg9tjMfsYbglXXYGNPLdPEYrwFxdbkQCAzvpSCSHCDWNl4hTtrol8WeboCSEpjdZK8qrCg=="],
"@rolldown/binding-linux-ppc64-gnu": ["@rolldown/binding-linux-ppc64-gnu@1.0.0-rc.9", "", { "os": "linux", "cpu": "ppc64" }, "sha512-aOKU9dJheda8Kj8Y3w9gnt9QFOO+qKPAl8SWd7JPHP+Cu0EuDAE5wokQubLzIDQWg2myXq2XhTpOVS07qqvT+w=="],
"@rolldown/binding-linux-s390x-gnu": ["@rolldown/binding-linux-s390x-gnu@1.0.0-rc.9", "", { "os": "linux", "cpu": "s390x" }, "sha512-OalO94fqj7IWRn3VdXWty75jC5dk4C197AWEuMhIpvVv2lw9fiPhud0+bW2ctCxb3YoBZor71QHbY+9/WToadA=="],
"@rolldown/binding-linux-x64-gnu": ["@rolldown/binding-linux-x64-gnu@1.0.0-rc.9", "", { "os": "linux", "cpu": "x64" }, "sha512-cVEl1vZtBsBZna3YMjGXNvnYYrOJ7RzuWvZU0ffvJUexWkukMaDuGhUXn0rjnV0ptzGVkvc+vW9Yqy6h8YX4pg=="],
"@rolldown/binding-linux-x64-musl": ["@rolldown/binding-linux-x64-musl@1.0.0-rc.9", "", { "os": "linux", "cpu": "x64" }, "sha512-UzYnKCIIc4heAKgI4PZ3dfBGUZefGCJ1TPDuLHoCzgrMYPb5Rv6TLFuYtyM4rWyHM7hymNdsg5ik2C+UD9VDbA=="],
"@rolldown/binding-openharmony-arm64": ["@rolldown/binding-openharmony-arm64@1.0.0-rc.9", "", { "os": "none", "cpu": "arm64" }, "sha512-+6zoiF+RRyf5cdlFQP7nm58mq7+/2PFaY2DNQeD4B87N36JzfF/l9mdBkkmTvSYcYPE8tMh/o3cRlsx1ldLfog=="],
"@rolldown/binding-wasm32-wasi": ["@rolldown/binding-wasm32-wasi@1.0.0-rc.9", "", { "dependencies": { "@napi-rs/wasm-runtime": "^1.1.1" }, "cpu": "none" }, "sha512-rgFN6sA/dyebil3YTlL2evvi/M+ivhfnyxec7AccTpRPccno/rPoNlqybEZQBkcbZu8Hy+eqNJCqfBR8P7Pg8g=="],
"@rolldown/binding-win32-arm64-msvc": ["@rolldown/binding-win32-arm64-msvc@1.0.0-rc.9", "", { "os": "win32", "cpu": "arm64" }, "sha512-lHVNUG/8nlF1IQk1C0Ci574qKYyty2goMiPlRqkC5R+3LkXDkL5Dhx8ytbxq35m+pkHVIvIxviD+TWLdfeuadA=="],
"@rolldown/binding-win32-x64-msvc": ["@rolldown/binding-win32-x64-msvc@1.0.0-rc.9", "", { "os": "win32", "cpu": "x64" }, "sha512-G0oA4+w1iY5AGi5HcDTxWsoxF509hrFIPB2rduV5aDqS9FtDg1CAfa7V34qImbjfhIcA8C+RekocJZA96EarwQ=="],
"@rolldown/pluginutils": ["@rolldown/pluginutils@1.0.0-rc.7", "", {}, "sha512-qujRfC8sFVInYSPPMLQByRh7zhwkGFS4+tyMQ83srV1qrxL4g8E2tyxVVyxd0+8QeBM1mIk9KbWxkegRr76XzA=="],
"@supabase/auth-js": ["@supabase/auth-js@2.99.1", "", { "dependencies": { "tslib": "2.8.1" } }, "sha512-x7lKKTvKjABJt/FYcRSPiTT01Xhm2FF8RhfL8+RHMkmlwmRQ88/lREupIHKwFPW0W6pTCJqkZb7Yhpw/EZ+fNw=="],
"@supabase/functions-js": ["@supabase/functions-js@2.99.1", "", { "dependencies": { "tslib": "2.8.1" } }, "sha512-WQE62W5geYImCO4jzFxCk/avnK7JmOdtqu2eiPz3zOaNiIJajNRSAwMMDgEGd2EMs+sUVYj1LfBjfmW3EzHgIA=="],
"@supabase/postgrest-js": ["@supabase/postgrest-js@2.99.1", "", { "dependencies": { "tslib": "2.8.1" } }, "sha512-gtw2ibJrADvfqrpUWXGNlrYUvxttF4WVWfPpTFKOb2IRj7B6YRWMDgcrYqIuD4ZEabK4m6YKQCCGy6clgf1lPA=="],
"@supabase/realtime-js": ["@supabase/realtime-js@2.99.1", "", { "dependencies": { "@types/phoenix": "^1.6.6", "@types/ws": "^8.18.1", "tslib": "2.8.1", "ws": "^8.18.2" } }, "sha512-9EDdy/5wOseGFqxW88ShV9JMRhm7f+9JGY5x+LqT8c7R0X1CTLwg5qie8FiBWcXTZ+68yYxVWunI+7W4FhkWOg=="],
"@supabase/storage-js": ["@supabase/storage-js@2.99.1", "", { "dependencies": { "iceberg-js": "^0.8.1", "tslib": "2.8.1" } }, "sha512-mf7zPfqofI62SOoyQJeNUVxe72E4rQsbWim6lTDPeLu3lHija/cP5utlQADGrjeTgOUN6znx/rWn7SjrETP1dw=="],
"@supabase/supabase-js": ["@supabase/supabase-js@2.99.1", "", { "dependencies": { "@supabase/auth-js": "2.99.1", "@supabase/functions-js": "2.99.1", "@supabase/postgrest-js": "2.99.1", "@supabase/realtime-js": "2.99.1", "@supabase/storage-js": "2.99.1" } }, "sha512-5MRoYD9ffXq8F6a036dm65YoSHisC3by/d22mauKE99Vrwf792KxYIIr/iqCX7E4hkuugbPZ5EGYHTB7MKy6Vg=="],
"@tailwindcss/node": ["@tailwindcss/node@4.2.1", "", { "dependencies": { "@jridgewell/remapping": "^2.3.5", "enhanced-resolve": "^5.19.0", "jiti": "^2.6.1", "lightningcss": "1.31.1", "magic-string": "^0.30.21", "source-map-js": "^1.2.1", "tailwindcss": "4.2.1" } }, "sha512-jlx6sLk4EOwO6hHe1oCGm1Q4AN/s0rSrTTPBGPM0/RQ6Uylwq17FuU8IeJJKEjtc6K6O07zsvP+gDO6MMWo7pg=="],
"@tailwindcss/oxide": ["@tailwindcss/oxide@4.2.1", "", { "optionalDependencies": { "@tailwindcss/oxide-android-arm64": "4.2.1", "@tailwindcss/oxide-darwin-arm64": "4.2.1", "@tailwindcss/oxide-darwin-x64": "4.2.1", "@tailwindcss/oxide-freebsd-x64": "4.2.1", "@tailwindcss/oxide-linux-arm-gnueabihf": "4.2.1", "@tailwindcss/oxide-linux-arm64-gnu": "4.2.1", "@tailwindcss/oxide-linux-arm64-musl": "4.2.1", "@tailwindcss/oxide-linux-x64-gnu": "4.2.1", "@tailwindcss/oxide-linux-x64-musl": "4.2.1", "@tailwindcss/oxide-wasm32-wasi": "4.2.1", "@tailwindcss/oxide-win32-arm64-msvc": "4.2.1", "@tailwindcss/oxide-win32-x64-msvc": "4.2.1" } }, "sha512-yv9jeEFWnjKCI6/T3Oq50yQEOqmpmpfzG1hcZsAOaXFQPfzWprWrlHSdGPEF3WQTi8zu8ohC9Mh9J470nT5pUw=="],
"@tailwindcss/oxide-android-arm64": ["@tailwindcss/oxide-android-arm64@4.2.1", "", { "os": "android", "cpu": "arm64" }, "sha512-eZ7G1Zm5EC8OOKaesIKuw77jw++QJ2lL9N+dDpdQiAB/c/B2wDh0QPFHbkBVrXnwNugvrbJFk1gK2SsVjwWReg=="],
"@tailwindcss/oxide-darwin-arm64": ["@tailwindcss/oxide-darwin-arm64@4.2.1", "", { "os": "darwin", "cpu": "arm64" }, "sha512-q/LHkOstoJ7pI1J0q6djesLzRvQSIfEto148ppAd+BVQK0JYjQIFSK3JgYZJa+Yzi0DDa52ZsQx2rqytBnf8Hw=="],
"@tailwindcss/oxide-darwin-x64": ["@tailwindcss/oxide-darwin-x64@4.2.1", "", { "os": "darwin", "cpu": "x64" }, "sha512-/f/ozlaXGY6QLbpvd/kFTro2l18f7dHKpB+ieXz+Cijl4Mt9AI2rTrpq7V+t04nK+j9XBQHnSMdeQRhbGyt6fw=="],
"@tailwindcss/oxide-freebsd-x64": ["@tailwindcss/oxide-freebsd-x64@4.2.1", "", { "os": "freebsd", "cpu": "x64" }, "sha512-5e/AkgYJT/cpbkys/OU2Ei2jdETCLlifwm7ogMC7/hksI2fC3iiq6OcXwjibcIjPung0kRtR3TxEITkqgn0TcA=="],
"@tailwindcss/oxide-linux-arm-gnueabihf": ["@tailwindcss/oxide-linux-arm-gnueabihf@4.2.1", "", { "os": "linux", "cpu": "arm" }, "sha512-Uny1EcVTTmerCKt/1ZuKTkb0x8ZaiuYucg2/kImO5A5Y/kBz41/+j0gxUZl+hTF3xkWpDmHX+TaWhOtba2Fyuw=="],
"@tailwindcss/oxide-linux-arm64-gnu": ["@tailwindcss/oxide-linux-arm64-gnu@4.2.1", "", { "os": "linux", "cpu": "arm64" }, "sha512-CTrwomI+c7n6aSSQlsPL0roRiNMDQ/YzMD9EjcR+H4f0I1SQ8QqIuPnsVp7QgMkC1Qi8rtkekLkOFjo7OlEFRQ=="],
"@tailwindcss/oxide-linux-arm64-musl": ["@tailwindcss/oxide-linux-arm64-musl@4.2.1", "", { "os": "linux", "cpu": "arm64" }, "sha512-WZA0CHRL/SP1TRbA5mp9htsppSEkWuQ4KsSUumYQnyl8ZdT39ntwqmz4IUHGN6p4XdSlYfJwM4rRzZLShHsGAQ=="],
"@tailwindcss/oxide-linux-x64-gnu": ["@tailwindcss/oxide-linux-x64-gnu@4.2.1", "", { "os": "linux", "cpu": "x64" }, "sha512-qMFzxI2YlBOLW5PhblzuSWlWfwLHaneBE0xHzLrBgNtqN6mWfs+qYbhryGSXQjFYB1Dzf5w+LN5qbUTPhW7Y5g=="],
"@tailwindcss/oxide-linux-x64-musl": ["@tailwindcss/oxide-linux-x64-musl@4.2.1", "", { "os": "linux", "cpu": "x64" }, "sha512-5r1X2FKnCMUPlXTWRYpHdPYUY6a1Ar/t7P24OuiEdEOmms5lyqjDRvVY1yy9Rmioh+AunQ0rWiOTPE8F9A3v5g=="],
"@tailwindcss/oxide-wasm32-wasi": ["@tailwindcss/oxide-wasm32-wasi@4.2.1", "", { "dependencies": { "@emnapi/core": "^1.8.1", "@emnapi/runtime": "^1.8.1", "@emnapi/wasi-threads": "^1.1.0", "@napi-rs/wasm-runtime": "^1.1.1", "@tybys/wasm-util": "^0.10.1", "tslib": "^2.8.1" }, "cpu": "none" }, "sha512-MGFB5cVPvshR85MTJkEvqDUnuNoysrsRxd6vnk1Lf2tbiqNlXpHYZqkqOQalydienEWOHHFyyuTSYRsLfxFJ2Q=="],
"@tailwindcss/oxide-win32-arm64-msvc": ["@tailwindcss/oxide-win32-arm64-msvc@4.2.1", "", { "os": "win32", "cpu": "arm64" }, "sha512-YlUEHRHBGnCMh4Nj4GnqQyBtsshUPdiNroZj8VPkvTZSoHsilRCwXcVKnG9kyi0ZFAS/3u+qKHBdDc81SADTRA=="],
"@tailwindcss/oxide-win32-x64-msvc": ["@tailwindcss/oxide-win32-x64-msvc@4.2.1", "", { "os": "win32", "cpu": "x64" }, "sha512-rbO34G5sMWWyrN/idLeVxAZgAKWrn5LiR3/I90Q9MkA67s6T1oB0xtTe+0heoBvHSpbU9Mk7i6uwJnpo4u21XQ=="],
"@tailwindcss/vite": ["@tailwindcss/vite@4.2.1", "", { "dependencies": { "@tailwindcss/node": "4.2.1", "@tailwindcss/oxide": "4.2.1", "tailwindcss": "4.2.1" }, "peerDependencies": { "vite": "^5.2.0 || ^6 || ^7" } }, "sha512-TBf2sJjYeb28jD2U/OhwdW0bbOsxkWPwQ7SrqGf9sVcoYwZj7rkXljroBO9wKBut9XnmQLXanuDUeqQK0lGg/w=="],
"@tanstack/query-core": ["@tanstack/query-core@5.90.20", "", {}, "sha512-OMD2HLpNouXEfZJWcKeVKUgQ5n+n3A2JFmBaScpNDUqSrQSjiveC7dKMe53uJUg1nDG16ttFPz2xfilz6i2uVg=="],
"@tanstack/react-query": ["@tanstack/react-query@5.90.21", "", { "dependencies": { "@tanstack/query-core": "5.90.20" }, "peerDependencies": { "react": "^18 || ^19" } }, "sha512-0Lu6y5t+tvlTJMTO7oh5NSpJfpg/5D41LlThfepTixPYkJ0sE2Jj0m0f6yYqujBwIXlId87e234+MxG3D3g7kg=="],
"@tybys/wasm-util": ["@tybys/wasm-util@0.10.1", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg=="],
"@types/d3-array": ["@types/d3-array@3.2.2", "", {}, "sha512-hOLWVbm7uRza0BYXpIIW5pxfrKe0W+D5lrFiAEYR+pb6w3N2SwSMaJbXdUfSEv+dT4MfHBLtn5js0LAWaO6otw=="],
"@types/d3-color": ["@types/d3-color@3.1.3", "", {}, "sha512-iO90scth9WAbmgv7ogoq57O9YpKmFBbmoEoCHDB2xMBY0+/KVrqAaCDyCE16dUspeOvIxFFRI+0sEtqDqy2b4A=="],
"@types/d3-ease": ["@types/d3-ease@3.0.2", "", {}, "sha512-NcV1JjO5oDzoK26oMzbILE6HW7uVXOHLQvHshBUW4UMdZGfiY6v5BeQwh9a9tCzv+CeefZQHJt5SRgK154RtiA=="],
"@types/d3-interpolate": ["@types/d3-interpolate@3.0.4", "", { "dependencies": { "@types/d3-color": "*" } }, "sha512-mgLPETlrpVV1YRJIglr4Ez47g7Yxjl1lj7YKsiMCb27VJH9W8NVM6Bb9d8kkpG/uAQS5AmbA48q2IAolKKo1MA=="],
"@types/d3-path": ["@types/d3-path@3.1.1", "", {}, "sha512-VMZBYyQvbGmWyWVea0EHs/BwLgxc+MKi1zLDCONksozI4YJMcTt8ZEuIR4Sb1MMTE8MMW49v0IwI5+b7RmfWlg=="],
"@types/d3-scale": ["@types/d3-scale@4.0.9", "", { "dependencies": { "@types/d3-time": "*" } }, "sha512-dLmtwB8zkAeO/juAMfnV+sItKjlsw2lKdZVVy6LRr0cBmegxSABiLEpGVmSJJ8O08i4+sGR6qQtb6WtuwJdvVw=="],
"@types/d3-shape": ["@types/d3-shape@3.1.8", "", { "dependencies": { "@types/d3-path": "*" } }, "sha512-lae0iWfcDeR7qt7rA88BNiqdvPS5pFVPpo5OfjElwNaT2yyekbM0C9vK+yqBqEmHr6lDkRnYNoTBYlAgJa7a4w=="],
"@types/d3-time": ["@types/d3-time@3.0.4", "", {}, "sha512-yuzZug1nkAAaBlBBikKZTgzCeA+k1uy4ZFwWANOfKw5z5LRhV0gNA7gNkKm7HoK+HRN0wX3EkxGk0fpbWhmB7g=="],
"@types/d3-timer": ["@types/d3-timer@3.0.2", "", {}, "sha512-Ps3T8E8dZDam6fUyNiMkekK3XUsaUEik+idO9/YjPtfj2qruF8tFBXS7XhtE4iIXBLxhmLjP3SXpLhVf21I9Lw=="],
"@types/estree": ["@types/estree@1.0.8", "", {}, "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w=="],
"@types/json-schema": ["@types/json-schema@7.0.15", "", {}, "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA=="],
"@types/node": ["@types/node@24.12.0", "", { "dependencies": { "undici-types": "~7.16.0" } }, "sha512-GYDxsZi3ChgmckRT9HPU0WEhKLP08ev/Yfcq2AstjrDASOYCSXeyjDsHg4v5t4jOj7cyDX3vmprafKlWIG9MXQ=="],
"@types/phoenix": ["@types/phoenix@1.6.7", "", {}, "sha512-oN9ive//QSBkf19rfDv45M7eZPi0eEXylht2OLEXicu5b4KoQ1OzXIw+xDSGWxSxe1JmepRR/ZH283vsu518/Q=="],
"@types/react": ["@types/react@19.2.14", "", { "dependencies": { "csstype": "^3.2.2" } }, "sha512-ilcTH/UniCkMdtexkoCN0bI7pMcJDvmQFPvuPvmEaYA/NSfFTAgdUSLAoVjaRJm7+6PvcM+q1zYOwS4wTYMF9w=="],
"@types/react-dom": ["@types/react-dom@19.2.3", "", { "peerDependencies": { "@types/react": "^19.2.0" } }, "sha512-jp2L/eY6fn+KgVVQAOqYItbF0VY/YApe5Mz2F0aykSO8gx31bYCZyvSeYxCHKvzHG5eZjc+zyaS5BrBWya2+kQ=="],
"@types/ws": ["@types/ws@8.18.1", "", { "dependencies": { "@types/node": "*" } }, "sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg=="],
"@typescript-eslint/eslint-plugin": ["@typescript-eslint/eslint-plugin@8.57.0", "", { "dependencies": { "@eslint-community/regexpp": "^4.12.2", "@typescript-eslint/scope-manager": "8.57.0", "@typescript-eslint/type-utils": "8.57.0", "@typescript-eslint/utils": "8.57.0", "@typescript-eslint/visitor-keys": "8.57.0", "ignore": "^7.0.5", "natural-compare": "^1.4.0", "ts-api-utils": "^2.4.0" }, "peerDependencies": { "@typescript-eslint/parser": "^8.57.0", "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.0.0" } }, "sha512-qeu4rTHR3/IaFORbD16gmjq9+rEs9fGKdX0kF6BKSfi+gCuG3RCKLlSBYzn/bGsY9Tj7KE/DAQStbp8AHJGHEQ=="],
"@typescript-eslint/parser": ["@typescript-eslint/parser@8.57.0", "", { "dependencies": { "@typescript-eslint/scope-manager": "8.57.0", "@typescript-eslint/types": "8.57.0", "@typescript-eslint/typescript-estree": "8.57.0", "@typescript-eslint/visitor-keys": "8.57.0", "debug": "^4.4.3" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.0.0" } }, "sha512-XZzOmihLIr8AD1b9hL9ccNMzEMWt/dE2u7NyTY9jJG6YNiNthaD5XtUHVF2uCXZ15ng+z2hT3MVuxnUYhq6k1g=="],
"@typescript-eslint/project-service": ["@typescript-eslint/project-service@8.57.0", "", { "dependencies": { "@typescript-eslint/tsconfig-utils": "^8.57.0", "@typescript-eslint/types": "^8.57.0", "debug": "^4.4.3" }, "peerDependencies": { "typescript": ">=4.8.4 <6.0.0" } }, "sha512-pR+dK0BlxCLxtWfaKQWtYr7MhKmzqZxuii+ZjuFlZlIGRZm22HnXFqa2eY+90MUz8/i80YJmzFGDUsi8dMOV5w=="],
"@typescript-eslint/scope-manager": ["@typescript-eslint/scope-manager@8.57.0", "", { "dependencies": { "@typescript-eslint/types": "8.57.0", "@typescript-eslint/visitor-keys": "8.57.0" } }, "sha512-nvExQqAHF01lUM66MskSaZulpPL5pgy5hI5RfrxviLgzZVffB5yYzw27uK/ft8QnKXI2X0LBrHJFr1TaZtAibw=="],
"@typescript-eslint/tsconfig-utils": ["@typescript-eslint/tsconfig-utils@8.57.0", "", { "peerDependencies": { "typescript": ">=4.8.4 <6.0.0" } }, "sha512-LtXRihc5ytjJIQEH+xqjB0+YgsV4/tW35XKX3GTZHpWtcC8SPkT/d4tqdf1cKtesryHm2bgp6l555NYcT2NLvA=="],
"@typescript-eslint/type-utils": ["@typescript-eslint/type-utils@8.57.0", "", { "dependencies": { "@typescript-eslint/types": "8.57.0", "@typescript-eslint/typescript-estree": "8.57.0", "@typescript-eslint/utils": "8.57.0", "debug": "^4.4.3", "ts-api-utils": "^2.4.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.0.0" } }, "sha512-yjgh7gmDcJ1+TcEg8x3uWQmn8ifvSupnPfjP21twPKrDP/pTHlEQgmKcitzF/rzPSmv7QjJ90vRpN4U+zoUjwQ=="],
"@typescript-eslint/types": ["@typescript-eslint/types@8.57.0", "", {}, "sha512-dTLI8PEXhjUC7B9Kre+u0XznO696BhXcTlOn0/6kf1fHaQW8+VjJAVHJ3eTI14ZapTxdkOmc80HblPQLaEeJdg=="],
"@typescript-eslint/typescript-estree": ["@typescript-eslint/typescript-estree@8.57.0", "", { "dependencies": { "@typescript-eslint/project-service": "8.57.0", "@typescript-eslint/tsconfig-utils": "8.57.0", "@typescript-eslint/types": "8.57.0", "@typescript-eslint/visitor-keys": "8.57.0", "debug": "^4.4.3", "minimatch": "^10.2.2", "semver": "^7.7.3", "tinyglobby": "^0.2.15", "ts-api-utils": "^2.4.0" }, "peerDependencies": { "typescript": ">=4.8.4 <6.0.0" } }, "sha512-m7faHcyVg0BT3VdYTlX8GdJEM7COexXxS6KqGopxdtkQRvBanK377QDHr4W/vIPAR+ah9+B/RclSW5ldVniO1Q=="],
"@typescript-eslint/utils": ["@typescript-eslint/utils@8.57.0", "", { "dependencies": { "@eslint-community/eslint-utils": "^4.9.1", "@typescript-eslint/scope-manager": "8.57.0", "@typescript-eslint/types": "8.57.0", "@typescript-eslint/typescript-estree": "8.57.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.0.0" } }, "sha512-5iIHvpD3CZe06riAsbNxxreP+MuYgVUsV0n4bwLH//VJmgtt54sQeY2GszntJ4BjYCpMzrfVh2SBnUQTtys2lQ=="],
"@typescript-eslint/visitor-keys": ["@typescript-eslint/visitor-keys@8.57.0", "", { "dependencies": { "@typescript-eslint/types": "8.57.0", "eslint-visitor-keys": "^5.0.0" } }, "sha512-zm6xx8UT/Xy2oSr2ZXD0pZo7Jx2XsCoID2IUh9YSTFRu7z+WdwYTRk6LhUftm1crwqbuoF6I8zAFeCMw0YjwDg=="],
"@vitejs/plugin-react": ["@vitejs/plugin-react@6.0.1", "", { "dependencies": { "@rolldown/pluginutils": "1.0.0-rc.7" }, "peerDependencies": { "@rolldown/plugin-babel": "^0.1.7 || ^0.2.0", "babel-plugin-react-compiler": "^1.0.0", "vite": "^8.0.0" }, "optionalPeers": ["@rolldown/plugin-babel", "babel-plugin-react-compiler"] }, "sha512-l9X/E3cDb+xY3SWzlG1MOGt2usfEHGMNIaegaUGFsLkb3RCn/k8/TOXBcab+OndDI4TBtktT8/9BwwW8Vi9KUQ=="],
"acorn": ["acorn@8.16.0", "", { "bin": { "acorn": "bin/acorn" } }, "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw=="],
"acorn-jsx": ["acorn-jsx@5.3.2", "", { "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ=="],
"ajv": ["ajv@6.14.0", "", { "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", "json-schema-traverse": "^0.4.1", "uri-js": "^4.2.2" } }, "sha512-IWrosm/yrn43eiKqkfkHis7QioDleaXQHdDVPKg0FSwwd/DuvyX79TZnFOnYpB7dcsFAMmtFztZuXPDvSePkFw=="],
"ansi-styles": ["ansi-styles@4.3.0", "", { "dependencies": { "color-convert": "^2.0.1" } }, "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg=="],
"argparse": ["argparse@2.0.1", "", {}, "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q=="],
"aria-hidden": ["aria-hidden@1.2.6", "", { "dependencies": { "tslib": "^2.0.0" } }, "sha512-ik3ZgC9dY/lYVVM++OISsaYDeg1tb0VtP5uL3ouh1koGOaUMDPpbFIei4JkFimWUFPn90sbMNMXQAIVOlnYKJA=="],
"balanced-match": ["balanced-match@1.0.2", "", {}, "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="],
"baseline-browser-mapping": ["baseline-browser-mapping@2.10.8", "", { "bin": { "baseline-browser-mapping": "dist/cli.cjs" } }, "sha512-PCLz/LXGBsNTErbtB6i5u4eLpHeMfi93aUv5duMmj6caNu6IphS4q6UevDnL36sZQv9lrP11dbPKGMaXPwMKfQ=="],
"brace-expansion": ["brace-expansion@1.1.12", "", { "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg=="],
"browserslist": ["browserslist@4.28.1", "", { "dependencies": { "baseline-browser-mapping": "^2.9.0", "caniuse-lite": "^1.0.30001759", "electron-to-chromium": "^1.5.263", "node-releases": "^2.0.27", "update-browserslist-db": "^1.2.0" }, "bin": { "browserslist": "cli.js" } }, "sha512-ZC5Bd0LgJXgwGqUknZY/vkUQ04r8NXnJZ3yYi4vDmSiZmC/pdSN0NbNRPxZpbtO4uAfDUAFffO8IZoM3Gj8IkA=="],
"callsites": ["callsites@3.1.0", "", {}, "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ=="],
"caniuse-lite": ["caniuse-lite@1.0.30001779", "", {}, "sha512-U5og2PN7V4DMgF50YPNtnZJGWVLFjjsN3zb6uMT5VGYIewieDj1upwfuVNXf4Kor+89c3iCRJnSzMD5LmTvsfA=="],
"chalk": ["chalk@4.1.2", "", { "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" } }, "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA=="],
"class-variance-authority": ["class-variance-authority@0.7.1", "", { "dependencies": { "clsx": "^2.1.1" } }, "sha512-Ka+9Trutv7G8M6WT6SeiRWz792K5qEqIGEGzXKhAE6xOWAY6pPH8U+9IY3oCMv6kqTmLsv7Xh/2w2RigkePMsg=="],
"clsx": ["clsx@2.1.1", "", {}, "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA=="],
"color-convert": ["color-convert@2.0.1", "", { "dependencies": { "color-name": "~1.1.4" } }, "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ=="],
"color-name": ["color-name@1.1.4", "", {}, "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="],
"concat-map": ["concat-map@0.0.1", "", {}, "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg=="],
"convert-source-map": ["convert-source-map@2.0.0", "", {}, "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg=="],
"cookie": ["cookie@1.1.1", "", {}, "sha512-ei8Aos7ja0weRpFzJnEA9UHJ/7XQmqglbRwnf2ATjcB9Wq874VKH9kfjjirM6UhU2/E5fFYadylyhFldcqSidQ=="],
"cross-spawn": ["cross-spawn@7.0.6", "", { "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", "which": "^2.0.1" } }, "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA=="],
"csstype": ["csstype@3.2.3", "", {}, "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ=="],
"d3-array": ["d3-array@3.2.4", "", { "dependencies": { "internmap": "1 - 2" } }, "sha512-tdQAmyA18i4J7wprpYq8ClcxZy3SC31QMeByyCFyRt7BVHdREQZ5lpzoe5mFEYZUWe+oq8HBvk9JjpibyEV4Jg=="],
"d3-color": ["d3-color@3.1.0", "", {}, "sha512-zg/chbXyeBtMQ1LbD/WSoW2DpC3I0mpmPdW+ynRTj/x2DAWYrIY7qeZIHidozwV24m4iavr15lNwIwLxRmOxhA=="],
"d3-ease": ["d3-ease@3.0.1", "", {}, "sha512-wR/XK3D3XcLIZwpbvQwQ5fK+8Ykds1ip7A2Txe0yxncXSdq1L9skcG7blcedkOX+ZcgxGAmLX1FrRGbADwzi0w=="],
"d3-format": ["d3-format@3.1.2", "", {}, "sha512-AJDdYOdnyRDV5b6ArilzCPPwc1ejkHcoyFarqlPqT7zRYjhavcT3uSrqcMvsgh2CgoPbK3RCwyHaVyxYcP2Arg=="],
"d3-interpolate": ["d3-interpolate@3.0.1", "", { "dependencies": { "d3-color": "1 - 3" } }, "sha512-3bYs1rOD33uo8aqJfKP3JWPAibgw8Zm2+L9vBKEHJ2Rg+viTR7o5Mmv5mZcieN+FRYaAOWX5SJATX6k1PWz72g=="],
"d3-path": ["d3-path@3.1.0", "", {}, "sha512-p3KP5HCf/bvjBSSKuXid6Zqijx7wIfNW+J/maPs+iwR35at5JCbLUT0LzF1cnjbCHWhqzQTIN2Jpe8pRebIEFQ=="],
"d3-scale": ["d3-scale@4.0.2", "", { "dependencies": { "d3-array": "2.10.0 - 3", "d3-format": "1 - 3", "d3-interpolate": "1.2.0 - 3", "d3-time": "2.1.1 - 3", "d3-time-format": "2 - 4" } }, "sha512-GZW464g1SH7ag3Y7hXjf8RoUuAFIqklOAq3MRl4OaWabTFJY9PN/E1YklhXLh+OQ3fM9yS2nOkCoS+WLZ6kvxQ=="],
"d3-shape": ["d3-shape@3.2.0", "", { "dependencies": { "d3-path": "^3.1.0" } }, "sha512-SaLBuwGm3MOViRq2ABk3eLoxwZELpH6zhl3FbAoJ7Vm1gofKx6El1Ib5z23NUEhF9AsGl7y+dzLe5Cw2AArGTA=="],
"d3-time": ["d3-time@3.1.0", "", { "dependencies": { "d3-array": "2 - 3" } }, "sha512-VqKjzBLejbSMT4IgbmVgDjpkYrNWUYJnbCGo874u7MMKIWsILRX+OpX/gTk8MqjpT1A/c6HY2dCA77ZN0lkQ2Q=="],
"d3-time-format": ["d3-time-format@4.1.0", "", { "dependencies": { "d3-time": "1 - 3" } }, "sha512-dJxPBlzC7NugB2PDLwo9Q8JiTR3M3e4/XANkreKSUxF8vvXKqm1Yfq4Q5dl8budlunRVlUUaDUgFt7eA8D6NLg=="],
"d3-timer": ["d3-timer@3.0.1", "", {}, "sha512-ndfJ/JxxMd3nw31uyKoY2naivF+r29V+Lc0svZxe1JvvIRmi8hUsrMvdOwgS1o6uBHmiz91geQ0ylPP0aj1VUA=="],
"debug": ["debug@4.4.3", "", { "dependencies": { "ms": "^2.1.3" } }, "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA=="],
"decimal.js-light": ["decimal.js-light@2.5.1", "", {}, "sha512-qIMFpTMZmny+MMIitAB6D7iVPEorVw6YQRWkvarTkT4tBeSLLiHzcwj6q0MmYSFCiVpiqPJTJEYIrpcPzVEIvg=="],
"deep-is": ["deep-is@0.1.4", "", {}, "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ=="],
"detect-libc": ["detect-libc@2.1.2", "", {}, "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ=="],
"detect-node-es": ["detect-node-es@1.1.0", "", {}, "sha512-ypdmJU/TbBby2Dxibuv7ZLW3Bs1QEmM7nHjEANfohJLvE0XVujisn1qPJcZxg+qDucsr+bP6fLD1rPS3AhJ7EQ=="],
"dom-helpers": ["dom-helpers@5.2.1", "", { "dependencies": { "@babel/runtime": "^7.8.7", "csstype": "^3.0.2" } }, "sha512-nRCa7CK3VTrM2NmGkIy4cbK7IZlgBE/PYMn55rrXefr5xXDP0LdtfPnblFDoVdcAfslJ7or6iqAUnx0CCGIWQA=="],
"electron-to-chromium": ["electron-to-chromium@1.5.313", "", {}, "sha512-QBMrTWEf00GXZmJyx2lbYD45jpI3TUFnNIzJ5BBc8piGUDwMPa1GV6HJWTZVvY/eiN3fSopl7NRbgGp9sZ9LTA=="],
"enhanced-resolve": ["enhanced-resolve@5.20.0", "", { "dependencies": { "graceful-fs": "^4.2.4", "tapable": "^2.3.0" } }, "sha512-/ce7+jQ1PQ6rVXwe+jKEg5hW5ciicHwIQUagZkp6IufBoY3YDgdTTY1azVs0qoRgVmvsNB+rbjLJxDAeHHtwsQ=="],
"escalade": ["escalade@3.2.0", "", {}, "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA=="],
"escape-string-regexp": ["escape-string-regexp@4.0.0", "", {}, "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA=="],
"eslint": ["eslint@9.39.4", "", { "dependencies": { "@eslint-community/eslint-utils": "^4.8.0", "@eslint-community/regexpp": "^4.12.1", "@eslint/config-array": "^0.21.2", "@eslint/config-helpers": "^0.4.2", "@eslint/core": "^0.17.0", "@eslint/eslintrc": "^3.3.5", "@eslint/js": "9.39.4", "@eslint/plugin-kit": "^0.4.1", "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", "@humanwhocodes/retry": "^0.4.2", "@types/estree": "^1.0.6", "ajv": "^6.14.0", "chalk": "^4.0.0", "cross-spawn": "^7.0.6", "debug": "^4.3.2", "escape-string-regexp": "^4.0.0", "eslint-scope": "^8.4.0", "eslint-visitor-keys": "^4.2.1", "espree": "^10.4.0", "esquery": "^1.5.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", "file-entry-cache": "^8.0.0", "find-up": "^5.0.0", "glob-parent": "^6.0.2", "ignore": "^5.2.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", "json-stable-stringify-without-jsonify": "^1.0.1", "lodash.merge": "^4.6.2", "minimatch": "^3.1.5", "natural-compare": "^1.4.0", "optionator": "^0.9.3" }, "peerDependencies": { "jiti": "*" }, "optionalPeers": ["jiti"], "bin": { "eslint": "bin/eslint.js" } }, "sha512-XoMjdBOwe/esVgEvLmNsD3IRHkm7fbKIUGvrleloJXUZgDHig2IPWNniv+GwjyJXzuNqVjlr5+4yVUZjycJwfQ=="],
"eslint-plugin-react-hooks": ["eslint-plugin-react-hooks@7.0.1", "", { "dependencies": { "@babel/core": "^7.24.4", "@babel/parser": "^7.24.4", "hermes-parser": "^0.25.1", "zod": "^3.25.0 || ^4.0.0", "zod-validation-error": "^3.5.0 || ^4.0.0" }, "peerDependencies": { "eslint": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 || ^9.0.0" } }, "sha512-O0d0m04evaNzEPoSW+59Mezf8Qt0InfgGIBJnpC0h3NH/WjUAR7BIKUfysC6todmtiZ/A0oUVS8Gce0WhBrHsA=="],
"eslint-plugin-react-refresh": ["eslint-plugin-react-refresh@0.5.2", "", { "peerDependencies": { "eslint": "^9 || ^10" } }, "sha512-hmgTH57GfzoTFjVN0yBwTggnsVUF2tcqi7RJZHqi9lIezSs4eFyAMktA68YD4r5kNw1mxyY4dmkyoFDb3FIqrA=="],
"eslint-scope": ["eslint-scope@8.4.0", "", { "dependencies": { "esrecurse": "^4.3.0", "estraverse": "^5.2.0" } }, "sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg=="],
"eslint-visitor-keys": ["eslint-visitor-keys@4.2.1", "", {}, "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ=="],
"espree": ["espree@10.4.0", "", { "dependencies": { "acorn": "^8.15.0", "acorn-jsx": "^5.3.2", "eslint-visitor-keys": "^4.2.1" } }, "sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ=="],
"esquery": ["esquery@1.7.0", "", { "dependencies": { "estraverse": "^5.1.0" } }, "sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g=="],
"esrecurse": ["esrecurse@4.3.0", "", { "dependencies": { "estraverse": "^5.2.0" } }, "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag=="],
"estraverse": ["estraverse@5.3.0", "", {}, "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA=="],
"esutils": ["esutils@2.0.3", "", {}, "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g=="],
"eventemitter3": ["eventemitter3@4.0.7", "", {}, "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw=="],
"fast-deep-equal": ["fast-deep-equal@3.1.3", "", {}, "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q=="],
"fast-equals": ["fast-equals@5.4.0", "", {}, "sha512-jt2DW/aNFNwke7AUd+Z+e6pz39KO5rzdbbFCg2sGafS4mk13MI7Z8O5z9cADNn5lhGODIgLwug6TZO2ctf7kcw=="],
"fast-json-stable-stringify": ["fast-json-stable-stringify@2.1.0", "", {}, "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw=="],
"fast-levenshtein": ["fast-levenshtein@2.0.6", "", {}, "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw=="],
"fdir": ["fdir@6.5.0", "", { "peerDependencies": { "picomatch": "^3 || ^4" }, "optionalPeers": ["picomatch"] }, "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg=="],
"file-entry-cache": ["file-entry-cache@8.0.0", "", { "dependencies": { "flat-cache": "^4.0.0" } }, "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ=="],
"find-up": ["find-up@5.0.0", "", { "dependencies": { "locate-path": "^6.0.0", "path-exists": "^4.0.0" } }, "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng=="],
"flat-cache": ["flat-cache@4.0.1", "", { "dependencies": { "flatted": "^3.2.9", "keyv": "^4.5.4" } }, "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw=="],
"flatted": ["flatted@3.4.1", "", {}, "sha512-IxfVbRFVlV8V/yRaGzk0UVIcsKKHMSfYw66T/u4nTwlWteQePsxe//LjudR1AMX4tZW3WFCh3Zqa/sjlqpbURQ=="],
"fsevents": ["fsevents@2.3.3", "", { "os": "darwin" }, "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw=="],
"gensync": ["gensync@1.0.0-beta.2", "", {}, "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg=="],
"get-nonce": ["get-nonce@1.0.1", "", {}, "sha512-FJhYRoDaiatfEkUK8HKlicmu/3SGFD51q3itKDGoSTysQJBnfOcxU5GxnhE1E6soB76MbT0MBtnKJuXyAx+96Q=="],
"glob-parent": ["glob-parent@6.0.2", "", { "dependencies": { "is-glob": "^4.0.3" } }, "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A=="],
"globals": ["globals@17.4.0", "", {}, "sha512-hjrNztw/VajQwOLsMNT1cbJiH2muO3OROCHnbehc8eY5JyD2gqz4AcMHPqgaOR59DjgUjYAYLeH699g/eWi2jw=="],
"graceful-fs": ["graceful-fs@4.2.11", "", {}, "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ=="],
"has-flag": ["has-flag@4.0.0", "", {}, "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ=="],
"hermes-estree": ["hermes-estree@0.25.1", "", {}, "sha512-0wUoCcLp+5Ev5pDW2OriHC2MJCbwLwuRx+gAqMTOkGKJJiBCLjtrvy4PWUGn6MIVefecRpzoOZ/UV6iGdOr+Cw=="],
"hermes-parser": ["hermes-parser@0.25.1", "", { "dependencies": { "hermes-estree": "0.25.1" } }, "sha512-6pEjquH3rqaI6cYAXYPcz9MS4rY6R4ngRgrgfDshRptUZIc3lw0MCIJIGDj9++mfySOuPTHB4nrSW99BCvOPIA=="],
"html-parse-stringify": ["html-parse-stringify@3.0.1", "", { "dependencies": { "void-elements": "3.1.0" } }, "sha512-KknJ50kTInJ7qIScF3jeaFRpMpE8/lfiTdzf/twXyPBLAGrLRTmkz3AdTnKeh40X8k9L2fdYwEp/42WGXIRGcg=="],
"i18next": ["i18next@25.8.18", "", { "dependencies": { "@babel/runtime": "^7.28.6" }, "peerDependencies": { "typescript": "^5" }, "optionalPeers": ["typescript"] }, "sha512-lzY5X83BiL5AP77+9DydbrqkQHFN9hUzWGjqjLpPcp5ZOzuu1aSoKaU3xbBLSjWx9dAzW431y+d+aogxOZaKRA=="],
"iceberg-js": ["iceberg-js@0.8.1", "", {}, "sha512-1dhVQZXhcHje7798IVM+xoo/1ZdVfzOMIc8/rgVSijRK38EDqOJoGula9N/8ZI5RD8QTxNQtK/Gozpr+qUqRRA=="],
"ignore": ["ignore@5.3.2", "", {}, "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g=="],
"import-fresh": ["import-fresh@3.3.1", "", { "dependencies": { "parent-module": "^1.0.0", "resolve-from": "^4.0.0" } }, "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ=="],
"imurmurhash": ["imurmurhash@0.1.4", "", {}, "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA=="],
"internmap": ["internmap@2.0.3", "", {}, "sha512-5Hh7Y1wQbvY5ooGgPbDaL5iYLAPzMTUrjMulskHLH6wnv/A+1q5rgEaiuqEjB+oxGXIVZs1FF+R/KPN3ZSQYYg=="],
"is-extglob": ["is-extglob@2.1.1", "", {}, "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ=="],
"is-glob": ["is-glob@4.0.3", "", { "dependencies": { "is-extglob": "^2.1.1" } }, "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg=="],
"isexe": ["isexe@2.0.0", "", {}, "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw=="],
"jiti": ["jiti@2.6.1", "", { "bin": { "jiti": "lib/jiti-cli.mjs" } }, "sha512-ekilCSN1jwRvIbgeg/57YFh8qQDNbwDb9xT/qu2DAHbFFZUicIl4ygVaAvzveMhMVr3LnpSKTNnwt8PoOfmKhQ=="],
"js-tokens": ["js-tokens@4.0.0", "", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="],
"js-yaml": ["js-yaml@4.1.1", "", { "dependencies": { "argparse": "^2.0.1" }, "bin": { "js-yaml": "bin/js-yaml.js" } }, "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA=="],
"jsesc": ["jsesc@3.1.0", "", { "bin": { "jsesc": "bin/jsesc" } }, "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA=="],
"json-buffer": ["json-buffer@3.0.1", "", {}, "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ=="],
"json-schema-traverse": ["json-schema-traverse@0.4.1", "", {}, "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg=="],
"json-stable-stringify-without-jsonify": ["json-stable-stringify-without-jsonify@1.0.1", "", {}, "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw=="],
"json5": ["json5@2.2.3", "", { "bin": { "json5": "lib/cli.js" } }, "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg=="],
"keyv": ["keyv@4.5.4", "", { "dependencies": { "json-buffer": "3.0.1" } }, "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw=="],
"levn": ["levn@0.4.1", "", { "dependencies": { "prelude-ls": "^1.2.1", "type-check": "~0.4.0" } }, "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ=="],
"lightningcss": ["lightningcss@1.32.0", "", { "dependencies": { "detect-libc": "^2.0.3" }, "optionalDependencies": { "lightningcss-android-arm64": "1.32.0", "lightningcss-darwin-arm64": "1.32.0", "lightningcss-darwin-x64": "1.32.0", "lightningcss-freebsd-x64": "1.32.0", "lightningcss-linux-arm-gnueabihf": "1.32.0", "lightningcss-linux-arm64-gnu": "1.32.0", "lightningcss-linux-arm64-musl": "1.32.0", "lightningcss-linux-x64-gnu": "1.32.0", "lightningcss-linux-x64-musl": "1.32.0", "lightningcss-win32-arm64-msvc": "1.32.0", "lightningcss-win32-x64-msvc": "1.32.0" } }, "sha512-NXYBzinNrblfraPGyrbPoD19C1h9lfI/1mzgWYvXUTe414Gz/X1FD2XBZSZM7rRTrMA8JL3OtAaGifrIKhQ5yQ=="],
"lightningcss-android-arm64": ["lightningcss-android-arm64@1.32.0", "", { "os": "android", "cpu": "arm64" }, "sha512-YK7/ClTt4kAK0vo6w3X+Pnm0D2cf2vPHbhOXdoNti1Ga0al1P4TBZhwjATvjNwLEBCnKvjJc2jQgHXH0NEwlAg=="],
"lightningcss-darwin-arm64": ["lightningcss-darwin-arm64@1.32.0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-RzeG9Ju5bag2Bv1/lwlVJvBE3q6TtXskdZLLCyfg5pt+HLz9BqlICO7LZM7VHNTTn/5PRhHFBSjk5lc4cmscPQ=="],
"lightningcss-darwin-x64": ["lightningcss-darwin-x64@1.32.0", "", { "os": "darwin", "cpu": "x64" }, "sha512-U+QsBp2m/s2wqpUYT/6wnlagdZbtZdndSmut/NJqlCcMLTWp5muCrID+K5UJ6jqD2BFshejCYXniPDbNh73V8w=="],
"lightningcss-freebsd-x64": ["lightningcss-freebsd-x64@1.32.0", "", { "os": "freebsd", "cpu": "x64" }, "sha512-JCTigedEksZk3tHTTthnMdVfGf61Fky8Ji2E4YjUTEQX14xiy/lTzXnu1vwiZe3bYe0q+SpsSH/CTeDXK6WHig=="],
"lightningcss-linux-arm-gnueabihf": ["lightningcss-linux-arm-gnueabihf@1.32.0", "", { "os": "linux", "cpu": "arm" }, "sha512-x6rnnpRa2GL0zQOkt6rts3YDPzduLpWvwAF6EMhXFVZXD4tPrBkEFqzGowzCsIWsPjqSK+tyNEODUBXeeVHSkw=="],
"lightningcss-linux-arm64-gnu": ["lightningcss-linux-arm64-gnu@1.32.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-0nnMyoyOLRJXfbMOilaSRcLH3Jw5z9HDNGfT/gwCPgaDjnx0i8w7vBzFLFR1f6CMLKF8gVbebmkUN3fa/kQJpQ=="],
"lightningcss-linux-arm64-musl": ["lightningcss-linux-arm64-musl@1.32.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-UpQkoenr4UJEzgVIYpI80lDFvRmPVg6oqboNHfoH4CQIfNA+HOrZ7Mo7KZP02dC6LjghPQJeBsvXhJod/wnIBg=="],
"lightningcss-linux-x64-gnu": ["lightningcss-linux-x64-gnu@1.32.0", "", { "os": "linux", "cpu": "x64" }, "sha512-V7Qr52IhZmdKPVr+Vtw8o+WLsQJYCTd8loIfpDaMRWGUZfBOYEJeyJIkqGIDMZPwPx24pUMfwSxxI8phr/MbOA=="],
"lightningcss-linux-x64-musl": ["lightningcss-linux-x64-musl@1.32.0", "", { "os": "linux", "cpu": "x64" }, "sha512-bYcLp+Vb0awsiXg/80uCRezCYHNg1/l3mt0gzHnWV9XP1W5sKa5/TCdGWaR/zBM2PeF/HbsQv/j2URNOiVuxWg=="],
"lightningcss-win32-arm64-msvc": ["lightningcss-win32-arm64-msvc@1.32.0", "", { "os": "win32", "cpu": "arm64" }, "sha512-8SbC8BR40pS6baCM8sbtYDSwEVQd4JlFTOlaD3gWGHfThTcABnNDBda6eTZeqbofalIJhFx0qKzgHJmcPTnGdw=="],
"lightningcss-win32-x64-msvc": ["lightningcss-win32-x64-msvc@1.32.0", "", { "os": "win32", "cpu": "x64" }, "sha512-Amq9B/SoZYdDi1kFrojnoqPLxYhQ4Wo5XiL8EVJrVsB8ARoC1PWW6VGtT0WKCemjy8aC+louJnjS7U18x3b06Q=="],
"locate-path": ["locate-path@6.0.0", "", { "dependencies": { "p-locate": "^5.0.0" } }, "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw=="],
"lodash": ["lodash@4.17.23", "", {}, "sha512-LgVTMpQtIopCi79SJeDiP0TfWi5CNEc/L/aRdTh3yIvmZXTnheWpKjSZhnvMl8iXbC1tFg9gdHHDMLoV7CnG+w=="],
"lodash.merge": ["lodash.merge@4.6.2", "", {}, "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ=="],
"loose-envify": ["loose-envify@1.4.0", "", { "dependencies": { "js-tokens": "^3.0.0 || ^4.0.0" }, "bin": { "loose-envify": "cli.js" } }, "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q=="],
"lru-cache": ["lru-cache@5.1.1", "", { "dependencies": { "yallist": "^3.0.2" } }, "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w=="],
"lucide-react": ["lucide-react@0.577.0", "", { "peerDependencies": { "react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "sha512-4LjoFv2eEPwYDPg/CUdBJQSDfPyzXCRrVW1X7jrx/trgxnxkHFjnVZINbzvzxjN70dxychOfg+FTYwBiS3pQ5A=="],
"magic-string": ["magic-string@0.30.21", "", { "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.5" } }, "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ=="],
"minimatch": ["minimatch@3.1.5", "", { "dependencies": { "brace-expansion": "^1.1.7" } }, "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w=="],
"ms": ["ms@2.1.3", "", {}, "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="],
"nanoid": ["nanoid@3.3.11", "", { "bin": { "nanoid": "bin/nanoid.cjs" } }, "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w=="],
"natural-compare": ["natural-compare@1.4.0", "", {}, "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw=="],
"next-themes": ["next-themes@0.4.6", "", { "peerDependencies": { "react": "^16.8 || ^17 || ^18 || ^19 || ^19.0.0-rc", "react-dom": "^16.8 || ^17 || ^18 || ^19 || ^19.0.0-rc" } }, "sha512-pZvgD5L0IEvX5/9GWyHMf3m8BKiVQwsCMHfoFosXtXBMnaS0ZnIJ9ST4b4NqLVKDEm8QBxoNNGNaBv2JNF6XNA=="],
"node-releases": ["node-releases@2.0.36", "", {}, "sha512-TdC8FSgHz8Mwtw9g5L4gR/Sh9XhSP/0DEkQxfEFXOpiul5IiHgHan2VhYYb6agDSfp4KuvltmGApc8HMgUrIkA=="],
"object-assign": ["object-assign@4.1.1", "", {}, "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg=="],
"optionator": ["optionator@0.9.4", "", { "dependencies": { "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", "levn": "^0.4.1", "prelude-ls": "^1.2.1", "type-check": "^0.4.0", "word-wrap": "^1.2.5" } }, "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g=="],
"p-limit": ["p-limit@3.1.0", "", { "dependencies": { "yocto-queue": "^0.1.0" } }, "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ=="],
"p-locate": ["p-locate@5.0.0", "", { "dependencies": { "p-limit": "^3.0.2" } }, "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw=="],
"parent-module": ["parent-module@1.0.1", "", { "dependencies": { "callsites": "^3.0.0" } }, "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g=="],
"path-exists": ["path-exists@4.0.0", "", {}, "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w=="],
"path-key": ["path-key@3.1.1", "", {}, "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q=="],
"picocolors": ["picocolors@1.1.1", "", {}, "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA=="],
"picomatch": ["picomatch@4.0.3", "", {}, "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q=="],
"postcss": ["postcss@8.5.8", "", { "dependencies": { "nanoid": "^3.3.11", "picocolors": "^1.1.1", "source-map-js": "^1.2.1" } }, "sha512-OW/rX8O/jXnm82Ey1k44pObPtdblfiuWnrd8X7GJ7emImCOstunGbXUpp7HdBrFQX6rJzn3sPT397Wp5aCwCHg=="],
"prelude-ls": ["prelude-ls@1.2.1", "", {}, "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g=="],
"prop-types": ["prop-types@15.8.1", "", { "dependencies": { "loose-envify": "^1.4.0", "object-assign": "^4.1.1", "react-is": "^16.13.1" } }, "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg=="],
"punycode": ["punycode@2.3.1", "", {}, "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg=="],
"radix-ui": ["radix-ui@1.4.3", "", { "dependencies": { "@radix-ui/primitive": "1.1.3", "@radix-ui/react-accessible-icon": "1.1.7", "@radix-ui/react-accordion": "1.2.12", "@radix-ui/react-alert-dialog": "1.1.15", "@radix-ui/react-arrow": "1.1.7", "@radix-ui/react-aspect-ratio": "1.1.7", "@radix-ui/react-avatar": "1.1.10", "@radix-ui/react-checkbox": "1.3.3", "@radix-ui/react-collapsible": "1.1.12", "@radix-ui/react-collection": "1.1.7", "@radix-ui/react-compose-refs": "1.1.2", "@radix-ui/react-context": "1.1.2", "@radix-ui/react-context-menu": "2.2.16", "@radix-ui/react-dialog": "1.1.15", "@radix-ui/react-direction": "1.1.1", "@radix-ui/react-dismissable-layer": "1.1.11", "@radix-ui/react-dropdown-menu": "2.1.16", "@radix-ui/react-focus-guards": "1.1.3", "@radix-ui/react-focus-scope": "1.1.7", "@radix-ui/react-form": "0.1.8", "@radix-ui/react-hover-card": "1.1.15", "@radix-ui/react-label": "2.1.7", "@radix-ui/react-menu": "2.1.16", "@radix-ui/react-menubar": "1.1.16", "@radix-ui/react-navigation-menu": "1.2.14", "@radix-ui/react-one-time-password-field": "0.1.8", "@radix-ui/react-password-toggle-field": "0.1.3", "@radix-ui/react-popover": "1.1.15", "@radix-ui/react-popper": "1.2.8", "@radix-ui/react-portal": "1.1.9", "@radix-ui/react-presence": "1.1.5", "@radix-ui/react-primitive": "2.1.3", "@radix-ui/react-progress": "1.1.7", "@radix-ui/react-radio-group": "1.3.8", "@radix-ui/react-roving-focus": "1.1.11", "@radix-ui/react-scroll-area": "1.2.10", "@radix-ui/react-select": "2.2.6", "@radix-ui/react-separator": "1.1.7", "@radix-ui/react-slider": "1.3.6", "@radix-ui/react-slot": "1.2.3", "@radix-ui/react-switch": "1.2.6", "@radix-ui/react-tabs": "1.1.13", "@radix-ui/react-toast": "1.2.15", "@radix-ui/react-toggle": "1.1.10", "@radix-ui/react-toggle-group": "1.1.11", "@radix-ui/react-toolbar": "1.1.11", "@radix-ui/react-tooltip": "1.2.8", "@radix-ui/react-use-callback-ref": "1.1.1", "@radix-ui/react-use-controllable-state": "1.2.2", "@radix-ui/react-use-effect-event": "0.0.2", "@radix-ui/react-use-escape-keydown": "1.1.1", "@radix-ui/react-use-is-hydrated": "0.1.0", "@radix-ui/react-use-layout-effect": "1.1.1", "@radix-ui/react-use-size": "1.1.1", "@radix-ui/react-visually-hidden": "1.2.3" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-aWizCQiyeAenIdUbqEpXgRA1ya65P13NKn/W8rWkcN0OPkRDxdBVLWnIEDsS2RpwCK2nobI7oMUSmexzTDyAmA=="],
"react": ["react@19.2.4", "", {}, "sha512-9nfp2hYpCwOjAN+8TZFGhtWEwgvWHXqESH8qT89AT/lWklpLON22Lc8pEtnpsZz7VmawabSU0gCjnj8aC0euHQ=="],
"react-dom": ["react-dom@19.2.4", "", { "dependencies": { "scheduler": "^0.27.0" }, "peerDependencies": { "react": "^19.2.4" } }, "sha512-AXJdLo8kgMbimY95O2aKQqsz2iWi9jMgKJhRBAxECE4IFxfcazB2LmzloIoibJI3C12IlY20+KFaLv+71bUJeQ=="],
"react-i18next": ["react-i18next@16.5.8", "", { "dependencies": { "@babel/runtime": "^7.28.4", "html-parse-stringify": "^3.0.1", "use-sync-external-store": "^1.6.0" }, "peerDependencies": { "i18next": ">= 25.6.2", "react": ">= 16.8.0", "typescript": "^5" }, "optionalPeers": ["typescript"] }, "sha512-2ABeHHlakxVY+LSirD+OiERxFL6+zip0PaHo979bgwzeHg27Sqc82xxXWIrSFmfWX0ZkrvXMHwhsi/NGUf5VQg=="],
"react-is": ["react-is@18.3.1", "", {}, "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg=="],
"react-remove-scroll": ["react-remove-scroll@2.7.2", "", { "dependencies": { "react-remove-scroll-bar": "^2.3.7", "react-style-singleton": "^2.2.3", "tslib": "^2.1.0", "use-callback-ref": "^1.3.3", "use-sidecar": "^1.1.3" }, "peerDependencies": { "@types/react": "*", "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-Iqb9NjCCTt6Hf+vOdNIZGdTiH1QSqr27H/Ek9sv/a97gfueI/5h1s3yRi1nngzMUaOOToin5dI1dXKdXiF+u0Q=="],
"react-remove-scroll-bar": ["react-remove-scroll-bar@2.3.8", "", { "dependencies": { "react-style-singleton": "^2.2.2", "tslib": "^2.0.0" }, "peerDependencies": { "@types/react": "*", "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" }, "optionalPeers": ["@types/react"] }, "sha512-9r+yi9+mgU33AKcj6IbT9oRCO78WriSj6t/cF8DWBZJ9aOGPOTEDvdUDz1FwKim7QXWwmHqtdHnRJfhAxEG46Q=="],
"react-router": ["react-router@7.13.1", "", { "dependencies": { "cookie": "^1.0.1", "set-cookie-parser": "^2.6.0" }, "peerDependencies": { "react": ">=18", "react-dom": ">=18" }, "optionalPeers": ["react-dom"] }, "sha512-td+xP4X2/6BJvZoX6xw++A2DdEi++YypA69bJUV5oVvqf6/9/9nNlD70YO1e9d3MyamJEBQFEzk6mbfDYbqrSA=="],
"react-router-dom": ["react-router-dom@7.13.1", "", { "dependencies": { "react-router": "7.13.1" }, "peerDependencies": { "react": ">=18", "react-dom": ">=18" } }, "sha512-UJnV3Rxc5TgUPJt2KJpo1Jpy0OKQr0AjgbZzBFjaPJcFOb2Y8jA5H3LT8HUJAiRLlWrEXWHbF1Z4SCZaQjWDHw=="],
"react-smooth": ["react-smooth@4.0.4", "", { "dependencies": { "fast-equals": "^5.0.1", "prop-types": "^15.8.1", "react-transition-group": "^4.4.5" }, "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "sha512-gnGKTpYwqL0Iii09gHobNolvX4Kiq4PKx6eWBCYYix+8cdw+cGo3do906l1NBPKkSWx1DghC1dlWG9L2uGd61Q=="],
"react-style-singleton": ["react-style-singleton@2.2.3", "", { "dependencies": { "get-nonce": "^1.0.0", "tslib": "^2.0.0" }, "peerDependencies": { "@types/react": "*", "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-b6jSvxvVnyptAiLjbkWLE/lOnR4lfTtDAl+eUC7RZy+QQWc6wRzIV2CE6xBuMmDxc2qIihtDCZD5NPOFl7fRBQ=="],
"react-transition-group": ["react-transition-group@4.4.5", "", { "dependencies": { "@babel/runtime": "^7.5.5", "dom-helpers": "^5.0.1", "loose-envify": "^1.4.0", "prop-types": "^15.6.2" }, "peerDependencies": { "react": ">=16.6.0", "react-dom": ">=16.6.0" } }, "sha512-pZcd1MCJoiKiBR2NRxeCRg13uCXbydPnmB4EOeRrY7480qNWO8IIgQG6zlDkm6uRMsURXPuKq0GWtiM59a5Q6g=="],
"recharts": ["recharts@2.15.4", "", { "dependencies": { "clsx": "^2.0.0", "eventemitter3": "^4.0.1", "lodash": "^4.17.21", "react-is": "^18.3.1", "react-smooth": "^4.0.4", "recharts-scale": "^0.4.4", "tiny-invariant": "^1.3.1", "victory-vendor": "^36.6.8" }, "peerDependencies": { "react": "^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", "react-dom": "^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "sha512-UT/q6fwS3c1dHbXv2uFgYJ9BMFHu3fwnd7AYZaEQhXuYQ4hgsxLvsUXzGdKeZrW5xopzDCvuA2N41WJ88I7zIw=="],
"recharts-scale": ["recharts-scale@0.4.5", "", { "dependencies": { "decimal.js-light": "^2.4.1" } }, "sha512-kivNFO+0OcUNu7jQquLXAxz1FIwZj8nrj+YkOKc5694NbjCvcT6aSZiIzNzd2Kul4o4rTto8QVR9lMNtxD4G1w=="],
"resolve-from": ["resolve-from@4.0.0", "", {}, "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g=="],
"rolldown": ["rolldown@1.0.0-rc.9", "", { "dependencies": { "@oxc-project/types": "=0.115.0", "@rolldown/pluginutils": "1.0.0-rc.9" }, "optionalDependencies": { "@rolldown/binding-android-arm64": "1.0.0-rc.9", "@rolldown/binding-darwin-arm64": "1.0.0-rc.9", "@rolldown/binding-darwin-x64": "1.0.0-rc.9", "@rolldown/binding-freebsd-x64": "1.0.0-rc.9", "@rolldown/binding-linux-arm-gnueabihf": "1.0.0-rc.9", "@rolldown/binding-linux-arm64-gnu": "1.0.0-rc.9", "@rolldown/binding-linux-arm64-musl": "1.0.0-rc.9", "@rolldown/binding-linux-ppc64-gnu": "1.0.0-rc.9", "@rolldown/binding-linux-s390x-gnu": "1.0.0-rc.9", "@rolldown/binding-linux-x64-gnu": "1.0.0-rc.9", "@rolldown/binding-linux-x64-musl": "1.0.0-rc.9", "@rolldown/binding-openharmony-arm64": "1.0.0-rc.9", "@rolldown/binding-wasm32-wasi": "1.0.0-rc.9", "@rolldown/binding-win32-arm64-msvc": "1.0.0-rc.9", "@rolldown/binding-win32-x64-msvc": "1.0.0-rc.9" }, "bin": { "rolldown": "bin/cli.mjs" } }, "sha512-9EbgWge7ZH+yqb4d2EnELAntgPTWbfL8ajiTW+SyhJEC4qhBbkCKbqFV4Ge4zmu5ziQuVbWxb/XwLZ+RIO7E8Q=="],
"scheduler": ["scheduler@0.27.0", "", {}, "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q=="],
"semver": ["semver@6.3.1", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA=="],
"set-cookie-parser": ["set-cookie-parser@2.7.2", "", {}, "sha512-oeM1lpU/UvhTxw+g3cIfxXHyJRc/uidd3yK1P242gzHds0udQBYzs3y8j4gCCW+ZJ7ad0yctld8RYO+bdurlvw=="],
"shebang-command": ["shebang-command@2.0.0", "", { "dependencies": { "shebang-regex": "^3.0.0" } }, "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA=="],
"shebang-regex": ["shebang-regex@3.0.0", "", {}, "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A=="],
"sonner": ["sonner@2.0.7", "", { "peerDependencies": { "react": "^18.0.0 || ^19.0.0 || ^19.0.0-rc", "react-dom": "^18.0.0 || ^19.0.0 || ^19.0.0-rc" } }, "sha512-W6ZN4p58k8aDKA4XPcx2hpIQXBRAgyiWVkYhT7CvK6D3iAu7xjvVyhQHg2/iaKJZ1XVJ4r7XuwGL+WGEK37i9w=="],
"source-map-js": ["source-map-js@1.2.1", "", {}, "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA=="],
"strip-json-comments": ["strip-json-comments@3.1.1", "", {}, "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig=="],
"supports-color": ["supports-color@7.2.0", "", { "dependencies": { "has-flag": "^4.0.0" } }, "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw=="],
"tailwind-merge": ["tailwind-merge@3.5.0", "", {}, "sha512-I8K9wewnVDkL1NTGoqWmVEIlUcB9gFriAEkXkfCjX5ib8ezGxtR3xD7iZIxrfArjEsH7F1CHD4RFUtxefdqV/A=="],
"tailwindcss": ["tailwindcss@4.2.1", "", {}, "sha512-/tBrSQ36vCleJkAOsy9kbNTgaxvGbyOamC30PRePTQe/o1MFwEKHQk4Cn7BNGaPtjp+PuUrByJehM1hgxfq4sw=="],
"tapable": ["tapable@2.3.0", "", {}, "sha512-g9ljZiwki/LfxmQADO3dEY1CbpmXT5Hm2fJ+QaGKwSXUylMybePR7/67YW7jOrrvjEgL1Fmz5kzyAjWVWLlucg=="],
"tiny-invariant": ["tiny-invariant@1.3.3", "", {}, "sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg=="],
"tinyglobby": ["tinyglobby@0.2.15", "", { "dependencies": { "fdir": "^6.5.0", "picomatch": "^4.0.3" } }, "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ=="],
"ts-api-utils": ["ts-api-utils@2.4.0", "", { "peerDependencies": { "typescript": ">=4.8.4" } }, "sha512-3TaVTaAv2gTiMB35i3FiGJaRfwb3Pyn/j3m/bfAvGe8FB7CF6u+LMYqYlDh7reQf7UNvoTvdfAqHGmPGOSsPmA=="],
"tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="],
"type-check": ["type-check@0.4.0", "", { "dependencies": { "prelude-ls": "^1.2.1" } }, "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew=="],
"typescript": ["typescript@5.9.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw=="],
"typescript-eslint": ["typescript-eslint@8.57.0", "", { "dependencies": { "@typescript-eslint/eslint-plugin": "8.57.0", "@typescript-eslint/parser": "8.57.0", "@typescript-eslint/typescript-estree": "8.57.0", "@typescript-eslint/utils": "8.57.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.0.0" } }, "sha512-W8GcigEMEeB07xEZol8oJ26rigm3+bfPHxHvwbYUlu1fUDsGuQ7Hiskx5xGW/xM4USc9Ephe3jtv7ZYPQntHeA=="],
"undici-types": ["undici-types@7.16.0", "", {}, "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw=="],
"update-browserslist-db": ["update-browserslist-db@1.2.3", "", { "dependencies": { "escalade": "^3.2.0", "picocolors": "^1.1.1" }, "peerDependencies": { "browserslist": ">= 4.21.0" }, "bin": { "update-browserslist-db": "cli.js" } }, "sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w=="],
"uri-js": ["uri-js@4.4.1", "", { "dependencies": { "punycode": "^2.1.0" } }, "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg=="],
"use-callback-ref": ["use-callback-ref@1.3.3", "", { "dependencies": { "tslib": "^2.0.0" }, "peerDependencies": { "@types/react": "*", "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-jQL3lRnocaFtu3V00JToYz/4QkNWswxijDaCVNZRiRTO3HQDLsdu1ZtmIUvV4yPp+rvWm5j0y0TG/S61cuijTg=="],
"use-sidecar": ["use-sidecar@1.1.3", "", { "dependencies": { "detect-node-es": "^1.1.0", "tslib": "^2.0.0" }, "peerDependencies": { "@types/react": "*", "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-Fedw0aZvkhynoPYlA5WXrMCAMm+nSWdZt6lzJQ7Ok8S6Q+VsHmHpRWndVRJ8Be0ZbkfPc5LRYH+5XrzXcEeLRQ=="],
"use-sync-external-store": ["use-sync-external-store@1.6.0", "", { "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "sha512-Pp6GSwGP/NrPIrxVFAIkOQeyw8lFenOHijQWkUTrDvrF4ALqylP2C/KCkeS9dpUM3KvYRQhna5vt7IL95+ZQ9w=="],
"victory-vendor": ["victory-vendor@36.9.2", "", { "dependencies": { "@types/d3-array": "^3.0.3", "@types/d3-ease": "^3.0.0", "@types/d3-interpolate": "^3.0.1", "@types/d3-scale": "^4.0.2", "@types/d3-shape": "^3.1.0", "@types/d3-time": "^3.0.0", "@types/d3-timer": "^3.0.0", "d3-array": "^3.1.6", "d3-ease": "^3.0.1", "d3-interpolate": "^3.0.1", "d3-scale": "^4.0.2", "d3-shape": "^3.1.0", "d3-time": "^3.0.0", "d3-timer": "^3.0.1" } }, "sha512-PnpQQMuxlwYdocC8fIJqVXvkeViHYzotI+NJrCuav0ZYFoq912ZHBk3mCeuj+5/VpodOjPe1z0Fk2ihgzlXqjQ=="],
"vite": ["vite@8.0.0", "", { "dependencies": { "@oxc-project/runtime": "0.115.0", "lightningcss": "^1.32.0", "picomatch": "^4.0.3", "postcss": "^8.5.8", "rolldown": "1.0.0-rc.9", "tinyglobby": "^0.2.15" }, "optionalDependencies": { "fsevents": "~2.3.3" }, "peerDependencies": { "@types/node": "^20.19.0 || >=22.12.0", "@vitejs/devtools": "^0.0.0-alpha.31", "esbuild": "^0.27.0", "jiti": ">=1.21.0", "less": "^4.0.0", "sass": "^1.70.0", "sass-embedded": "^1.70.0", "stylus": ">=0.54.8", "sugarss": "^5.0.0", "terser": "^5.16.0", "tsx": "^4.8.1", "yaml": "^2.4.2" }, "optionalPeers": ["@types/node", "@vitejs/devtools", "esbuild", "jiti", "less", "sass", "sass-embedded", "stylus", "sugarss", "terser", "tsx", "yaml"], "bin": { "vite": "bin/vite.js" } }, "sha512-fPGaRNj9Zytaf8LEiBhY7Z6ijnFKdzU/+mL8EFBaKr7Vw1/FWcTBAMW0wLPJAGMPX38ZPVCVgLceWiEqeoqL2Q=="],
"void-elements": ["void-elements@3.1.0", "", {}, "sha512-Dhxzh5HZuiHQhbvTW9AMetFfBHDMYpo23Uo9btPXgdYP+3T5S+p+jgNy7spra+veYhBP2dCSgxR/i2Y02h5/6w=="],
"which": ["which@2.0.2", "", { "dependencies": { "isexe": "^2.0.0" }, "bin": { "node-which": "./bin/node-which" } }, "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA=="],
"word-wrap": ["word-wrap@1.2.5", "", {}, "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA=="],
"ws": ["ws@8.19.0", "", { "peerDependencies": { "bufferutil": "^4.0.1", "utf-8-validate": ">=5.0.2" }, "optionalPeers": ["bufferutil", "utf-8-validate"] }, "sha512-blAT2mjOEIi0ZzruJfIhb3nps74PRWTCz1IjglWEEpQl5XS/UNama6u2/rjFkDDouqr4L67ry+1aGIALViWjDg=="],
"yallist": ["yallist@3.1.1", "", {}, "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g=="],
"yocto-queue": ["yocto-queue@0.1.0", "", {}, "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q=="],
"zod": ["zod@4.3.6", "", {}, "sha512-rftlrkhHZOcjDwkGlnUtZZkvaPHCsDATp4pGpuOOMDaTdDDXF91wuVDJoWoPsKX/3YPQ5fHuF3STjcYyKr+Qhg=="],
"zod-validation-error": ["zod-validation-error@4.0.2", "", { "peerDependencies": { "zod": "^3.25.0 || ^4.0.0" } }, "sha512-Q6/nZLe6jxuU80qb/4uJ4t5v2VEZ44lzQjPDhYJNztRQ4wyWc6VF3D3Kb/fAuPetZQnhS3hnajCf9CsWesghLQ=="],
"@eslint-community/eslint-utils/eslint-visitor-keys": ["eslint-visitor-keys@3.4.3", "", {}, "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag=="],
"@eslint/eslintrc/globals": ["globals@14.0.0", "", {}, "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ=="],
"@tailwindcss/node/lightningcss": ["lightningcss@1.31.1", "", { "dependencies": { "detect-libc": "^2.0.3" }, "optionalDependencies": { "lightningcss-android-arm64": "1.31.1", "lightningcss-darwin-arm64": "1.31.1", "lightningcss-darwin-x64": "1.31.1", "lightningcss-freebsd-x64": "1.31.1", "lightningcss-linux-arm-gnueabihf": "1.31.1", "lightningcss-linux-arm64-gnu": "1.31.1", "lightningcss-linux-arm64-musl": "1.31.1", "lightningcss-linux-x64-gnu": "1.31.1", "lightningcss-linux-x64-musl": "1.31.1", "lightningcss-win32-arm64-msvc": "1.31.1", "lightningcss-win32-x64-msvc": "1.31.1" } }, "sha512-l51N2r93WmGUye3WuFoN5k10zyvrVs0qfKBhyC5ogUQ6Ew6JUSswh78mbSO+IU3nTWsyOArqPCcShdQSadghBQ=="],
"@tailwindcss/oxide-wasm32-wasi/@emnapi/core": ["@emnapi/core@1.9.0", "", { "dependencies": { "@emnapi/wasi-threads": "1.2.0", "tslib": "^2.4.0" }, "bundled": true }, "sha512-0DQ98G9ZQZOxfUcQn1waV2yS8aWdZ6kJMbYCJB3oUBecjWYO1fqJ+a1DRfPF3O5JEkwqwP1A9QEN/9mYm2Yd0w=="],
"@tailwindcss/oxide-wasm32-wasi/@emnapi/runtime": ["@emnapi/runtime@1.9.0", "", { "dependencies": { "tslib": "^2.4.0" }, "bundled": true }, "sha512-QN75eB0IH2ywSpRpNddCRfQIhmJYBCJ1x5Lb3IscKAL8bMnVAKnRg8dCoXbHzVLLH7P38N2Z3mtulB7W0J0FKw=="],
"@tailwindcss/oxide-wasm32-wasi/@emnapi/wasi-threads": ["@emnapi/wasi-threads@1.2.0", "", { "dependencies": { "tslib": "^2.4.0" }, "bundled": true }, "sha512-N10dEJNSsUx41Z6pZsXU8FjPjpBEplgH24sfkmITrBED1/U2Esum9F3lfLrMjKHHjmi557zQn7kR9R+XWXu5Rg=="],
"@tailwindcss/oxide-wasm32-wasi/@napi-rs/wasm-runtime": ["@napi-rs/wasm-runtime@1.1.1", "", { "dependencies": { "@emnapi/core": "^1.7.1", "@emnapi/runtime": "^1.7.1", "@tybys/wasm-util": "^0.10.1" }, "bundled": true }, "sha512-p64ah1M1ld8xjWv3qbvFwHiFVWrq1yFvV4f7w+mzaqiR4IlSgkqhcRdHwsGgomwzBH51sRY4NEowLxnaBjcW/A=="],
"@tailwindcss/oxide-wasm32-wasi/@tybys/wasm-util": ["@tybys/wasm-util@0.10.1", "", { "dependencies": { "tslib": "^2.4.0" }, "bundled": true }, "sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg=="],
"@tailwindcss/oxide-wasm32-wasi/tslib": ["tslib@2.8.1", "", { "bundled": true }, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="],
"@typescript-eslint/eslint-plugin/ignore": ["ignore@7.0.5", "", {}, "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg=="],
"@typescript-eslint/typescript-estree/minimatch": ["minimatch@10.2.4", "", { "dependencies": { "brace-expansion": "^5.0.2" } }, "sha512-oRjTw/97aTBN0RHbYCdtF1MQfvusSIBQM0IZEgzl6426+8jSC0nF1a/GmnVLpfB9yyr6g6FTqWqiZVbxrtaCIg=="],
"@typescript-eslint/typescript-estree/semver": ["semver@7.7.4", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA=="],
"@typescript-eslint/visitor-keys/eslint-visitor-keys": ["eslint-visitor-keys@5.0.1", "", {}, "sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA=="],
"prop-types/react-is": ["react-is@16.13.1", "", {}, "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ=="],
"rolldown/@rolldown/pluginutils": ["@rolldown/pluginutils@1.0.0-rc.9", "", {}, "sha512-w6oiRWgEBl04QkFZgmW+jnU1EC9b57Oihi2ot3HNWIQRqgHp5PnYDia5iZ5FF7rpa4EQdiqMDXjlqKGXBhsoXw=="],
"@tailwindcss/node/lightningcss/lightningcss-android-arm64": ["lightningcss-android-arm64@1.31.1", "", { "os": "android", "cpu": "arm64" }, "sha512-HXJF3x8w9nQ4jbXRiNppBCqeZPIAfUo8zE/kOEGbW5NZvGc/K7nMxbhIr+YlFlHW5mpbg/YFPdbnCh1wAXCKFg=="],
"@tailwindcss/node/lightningcss/lightningcss-darwin-arm64": ["lightningcss-darwin-arm64@1.31.1", "", { "os": "darwin", "cpu": "arm64" }, "sha512-02uTEqf3vIfNMq3h/z2cJfcOXnQ0GRwQrkmPafhueLb2h7mqEidiCzkE4gBMEH65abHRiQvhdcQ+aP0D0g67sg=="],
"@tailwindcss/node/lightningcss/lightningcss-darwin-x64": ["lightningcss-darwin-x64@1.31.1", "", { "os": "darwin", "cpu": "x64" }, "sha512-1ObhyoCY+tGxtsz1lSx5NXCj3nirk0Y0kB/g8B8DT+sSx4G9djitg9ejFnjb3gJNWo7qXH4DIy2SUHvpoFwfTA=="],
"@tailwindcss/node/lightningcss/lightningcss-freebsd-x64": ["lightningcss-freebsd-x64@1.31.1", "", { "os": "freebsd", "cpu": "x64" }, "sha512-1RINmQKAItO6ISxYgPwszQE1BrsVU5aB45ho6O42mu96UiZBxEXsuQ7cJW4zs4CEodPUioj/QrXW1r9pLUM74A=="],
"@tailwindcss/node/lightningcss/lightningcss-linux-arm-gnueabihf": ["lightningcss-linux-arm-gnueabihf@1.31.1", "", { "os": "linux", "cpu": "arm" }, "sha512-OOCm2//MZJ87CdDK62rZIu+aw9gBv4azMJuA8/KB74wmfS3lnC4yoPHm0uXZ/dvNNHmnZnB8XLAZzObeG0nS1g=="],
"@tailwindcss/node/lightningcss/lightningcss-linux-arm64-gnu": ["lightningcss-linux-arm64-gnu@1.31.1", "", { "os": "linux", "cpu": "arm64" }, "sha512-WKyLWztD71rTnou4xAD5kQT+982wvca7E6QoLpoawZ1gP9JM0GJj4Tp5jMUh9B3AitHbRZ2/H3W5xQmdEOUlLg=="],
"@tailwindcss/node/lightningcss/lightningcss-linux-arm64-musl": ["lightningcss-linux-arm64-musl@1.31.1", "", { "os": "linux", "cpu": "arm64" }, "sha512-mVZ7Pg2zIbe3XlNbZJdjs86YViQFoJSpc41CbVmKBPiGmC4YrfeOyz65ms2qpAobVd7WQsbW4PdsSJEMymyIMg=="],
"@tailwindcss/node/lightningcss/lightningcss-linux-x64-gnu": ["lightningcss-linux-x64-gnu@1.31.1", "", { "os": "linux", "cpu": "x64" }, "sha512-xGlFWRMl+0KvUhgySdIaReQdB4FNudfUTARn7q0hh/V67PVGCs3ADFjw+6++kG1RNd0zdGRlEKa+T13/tQjPMA=="],
"@tailwindcss/node/lightningcss/lightningcss-linux-x64-musl": ["lightningcss-linux-x64-musl@1.31.1", "", { "os": "linux", "cpu": "x64" }, "sha512-eowF8PrKHw9LpoZii5tdZwnBcYDxRw2rRCyvAXLi34iyeYfqCQNA9rmUM0ce62NlPhCvof1+9ivRaTY6pSKDaA=="],
"@tailwindcss/node/lightningcss/lightningcss-win32-arm64-msvc": ["lightningcss-win32-arm64-msvc@1.31.1", "", { "os": "win32", "cpu": "arm64" }, "sha512-aJReEbSEQzx1uBlQizAOBSjcmr9dCdL3XuC/6HLXAxmtErsj2ICo5yYggg1qOODQMtnjNQv2UHb9NpOuFtYe4w=="],
"@tailwindcss/node/lightningcss/lightningcss-win32-x64-msvc": ["lightningcss-win32-x64-msvc@1.31.1", "", { "os": "win32", "cpu": "x64" }, "sha512-I9aiFrbd7oYHwlnQDqr1Roz+fTz61oDDJX7n9tYF9FJymH1cIN1DtKw3iYt6b8WZgEjoNwVSncwF4wx/ZedMhw=="],
"@typescript-eslint/typescript-estree/minimatch/brace-expansion": ["brace-expansion@5.0.4", "", { "dependencies": { "balanced-match": "^4.0.2" } }, "sha512-h+DEnpVvxmfVefa4jFbCf5HdH5YMDXRsmKflpf1pILZWRFlTbJpxeU55nJl4Smt5HQaGzg1o6RHFPJaOqnmBDg=="],
"@typescript-eslint/typescript-estree/minimatch/brace-expansion/balanced-match": ["balanced-match@4.0.4", "", {}, "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA=="],
}
}

21
components.json Normal file
View File

@@ -0,0 +1,21 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "new-york",
"rsc": false,
"tsx": true,
"tailwind": {
"config": "",
"css": "src/index.css",
"baseColor": "neutral",
"cssVariables": true,
"prefix": ""
},
"aliases": {
"components": "@/components",
"utils": "@/lib/utils",
"ui": "@/components/ui",
"lib": "@/lib",
"hooks": "@/hooks"
},
"iconLibrary": "lucide"
}

23
eslint.config.js Normal file
View File

@@ -0,0 +1,23 @@
import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import tseslint from 'typescript-eslint'
import { defineConfig, globalIgnores } from 'eslint/config'
export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
js.configs.recommended,
tseslint.configs.recommended,
reactHooks.configs.flat.recommended,
reactRefresh.configs.vite,
],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
},
},
])

13
index.html Normal file
View File

@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>SimpleFinanceDash</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>

45
package.json Normal file
View File

@@ -0,0 +1,45 @@
{
"name": "simple-finance-dash",
"private": true,
"version": "0.1.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc -b && vite build",
"lint": "eslint .",
"preview": "vite preview"
},
"dependencies": {
"@supabase/supabase-js": "^2.99.1",
"@tanstack/react-query": "^5.90.21",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"i18next": "^25.8.18",
"lucide-react": "^0.577.0",
"next-themes": "^0.4.6",
"radix-ui": "^1.4.3",
"react": "^19.2.4",
"react-dom": "^19.2.4",
"react-i18next": "^16.5.8",
"react-router-dom": "^7.13.1",
"recharts": "2.15.4",
"sonner": "^2.0.7",
"tailwind-merge": "^3.5.0"
},
"devDependencies": {
"@eslint/js": "^9.39.4",
"@tailwindcss/vite": "^4.2.1",
"@types/node": "^24.12.0",
"@types/react": "^19.2.14",
"@types/react-dom": "^19.2.3",
"@vitejs/plugin-react": "^6.0.0",
"eslint": "^9.39.4",
"eslint-plugin-react-hooks": "^7.0.1",
"eslint-plugin-react-refresh": "^0.5.2",
"globals": "^17.4.0",
"tailwindcss": "^4.2.1",
"typescript": "~5.9.3",
"typescript-eslint": "^8.56.1",
"vite": "^8.0.0"
}
}

1
public/favicon.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 9.3 KiB

24
public/icons.svg Normal file
View File

@@ -0,0 +1,24 @@
<svg xmlns="http://www.w3.org/2000/svg">
<symbol id="bluesky-icon" viewBox="0 0 16 17">
<g clip-path="url(#bluesky-clip)"><path fill="#08060d" d="M7.75 7.735c-.693-1.348-2.58-3.86-4.334-5.097-1.68-1.187-2.32-.981-2.74-.79C.188 2.065.1 2.812.1 3.251s.241 3.602.398 4.13c.52 1.744 2.367 2.333 4.07 2.145-2.495.37-4.71 1.278-1.805 4.512 3.196 3.309 4.38-.71 4.987-2.746.608 2.036 1.307 5.91 4.93 2.746 2.72-2.746.747-4.143-1.747-4.512 1.702.189 3.55-.4 4.07-2.145.156-.528.397-3.691.397-4.13s-.088-1.186-.575-1.406c-.42-.19-1.06-.395-2.741.79-1.755 1.24-3.64 3.752-4.334 5.099"/></g>
<defs><clipPath id="bluesky-clip"><path fill="#fff" d="M.1.85h15.3v15.3H.1z"/></clipPath></defs>
</symbol>
<symbol id="discord-icon" viewBox="0 0 20 19">
<path fill="#08060d" d="M16.224 3.768a14.5 14.5 0 0 0-3.67-1.153c-.158.286-.343.67-.47.976a13.5 13.5 0 0 0-4.067 0c-.128-.306-.317-.69-.476-.976A14.4 14.4 0 0 0 3.868 3.77C1.546 7.28.916 10.703 1.231 14.077a14.7 14.7 0 0 0 4.5 2.306q.545-.748.965-1.587a9.5 9.5 0 0 1-1.518-.74q.191-.14.372-.293c2.927 1.369 6.107 1.369 8.999 0q.183.152.372.294-.723.437-1.52.74.418.838.963 1.588a14.6 14.6 0 0 0 4.504-2.308c.37-3.911-.63-7.302-2.644-10.309m-9.13 8.234c-.878 0-1.599-.82-1.599-1.82 0-.998.705-1.82 1.6-1.82.894 0 1.614.82 1.599 1.82.001 1-.705 1.82-1.6 1.82m5.91 0c-.878 0-1.599-.82-1.599-1.82 0-.998.705-1.82 1.6-1.82.893 0 1.614.82 1.599 1.82 0 1-.706 1.82-1.6 1.82"/>
</symbol>
<symbol id="documentation-icon" viewBox="0 0 21 20">
<path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="m15.5 13.333 1.533 1.322c.645.555.967.833.967 1.178s-.322.623-.967 1.179L15.5 18.333m-3.333-5-1.534 1.322c-.644.555-.966.833-.966 1.178s.322.623.966 1.179l1.534 1.321"/>
<path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M17.167 10.836v-4.32c0-1.41 0-2.117-.224-2.68-.359-.906-1.118-1.621-2.08-1.96-.599-.21-1.349-.21-2.848-.21-2.623 0-3.935 0-4.983.369-1.684.591-3.013 1.842-3.641 3.428C3 6.449 3 7.684 3 10.154v2.122c0 2.558 0 3.838.706 4.726q.306.383.713.671c.76.536 1.79.64 3.581.66"/>
<path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M3 10a2.78 2.78 0 0 1 2.778-2.778c.555 0 1.209.097 1.748-.047.48-.129.854-.503.982-.982.145-.54.048-1.194.048-1.749a2.78 2.78 0 0 1 2.777-2.777"/>
</symbol>
<symbol id="github-icon" viewBox="0 0 19 19">
<path fill="#08060d" fill-rule="evenodd" d="M9.356 1.85C5.05 1.85 1.57 5.356 1.57 9.694a7.84 7.84 0 0 0 5.324 7.44c.387.079.528-.168.528-.376 0-.182-.013-.805-.013-1.454-2.165.467-2.616-.935-2.616-.935-.349-.91-.864-1.143-.864-1.143-.71-.48.051-.48.051-.48.787.051 1.2.805 1.2.805.695 1.194 1.817.857 2.268.649.064-.507.27-.857.49-1.052-1.728-.182-3.545-.857-3.545-3.87 0-.857.31-1.558.8-2.104-.078-.195-.349-1 .077-2.078 0 0 .657-.208 2.14.805a7.5 7.5 0 0 1 1.946-.26c.657 0 1.328.092 1.946.26 1.483-1.013 2.14-.805 2.14-.805.426 1.078.155 1.883.078 2.078.502.546.799 1.247.799 2.104 0 3.013-1.818 3.675-3.558 3.87.284.247.528.714.528 1.454 0 1.052-.012 1.896-.012 2.156 0 .208.142.455.528.377a7.84 7.84 0 0 0 5.324-7.441c.013-4.338-3.48-7.844-7.773-7.844" clip-rule="evenodd"/>
</symbol>
<symbol id="social-icon" viewBox="0 0 20 20">
<path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M12.5 6.667a4.167 4.167 0 1 0-8.334 0 4.167 4.167 0 0 0 8.334 0"/>
<path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M2.5 16.667a5.833 5.833 0 0 1 8.75-5.053m3.837.474.513 1.035c.07.144.257.282.414.309l.93.155c.596.1.736.536.307.965l-.723.73a.64.64 0 0 0-.152.531l.207.903c.164.715-.213.991-.84.618l-.872-.52a.63.63 0 0 0-.577 0l-.872.52c-.624.373-1.003.094-.84-.618l.207-.903a.64.64 0 0 0-.152-.532l-.723-.729c-.426-.43-.289-.864.306-.964l.93-.156a.64.64 0 0 0 .412-.31l.513-1.034c.28-.562.735-.562 1.012 0"/>
</symbol>
<symbol id="x-icon" viewBox="0 0 19 19">
<path fill="#08060d" fill-rule="evenodd" d="M1.893 1.98c.052.072 1.245 1.769 2.653 3.77l2.892 4.114c.183.261.333.48.333.486s-.068.089-.152.183l-.522.593-.765.867-3.597 4.087c-.375.426-.734.834-.798.905a1 1 0 0 0-.118.148c0 .01.236.017.664.017h.663l.729-.83c.4-.457.796-.906.879-.999a692 692 0 0 0 1.794-2.038c.034-.037.301-.34.594-.675l.551-.624.345-.392a7 7 0 0 1 .34-.374c.006 0 .93 1.306 2.052 2.903l2.084 2.965.045.063h2.275c1.87 0 2.273-.003 2.266-.021-.008-.02-1.098-1.572-3.894-5.547-2.013-2.862-2.28-3.246-2.273-3.266.008-.019.282-.332 2.085-2.38l2-2.274 1.567-1.782c.022-.028-.016-.03-.65-.03h-.674l-.3.342a871 871 0 0 1-1.782 2.025c-.067.075-.405.458-.75.852a100 100 0 0 1-.803.91c-.148.172-.299.344-.99 1.127-.304.343-.32.358-.345.327-.015-.019-.904-1.282-1.976-2.808L6.365 1.85H1.8zm1.782.91 8.078 11.294c.772 1.08 1.413 1.973 1.425 1.984.016.017.241.02 1.05.017l1.03-.004-2.694-3.766L7.796 5.75 5.722 2.852l-1.039-.004-1.039-.004z" clip-rule="evenodd"/>
</symbol>
</svg>

After

Width:  |  Height:  |  Size: 4.9 KiB

74
src/App.tsx Normal file
View File

@@ -0,0 +1,74 @@
import { Routes, Route, Navigate } from "react-router-dom"
import { useAuth } from "@/hooks/useAuth"
import AppLayout from "@/components/AppLayout"
import LoginPage from "@/pages/LoginPage"
import RegisterPage from "@/pages/RegisterPage"
import SetupPage from "@/pages/SetupPage"
import DashboardPage from "@/pages/DashboardPage"
import CategoriesPage from "@/pages/CategoriesPage"
import TemplatePage from "@/pages/TemplatePage"
import BudgetListPage from "@/pages/BudgetListPage"
import BudgetDetailPage from "@/pages/BudgetDetailPage"
import QuickAddPage from "@/pages/QuickAddPage"
import SettingsPage from "@/pages/SettingsPage"
function ProtectedRoute({ children }: { children: React.ReactNode }) {
const { user, loading } = useAuth()
if (loading) return null
if (!user) return <Navigate to="/login" replace />
return <>{children}</>
}
function PublicRoute({ children }: { children: React.ReactNode }) {
const { user, loading } = useAuth()
if (loading) return null
if (user) return <Navigate to="/" replace />
return <>{children}</>
}
export default function App() {
return (
<Routes>
<Route
path="/login"
element={
<PublicRoute>
<LoginPage />
</PublicRoute>
}
/>
<Route
path="/register"
element={
<PublicRoute>
<RegisterPage />
</PublicRoute>
}
/>
<Route
path="/setup"
element={
<ProtectedRoute>
<SetupPage />
</ProtectedRoute>
}
/>
<Route
element={
<ProtectedRoute>
<AppLayout />
</ProtectedRoute>
}
>
<Route index element={<DashboardPage />} />
<Route path="categories" element={<CategoriesPage />} />
<Route path="template" element={<TemplatePage />} />
<Route path="budgets" element={<BudgetListPage />} />
<Route path="budgets/:id" element={<BudgetDetailPage />} />
<Route path="quick-add" element={<QuickAddPage />} />
<Route path="settings" element={<SettingsPage />} />
</Route>
<Route path="*" element={<Navigate to="/" replace />} />
</Routes>
)
}

View File

@@ -0,0 +1,100 @@
import { NavLink, Outlet, useNavigate } from "react-router-dom"
import { useTranslation } from "react-i18next"
import {
LayoutDashboard,
Tags,
FileText,
Wallet,
Zap,
Settings,
LogOut,
} from "lucide-react"
import { useAuth } from "@/hooks/useAuth"
import { cn } from "@/lib/utils"
import {
Sidebar,
SidebarContent,
SidebarFooter,
SidebarGroup,
SidebarGroupContent,
SidebarHeader,
SidebarMenu,
SidebarMenuButton,
SidebarMenuItem,
SidebarProvider,
SidebarInset,
} from "@/components/ui/sidebar"
import { Button } from "@/components/ui/button"
import { Separator } from "@/components/ui/separator"
const navItems = [
{ path: "/", icon: LayoutDashboard, labelKey: "nav.dashboard" },
{ path: "/categories", icon: Tags, labelKey: "nav.categories" },
{ path: "/template", icon: FileText, labelKey: "nav.template" },
{ path: "/budgets", icon: Wallet, labelKey: "nav.budgets" },
{ path: "/quick-add", icon: Zap, labelKey: "nav.quickAdd" },
{ path: "/settings", icon: Settings, labelKey: "nav.settings" },
] as const
export default function AppLayout() {
const { t } = useTranslation()
const { signOut } = useAuth()
const navigate = useNavigate()
async function handleLogout() {
await signOut()
navigate("/login")
}
return (
<SidebarProvider>
<Sidebar>
<SidebarHeader className="p-4">
<h1 className="text-lg font-semibold tracking-tight">
{t("app.title")}
</h1>
</SidebarHeader>
<SidebarContent>
<SidebarGroup>
<SidebarGroupContent>
<SidebarMenu>
{navItems.map((item) => (
<SidebarMenuItem key={item.path}>
<SidebarMenuButton asChild>
<NavLink
to={item.path}
end={item.path === "/"}
className={({ isActive }) =>
cn(isActive && "bg-sidebar-accent font-medium")
}
>
<item.icon className="size-4" />
<span>{t(item.labelKey)}</span>
</NavLink>
</SidebarMenuButton>
</SidebarMenuItem>
))}
</SidebarMenu>
</SidebarGroupContent>
</SidebarGroup>
</SidebarContent>
<SidebarFooter className="p-4">
<Separator className="mb-4" />
<Button
variant="ghost"
className="w-full justify-start gap-2"
onClick={handleLogout}
>
<LogOut className="size-4" />
{t("nav.logout")}
</Button>
</SidebarFooter>
</Sidebar>
<SidebarInset>
<main className="flex-1 p-6">
<Outlet />
</main>
</SidebarInset>
</SidebarProvider>
)
}

View File

@@ -0,0 +1,252 @@
import { useState } from "react"
import { useTranslation } from "react-i18next"
import { Zap } from "lucide-react"
import { toast } from "sonner"
import { useQuickAdd } from "@/hooks/useQuickAdd"
import { useCategories } from "@/hooks/useCategories"
import { useBudgets } from "@/hooks/useBudgets"
import type { QuickAddItem, CategoryType } from "@/lib/types"
import { categoryColors } from "@/lib/palette"
import { Button } from "@/components/ui/button"
import { Input } from "@/components/ui/input"
import { Label } from "@/components/ui/label"
import {
Popover,
PopoverContent,
PopoverTrigger,
} from "@/components/ui/popover"
import {
Dialog,
DialogContent,
DialogHeader,
DialogTitle,
} from "@/components/ui/dialog"
import {
Select,
SelectContent,
SelectGroup,
SelectItem,
SelectLabel,
SelectTrigger,
SelectValue,
} from "@/components/ui/select"
// ---------------------------------------------------------------------------
// Constants
// ---------------------------------------------------------------------------
const CATEGORY_TYPES: CategoryType[] = [
"income",
"bill",
"variable_expense",
"debt",
"saving",
"investment",
]
// ---------------------------------------------------------------------------
// Props
// ---------------------------------------------------------------------------
interface QuickAddPickerProps {
/** The id of the current month's budget to add the item to. */
budgetId: string
}
// ---------------------------------------------------------------------------
// QuickAddPicker
// ---------------------------------------------------------------------------
/**
* A Popover + Dialog component that lets users quickly add a one-off budget
* item from their saved quick-add library.
*
* Flow:
* 1. Click "Quick Add" button → Popover opens listing saved quick-add items.
* 2. Select an item → Popover closes, confirmation Dialog opens.
* 3. Choose a category and enter an amount → save adds a one_off budget item.
*/
export default function QuickAddPicker({ budgetId }: QuickAddPickerProps) {
const { t } = useTranslation()
const { items } = useQuickAdd()
const { categories } = useCategories()
const { createItem } = useBudgets()
// Popover open state
const [popoverOpen, setPopoverOpen] = useState(false)
// Dialog state
const [dialogOpen, setDialogOpen] = useState(false)
const [selectedItem, setSelectedItem] = useState<QuickAddItem | null>(null)
const [categoryId, setCategoryId] = useState("")
const [amount, setAmount] = useState("")
// ------------------------------------------------------------------
// Handlers
// ------------------------------------------------------------------
function handlePickItem(item: QuickAddItem) {
setSelectedItem(item)
setCategoryId("")
setAmount("")
setPopoverOpen(false)
setDialogOpen(true)
}
function handleDialogClose() {
setDialogOpen(false)
setSelectedItem(null)
setCategoryId("")
setAmount("")
}
async function handleSave() {
const parsed = parseFloat(amount)
if (!categoryId || isNaN(parsed) || parsed < 0) return
try {
await createItem.mutateAsync({
budgetId,
category_id: categoryId,
budgeted_amount: parsed,
actual_amount: parsed,
notes: selectedItem?.name ?? null,
})
handleDialogClose()
toast.success(selectedItem?.name ?? t("budgets.addItem"))
} catch {
toast.error(t("common.error"))
}
}
const canSave =
Boolean(categoryId) &&
Boolean(amount) &&
!isNaN(parseFloat(amount)) &&
parseFloat(amount) >= 0
// ------------------------------------------------------------------
// Render
// ------------------------------------------------------------------
return (
<>
{/* Trigger popover */}
<Popover open={popoverOpen} onOpenChange={setPopoverOpen}>
<PopoverTrigger asChild>
<Button variant="outline" size="sm">
<Zap className="mr-1.5 size-4" />
{t("nav.quickAdd")}
</Button>
</PopoverTrigger>
<PopoverContent align="end" className="w-56 p-1">
{items.length === 0 ? (
<p className="px-2 py-3 text-center text-sm text-muted-foreground">
{t("quickAdd.empty")}
</p>
) : (
<ul role="listbox" aria-label={t("nav.quickAdd")}>
{items.map((item) => (
<li key={item.id}>
<button
type="button"
role="option"
aria-selected={false}
className="flex w-full items-center gap-2 px-2 py-1.5 text-sm hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"
onClick={() => handlePickItem(item)}
>
{item.icon && (
<span className="shrink-0 text-base leading-none">
{item.icon}
</span>
)}
<span className="truncate">{item.name}</span>
</button>
</li>
))}
</ul>
)}
</PopoverContent>
</Popover>
{/* Confirmation / detail dialog */}
<Dialog open={dialogOpen} onOpenChange={(open) => !open && handleDialogClose()}>
<DialogContent>
<DialogHeader>
<DialogTitle>
{selectedItem?.icon && (
<span className="mr-2">{selectedItem.icon}</span>
)}
{selectedItem?.name ?? t("budgets.addItem")}
</DialogTitle>
</DialogHeader>
<div className="space-y-4">
{/* Category picker */}
<div className="space-y-2">
<Label>{t("quickAdd.pickCategory")}</Label>
<Select value={categoryId} onValueChange={setCategoryId}>
<SelectTrigger>
<SelectValue placeholder={t("quickAdd.pickCategory")} />
</SelectTrigger>
<SelectContent>
{CATEGORY_TYPES.map((type) => {
const filtered = categories.filter((c) => c.type === type)
if (filtered.length === 0) return null
return (
<SelectGroup key={type}>
<SelectLabel className="flex items-center gap-1.5">
<div
className="size-2"
style={{ backgroundColor: categoryColors[type] }}
/>
{t(`categories.types.${type}`)}
</SelectLabel>
{filtered.map((cat) => (
<SelectItem key={cat.id} value={cat.id}>
{cat.name}
</SelectItem>
))}
</SelectGroup>
)
})}
</SelectContent>
</Select>
</div>
{/* Amount */}
<div className="space-y-2">
<Label>{t("quickAdd.amount")}</Label>
<Input
type="number"
min="0"
step="0.01"
value={amount}
onChange={(e) => setAmount(e.target.value)}
placeholder="0.00"
autoFocus
/>
</div>
<div className="flex justify-end gap-2">
<Button
variant="outline"
onClick={handleDialogClose}
disabled={createItem.isPending}
>
{t("common.cancel")}
</Button>
<Button
onClick={() => void handleSave()}
disabled={!canSave || createItem.isPending}
>
{t("common.save")}
</Button>
</div>
</div>
</DialogContent>
</Dialog>
</>
)
}

View File

@@ -70,7 +70,7 @@ export function CategorySection({
<Collapsible open={open} onOpenChange={onOpenChange}>
<CollapsibleTrigger asChild>
<button
className="group flex w-full items-center gap-3 rounded-md border-l-4 bg-card px-4 py-3 text-left hover:bg-muted/40 transition-colors"
className="group flex w-full items-center gap-3 border-l-4 bg-card px-4 py-3 text-left hover:bg-muted/40 transition-colors"
style={{ borderLeftColor: categoryColors[type] }}
>
<ChevronRight

View File

@@ -17,22 +17,22 @@ function SkeletonStatCard() {
export function DashboardSkeleton() {
return (
<div className="flex flex-col gap-6">
<div className="flex flex-col gap-8">
{/* Summary cards skeleton */}
<div className="grid gap-4 sm:grid-cols-2 lg:grid-cols-3">
<div className="grid gap-6 sm:grid-cols-2 lg:grid-cols-3">
<SkeletonStatCard />
<SkeletonStatCard />
<SkeletonStatCard />
</div>
{/* 3-column chart area skeleton */}
<div className="grid gap-6 md:grid-cols-2 lg:grid-cols-3">
<div className="grid gap-8 md:grid-cols-2 lg:grid-cols-3">
<Card>
<CardHeader>
<Skeleton className="h-5 w-40" />
</CardHeader>
<CardContent>
<Skeleton className="h-[250px] w-full rounded-md" />
<Skeleton className="h-[250px] w-full" />
</CardContent>
</Card>
<Card>
@@ -40,7 +40,7 @@ export function DashboardSkeleton() {
<Skeleton className="h-5 w-40" />
</CardHeader>
<CardContent>
<Skeleton className="h-[250px] w-full rounded-md" />
<Skeleton className="h-[250px] w-full" />
</CardContent>
</Card>
<Card>
@@ -48,7 +48,7 @@ export function DashboardSkeleton() {
<Skeleton className="h-5 w-40" />
</CardHeader>
<CardContent>
<Skeleton className="h-[250px] w-full rounded-md" />
<Skeleton className="h-[250px] w-full" />
</CardContent>
</Card>
</div>
@@ -56,12 +56,12 @@ export function DashboardSkeleton() {
{/* Collapsible sections skeleton */}
<div className="space-y-3">
{[1, 2, 3].map((i) => (
<div key={i} className="flex items-center gap-3 rounded-md border-l-4 border-muted bg-card px-4 py-3">
<div key={i} className="flex items-center gap-3 border-l-4 border-muted bg-card px-4 py-3">
<Skeleton className="size-4" />
<Skeleton className="h-4 w-32" />
<div className="ml-auto flex items-center gap-2">
<Skeleton className="h-5 w-24 rounded-full" />
<Skeleton className="h-5 w-24 rounded-full" />
<Skeleton className="h-5 w-24" />
<Skeleton className="h-5 w-24" />
<Skeleton className="h-4 w-16" />
</div>
</div>

View File

@@ -9,7 +9,7 @@ export function ChartEmptyState({ message, className }: ChartEmptyStateProps) {
return (
<div
className={cn(
"flex min-h-[250px] w-full items-center justify-center rounded-lg border border-dashed border-muted-foreground/20 bg-muted/30",
"flex min-h-[250px] w-full items-center justify-center border border-dashed border-muted-foreground/20 bg-muted/30",
className
)}
>

View File

@@ -138,7 +138,7 @@ export function ExpenseDonutChart({
className="flex items-center gap-2 text-sm"
>
<span
className="inline-block size-3 shrink-0 rounded-full"
className="inline-block size-3 shrink-0"
style={{
backgroundColor: `var(--color-${entry.type}-fill)`,
}}

View File

@@ -54,9 +54,9 @@ export function IncomeBarChart({
<Bar
dataKey="budgeted"
fill="var(--color-budgeted)"
radius={[4, 4, 0, 0]}
radius={0}
/>
<Bar dataKey="actual" radius={[4, 4, 0, 0]}>
<Bar dataKey="actual" radius={0}>
{data.map((entry, index) => (
<Cell
key={index}

View File

@@ -64,9 +64,9 @@ export function SpendBarChart({
<Bar
dataKey="budgeted"
fill="var(--color-budgeted)"
radius={4}
radius={0}
/>
<Bar dataKey="actual" radius={4}>
<Bar dataKey="actual" radius={0}>
{data.map((entry, index) => (
<Cell
key={index}

View File

@@ -0,0 +1,31 @@
import { useTranslation } from "react-i18next"
interface AllocationBarProps {
remaining: number
currency: string
}
export function AllocationBar({ remaining, currency }: AllocationBarProps) {
const { t } = useTranslation()
const formatted = new Intl.NumberFormat(undefined, {
style: "currency",
currency,
minimumFractionDigits: 0,
maximumFractionDigits: 0,
}).format(remaining)
return (
<div className="sticky top-0 z-10 flex justify-between items-center py-3 px-4 bg-muted border-b border-border rounded-none">
<span className="text-sm font-semibold">{t("setup.step2.remaining")}</span>
<span
aria-live="polite"
className={`text-base font-semibold ${
remaining >= 0 ? "text-on-budget" : "text-destructive"
}`}
>
{formatted}
</span>
</div>
)
}

View File

@@ -0,0 +1,36 @@
import type { CategoryType } from "@/lib/types"
import { Separator } from "@/components/ui/separator"
interface CategoryGroupHeaderProps {
type: CategoryType
label: string
count: number
}
const colorVar = (type: CategoryType): string => {
const map: Record<CategoryType, string> = {
income: "var(--color-income)",
bill: "var(--color-bill)",
variable_expense: "var(--color-variable-expense)",
debt: "var(--color-debt)",
saving: "var(--color-saving)",
investment: "var(--color-investment)",
}
return map[type]
}
export function CategoryGroupHeader({ type, label, count }: CategoryGroupHeaderProps) {
return (
<div>
<div className="flex items-center gap-2 pt-4 pb-2">
<span
className="w-2.5 h-2.5 rounded-full"
style={{ backgroundColor: colorVar(type) }}
/>
<span className="text-sm font-semibold">{label}</span>
<span className="text-xs text-muted-foreground">({count} items)</span>
</div>
<Separator />
</div>
)
}

Some files were not shown because too many files have changed in this diff Show More