Added a clean, minimal insights card that displays above the chat messages. Shows intelligent alerts about pending tasks, upcoming events, active projects, and ideas.
- Position: Above chat messages (below header, above suggested queries)
- Styling:
- Dark background:
rgba(24,24,27,0.8)(zinc-900) - Border:
1px solid rgba(39,39,42,0.8) - Border radius:
6px - Padding:
10px 12px - Font: JetBrains Mono
- Text size:
text-xs(8px) for label,text-sm(11px) for insights - Text color:
#a1a1aa(zinc-400)
- Dark background:
ACTIVE INSIGHTS
π You have 3 pending tasks. Start by focusing on the most important one.
β° Alert: "Meeting" in 30 minutes.
π 2 active projects in progress.
π‘ 2 ideas waiting to be converted into tasks.
- Added
insightsstate:const [insights, setInsights] = useState<string[]>([]) - Added
useEffectto fetch insights on mount - Fetches from
/api/aiwith message:GET_INSIGHTS - Displays insights card conditionally (
{insights.length > 0 && ...})
- Added special handler for
message === 'GET_INSIGHTS' - Fetches tasks, events, projects, ideas from Supabase
- Calls
generateInsights()function with aggregated data - Returns JSON:
{ insights: string[] }
The generateInsights() function generates 4 types of insights:
-
Pending Tasks: Counts incomplete tasks (
done === false)- Output:
π You have X pending task(s). Start by focusing on the most important one.
- Output:
-
Upcoming Events: Finds events within 1 hour window
- Output:
β° Alert: "Event Title" in X minute(s).
- Output:
-
Active Projects: Filters projects with
status === 'active'- Output:
π X active project(s) in progress.
- Output:
-
Ideas: Counts all ideas awaiting conversion
- Output:
π‘ X idea(s) waiting to be converted into tasks.
- Output:
The insights card automatically appears when there are insights to display. No manual refresh needed - it loads on page mount and can be updated by calling the insights endpoint again.
- Matches NOVA interface aesthetic (dark, minimal, monospace)
- Uses
nova-monoclass for JetBrains Mono font - Uses
nova-msg-inclass for fade-in animation - Follows existing color palette (zinc-900, zinc-500, zinc-400)
- Refresh insights on interval (e.g., every 5 minutes)
- Click insights to navigate to relevant sections
- Animated updates when insights change
- Dismissible insights with "X" button