refactor(dashboard): format custom provider quota keys into title-cased labels (#11188)

Validated on the combined batch board + this branch: dashboard-ux-operability green. Unmapped custom quota keys now render as title-cased labels instead of raw snake_case. Conflict with the tip was only stale provider-count docs. Thank you @rqzbeh!
This commit is contained in:
Rouzbeh†
2026-08-23 07:31:11 +03:30
committed by GitHub
parent f131b64a6e
commit b25b2eacb3
2 changed files with 10 additions and 1 deletions

View File

@@ -98,7 +98,7 @@ export function formatQuotaLabel(name: string) {
return `Weekly ${toTitleCaseWords(weeklyModelMatch[1])}`;
}
return trimmed;
return toTitleCaseWords(trimmed.replace(/_/g, " "));
}
/**

View File

@@ -0,0 +1,9 @@
import assert from "node:assert/strict";
import { test } from "node:test";
import { formatQuotaLabel } from "../../src/app/(dashboard)/dashboard/usage/components/ProviderLimits/utils.tsx";
test("formatQuotaLabel formats custom quota keys with proper title-casing", () => {
assert.equal(formatQuotaLabel("session"), "Session");
assert.equal(formatQuotaLabel("weekly"), "Weekly");
assert.equal(formatQuotaLabel("custom_quota_limit"), "Custom Quota Limit");
});