From f9191c6f2b60c40524ba2a53ceaadc12faa468b8 Mon Sep 17 00:00:00 2001 From: Jinwoo Hong <73622457+Jinwoo-H@users.noreply.github.com> Date: Sun, 17 May 2026 13:24:45 -0400 Subject: [PATCH] fix(status-bar): restore weekly usage label (#2149) Co-authored-by: Orca --- src/main/rate-limits/codex-fetcher.ts | 2 +- src/renderer/src/lib/window-label-formatter.test.ts | 4 ++-- src/renderer/src/lib/window-label-formatter.ts | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/rate-limits/codex-fetcher.ts b/src/main/rate-limits/codex-fetcher.ts index c3cc96d65..a3143daf1 100644 --- a/src/main/rate-limits/codex-fetcher.ts +++ b/src/main/rate-limits/codex-fetcher.ts @@ -74,7 +74,7 @@ function mapRpcWindow( return { usedPercent: Math.min(100, Math.max(0, raw.usedPercent)), // Why: Codex currently reports remaining minutes in `windowDurationMins`. - // Orca's UI needs the fixed bucket duration so labels stay "5h" / "7d". + // Orca's UI needs the fixed bucket duration so labels stay "5h" / "wk". windowMinutes: expectedWindowMinutes, resetsAt, resetDescription diff --git a/src/renderer/src/lib/window-label-formatter.test.ts b/src/renderer/src/lib/window-label-formatter.test.ts index 57364dc25..730afbbd5 100644 --- a/src/renderer/src/lib/window-label-formatter.test.ts +++ b/src/renderer/src/lib/window-label-formatter.test.ts @@ -10,8 +10,8 @@ describe('formatWindowLabel', () => { expect(formatWindowLabel(60)).toBe('1h') }) - it('returns "7d" for 10080 minutes (7 days)', () => { - expect(formatWindowLabel(10080)).toBe('7d') + it('returns "wk" for 10080 minutes (7 days)', () => { + expect(formatWindowLabel(10080)).toBe('wk') }) it('returns "1d" for 1440 minutes (1 day)', () => { diff --git a/src/renderer/src/lib/window-label-formatter.ts b/src/renderer/src/lib/window-label-formatter.ts index c233c6df9..1fbbcdb54 100644 --- a/src/renderer/src/lib/window-label-formatter.ts +++ b/src/renderer/src/lib/window-label-formatter.ts @@ -1,12 +1,12 @@ /** * Returns a short human-readable label for a usage window duration. * - * Why: the status bar uses duration labels, so the weekly bucket is shown as - * "7d" instead of a calendar-period label like "wk". + * Why: 10080 minutes (7 days) is hard-coded as "wk" for backward + * compatibility with the original StatusBar implementation. */ export function formatWindowLabel(windowMinutes: number): string { if (windowMinutes === 10080) { - return '7d' + return 'wk' } if (windowMinutes === 300) { return '5h'