fix(quota): stop showing misleading OpenRouter percentages (#1127)

* fix(quota): stop showing misleading OpenRouter percentages

Fixes #1085

* fix(quota): clean up OpenRouter credit labels

---------
Co-authored-by: Bohdan Triapitsyn <artmore@protonmail.com>
This commit is contained in:
zerone0x
2026-05-07 23:39:53 +03:00
committed by GitHub
co-authored by Bohdan Triapitsyn
parent b65edc3436
commit 3fbcdbc3dc
7 changed files with 32 additions and 19 deletions
+1
View File
@@ -3,6 +3,7 @@ export type { QuotaProviderMeta } from './providers';
export {
clampPercent,
formatPercent,
formatQuotaValueLabel,
resolveUsageTone,
formatWindowLabel,
calculatePace,
+7
View File
@@ -12,6 +12,13 @@ export const formatPercent = (value: number | null): string => {
return `${Math.round(value)}%`;
};
export const formatQuotaValueLabel = (
valueLabel: string | null | undefined,
percent: number | null,
): string => {
return valueLabel ?? formatPercent(percent);
};
export const resolveUsageTone = (percent: number | null): 'safe' | 'warn' | 'critical' => {
if (percent === null) {
return 'safe';