Skip to content

[claude-code] Add ClaudeCodeUsageDashboard component #763

Description

@edelauna

Parent issue

#756

Depends on

#757 #760 #762

Context

Surfaces subscription tier and rate limit utilization in the settings panel. The Agent SDK SDKResultSuccess includes subscription_type and rate_limits — the extension host caches this after each completed request and serves it via a message to the webview. Mirrors OpenAICodexRateLimitDashboard.

Files

  • packages/types/src/providers/claude-code-rate-limits.ts (new)
  • webview-ui/src/components/settings/providers/ClaudeCodeUsageDashboard.tsx (new)
  • Extension host: cache SDKResultSuccess rate limit fields, handle requestClaudeCodeRateLimits message
  • webview-ui/src/components/settings/providers/__tests__/ClaudeCodeUsageDashboard.spec.tsx (new)

Work

  • ClaudeCodeRateLimitInfo type: { subscriptionType: string | null, rateLimitsAvailable: boolean, rateLimits: { ... } | null, fetchedAt: number }
  • Dashboard component:
    • Hidden when not connected
    • Shows subscription tier label (Pro / Max / Team / Enterprise)
    • Shows rate limit progress bars when rateLimitsAvailable is true, using the UsageProgressBar pattern from OpenAICodexRateLimitDashboard
    • Shows "Rate limit info unavailable" when rateLimitsAvailable is false (API key or Bedrock sessions)
  • Extension host caches last SDKResultSuccess.rate_limits and responds to requestClaudeCodeRateLimits

Tests

  • Hidden when isConnected is false
  • Renders subscription type label for each tier (pro / max / team / enterprise / null)
  • Renders progress bars when rate limits are available
  • Renders graceful fallback when rateLimits is null
  • Extension host responds to requestClaudeCodeRateLimits with cached data

Acceptance criteria

  • Dashboard reflects real SDKResultSuccess data after a completed request
  • All subscription tier labels are i18n-keyed
  • All tests pass

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions