From 7c3008dd81b18340ddcd000afbe24bc93c4dcbb2 Mon Sep 17 00:00:00 2001 From: lzt404 <2596933790@qq.com> Date: Mon, 5 Oct 2026 00:43:00 +0800 Subject: [PATCH] refactor(quota): simplify reset expiry display - Remove redundant reset count and applicability labels - Display each Codex and Claude reset expiry directly - Improve reset expiry layout with clearer spacing and separators - Update quota panel and quota page tests --- src/components/AuthFileQuotaPanel.tsx | 7 +------ src/components/ResetCreditExpiries.css | 8 ++++---- src/components/ResetCreditExpiries.tsx | 1 - src/pages/QuotaPage.tsx | 2 -- tests/authFileCompactPanels.test.tsx | 4 ++-- tests/authFileQuotaDense.test.tsx | 4 ++-- tests/claudeReset.test.tsx | 1 - tests/quotaRendering.test.tsx | 2 +- 8 files changed, 10 insertions(+), 19 deletions(-) diff --git a/src/components/AuthFileQuotaPanel.tsx b/src/components/AuthFileQuotaPanel.tsx index d058bc4..3bc01aa 100644 --- a/src/components/AuthFileQuotaPanel.tsx +++ b/src/components/AuthFileQuotaPanel.tsx @@ -24,12 +24,10 @@ export function AuthFileQuotaPanel({ quota, file, disabled, onRefresh, onReset, const compactLayout = compact || dense; const fileDisabled = readBoolean(file, 'disabled'); const showReset = Boolean(onReset && ((quota.resetCredits ?? 0) > 0 || hasPendingClaudeReset(file))); - const resetCreditsLabel = quota.resetCredits !== undefined ? t('authFiles.quota.resets', { count: quota.resetCredits }) : ''; const accountCreditsLabel = quota.creditsUnlimited ? t('quota.creditUnlimited') : quota.creditBalance !== undefined ? quota.creditBalance : ''; const denseMetadata = dense ? [ - quota.resetCreditsApplicable !== undefined ? t('quota.resetApplicable', { count: quota.resetCreditsApplicable }) : '', quota.subscriptionActiveUntil ? t('quota.subscriptionExpiry', { time: formatQuotaTimestamp(quota.subscriptionActiveUntil, locale) }) : '', accountCreditsLabel ? t('quota.creditBalance') + ': ' + accountCreditsLabel : '', ].filter(Boolean).join(' · ') : ''; @@ -52,10 +50,9 @@ export function AuthFileQuotaPanel({ quota, file, disabled, onRefresh, onReset, }; return (
- {!compactLayout || showReset || (dense && resetCreditsLabel) ?
+ {!compactLayout || showReset ?
{!compactLayout ? {t('authFiles.settings.quotaRemaining')} : null} {!compactLayout && quota.plan ? {quota.plan} : null} - {dense && resetCreditsLabel ? {resetCreditsLabel} : null} {showReset ? : null} {!compactLayout ?