Commit c429337
committed
feat(usage-analytics): add profile hero with stats and token heat map
Add UsageProfileHero component above existing Usage page contents for
personal context only. Includes:
- ProfileHeader: centered circular avatar with initials, display name,
and "Personal usage" handle
- UsageProfileStats: 4-KPI grid showing lifetime tokens, peak tokens,
current streak, and longest streak
- TokenActivityHeatmap: GitHub-style daily grid with 30d/90d/1y range
toggle, intensity-based tile coloring, and tooltips on all days
Adds getProfile tRPC procedure querying MICRODOLLAR_USAGE_DAILY for
lifetime totals (SUM/MAX) and last 365 days of daily activity. Streaks
are computed client-side from daily activity with GitHub-style semantics
(current streak = consecutive active days ending today).1 parent 703f847 commit c429337
5 files changed
Lines changed: 636 additions & 0 deletions
File tree
- apps/web/src
- components/usage-analytics
- routers
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| 42 | + | |
41 | 43 | | |
42 | 44 | | |
43 | 45 | | |
| |||
274 | 276 | | |
275 | 277 | | |
276 | 278 | | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
277 | 286 | | |
278 | 287 | | |
279 | 288 | | |
| |||
536 | 545 | | |
537 | 546 | | |
538 | 547 | | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
539 | 555 | | |
540 | 556 | | |
541 | 557 | | |
| |||
0 commit comments