Skip to content

feat(ui): Model Usage pilot on the shared design system (U5 B2)#443

Merged
OBenner merged 1 commit into
developfrom
claude/ui-b2-model-usage
Jul 24, 2026
Merged

feat(ui): Model Usage pilot on the shared design system (U5 B2)#443
OBenner merged 1 commit into
developfrom
claude/ui-b2-model-usage

Conversation

@OBenner

@OBenner OBenner commented Jul 24, 2026

Copy link
Copy Markdown
Owner

Summary

Fifth and final B2 slice — closes the "Analytics & usage" batch. Reuses the generic AnalyticsDashboard with no new libs/ui component, and exercises all four of its slots (KPIs / charts / barLists / sections) at once.

Electron

  • Pure model-usage-ui mappers: shortModelName (strips provider prefix + date suffix so bars read as short model names); buildModelKpis / buildModelCharts / buildModelBarLists / buildModelSections from ModelUsageSummary + ModelUsageTrendPoint, reusing analytics-ui's formatCount/formatCost/shortDate/sampleLabels. 8 tests.
  • ModelUsagePilotView over getModelUsageSummary + getModelUsageTrends, mounted as "Model Usage (new UI)" beside the legacy P5 dashboard (export flow stays there).

i18n

  • model-usage:modelUsagePilot.* (en+fr), navigation:items.modelUsageNext; adds the Cpu nav icon.

What it renders

  • KPIs (with trend sparklines): AI calls, tokens, total cost, distinct models.
  • Trend charts: tokens over time, cost over time.
  • BarList: "tokens by model" ranked by usage.
  • Rail card: input/output token split + provider count.

Verification

B2 done

All four B2 screens (Analytics, Productivity, Merge Analytics, Model Usage) now pilot on the shared design system, built on two new primitives (chart set + BarList) and one generic AnalyticsDashboard. That's 10 of 24 sidebar views migrated.

Next

B3 "Extension & infra" (Agent Tools, Plugins, Scheduler, Webhooks, Feedback) — pending your call on whether B5 GitLab is in scope.

🤖 Generated with Claude Code

Fifth and final B2 slice — closes the batch. Reuses the generic
AnalyticsDashboard (KPIs + trend charts + BarList + rail) with no new
libs/ui component:

- Electron: pure model-usage-ui mappers (shortModelName strips the
  provider prefix + date suffix; buildModelKpis/Charts/BarLists/Sections
  from ModelUsageSummary + ModelUsageTrendPoint, reusing analytics-ui's
  formatCount/formatCost/shortDate/sampleLabels; 8 tests) +
  ModelUsagePilotView over getModelUsageSummary + getModelUsageTrends.
  Mounted as "Model Usage (new UI)".
- i18n: model-usage:modelUsagePilot.* keys (en+fr),
  navigation.modelUsageNext; also imports the Cpu icon for the nav item.

The dashboard shows token/cost trend charts + AI-call/token/cost/model
KPIs with sparklines, a "tokens by model" BarList ranked by usage, and
an input/output token-split + provider-count rail card. This exercises
all four AnalyticsDashboard slots (kpis/charts/barLists/sections) at
once, confirming the generic screen serves every B2 view.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@cursor

cursor Bot commented Jul 24, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@OBenner, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 32 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: d2d54f71-dbcd-497e-bc26-461e9ab13580

📥 Commits

Reviewing files that changed from the base of the PR and between 1e7c8a7 and 3da9d94.

📒 Files selected for processing (9)
  • apps/frontend/src/renderer/App.tsx
  • apps/frontend/src/renderer/__tests__/model-usage-ui.test.ts
  • apps/frontend/src/renderer/components/ModelUsagePilotView.tsx
  • apps/frontend/src/renderer/components/Sidebar.tsx
  • apps/frontend/src/renderer/lib/model-usage-ui.ts
  • apps/frontend/src/shared/i18n/locales/en/model-usage.json
  • apps/frontend/src/shared/i18n/locales/en/navigation.json
  • apps/frontend/src/shared/i18n/locales/fr/model-usage.json
  • apps/frontend/src/shared/i18n/locales/fr/navigation.json
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/ui-b2-model-usage

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.

@OBenner
OBenner merged commit 6eda5e7 into develop Jul 24, 2026
19 checks passed
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
8.5% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant