Skip to content

feat(code): unify dashboard usage chart with agent chart - #2252

Merged
steebchen merged 1 commit into
mainfrom
feat/devpass-stacked-model-chart
May 11, 2026
Merged

steebchen merged 1 commit into
mainfrom
feat/devpass-stacked-model-chart

Conversation

@smakosh

@smakosh smakosh commented May 11, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Replace the bespoke "Daily spend" bar chart on the DevPass dashboard with the same AgentModelUsageChart used on each coding agent card.
  • The chart receives all known coding-agent sources, so it renders the total stacked-by-model usage across agents instead of per-agent.
  • The cycle metric cards (Spend / Requests / Tokens / Peak day) and usage bar are untouched.

Test plan

  • Open /dashboard with an active DevPlan — the previous "Daily spend" card is replaced by a "Model Usage Overview" card.
  • Time-range toggles (1h, 4h, 1d, 7d, 30d) update the chart.
  • Metric dropdown (Cost / Requests / Tokens) switches the Y-axis correctly.
  • Per-agent charts on the coding agent cards below still work (verifies the renamed ALL_CODING_AGENT_SOURCES export is wired up).
  • Empty-state copy renders when there is no recent activity in the selected range.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Dashboard Changes
    • Removed the Daily spend chart visualization from the Usage Overview dashboard to streamline the interface
    • Added a new Agent Model Usage Chart providing detailed insights into coding agent usage, performance patterns, and model allocation

Review Change Stack

Replace the bespoke "Daily spend" bar chart on the DevPass dashboard
with the same AgentModelUsageChart used on each coding agent card,
passing all known agent sources so it shows total (stacked) usage
across agents instead of per-agent.

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

coderabbitai Bot commented May 11, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: d4a6c37b-b203-4275-9a52-287356229706

📥 Commits

Reviewing files that changed from the base of the PR and between 1729a8a and 652df7f.

📒 Files selected for processing (2)
  • apps/code/src/app/dashboard/components/CodingAgents.tsx
  • apps/code/src/app/dashboard/components/UsageOverview.tsx

Walkthrough

The PR refactors the dashboard's metrics display by extracting agent sources into a reusable exported constant and replacing the daily spend chart visualization. CodingAgents.tsx now exports ALL_CODING_AGENT_SOURCES and updates the logs query to use it. UsageOverview.tsx removes Recharts dependencies, simplifies data fetching, and replaces the daily cost chart with an agent model usage chart.

Changes

Dashboard Chart Refactoring

Layer / File(s) Summary
Export agent sources constant
apps/code/src/app/dashboard/components/CodingAgents.tsx
Exports ALL_CODING_AGENT_SOURCES derived from AGENTS sources for reuse by other components.
Update logs query with exported constant
apps/code/src/app/dashboard/components/CodingAgents.tsx
Updates the /logs query source parameter to use the newly exported ALL_CODING_AGENT_SOURCES instead of the file-local constant.
Refactor imports and data fetch
apps/code/src/app/dashboard/components/UsageOverview.tsx
Removes Recharts and chart UI imports, adds AgentModelUsageChart and ALL_CODING_AGENT_SOURCES imports, and simplifies api.useQuery destructuring by removing isLoading.
Replace daily spend chart
apps/code/src/app/dashboard/components/UsageOverview.tsx
Removes DailySpendChart implementation and chart configuration block, and adds a stacked AgentModelUsageChart rendering with ALL_CODING_AGENT_SOURCES in the metrics area.

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat(code): unify dashboard usage chart with agent chart' accurately describes the main change: replacing the Daily spend chart with AgentModelUsageChart to unify the usage visualization.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/devpass-stacked-model-chart

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@smakosh smakosh self-assigned this May 11, 2026
@steebchen
steebchen added this pull request to the merge queue May 11, 2026
Merged via the queue into main with commit ac96adc May 11, 2026
12 checks passed
@steebchen
steebchen deleted the feat/devpass-stacked-model-chart branch May 11, 2026 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants