Scrum4Me/docs/plans
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
..
archive docs: AI-optimized docs restructure (Phases 1–8) (#61) 2026-05-03 03:21:59 +02:00
auto-pr-deploy-sync.md feat(T-572): map SKIPPED in lib/job-status + alle terminal-checks 2026-05-05 23:10:14 +02:00
docs-restructure-ai-lookup.md docs: AI-optimized docs restructure (Phases 1–8) (#61) 2026-05-03 03:21:59 +02:00
docs-restructure-pbi-spec.md Phase 1 — Junk cleanup + front-matter on every doc (#62) 2026-05-03 12:50:35 +02:00
job-model-selection.md feat(PBI-67): model + mode-selectie per ClaudeJob-kind (#169) 2026-05-08 11:20:10 +02:00
landing-local-first.md feat(landing): rewrite around local-first proposition + architecture diagram 2026-05-03 20:24:10 +02:00
landing-v3-idea-flow.md Landing v3: van idee tot pull request + 6 nieuwe screenshots (#127) 2026-05-06 09:05:22 +02:00
lees-de-readme-md-validated-book.md feat(PBI-74): Zustand product-workspace rearchitecture (Stories 1-8) (#180) 2026-05-10 02:25:19 +02:00
load-render-improvement-plan-2026-05-10.md Load/render workspace alignment (#182) 2026-05-10 07:34:58 +02:00
Local github setup.md docs: add plans and recommendations 2026-05-09 22:54:23 +02:00
M9-active-product-backlog.md docs: AI-optimized docs restructure (Phases 1–8) (#61) 2026-05-03 03:21:59 +02:00
M10-qr-pairing-login.md docs: AI-optimized docs restructure (Phases 1–8) (#61) 2026-05-03 03:21:59 +02:00
M11-claude-questions.md docs: AI-optimized docs restructure (Phases 1–8) (#61) 2026-05-03 03:21:59 +02:00
M12-ideas.md schema: add Idea + IdeaLog models, extend ClaudeJob/Question for ideas (M12 T-491) 2026-05-04 19:25:07 +02:00
PBI-11-mobile-shell.md docs(PBI-11): canoniek plan voor mobile-shell met drie architectuur-beslissingen 2026-05-04 09:40:03 +02:00
PBI-75-sprint-task-edit-store.md feat(PBI-75): sprint task-edit client-side via workspace-store (#183) 2026-05-10 08:21:42 +02:00
PBI-78-cost-analysis-widget.md feat(PBI-78): cost-analysis widget on insights page (#187) 2026-05-10 12:59:45 +02:00
queue-loop-extraction.md feat(PBI-4/ST-006): mirror job-config naar webapp + runbook-fix CLI-flags (#171) 2026-05-09 07:11:52 +02:00
sprint-pr-worktree-state-machines.md docs: archiveer sprint-pr-worktree state-machines advies (#140) 2026-05-07 13:32:30 +02:00
ST-1109-pbi-status.md docs: AI-optimized docs restructure (Phases 1–8) (#61) 2026-05-03 03:21:59 +02:00
ST-1110-demo-readonly.md docs: AI-optimized docs restructure (Phases 1–8) (#61) 2026-05-03 03:21:59 +02:00
ST-1111-claude-job-trigger.md docs: AI-optimized docs restructure (Phases 1–8) (#61) 2026-05-03 03:21:59 +02:00
ST-1114-copilot-reviews.md docs: AI-optimized docs restructure (Phases 1–8) (#61) 2026-05-03 03:21:59 +02:00
sync-model-prices.md feat(PBI-66): wekelijkse sync van model_prices via Anthropic /v1/models (#167) 2026-05-08 09:38:33 +02:00
tweede-claude-agent-planning.md docs: AI-optimized docs restructure (Phases 1–8) (#61) 2026-05-03 03:21:59 +02:00
user-settings-store.md feat(PBI-76): user-settings DB-store infrastructure (Phase 0) (#185) 2026-05-10 12:44:32 +02:00
v1-readiness.md docs: v1.0 smoke-test checklist + readiness-doc bijgewerkt 2026-05-04 14:18:25 +02:00
zustand-store-rearchitecture.md docs: add plans and recommendations 2026-05-09 22:54:23 +02:00
zustand-workspace-store-implementation.md feat(PBI-74): sprint-workspace-store (Story 9) (#181) 2026-05-10 06:53:04 +02:00