From 0ead4cbb5442a6c984c85b1767c19aadf276c0b0 Mon Sep 17 00:00:00 2001 From: Diego Rodrigues de Sa e Souza <8016841+diegosouzapw@users.noreply.github.com> Date: Sun, 24 May 2026 16:03:18 -0300 Subject: [PATCH] feat(quota+providers): card-grid layout, provider group headers, Codex race fix (#2667) Integrated into release/v3.8.3 --- .../(dashboard)/dashboard/providers/page.tsx | 108 +-- .../components/ProviderLimits/AccountRow.tsx | 631 ------------------ .../ProviderLimits/ProviderGroup.tsx | 162 ----- .../components/ProviderLimits/QuotaCard.tsx | 97 +++ .../ProviderLimits/QuotaCardGrid.tsx | 68 ++ .../ProviderLimits/QuotaMiniBar.tsx | 34 + .../usage/components/ProviderLimits/index.tsx | 153 +---- .../ProviderLimits/parts/QuotaCardBody.tsx | 132 ++++ .../parts/QuotaCardExpanded.tsx | 189 ++++++ .../ProviderLimits/parts/QuotaCardHeader.tsx | 124 ++++ .../ProviderLimits/parts/QuotaEnvGroup.tsx | 50 ++ .../usage/components/ProviderLimits/utils.tsx | 103 +++ src/i18n/messages/en.json | 21 +- src/i18n/messages/pt-BR.json | 21 +- src/sse/services/tokenRefresh.ts | 18 +- tests/unit/quota-helpers.test.ts | 132 ++++ tests/unit/token-refresh-race.test.ts | 134 ++++ 17 files changed, 1205 insertions(+), 972 deletions(-) delete mode 100644 src/app/(dashboard)/dashboard/usage/components/ProviderLimits/AccountRow.tsx delete mode 100644 src/app/(dashboard)/dashboard/usage/components/ProviderLimits/ProviderGroup.tsx create mode 100644 src/app/(dashboard)/dashboard/usage/components/ProviderLimits/QuotaCard.tsx create mode 100644 src/app/(dashboard)/dashboard/usage/components/ProviderLimits/QuotaCardGrid.tsx create mode 100644 src/app/(dashboard)/dashboard/usage/components/ProviderLimits/QuotaMiniBar.tsx create mode 100644 src/app/(dashboard)/dashboard/usage/components/ProviderLimits/parts/QuotaCardBody.tsx create mode 100644 src/app/(dashboard)/dashboard/usage/components/ProviderLimits/parts/QuotaCardExpanded.tsx create mode 100644 src/app/(dashboard)/dashboard/usage/components/ProviderLimits/parts/QuotaCardHeader.tsx create mode 100644 src/app/(dashboard)/dashboard/usage/components/ProviderLimits/parts/QuotaEnvGroup.tsx create mode 100644 tests/unit/quota-helpers.test.ts create mode 100644 tests/unit/token-refresh-race.test.ts diff --git a/src/app/(dashboard)/dashboard/providers/page.tsx b/src/app/(dashboard)/dashboard/providers/page.tsx index df86751669..876b143c8e 100644 --- a/src/app/(dashboard)/dashboard/providers/page.tsx +++ b/src/app/(dashboard)/dashboard/providers/page.tsx @@ -984,6 +984,7 @@ export default function ProvidersPage() { +

{t("compatibleProvidersDesc")}

{compatibleProviders.length === 0 && anthropicCompatibleProviders.length === 0 && ccCompatibleProviders.length === 0 ? ( @@ -992,7 +993,7 @@ export default function ProvidersPage() { {t("noCompatibleYet")} ) : ( -
+
{compatibleProviderEntries.map( ({ providerId, provider, stats, displayAuthType, toggleAuthType }) => (
-
+

{t("oauthProvidersDesc")}

+
{oauthProviderEntries .filter((e) => !IDE_PROVIDER_IDS.has(e.providerId)) .map(({ providerId, provider, stats, displayAuthType, toggleAuthType }) => ( @@ -1115,7 +1117,7 @@ export default function ProvidersPage() { {t("noIdeProviders") || "No IDE providers match the current filters."}
) : ( -
+
{ideProviderEntries.map( ({ providerId, provider, stats, displayAuthType, toggleAuthType }) => (
-
+

{t("webCookieProvidersDesc")}

+
{webCookieProviderEntries.map(({ providerId, provider, stats, toggleAuthType }) => (
-
+
{freeSectionEntries.map( ({ providerId, provider, stats, displayAuthType, toggleAuthType }) => (
+

{t("apiKeyProvidersDesc")}

{llmProviderEntries.length > 0 && (

{t("llmProviders")}

-
+
{llmProviderEntries.map( ({ providerId, provider, stats, displayAuthType, toggleAuthType }) => (
-
+

{t("noAuthProvidersDesc")}

+
{noAuthEntries.map(({ providerId, provider, stats, toggleAuthType }) => (
-
+

{t("upstreamProxyProvidersDesc")}

+
{upstreamProxyEntries.map(({ providerId, provider, stats, toggleAuthType }) => (
-
+

{t("webFetchProvidersDesc")}

+
{webFetchEntries.map( ({ providerId, provider, stats, displayAuthType, toggleAuthType }) => ( 0 && (
-
-
-

{t("aggregatorsGateways")}

- +
+

+ {t("aggregatorsGateways")}{" "} + + +

-
+

{t("aggregatorsGatewaysDesc")}

+
{aggregatorProviderEntries.map( ({ providerId, provider, stats, displayAuthType, toggleAuthType }) => ( 0 && (
-
-
-

{t("enterpriseCloud")}

- +
+

+ {t("enterpriseCloud")}{" "} + + +

-
+

{t("enterpriseCloudDesc")}

+
{enterpriseProviderEntries.map( ({ providerId, provider, stats, displayAuthType, toggleAuthType }) => (
-
+

{t("cloudAgentProvidersDesc")}

+
{cloudAgentProviderEntries.map(({ providerId, provider, stats, toggleAuthType }) => (
-
+

{t("localProvidersDesc")}

+
{localProviderEntries.map(({ providerId, provider, stats, toggleAuthType }) => (
-
+

{t("searchProvidersDesc")}

+
{searchProviderEntries.map(({ providerId, provider, stats, toggleAuthType }) => ( 0 && (
-
-
-

{t("embeddingRerankProviders")}

- +
+

+ {t("embeddingRerankProviders")}{" "} + + +

-
+

{t("embeddingRerankProvidersDesc")}

+
{embeddingRerankProviderEntries.map( ({ providerId, provider, stats, displayAuthType, toggleAuthType }) => ( 0 && (
-
-
-

{t("imageProviders")}

- +
+

+ {t("imageProviders")}{" "} + + +

-
+

{t("imageProvidersDesc")}

+
{imageProviderEntries.map( ({ providerId, provider, stats, displayAuthType, toggleAuthType }) => (
-
+

{t("audioProvidersDesc")}

+
{audioProviderEntries.map(({ providerId, provider, stats, toggleAuthType }) => ( 0 && (
-
-
-

{t("videoProviders")}

- +
+

+ {t("videoProviders")}{" "} + + +

-
+

{t("videoProvidersDesc")}

+
{videoProviderEntries.map( ({ providerId, provider, stats, displayAuthType, toggleAuthType }) => (