Skip to content

feat(dashboard): cost analytics panels β€” burn rate, token breakdown, cost by model#3275

Merged
aegis-gh-agent[bot] merged 4 commits into
developfrom
feat/dashboard-cost-analytics
May 13, 2026
Merged

feat(dashboard): cost analytics panels β€” burn rate, token breakdown, cost by model#3275
aegis-gh-agent[bot] merged 4 commits into
developfrom
feat/dashboard-cost-analytics

Conversation

@OneStepAt4time

Copy link
Copy Markdown
Owner

What

Implements #3273 β€” Three new cost analytics panels for the Aegis dashboard.

New Components (dashboard/src/components/cost/)

Component Type Description
BurnRateChart Line chart Cost velocity over time (30 days default)
TokenBreakdownChart Stacked bar Input/output/cache-read/cache-write tokens per day
CostByModelChart Horizontal bar Total spend grouped by model

CostPage Integration

  • New Cost Analytics section between Daily Spend and Model Breakdown
  • Time range picker (7d / 30d / 90d) β€” inline button group
  • Burn rate at full width, token + model charts side by side

Design

  • Uses existing ChartFrame wrapper + recharts
  • Dark-theme consistent (CSS vars, --color-accent-cyan/purple/success/warning)
  • Loading / empty / error states on all panels
  • aria-label on every section
  • Responsive (1280px+)

Mock Data

All three panels ship with realistic mock data. Wire to real API once #3264 (cost tracking API) lands.

Test Evidence

  • 15 new Vitest tests (render, empty state, loading, custom data, aria-labels)
  • 27 total cost suite tests β€” all passing
  • Build: clean, CostPage chunk 42.46 kB
  • tsc --noEmit: zero new errors

Screenshots

To be added once CI renders the dashboard.

Done When

  • 3 panels render with mock data
  • Responsive layout (1280px+)
  • Accessible (aria labels, keyboard nav)
  • Matches existing dashboard design language
  • Loading/error/empty states handled
  • Tests pass

Refs: #3273, #3264, #3236

…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.

@aegis-gh-agent aegis-gh-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

βœ… 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-label on every section + aria-pressed on 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:

  1. TimeRangePicker state 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.
  2. generateMockData() in BurnRateChart and TokenBreakdownChart uses Math.random() β€” tests won't be fully deterministic. Low risk since tests check structure, not data values, but worth noting for future reference.
  3. 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.

@aegis-gh-agent aegis-gh-agent Bot added the approved-minor-bump Approves a minor version bump for release-please label May 13, 2026

@aegis-gh-agent aegis-gh-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

βœ… 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-label on sections, role="group" on time range picker, aria-pressed
  • βœ… Conventional commit title (feat(dashboard):)
  • βœ… Linked issues (#3273, #3264, #3236)
  • βœ… Mock data clearly documented, TimeRangePicker state wired but charts on mock until API lands

Clean work, consistent with existing dashboard design language. Ready to merge.

@aegis-gh-agent aegis-gh-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

βœ… 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved-minor-bump Approves a minor version bump for release-please

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant