Skip to content

fix(docs): add ARIA tab semantics to the ASM/SAT spec switcher#60

Open
dmchaledev wants to merge 1 commit into
mainfrom
claude/elegant-edison-6fg901
Open

fix(docs): add ARIA tab semantics to the ASM/SAT spec switcher#60
dmchaledev wants to merge 1 commit into
mainfrom
claude/elegant-edison-6fg901

Conversation

@dmchaledev

Copy link
Copy Markdown
Contributor

Summary

docs/index.html renders two buttons that switch the embedded Redoc viewer between the ASM and SAT OpenAPI specs. They had no ARIA roles or selected-state semantics — a screen reader user tabbing to them would hear two unlabeled buttons with no indication they're a tab pair or which one is currently showing.

This adds the standard ARIA tab pattern:

  • role="tablist" on a wrapper around the two buttons (display: contents so it doesn't affect the existing flex layout)
  • role="tab" + aria-controls="redoc-container" on each button
  • aria-selected toggled between "true"/"false" in the existing activate() handler, kept in sync with the .active CSS class it already manages
  • role="tabpanel" + aria-live="polite" on the Redoc container, so switching specs is announced

No visual or behavioral change — purely additive markup/attributes.

Pre-flight duplicate check

Related issues/PRs

None found.

Testing

  • git diff reviewed — change is confined to docs/index.html markup and the activate() function.
  • Served the page locally (with copies of asm/openapi.yaml/sat/openapi.yaml alongside it, matching what deploy-docs.yml produces) and drove it with Playwright/Chromium:
    • Initial state: #tab-asm has aria-selected="true", #tab-sat has aria-selected="false".
    • After clicking the SAT tab: selection flips correctly (asm=false, sat=true), role="tablist"/"tab"/"tabpanel" all present.
    • Screenshot confirms the nav bar layout is pixel-identical to before (the display: contents wrapper doesn't introduce any visual box).
  • Redoc itself didn't load in the sandboxed test environment (CDN unreachable there), but that's unrelated to this change — the markup/JS under test loads and behaves correctly independent of Redoc's own rendering.

Generated by Claude Code

The nav buttons that toggle between the ASM and SAT Redoc specs had no
role or selected-state semantics, so screen reader users had no way to
tell they were tabs or which spec was currently active. Adds
role="tablist"/"tab"/"tabpanel", aria-controls, and aria-selected
(kept in sync in the existing activate() handler).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RsxuZiC7PrEJ7XkftvUqT
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