fix(usage): sort per-model usage breakdown by cost descending (#13676)

This commit is contained in:
roshan authored and GitHub committed 2026-07-31 21:59:57 +00:00
1 parent 2b2e3c668a
commit fc73de040e
1 file changed
+5 -1
@@ -48,6 +48,10 @@ function WindowCostSection({ windowCostCents, rows }: WindowCostSectionProps) {
0
);
const hasCache = rows.some((row) => row.cache_read_tokens > 0);
const sortedRows = useMemo(
() => [...rows].sort((a, b) => b.cost_cents - a.cost_cents),
[rows]
);
return (
<Section gap={0.75} justifyContent="start">
@@ -68,7 +72,7 @@ function WindowCostSection({ windowCostCents, rows }: WindowCostSectionProps) {
/>
) : (
<Card>
{rows.map((row, index) => (
{sortedRows.map((row, index) => (
<div key={`${row.day}-${row.model}`}>
{index > 0 && <Divider />}
<Section gap={0.5} alignItems="start" justifyContent="start">