The best way to control Claude Code, Codex and more from any computer or phone
fix(web): usage tabs no longer jump when switching to Limits (#25336)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Theo Browne committed
Oct 25, 2026 at 22:28 UTC
32507803daba90107aab1f506ade8f951502c2bb
1 file changed
+35
-34
apps/web/src/components/usage/UsagePage.tsx
+35
-34
@@ -392,34 +392,35 @@ export function UsagePage() {
392
) : null}
393
<div className="ms-auto hidden shrink-0 items-center justify-end gap-2 @4xl/usage-header:flex">
394
<ToggleGroup
395
- aria-label="Usage metric"
395
+ aria-label="Usage period"
396
variant="segmented"
397
- value={[metric]}
397
+ value={[String(windowDays)]}
398
+ disabled={showingLimits}
399
+ // Limits are always current; the New design hides the period instead of greying it.
400
+ // It sits before the metric tabs so hiding it never moves them.
401
+ className={showingLimits ? "redesign:hidden" : undefined}
402
onValueChange={(next) => {
403
const value = next[0];
400
- if (isUsageMetric(value)) selectMetric(value);
404
+ if (value) selectWindow(Number(value));
405
}}
406
>
403
- {METRIC_OPTIONS.map((option) => (
404
- <Toggle key={option.value} value={option.value} title={shortcutTitle(option)}>
407
+ {WINDOW_OPTIONS.map((option) => (
408
+ <Toggle key={option.days} value={String(option.days)} title={shortcutTitle(option)}>
409
{option.label}
410
</Toggle>
411
))}
412
</ToggleGroup>
413
<ToggleGroup
410
- aria-label="Usage period"
414
+ aria-label="Usage metric"
415
variant="segmented"
412
- value={[String(windowDays)]}
413
- disabled={showingLimits}
414
- // Limits are always current; the New design hides the period instead of greying it.
415
- className={showingLimits ? "redesign:hidden" : undefined}
416
+ value={[metric]}
417
onValueChange={(next) => {
418
const value = next[0];
418
- if (value) selectWindow(Number(value));
419
+ if (isUsageMetric(value)) selectMetric(value);
420
}}
421
>
421
- {WINDOW_OPTIONS.map((option) => (
422
- <Toggle key={option.days} value={String(option.days)} title={shortcutTitle(option)}>
422
+ {METRIC_OPTIONS.map((option) => (
423
+ <Toggle key={option.value} value={option.value} title={shortcutTitle(option)}>
424
{option.label}
425
</Toggle>
426
))}
@@ -437,51 +438,51 @@ export function UsagePage() {
438
</div>
439
<div className="ms-auto flex shrink-0 items-center justify-end gap-1 @4xl/usage-header:hidden">
440
<Select
440
- value={metric}
441
- onValueChange={(value) => {
442
- if (isUsageMetric(value)) selectMetric(value);
443
- }}
441
+ value={String(windowDays)}
442
+ disabled={showingLimits}
443
+ onValueChange={(value) => selectWindow(Number(value))}
444
>
445
<SelectTrigger
446
- aria-label="Usage metric"
446
+ aria-label="Usage period"
447
size="compact"
448
variant="ghost"
449
- className="w-auto min-w-0"
449
+ className={cn("w-auto min-w-0", showingLimits && "redesign:hidden")}
450
>
451
<SelectValue>
452
- {METRIC_OPTIONS.find((option) => option.value === metric)?.label}
452
+ {WINDOW_OPTIONS.find((option) => option.days === windowDays)?.label}
453
</SelectValue>
454
</SelectTrigger>
455
<SelectPopup align="end" alignItemWithTrigger={false}>
456
- {METRIC_OPTIONS.map((option) => (
457
- <SelectItem key={option.value} value={option.value} title={shortcutTitle(option)}>
456
+ {WINDOW_OPTIONS.map((option) => (
457
+ <SelectItem
458
+ key={option.days}
459
+ value={String(option.days)}
460
+ title={shortcutTitle(option)}
461
+ >
462
{option.label}
463
</SelectItem>
464
))}
465
</SelectPopup>
466
</Select>
467
<Select
464
- value={String(windowDays)}
465
- disabled={showingLimits}
466
- onValueChange={(value) => selectWindow(Number(value))}
468
+ value={metric}
469
+ onValueChange={(value) => {
470
+ if (isUsageMetric(value)) selectMetric(value);
471
+ }}
472
>
473
<SelectTrigger
469
- aria-label="Usage period"
474
+ aria-label="Usage metric"
475
size="compact"
476
variant="ghost"
472
- className={cn("w-auto min-w-0", showingLimits && "redesign:hidden")}
477
+ className="w-auto min-w-0"
478
>
479
<SelectValue>
475
- {WINDOW_OPTIONS.find((option) => option.days === windowDays)?.label}
480
+ {METRIC_OPTIONS.find((option) => option.value === metric)?.label}
481
</SelectValue>
482
</SelectTrigger>
483
<SelectPopup align="end" alignItemWithTrigger={false}>
479
- {WINDOW_OPTIONS.map((option) => (
480
- <SelectItem
481
- key={option.days}
482
- value={String(option.days)}
483
- title={shortcutTitle(option)}
484
- >
484
+ {METRIC_OPTIONS.map((option) => (
485
+ <SelectItem key={option.value} value={option.value} title={shortcutTitle(option)}>
486
{option.label}
487
</SelectItem>
488
))}