@@ -32,7 +32,7 @@ import {
3232import { WorkspacePageContainer } from "../WorkspacePageContainer" ;
3333import { WorkspacePageHeader } from "../WorkspacePageHeader" ;
3434import { UsageProviderChart , type UsageChartMetric } from "./UsageProviderChart" ;
35- import { PROVIDER_ORDER , PROVIDER_PRESENTATION } from "./usageProviders" ;
35+ import { PROVIDER_ORDER , PROVIDER_PRESENTATION , providersWithUsage } from "./usageProviders" ;
3636
3737const WINDOW_OPTIONS = [
3838 { days : 1 , label : "Past 24h" } ,
@@ -74,6 +74,8 @@ export function UsagePage() {
7474 ( ) => ( isPast24Hours ? merged . hourly : merged . daily ) . toReversed ( ) ,
7575 [ isPast24Hours , merged . daily , merged . hourly ] ,
7676 ) ;
77+ const activeProviders = useMemo ( ( ) => providersWithUsage ( merged . providers ) , [ merged . providers ] ) ;
78+ const timeValueColumnWidth = `${ 60 / ( activeProviders . length + 2 ) } %` ;
7779
7880 const selectWindow = ( days : number ) => {
7981 setWindowSelection ( {
@@ -225,7 +227,7 @@ export function UsagePage() {
225227 </ span >
226228 </ div >
227229
228- { PROVIDER_ORDER . map ( ( provider ) => {
230+ { activeProviders . map ( ( provider ) => {
229231 const totals = merged . providers . find ( ( entry ) => entry . provider === provider ) ;
230232 const share =
231233 metric === "cost" ? ( totals ?. costShare ?? 0 ) : ( totals ?. tokenShare ?? 0 ) ;
@@ -276,6 +278,7 @@ export function UsagePage() {
276278 { metric === "tokens" ? "processed tokens" : "cost" }
277279 </ h2 >
278280 < UsageProviderChart
281+ providers = { activeProviders }
279282 days = { days }
280283 daily = { merged . daily }
281284 hours = { hours }
@@ -331,7 +334,13 @@ export function UsagePage() {
331334 </ div >
332335
333336 { breakdown === "model" ? (
334- < table className = "w-full text-sm" >
337+ < table className = "w-full table-fixed text-sm" >
338+ < colgroup >
339+ < col className = "w-2/5" />
340+ < col className = "w-1/5" />
341+ < col className = "w-1/5" />
342+ < col className = "w-1/5" />
343+ </ colgroup >
335344 < thead >
336345 < tr className = "border-b border-border text-left text-xs text-muted-foreground" >
337346 < th className = "py-2 font-normal" > Model</ th >
@@ -374,11 +383,19 @@ export function UsagePage() {
374383 </ tbody >
375384 </ table >
376385 ) : (
377- < table className = "w-full text-sm" >
386+ < table className = "w-full table-fixed text-sm" >
387+ < colgroup >
388+ < col className = "w-2/5" />
389+ { activeProviders . map ( ( provider ) => (
390+ < col key = { provider } style = { { width : timeValueColumnWidth } } />
391+ ) ) }
392+ < col style = { { width : timeValueColumnWidth } } />
393+ < col style = { { width : timeValueColumnWidth } } />
394+ </ colgroup >
378395 < thead >
379396 < tr className = "border-b border-border text-left text-xs text-muted-foreground" >
380397 < th className = "py-2 font-normal" > { isPast24Hours ? "Hour" : "Day" } </ th >
381- { PROVIDER_ORDER . map ( ( provider ) => (
398+ { activeProviders . map ( ( provider ) => (
382399 < th key = { provider } className = "py-2 text-right font-normal" >
383400 { PROVIDER_PRESENTATION [ provider ] . label }
384401 </ th >
@@ -390,7 +407,10 @@ export function UsagePage() {
390407 < tbody >
391408 { breakdownPeriods . length === 0 ? (
392409 < tr >
393- < td colSpan = { 5 } className = "py-6 text-center text-muted-foreground" >
410+ < td
411+ colSpan = { activeProviders . length + 3 }
412+ className = "py-6 text-center text-muted-foreground"
413+ >
394414 No activity in this window.
395415 </ td >
396416 </ tr >
@@ -405,7 +425,7 @@ export function UsagePage() {
405425 ? formatHourShort ( period . hourStart , window . timeZone )
406426 : formatDayShort ( period . day ) }
407427 </ td >
408- { PROVIDER_ORDER . map ( ( provider ) => (
428+ { activeProviders . map ( ( provider ) => (
409429 < td
410430 key = { provider }
411431 className = "py-2 text-right text-muted-foreground tabular-nums"
0 commit comments