Skip to content

Commit d67c5be

Browse files
committed
fix(web): hide the empty reset badge on unstarted limit windows
1 parent 5d59e71 commit d67c5be

1 file changed

Lines changed: 19 additions & 16 deletions

File tree

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

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -290,23 +290,26 @@ function PoolSegment({
290290
/>
291291
) : null}
292292
<span className="shrink-0 font-semibold text-foreground tabular-nums">{remaining}%</span>
293-
{/* Countdown and badge get their own plate: fill and hatching run under them otherwise. */}
294-
<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">
295-
{resetsIn?.replace("resets in ", "↻ ") ?? ""}
296-
{credits ? (
297-
<>
298-
{resetsIn ? (
299-
<span aria-hidden className="text-muted-foreground">
300-
·
293+
{/* Countdown and badge get their own plate: fill and hatching run under them otherwise.
294+
An unstarted window has no reset, so the plate is skipped rather than drawn empty. */}
295+
{resetsIn || credits ? (
296+
<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">
297+
{resetsIn?.replace("resets in ", "↻ ") ?? ""}
298+
{credits ? (
299+
<>
300+
{resetsIn ? (
301+
<span aria-hidden className="text-muted-foreground">
302+
·
303+
</span>
304+
) : null}
305+
<span aria-hidden className="inline-flex items-center gap-0.5 font-semibold">
306+
<TicketIcon className="size-3" aria-hidden />
307+
{credits}
301308
</span>
302-
) : null}
303-
<span aria-hidden className="inline-flex items-center gap-0.5 font-semibold">
304-
<TicketIcon className="size-3" aria-hidden />
305-
{credits}
306-
</span>
307-
</>
308-
) : null}
309-
</span>
309+
</>
310+
) : null}
311+
</span>
312+
) : null}
310313
</div>
311314
</PopoverTrigger>
312315
<LegendRow account={account} window={window} color={color} now={now} index={index} />

0 commit comments

Comments
 (0)