Skip to content

fix(accessibility): give the loading region a role so its label is exposed - #725

Merged
addyosmani merged 1 commit into
addyosmani:mainfrom
rudycelekli:fix/a11y-busy-role-20261023-01
Oct 29, 2026
Merged

addyosmani merged 1 commit into
addyosmani:mainfrom
rudycelekli:fix/a11y-busy-role-20261023-01

Conversation

@rudycelekli

Copy link
Copy Markdown
Contributor

The loading skeleton in frontend-ui-engineering and the "Loading states" example in references/accessibility-checklist.md both put aria-label="Loading tasks" on a plain <div>. ARIA 1.2 prohibits naming an element with no role (a div is generic), so assistive tech drops the label and "Loading tasks" is never announced. The skeleton is exactly the case an agent copies when it follows the skill's "skeleton loading" advice.

Trigger: run axe on the example as written.

skill:     <div class="space-y-3" aria-busy="true" aria-label="Loading tasks">
  violation: aria-prohibited-attr: aria-label attribute cannot be used on "div" elements with no valid role attribute.
checklist: <div aria-busy="true" aria-label="Loading tasks">
  needs review: aria-prohibited-attr

(The checklist copy has child text in my harness, so axe reports it as "needs review" rather than a hard violation; it is the same markup problem.)

Fix: add role="status" to both. status allows an author-supplied name, and it is the polite live region the checklist already recommends for status messages, so the region is announced when loading ends.

Verification:

  • Script that extracts both snippets from the repo files, loads them into jsdom and runs axe-core 4.x (wcag2a, wcag2aa, best-practice). On main: exits 1 with the output above. With this change: no violations, nothing to review, exit 0. I reverted the change once and watched it fail again.
  • node scripts/validate-skills.js, validate-versions.js, validate-reference-links.js, validate-commands.js, validate-artifact-paths.js: pass.
  • node --test on the seven test files CI runs: pass. bash hooks/session-start-test.sh: pass.
  • node scripts/run-evals.js --min-rank1 95: 143 checks passed, rank-1 91/91.

No description or trigger text changed.

…posed

Co-authored-by: Cursor <cursoragent@cursor.com>

@addyosmani addyosmani left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

praise: a div can't be named without a role, so the loading label was never exposed to assistive tech. role="status" is the right fix. Merging.

@addyosmani
addyosmani merged commit 2ba5de2 into addyosmani:main Oct 29, 2026
7 checks passed
hillemacher pushed a commit to hillemacher/agent-skills that referenced this pull request Dec 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants