Commit Graph

20 Commits

Author SHA1 Message Date
e3ac732b1b Add pointer cursor to Generate insights button
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 22:17:35 -04:00
2dae000342 Fix hydration mismatch from theme blocking script
The inline script adds the 'dark' class to <html> before React hydrates,
causing a server/client className mismatch. suppressHydrationWarning on
<html> is the standard Next.js fix for this pattern.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 22:15:34 -04:00
48b481999d Fix AI insight prompt passing raw cents instead of dollar amounts
recentExpenses and chart were JSON-stringified with raw amountCents/
expensesCents/paychecksCents values, causing the model to read e.g.
10000 as $10,000 instead of $100. Both arrays are now mapped through
centsToDisplay() before inclusion in the prompt, matching the pattern
already used for totals and category breakdown.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 22:11:45 -04:00
012385e9e1 Add dark mode with theme toggle and OpenSpec change
- Add @custom-variant dark in globals.css for class-based dark mode
- Add ThemeToggle component with localStorage persistence and system preference fallback
- Inject blocking inline script in layout to prevent flash on load
- Apply dark: variants across all components (layout, site-nav, home-dashboard, expense-workspace, paycheck-workspace, recurring-expense-manager) and page headers
- Create openspec/changes/theming-dark-mode with proposal, design, and tasks artifacts

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 22:04:20 -04:00
5f2111ea66 Add recurring expenses with active nav tab highlighting
- Add RecurringExpense model to Prisma schema with migration
- Add lib/recurring-expenses.ts: CRUD + virtual projection per month
- Add /recurring-expenses API routes (GET, POST, PATCH, DELETE)
- Merge projected recurring expenses into dashboard totals and expense list
- Add RecurringExpenseManager component to /add-expense page
- Show amber "Recurring" badge on projected items; hide edit/delete for them
- Highlight active nav tab using usePathname() with hover state
- Fix Turbopack/Prisma stub issue by adding serverExternalPackages to next.config.ts
- Clear stale Turbopack stub in Dockerfile before each build

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 21:08:38 -04:00
3e6231b654 Teach local AI from user category corrections
- Add MerchantCorrection model: upsert by merchantName, Category enum
- Check corrections DB first in suggestCategoryForMerchant (source: "learned",
  no confirmation required); falls through to rules then Ollama if no match
- Inject recent corrections as few-shot examples in the Ollama prompt so the
  model improves even for merchants not yet explicitly corrected
- Add POST /categories/correct route to persist corrections
- Detect category override on form save (suggestedCategory !== chosen category)
  and silently fire a correction — no extra UX required
- Fix test isolation: beforeEach re-applies vi.fn() defaults after restoreAllMocks

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 17:28:26 -04:00
1015e24e69 Add dashboard error handling, seed data, and Docker host Ollama wiring
- Wrap getDashboardSnapshot in try/catch; return JSON 500 instead of crashing
- Add prisma/seed.ts with realistic Feb + Mar 2026 data: biweekly $2,850 pay
  schedule, $2,430 rent, expenses across all 8 categories
- Update Dockerfile and backup route for host Ollama runtime

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 17:20:38 -04:00
83d6891023 Add biweekly pay schedule with projected paychecks and dashboard integration
- Add PaySchedule model (anchorDate + amountCents + active flag)
- Add /pay-schedule API route (GET, POST, DELETE)
- Project biweekly pay dates from anchor; deduplicate against manual paychecks
- Merge projected paychecks into dashboard totals and daily chart
- Fix DST day-shift bug in getProjectedPayDates by using Date.UTC throughout
- Rewrite paycheck workspace: schedule panel at top, manual entry below,
  projected dates with "Mark received" buttons, confirmed badges
- Pass paySchedule context to Ollama insight prompt

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 17:20:32 -04:00
e8c23405e7 Add expense editing with inline form and PATCH API route
- Add updateExpense() to lib/expenses.ts
- Add PATCH /expenses/:id route with validation and P2025 not-found handling
- Edit button on each expense card pre-fills form; cancel restores add mode
- Submit dynamically PATCHes or POSTs depending on edit state

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 17:20:13 -04:00
27bb8df513 Improve monthly insights: structured prompt, bullet recommendations, visual cards
- Strengthen prompt with required observations (savings rate, spend-to-income,
  top category, anomaly), dollar-formatted amounts, and pay schedule context
- Preserve recommendation array structure; store as JSON array string in DB
- Render recommendations as numbered cards with icons in home dashboard
- Add spend-vs-income progress bar and category flow mini bar chart
- Fix test assertions for new JSON array recommendation format

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 17:20:03 -04:00
5a6d03f5c8 Use host Ollama for Docker app runtime 2026-03-23 14:34:07 -04:00
28c5ad959f Add Ollama setup helpers and database backup 2026-03-23 14:27:53 -04:00
3bc8550f12 Add Ollama status checks and Docker deployment 2026-03-23 14:21:37 -04:00
a745c0ca1e Add offline monthly insights with Ollama 2026-03-23 14:12:35 -04:00
696d393fca Add offline merchant category suggestions 2026-03-23 13:28:00 -04:00
12c72ddcad Add monthly dashboard summaries for v1 2026-03-23 12:53:09 -04:00
f2854095f1 Add paycheck tracking workflow for v1 2026-03-23 12:45:24 -04:00
dec639ec16 Fix local database ignore rules 2026-03-23 12:37:05 -04:00
905af75cd8 Implement expense tracking foundation for v1 2026-03-23 12:32:36 -04:00
5d7e25c015 Define OpenSpec change for monthly expense tracker v1 2026-03-23 12:10:18 -04:00