From 2e279c81d2b58c912719013b3dff0ad2d4e6e2c3 Mon Sep 17 00:00:00 2001 From: heyx Date: Fri, 21 Aug 2026 16:23:11 +0800 Subject: [PATCH] fix(frontend): make CN provider quota/balance refresh affordance explicit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The quota cell used the noun label "5-hour window/weekly window" and the balance cell the balance value itself as the click target for a manual refresh. Both read as passive captions, so users could not discover the manual probe and reported the feature as missing ("only OpenAI has a refresh button"). - Split data display from the refresh action: bars/balance render as static rows (snapshot already paints on mount), with a dedicated action button below, aligned with the OpenAI "Query" and Grok "Probe" buttons (same icon, blue action styling). - Label the control with a verb (cnProviders.probe: 查询 / Query) and give the balance cell a tooltip (it previously had none). - Keep the tier/label layout classes and data-test hooks intact. - Extend the quota cell spec and add a balance cell spec covering snapshot rendering, explicit action labeling and failure passthrough. --- .../account/CNProviderBalanceCell.vue | 40 ++++++---- .../account/CNProviderQuotaCell.vue | 63 +++++++-------- .../__tests__/CNProviderBalanceCell.spec.ts | 76 +++++++++++++++++++ .../__tests__/CNProviderQuotaCell.spec.ts | 19 +++++ .../src/i18n/locales/en/admin/accounts.ts | 2 + .../src/i18n/locales/zh/admin/accounts.ts | 2 + 6 files changed, 158 insertions(+), 44 deletions(-) create mode 100644 frontend/src/components/account/__tests__/CNProviderBalanceCell.spec.ts diff --git a/frontend/src/components/account/CNProviderBalanceCell.vue b/frontend/src/components/account/CNProviderBalanceCell.vue index 2ad2cbf3ab..52b5fb15e2 100644 --- a/frontend/src/components/account/CNProviderBalanceCell.vue +++ b/frontend/src/components/account/CNProviderBalanceCell.vue @@ -1,13 +1,35 @@