This commit is contained in:
Roberto Musso
2026-02-25 07:31:50 +01:00
parent 5445bb0eec
commit 50b7fa784c
8 changed files with 335 additions and 86 deletions

View File

@@ -562,3 +562,30 @@
- TaskItem type in TaskRow.tsx is manually defined (not auto-inferred from tRPC) — must be updated when adding columns to the tasks select
- The ai.chat mutation can be instantiated multiple times for independent suggest flows (suggestCheckpoints vs suggestTasks)
---
## 2026-02-25 - US-025
- Implemented Home dashboard with AI daily brief and suggestion chips
- AIChatPanel enhanced to serve as both home page (initial greeting/brief/chips state) and curtain chat
- Added `userName` setting to electron-store (defaults to 'there'), with `getUserName`/`setUserName` tRPC procedures
- Added `tasks.dueToday` query returning tasks with dueDate on or before end of today (status != done)
- AppShell hides content panel on home route, revealing AIChatPanel directly
- Home initial state: greeting "✦ Hello, {name}" (30px, -1px tracking) + Badge (variant=secondary) with due task count
- Daily brief auto-fires via ai.chat on mount, streams into a Card below greeting
- Chat input: white bg, border #d4d4d4, shadow-lg, min-height 109px, send button with foreground/background colors
- 4 suggestion chips (ListTodo, TrendingUp, AlertCircle, Lightbulb) below chat input, populate input on click
- On first user message: greeting + chips disappear, brief card persists, chat messages flow below
- Responsive: flex-wrap on chips for narrow screens, max-w-3xl container
- Files changed:
- src/main/store.ts (added userName field)
- src/main/router/index.ts (getUserName, setUserName, dueToday)
- src/renderer/components/ai/AIChatPanel.tsx (main change — home mode with greeting, brief, chips)
- src/renderer/components/layout/AppShell.tsx (hide content panel on home, pass isHomePage prop)
- src/renderer/routes/index.tsx (simplified to null component)
- prd.json (passes: true)
- **Learnings for future iterations:**
- AIChatPanel is the single source of truth for all AI chat UIs — home page is just a different initial state, not a separate component
- The curtain is disabled on home (`currentPath !== '/'`), so AppShell conditionally hides the motion.div content panel to reveal AIChatPanel
- Stream interleaving prevention: disable chat input while dailyBrief is loading (both use the same `ai:stream` IPC channel)
- `hasFiredBrief` ref prevents double-fire in React strict mode for the auto-fire daily brief effect
- electron-store settings don't need schema migrations — just add to the AppSettings interface with a default
---