Skip to content

Commit 3f510e0

Browse files
committed
fix(usage): simplify single-account limit bars
1 parent f24f90f commit 3f510e0

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

‎apps/web/src/components/usage/UsageLimitsPooled.tsx‎

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import {
44
collectLimitPools,
55
cursorUsageWindowDetails,
66
displayLimitWindows,
7-
formatDuration,
87
formatResetsIn,
98
type LimitAccount,
109
type LimitPool,
@@ -226,6 +225,7 @@ function PoolSegment({
226225
color,
227226
now,
228227
index,
228+
showAccountName,
229229
}: {
230230
readonly account: LimitAccount;
231231
readonly window: LimitPoolMember["window"];
@@ -234,6 +234,7 @@ function PoolSegment({
234234
readonly now: number;
235235
/** 1-based position in the bar, shown on the strip and its legend row to tie them together. */
236236
readonly index: number;
237+
readonly showAccountName: boolean;
237238
}) {
238239
const [open, setOpen] = useState(false);
239240
const remaining = remainingPercent(window);
@@ -276,7 +277,12 @@ function PoolSegment({
276277
{index}
277278
</span>
278279
<div className="relative hidden h-full min-w-0 items-center gap-1.5 px-2 text-xs @2xl/pool:flex">
279-
<AccountName account={account} className="min-w-0 truncate font-medium text-foreground" />
280+
{showAccountName ? (
281+
<AccountName
282+
account={account}
283+
className="min-w-0 truncate font-medium text-foreground"
284+
/>
285+
) : null}
280286
<span className="shrink-0 font-semibold text-foreground tabular-nums">{remaining}%</span>
281287
{/* Countdown and badge get their own plate: fill and hatching run under them otherwise. */}
282288
<span className="ms-auto flex shrink-0 items-center gap-1.5 rounded-sm bg-background/85 px-1.5 py-0.5 text-2xs text-foreground tabular-nums">
@@ -465,6 +471,7 @@ function PoolBar({
465471
color={color}
466472
now={now}
467473
index={position + 1}
474+
showAccountName={pool.columns.length > 1}
468475
/>
469476
) : null,
470477
)}
@@ -503,10 +510,9 @@ function PoolWindowCard({
503510
<span className="text-sm text-muted-foreground">left</span>
504511
{pool.pace ? <PaceIcon pace={pool.pace} /> : null}
505512
</span>
506-
{nextRefill ? (
507-
<span className="text-xs text-muted-foreground tabular-nums">
508-
<span className="font-medium text-foreground">↻ +{nextRefill.restoresPercent}%</span>{" "}
509-
{nextRefill.at <= now ? "now" : `in ${formatDuration(nextRefill.at - now)}`}
513+
{nextRefill && pool.columns.length > 1 ? (
514+
<span className="text-xs font-medium text-foreground tabular-nums">
515+
↻ +{nextRefill.restoresPercent}%
510516
</span>
511517
) : null}
512518
</div>

0 commit comments

Comments
 (0)