Skip to content

Improve accessibility with semantic HTML and ARIA updates#2195

Open
Nakshatra480 wants to merge 11 commits intojson-schema-org:mainfrom
Nakshatra480:feature/accessibility-fixes-issue-2167
Open

Improve accessibility with semantic HTML and ARIA updates#2195
Nakshatra480 wants to merge 11 commits intojson-schema-org:mainfrom
Nakshatra480:feature/accessibility-fixes-issue-2167

Conversation

@Nakshatra480
Copy link

@Nakshatra480 Nakshatra480 commented Feb 2, 2026

What kind of change does this PR introduce?

Accessibility improvement / Bug fix

Issue Number:

Screenshots/videos:

N/A - This PR focuses on semantic HTML and ARIA attribute improvements which don't change visual appearance.

If relevant, did you update the documentation?

N/A - No documentation updates required.

Summary

This PR addresses several accessibility gaps to improve keyboard navigation and screen reader support. The primary focus was replacing non-semantic interactive elements (like divs with onClick) with proper <button> elements and ensuring all form inputs have accessible labels.

Changes

  • Semantic HTML: Replaced div elements with <button> tags in DarkModeToggle, TabsGroup, Layout (mobile menu), Accordion, and the homepage search trigger to ensure native keyboard focus and activation.
  • ARIA Enhancements:
    • Added role="tablist", role="tab", and role="tabpanel" to TabsGroup for correct screen reader announcements.
    • Added aria-label to the SearchBar input.
    • Marked decorative visual elements in the Table of Contents with aria-hidden="true".
  • Headlines: Updated Headlines.tsx to wrap heading text in anchor tags rather than placing click listeners on the heading element itself, preserving better semantic structure.
  • Forms: Fixed accessibility for radio buttons in DocsHelp.

Does this PR introduce a breaking change?

No

Checklist

@Nakshatra480 Nakshatra480 requested a review from a team as a code owner February 2, 2026 10:37
@github-project-automation github-project-automation bot moved this to Ready to review in PR - Triage Group Feb 2, 2026
@github-actions
Copy link

github-actions bot commented Feb 2, 2026

Hi @Nakshatra480! Thanks a lot for your contribution!

I noticed that the following required information is missing or incomplete: kind of change description

Please update the PR description to include this information. You can find placeholders in the PR template for these items.

Thanks a lot!

@github-actions
Copy link

github-actions bot commented Feb 2, 2026

built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
website ✅ Ready (View Log) Visit Preview ef31e62

@github-actions
Copy link

github-actions bot commented Feb 2, 2026

Hi @Nakshatra480! Thanks a lot for your contribution!

I noticed that the following required information is missing or incomplete: kind of change description

Please update the PR description to include this information. You can find placeholders in the PR template for these items.

Thanks a lot!

@github-actions
Copy link

github-actions bot commented Feb 2, 2026

Hi @Nakshatra480! Thanks a lot for your contribution!

I noticed that the following required information is missing or incomplete: kind of change description

Please update the PR description to include this information. You can find placeholders in the PR template for these items.

Thanks a lot!

@github-actions
Copy link

github-actions bot commented Feb 2, 2026

Hi @Nakshatra480! Thanks a lot for your contribution!

I noticed that the following required information is missing or incomplete: kind of change description

Please update the PR description to include this information. You can find placeholders in the PR template for these items.

Thanks a lot!

@github-actions
Copy link

github-actions bot commented Feb 2, 2026

Hi @Nakshatra480! Thanks a lot for your contribution!

I noticed that the following required information is missing or incomplete: kind of change description

Please update the PR description to include this information. You can find placeholders in the PR template for these items.

Thanks a lot!

@github-actions
Copy link

github-actions bot commented Feb 2, 2026

Hi @Nakshatra480! Thanks a lot for your contribution!

I noticed that the following required information is missing or incomplete: kind of change description

Please update the PR description to include this information. You can find placeholders in the PR template for these items.

Thanks a lot!

@github-actions
Copy link

github-actions bot commented Feb 2, 2026

Hi @Nakshatra480! Thanks a lot for your contribution!

I noticed that the following required information is missing or incomplete: kind of change description

Please update the PR description to include this information. You can find placeholders in the PR template for these items.

Thanks a lot!

Fixes formatting issues in Cypress component test files that were
causing CI lint checks to fail.

Signed-off-by: Nakshatra Sharma <sharma.cs.snu@gmail.com>
@github-actions
Copy link

github-actions bot commented Feb 2, 2026

Hi @Nakshatra480! Thanks a lot for your contribution!

I noticed that the following required information is missing or incomplete: kind of change description

Please update the PR description to include this information. You can find placeholders in the PR template for these items.

Thanks a lot!

Removes test files that were added but are not essential to the
accessibility fix in issue json-schema-org#2167:
- GettingStarted.cy.tsx
- StyledMarkdown.cy.tsx
- TableOfContentMarkdown.cy.tsx
- TabsGroup.cy.tsx
- Collapsible.cy.tsx

These tests caused CI failures and are not part of the core
accessibility improvements (semantic HTML, ARIA attributes).

Signed-off-by: Nakshatra Sharma <sharma.cs.snu@gmail.com>
Updates failing Accordion tests to match actual component implementation:
- Changed hover class check from 'hover:text-lg' to 'group-hover:text-blue-600'
- Updated open state assertion to check 'transition-colors' and 'text-lg'
- Updated closed state assertion to check 'font-medium' base class

The original tests were checking for CSS classes that don't exist or are
applied conditionally in ways that weren't being detected correctly.

Signed-off-by: Nakshatra Sharma <sharma.cs.snu@gmail.com>
Removes unreliable CSS class assertions that fail due to Tailwind's
dynamic class merging. Tests now verify:
- Open state: answer visibility + icon shows '×'
- Closed state: answer not visible + icon shows '+'

These checks are reliable and test the actual user-visible behavior.

Signed-off-by: Nakshatra Sharma <sharma.cs.snu@gmail.com>
@Nakshatra480
Copy link
Author

Hi @AgniveshChaubey just a quick reminder, pls review this PR...
thanks for your time

@Nakshatra480
Copy link
Author

ping @AgniveshChaubey

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Ready to review

Development

Successfully merging this pull request may close these issues.

🐛 Bug: Accessibility: Semantic HTML & ARIA Usage

1 participant