feat: add root TUI app model with 10-tab dashboard and async data loading
Add the core App Bubble Tea model that orchestrates the entire TUI dashboard. The model manages: - 10 navigable tabs: Dashboard, Costs, Sessions, Models, Projects, Trends, Efficiency, Activity, Budget, and Settings. Each tab is accessible via single-key shortcuts (d/c/s/m/p/t/e/a/b/x) or left/right arrows for sequential navigation. - Async data pipeline: launches the JSONL loader in a goroutine and receives progress updates via a channel subscription, displaying an animated loading screen with a spinner and file count. Data loads once on startup and recomputes aggregates when filters change. - Filter state: supports configurable time range (7/30/90 days), project filter, and model filter. Changing any filter triggers recomputation of all derived stats (summary, daily, model, project breakdowns) including a comparison period for delta calculations. - First-run detection: if no config file exists when data finishes loading, automatically enters the setup wizard flow before showing the dashboard. - Tab-specific rendering: Dashboard shows metric cards with period- over-period deltas, daily token/cost bar charts, model pie-style breakdown, and top projects. Costs shows a per-model cost table. Trends renders daily tokens, cost, and session bar charts. Efficiency shows cache hit rate and savings metrics. Activity renders an hourly heatmap. Budget tracks spend against plan limits with a burn-rate projection chart. - Help overlay: toggleable help panel listing all keyboard shortcuts, rendered as a centered overlay above the active tab content.
This commit is contained in:
1157
internal/tui/app.go
Normal file
1157
internal/tui/app.go
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user