Add Insights Dashboard with usage analytics

New sidebar section showing rich analytics from the sessions database:
- Overview grid: sessions, messages, tokens (input/output/cache), active
  time, avg session duration, avg messages per session
- Model breakdown: sessions and total tokens per model
- Platform breakdown: CLI vs Telegram etc with session/message counts
- Top tools bar chart: ranked by call count with percentages
- Activity patterns: day-of-week bars and hourly heatmap
- Notable sessions: longest, most messages, most tokens, most tool calls
  with clickable links to open in Sessions browser
- Time period selector: 7/30/90 days or all time

Also adds ROADMAP.md documenting the full feature expansion plan.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Alan Wizemann
2026-03-31 10:45:35 -04:00
parent 2a14e28589
commit f3cb1eb86b
7 changed files with 720 additions and 1 deletions
@@ -2,6 +2,7 @@ import Foundation
enum SidebarSection: String, CaseIterable, Identifiable {
case dashboard = "Dashboard"
case insights = "Insights"
case sessions = "Sessions"
case activity = "Activity"
case chat = "Chat"
@@ -16,6 +17,7 @@ enum SidebarSection: String, CaseIterable, Identifiable {
var icon: String {
switch self {
case .dashboard: return "gauge.with.dots.needle.33percent"
case .insights: return "chart.bar"
case .sessions: return "bubble.left.and.bubble.right"
case .activity: return "bolt.horizontal"
case .chat: return "text.bubble"