fix(dashboard): make provider card warning indicators expose the interaction they advertise - #10448
Open
diegosouzapw wants to merge 2 commits into
Open
fix(dashboard): make provider card warning indicators expose the interaction they advertise#10448diegosouzapw wants to merge 2 commits into
diegosouzapw wants to merge 2 commits into
Conversation
…raction they advertise The usage-risk indicator (subscriptionRisk) promised "click for details" in its tooltip but was a bare <span> with no onClick/role/dialog. The connection warning-count badge exposed neither a title tooltip (reasons) nor any click affordance, even though the reasons already exist in providerSpecificData.apiKeyHealth[]. Turn the risk indicator into a real <button role/aria-haspopup="dialog"> that opens an accessible Modal reusing the existing riskNotice copy, and wrap the warning badge in a keyboard- and pointer-interactive control that surfaces a sanitized reasons summary (max failure count + relative last-failure time, never raw upstream error text) and navigates to the connection detail/health view on activation. Both indicators are now visually distinct (bare icon vs. pill Badge). Closes #10261
… all 42 locales (#10261) Real Vietnamese translations (vi.json has a strict no-__MISSING__-marker gate); other 41 locales carry the sync-ui __MISSING__ placeholder pending the normal translation pass.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #10261
Root cause
src/app/(dashboard)/dashboard/providers/components/ProviderCard.tsxrendered two warning indicators that advertised interaction they did not implement:subscriptionRisk) — a plain<span title="… click for details">with noonClick, norole, and no dialog. Clicking it did nothing.Badgewith notitle(no reasons exposed) and no click affordance, even though the reasons (failures,lastFailure,totalRequests) already exist per-connection inproviderSpecificData.apiKeyHealth[]and are shown inEditConnectionModal.tsx.Fix
<button role... aria-haspopup="dialog">that opens an accessibleModal(reuses the existingriskNoticecopy, keyed byriskNoticeVariant).role="button",tabIndex=0, Enter/Space activation) exposing a sanitized reasons summary (max failure count + relative last-failure time — never raw upstream error text, Hard Rule fix(ui): fix Select dropdown dark theme inconsistency #12) viatitle/aria-label, and navigates to the provider detail/health view on activation.material-symbols-outlinedglyph; the warning badge is the pill-shapedBadgecomponent.preventDefault()/stopPropagation()so they don't trigger the card's wrapping<Link>navigation (existing pattern fromhandleTestClick/handleToggle).page.tsxnow aggregates a sanitizedwarningMaxFailures/warningLastFailureRelativesummary fromapiKeyHealthalongside the existing warning count.providers.riskNotice.detailsTitleandproviders.warningNotice.{tooltip,lastFailureSuffix,ariaLabel}toen.json.Regression test
src/app/(dashboard)/dashboard/providers/components/__tests__/providerCardWarningIndicators.test.tsx(vitest, matches thetests/unit/**/*.test.tsx/dashboard/providers/**/__tests__/**include globs invitest.config.ts):tabindex=0, no raw upstream error strings)Gates run
npm run typecheck:core— cleannpx eslint --suppressions-location config/quality/eslint-suppressions.json <changed files>— cleannode scripts/check/check-file-size.mjs— OK, no new violations on touched filesnode scripts/check/check-complexity.mjs— OK (2456 vs baseline 2774)node scripts/check/check-cognitive-complexity.mjs— OK (1104 vs baseline 1223)node scripts/check/check-test-discovery.mjs— OK, new test file discoverednpx vitest runProviderCard(tests/unit/ui/providerCardHandle.test.tsx,highlightableProviderCard.test.tsx,providerCardKimiPartnerAccent.test.tsx,card-hover-visible.test.ts,providers-page-utils.test.ts) — confirmed by content inspection that none touchsubscriptionRisk/warningCount/the changed lines; a devbox-saturated (13-way parallel fan-out)npm run test:unitrun hit vitest worker-pool timeouts unrelated to this diff, consistent with known devbox-under-load flakiness, not a regression from this change.