Scrum4Me/app
Janpeter Visser a1e6ec35e5
feat(PBI-78): cost-analysis widget on insights page (#187)
* feat(PBI-78): cost-analysis data layer (T-902)

- New lib/insights/cost-analysis.ts with 5 query functions:
  getCostKpi, getCostByDay, getCostByModel, getCostByKind, getCacheEfficiency
- Period type: 7d | 30d | 90d | mtd
- Cost formula reused from token-stats.ts (input + output + cache + thinking)
- Cache savings: cache_read_tokens × (input_price - cache_read_price) / 1M
- Plan: docs/plans/PBI-78-cost-analysis-widget.md

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(PBI-78): cost-analysis UI component (T-903)

- New app/(app)/insights/components/cost-analysis.tsx
- Period selector (7d/30d/90d/MTD) via URL ?period= with useTransition + router.replace
- KPI strip: total cost, avg per day, cache savings, top model
- 2x2 chart grid: daily cost (BarChart), per-model + per-kind (vertical BarCharts), cache efficiency (PieChart)
- Empty state for kpi.jobCount === 0
- Uses MD3 tokens (var(--chart-N), var(--status-done))

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* feat(PBI-78): wire CostAnalysisCard onto insights page (T-904)

- Parse ?period= from searchParams (default 30d, validates against 7d/30d/90d/mtd)
- Parallel-fetch 5 cost queries via Promise.all alongside existing widgets
- New "Cost analyse" section between Sprint Health and Plan-quality
- Existing TokenUsageCard ("Token gebruik" section) stays as sprint detail

verify (lint+typecheck+test) and build pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-10 12:59:45 +02:00
..
(app) feat(PBI-78): cost-analysis widget on insights page (#187) 2026-05-10 12:59:45 +02:00
(auth) feat(ST-l9kkxh2m): /reset-password pagina + resetPasswordAction + hashPassword 2026-05-05 14:30:59 +02:00
(mobile) Load/render workspace alignment (#182) 2026-05-10 07:34:58 +02:00
_components/tasks refactor(PBI-77): standaardiseer loading-skeletons rond shadcn Skeleton (#186) 2026-05-10 12:59:08 +02:00
api feat(PBI-76): user-settings DB-store infrastructure (Phase 0) (#185) 2026-05-10 12:44:32 +02:00
debug-env fix(privacy): NODE_ENV-guard 4 debug-routes (before-launch privacy review) 2026-05-04 14:16:49 +02:00
debug-realtime fix(privacy): NODE_ENV-guard 4 debug-routes (before-launch privacy review) 2026-05-04 14:16:49 +02:00
styles PBI-46: Sprint-niveau jobflow met cascade-FAIL (F1/F2/F4 Scrum4Me) (#136) 2026-05-06 16:43:57 +02:00
apple-icon.png chore: documentatie naar docs/, iconen bijgewerkt, theme.css verplaatst 2026-04-24 22:51:42 +02:00
favicon.ico chore: documentatie naar docs/, iconen bijgewerkt, theme.css verplaatst 2026-04-24 22:51:42 +02:00
globals.css Sprint: Verbeteren debug mode (#179) 2026-05-09 22:46:29 +02:00
icon.png chore: documentatie naar docs/, iconen bijgewerkt, theme.css verplaatst 2026-04-24 22:51:42 +02:00
layout.tsx Sprint: pbi-55 (#156) 2026-05-07 21:46:01 +02:00
page.tsx ST-1241: Verwijder frontend todo-UI (page, component, navbar en marketing page) (#133) 2026-05-06 12:24:00 +02:00