mirror of
https://github.com/andrewyng/openworker.git
synced 2026-09-11 14:50:14 +00:00
Usage popover: one field per line
Stacked label/value rows instead of the wrapped inline stats; values are session sums per model (fresh input split from the cache rows).
This commit is contained in:
@@ -587,11 +587,14 @@ function UsageChip({
|
|||||||
: null;
|
: null;
|
||||||
const labelFor = (id: string) =>
|
const labelFor = (id: string) =>
|
||||||
id === "unknown" ? "Unknown model" : modelLabels?.[id] || shortModel(id);
|
id === "unknown" ? "Unknown model" : modelLabels?.[id] || shortModel(id);
|
||||||
|
// One field per line, session-summed (owner ask 2026-07-28). Values are cumulative
|
||||||
|
// across the whole session, never just the last turn; "Input" is the fresh
|
||||||
|
// (uncached) share — the cached share sits in the cache rows at its own price.
|
||||||
const stat = (label: string, value: number) => (
|
const stat = (label: string, value: number) => (
|
||||||
<span className="inline-flex items-baseline gap-1">
|
<div className="flex items-baseline justify-between text-[11.5px] leading-snug">
|
||||||
<span className="text-faint">{label}</span>
|
<span className="text-faint">{label}</span>
|
||||||
<span className="text-ink tabular-nums">{formatTokens(value)}</span>
|
<span className="text-ink tabular-nums">{formatTokens(value)}</span>
|
||||||
</span>
|
</div>
|
||||||
);
|
);
|
||||||
return (
|
return (
|
||||||
<div className="relative">
|
<div className="relative">
|
||||||
@@ -655,7 +658,7 @@ function UsageChip({
|
|||||||
<div className="text-[12px] text-ink font-medium truncate" title={id}>
|
<div className="text-[12px] text-ink font-medium truncate" title={id}>
|
||||||
{labelFor(id)}
|
{labelFor(id)}
|
||||||
</div>
|
</div>
|
||||||
<div className="flex flex-wrap gap-x-3 text-[11.5px] leading-snug">
|
<div className="mt-0.5 flex flex-col gap-0.5">
|
||||||
{stat("Input", t.input)}
|
{stat("Input", t.input)}
|
||||||
{stat("Output", t.output)}
|
{stat("Output", t.output)}
|
||||||
{t.cache_read > 0 && stat("Cache read", t.cache_read)}
|
{t.cache_read > 0 && stat("Cache read", t.cache_read)}
|
||||||
|
|||||||
Reference in New Issue
Block a user