feat(ui): add Usage tab to Billing page - #81
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: addsgetUsageSummary/getCostHistory/getCostBreakdown, extending the existing read-only GET client patternBilling.jsx: splits the page into Overview/Usage tabs (@omnibioai/ui'sTabs/Table); Overview is unchanged behavior, just extracted into its own componentbilling.test.jsx: +6 tests — empty state, populated rows, three independent endpoint-failure-isolation cases, and an assertion thatgetUsageEventsis not exportedVerification
vitest run tests/ui/billing.test.jsx→ 10/10 pass; full UI suite → 205/205 passweb-ui, logged in against the real running dev stack asadmin@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 cost2026-08-07 → 12.50 USD, cost-by-serviceworkbench → 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