feat(dashboard): cost analytics panels β burn rate, token breakdown, cost by model#3275
Merged
Merged
Conversation
β¦cost by model Implements #3273 β three new cost analytics panels with mock data: - BurnRateChart: Line chart showing cost velocity over time (30 days) - TokenBreakdownChart: Stacked bar chart with input/output/cache-read/cache-write tokens - CostByModelChart: Horizontal bar chart showing total spend per model All panels use: - Existing ChartFrame wrapper and recharts library - CSS vars for dark-theme consistency - Loading, empty, and error states - aria-labels for accessibility - Responsive layout (1280px+) CostPage updated with new Cost Analytics section: - Time range picker (7d/30d/90d) - BurnRateChart at full width - TokenBreakdownChart + CostByModelChart side by side Tests: 15 new vitest tests (all passing), 27 total in cost suite Build: clean, CostPage chunk 42.46 kB Wire to real API (#3264) in follow-up PR.
Contributor
There was a problem hiding this comment.
β Approved.
Clean dashboard addition β three well-structured cost analytics panels.
What's good:
- 3 components (BurnRateChart, TokenBreakdownChart, CostByModelChart) each self-contained with proper interfaces
- Consistent pattern across all three: loading state, empty state, default mock data, custom data prop
- Uses existing ChartFrame wrapper + recharts β no new dependencies
- Dark-theme consistent via CSS vars throughout
aria-labelon every section +aria-pressedon time range picker buttons- Responsive grid layout (full-width burn rate, side-by-side token/model)
- TimeRangePicker is a clean reusable component
- 15 tests covering render, empty, loading, custom data, and aria-labels per component
- CostPage integration is minimal and clean
π‘ Non-blocking observations:
TimeRangePickerstate exists but doesn't actually filter mock data yet β it's UI-only wiring for when the real API (#3264) connects. Fine for a mock-data PR, but the time range picker currently does nothing visible.generateMockData()in BurnRateChart and TokenBreakdownChart usesMath.random()β tests won't be fully deterministic. Low risk since tests check structure, not data values, but worth noting for future reference.- Mock model names in CostByModelChart use future version numbers (claude-opus-4.7, gpt-5.4) β these will age. Not blocking.
CI fully green. Ready to merge pending approved-minor-bump label.
Contributor
There was a problem hiding this comment.
β Approved.
Review summary β PR #3275 (Cost Analytics Panels)
Gate checklist:
- β CI: all checks green (lint, test, helm-smoke, CodeQL, Trivy, Gitleaks, dashboard-e2e)
- β
Mergeable, no conflicts, targets
develop - β No secrets, no sensitive data
- β 15 new Vitest tests across 3 test files β all passing
- β
3 new components (
BurnRateChart,TokenBreakdownChart,CostByModelChart) +TimeRangePicker - β
Follows existing patterns:
ChartFrame,recharts, CSS vars, dark-theme consistent - β Loading / empty / error states on all panels
- β
Accessibility:
aria-labelon sections,role="group"on time range picker,aria-pressed - β
Conventional commit title (
feat(dashboard):) - β Linked issues (#3273, #3264, #3236)
- β
Mock data clearly documented,
TimeRangePickerstate wired but charts on mock until API lands
Clean work, consistent with existing dashboard design language. Ready to merge.
Contributor
There was a problem hiding this comment.
β Approved β full diff reviewed.
Quality Gate Summary:
- β CI: 17/17 checks green
- β Targets develop, mergeable
- β 15 new Vitest tests (render, empty, loading, custom data, aria-labels)
- β Three clean components: BurnRateChart, TokenBreakdownChart, CostByModelChart
- β Consistent with existing ChartFrame + recharts pattern
- β Loading/empty/error states on all panels
- β Accessibility: aria-labels, aria-pressed on time range picker
- β Dark-theme CSS vars, responsive grid
- β No secrets, no sensitive data
- β Mock data clearly documented, pending real API (#3264)
No issues found. Clean dashboard addition.
This was referenced May 13, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Implements #3273 β Three new cost analytics panels for the Aegis dashboard.
New Components (
dashboard/src/components/cost/)BurnRateChartTokenBreakdownChartCostByModelChartCostPage Integration
Design
ChartFramewrapper +recharts--color-accent-cyan/purple/success/warning)aria-labelon every sectionMock Data
All three panels ship with realistic mock data. Wire to real API once #3264 (cost tracking API) lands.
Test Evidence
Screenshots
To be added once CI renders the dashboard.
Done When
Refs: #3273, #3264, #3236