fix(api-manager): accessible loading status on the skeleton gate - #12541
Open
pacocartones wants to merge 2 commits into
Open
fix(api-manager): accessible loading status on the skeleton gate#12541pacocartones wants to merge 2 commits into
pacocartones wants to merge 2 commits into
Conversation
While the initial /api/keys fetch is pending, ApiManagerPageClient renders only two CardSkeleton cards, and CardSkeleton is aria-hidden. For the whole loading window the page therefore has no accessible content at all: screen readers and automated tooling see only the sidebar, which is the "API Keys page is empty" reading in the report. Wrap the two skeletons in the same role="status" aria-live="polite" aria-busy="true" container the other dashboard loading states already use, with a visually hidden common.loading label. Loading.tsx is left untouched so its other callers keep their current semantics. Closes diegosouzapw#12066
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.
Summary
ApiManagerPageClient.tsx:950-956returns nothing but two<CardSkeleton />while the initial/api/keysfetch is pending, andCardSkeleton(src/shared/components/Loading.tsx:96-105) isaria-hidden="true"with norole="status"alongside it. For the whole loading window the API Keys page has no accessible content at all: a screen reader or any tool inspecting the accessibility tree sees only the sidebar, which is the "page is empty" / "API Keys link does nothing" reading in fix: /dashboard/api-manager renders blank (only sidebar visible) #12066 and its duplicate [BUG] Home Quick Start 'API Keys' link does not navigate #12065.role="status" aria-live="polite" aria-busy="true"container the other dashboard loading states already use (providers/loading.tsx:7,analytics/loading.tsx:7,settings/loading.tsx:7; same pattern asPageLoadinginLoading.tsx:69-77and the Profile gate from fix(profile): expose accessible status and progress #11838), with a visually hiddencommon.loadinglabel.common.loadingalready exists in every locale, so no message file changes.Loading.tsxis deliberately untouched:CardSkeletonhas 30 usages across 18 files and three route-levelloading.tsxfiles already wrap it in a status container, so giving the skeleton itself a role would nest live regions. The fix is local to the one gate that had none. No layout change: the wrapper keepsflex flex-col gap-8, the label issr-only, and the status disappears with the gate onceloadingclears (thefinallyinfetchData, so it clears on both success and failure).Related Issues
Validation
vitest run --config vitest.config.ts tests/unit/ui/api-manager-loading-status-12066.test.tsx2/2,node scripts/check/check-complexity-ratchets.mjs --base-ref origin/release/v3.8.51OK,npm run check:changelog-integrityOK,eslintexit 0 andprettier --checkclean on the touched filesnpm run lintrelease/v3.8.51; focused checks rerun afterwardTests Added Or Updated
tests/unit/ui/api-manager-loading-status-12066.test.tsx(new, 2 cases): mountsApiManagerPageClientin jsdom withnext-intlmocked. Case 1 keepsfetchpending forever and asserts a[role="status"]witharia-live="polite",aria-busy="true"and theloadinglabel exists while the skeleton cards stayaria-hidden. Case 2 resolvesfetchand asserts the status is gone and the page<h1>is rendered. Red on the base (expected null not to be nullon the status query), green with the change.Coverage Notes
src/app/(dashboard)/dashboard/api-manager/ApiManagerPageClient.tsx: theloadingbranch is now exercised by the new test in both states (pending and settled); the rest of the file is unchanged and keeps its existing coverage fromtests/unit/api-manager-*.test.ts.Reviewer Notes
CardSkeletonitself, that is a wider change across its call sites and the threeloading.tsxpages that already wrap it would end up with nested live regions, so I kept it out of this PR.PENDING-api-manager-skeleton-a11y-status.md; I will rename it to the PR number once assigned.