fix(quota): use three-color thresholds for quota change indicators

This commit is contained in:
Supra4E8C
2026-03-28 02:05:31 +08:00
Unverified
parent 135619ff49
commit 2534578eae
4 changed files with 32 additions and 7 deletions
+27 -5
View File
@@ -84,6 +84,8 @@ type QuotaUpdater<T> = T | ((prev: T) => T);
type QuotaType = 'antigravity' | 'claude' | 'codex' | 'gemini-cli' | 'kimi';
const DEFAULT_ANTIGRAVITY_PROJECT_ID = 'bamboo-precept-lgxtn';
const QUOTA_PROGRESS_HIGH_THRESHOLD = 70;
const QUOTA_PROGRESS_MEDIUM_THRESHOLD = 30;
const geminiCliSupplementaryRequestIds = new Map<string, number>();
const geminiCliSupplementaryCache = new Map<
string,
@@ -721,7 +723,11 @@ const renderAntigravityItems = (
h('span', { className: styleMap.quotaReset }, resetLabel)
)
),
h(QuotaProgressBar, { percent, highThreshold: 60, mediumThreshold: 20 })
h(QuotaProgressBar, {
percent,
highThreshold: QUOTA_PROGRESS_HIGH_THRESHOLD,
mediumThreshold: QUOTA_PROGRESS_MEDIUM_THRESHOLD,
})
);
});
};
@@ -795,7 +801,11 @@ const renderCodexItems = (
h('span', { className: styleMap.quotaReset }, window.resetLabel)
)
),
h(QuotaProgressBar, { percent: remaining, highThreshold: 80, mediumThreshold: 50 })
h(QuotaProgressBar, {
percent: remaining,
highThreshold: QUOTA_PROGRESS_HIGH_THRESHOLD,
mediumThreshold: QUOTA_PROGRESS_MEDIUM_THRESHOLD,
})
);
})
);
@@ -886,7 +896,11 @@ const renderGeminiCliItems = (
h('span', { className: styleMap.quotaReset }, resetLabel)
)
),
h(QuotaProgressBar, { percent, highThreshold: 60, mediumThreshold: 20 })
h(QuotaProgressBar, {
percent,
highThreshold: QUOTA_PROGRESS_HIGH_THRESHOLD,
mediumThreshold: QUOTA_PROGRESS_MEDIUM_THRESHOLD,
})
);
})
);
@@ -1078,7 +1092,11 @@ const renderClaudeItems = (
h('span', { className: styleMap.quotaReset }, window.resetLabel)
)
),
h(QuotaProgressBar, { percent: remaining, highThreshold: 80, mediumThreshold: 50 })
h(QuotaProgressBar, {
percent: remaining,
highThreshold: QUOTA_PROGRESS_HIGH_THRESHOLD,
mediumThreshold: QUOTA_PROGRESS_MEDIUM_THRESHOLD,
})
);
})
);
@@ -1293,7 +1311,11 @@ const renderKimiItems = (
: null
)
),
h(QuotaProgressBar, { percent: remaining, highThreshold: 60, mediumThreshold: 20 })
h(QuotaProgressBar, {
percent: remaining,
highThreshold: QUOTA_PROGRESS_HIGH_THRESHOLD,
mediumThreshold: QUOTA_PROGRESS_MEDIUM_THRESHOLD,
})
);
});
};
+1 -1
View File
@@ -541,7 +541,7 @@
}
.quotaBarFillMedium {
background-color: var(--warning-color);
background-color: var(--quota-medium-color, #e0aa14);
}
.quotaBarFillLow {
+1 -1
View File
@@ -243,7 +243,7 @@
}
.quotaBarFillMedium {
background-color: var(--warning-color);
background-color: var(--quota-medium-color, #e0aa14);
}
.quotaBarFillLow {
+3
View File
@@ -32,6 +32,7 @@
--primary-contrast: #ffffff;
--success-color: #10b981;
--quota-medium-color: #e0aa14;
--warning-color: #c65746; // 错误/警告色
--error-color: #c65746;
--danger-color: var(--error-color);
@@ -88,6 +89,7 @@
--primary-contrast: #ffffff;
--success-color: #10b981;
--quota-medium-color: #e0aa14;
--warning-color: #c65746;
--error-color: #c65746;
--danger-color: var(--error-color);
@@ -145,6 +147,7 @@
--primary-contrast: #ffffff;
--success-color: #10b981;
--quota-medium-color: #ffd862;
--warning-color: #c65746;
--error-color: #c65746;
--danger-color: var(--error-color);