Skip to content

feat(ui): add Usage tab to Billing page - #81

Merged
man4ish merged 1 commit into
mainfrom
feat/billing-usage-tab
Sep 4, 2026
Merged

feat(ui): add Usage tab to Billing page#81
man4ish merged 1 commit into
mainfrom
feat/billing-usage-tab

Conversation

@man4ish

@man4ish man4ish commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds a "Usage" tab alongside the existing Billing summary, surfacing raw operational usage and cost data using billing-service's already-deployed endpoints (no backend changes needed):

  • /usage — raw usage by service/action/resource
  • /cost-history — daily $ over a trailing 30-day window
  • /cost-breakdown — $ grouped by service (default grouping)

Deliberately excludes /usage-events (the per-user raw activity log) — that data needs its own explicit access decision, same reasoning as the cron-log exclusion, not default inclusion alongside aggregate reporting.

Changes

  • billingApi.js: adds getUsageSummary / getCostHistory / getCostBreakdown, extending the existing read-only GET client pattern
  • Billing.jsx: splits the page into Overview/Usage tabs (@omnibioai/ui's Tabs/Table); Overview is unchanged behavior, just extracted into its own component
  • billing.test.jsx: +6 tests — empty state, populated rows, three independent endpoint-failure-isolation cases, and an assertion that getUsageEvents is not exported

Verification

  • vitest run tests/ui/billing.test.jsx → 10/10 pass; full UI suite → 205/205 pass
  • Rebuilt web-ui, logged in against the real running dev stack as admin@omnibioai (org feat: move data/ and work/ directories to ecosystem level #1), clicked through Overview → Usage. Real data rendered correctly: workbench/compute/gpu_hours → 5 hours, daily cost 2026-08-07 → 12.50 USD, cost-by-service workbench → 12.50 USD. All three new endpoints returned 200; no console errors introduced (only a pre-existing unrelated Sentry 429 and the expected no-subscription 404s).

Note

Branch coverage (92.4%) is essentially unchanged from main's pre-existing 92.68% — the repo's 95% coverage gate was already failing before this change, not a regression introduced here. Separate cleanup needed.

🤖 Generated with Claude Code

Surfaces raw operational usage and cost data alongside the existing
subscription/quota view, using billing-service's already-deployed
/usage, /cost-history, and /cost-breakdown endpoints (no backend
changes needed).

Deliberately excludes /usage-events (per-user raw activity log) --
that data needs its own explicit access decision, same reasoning as
the cron-log exclusion earlier this week, not default inclusion.

- billingApi.js: getUsageSummary/getCostHistory/getCostBreakdown
- Billing.jsx: split into Overview/Usage tabs
- billing.test.jsx: +6 tests (empty state, populated, independent
  endpoint-failure isolation, getUsageEvents non-export assertion)

Verified live against org 1: real 5 GPU-hours / $12.50 cost data
rendered correctly across all three new views.

Note: branch coverage (92.4%) is essentially unchanged from main's
pre-existing 92.68% -- the 95% gate was already failing before this
change, not a regression introduced here. Separate cleanup needed.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rjm5Pbw61jjRLjGHh9VRpB
@man4ish
man4ish merged commit 372130d into main Sep 4, 2026
6 of 7 checks passed
@man4ish
man4ish deleted the feat/billing-usage-tab branch September 4, 2026 14:27
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.

1 participant