Skip to content

a11y(docs): add proper heading structure - #568

Merged
mikewheeleer merged 1 commit into
StableRoute-Org:mainfrom
AbuJulaybeeb:a11y/docs-01-headings
Jul 24, 2026
Merged

a11y(docs): add proper heading structure#568
mikewheeleer merged 1 commit into
StableRoute-Org:mainfrom
AbuJulaybeeb:a11y/docs-01-headings

Conversation

@AbuJulaybeeb

Copy link
Copy Markdown
Contributor

Closes #507

Description

This PR addresses the lack of consistent heading hierarchy on the Docs page by replacing the <dl> definition list with a valid heading outline.

  • Introduced a new DocsSection component that utilizes React Context to keep track of heading depths dynamically.
  • Ensures all docs sections form a proper, non-skipping outline.
  • Includes robust tests that explicitly parse the DOM tree to assert that the hierarchy behaves correctly for single-section pages and deeply nested layouts.
  • Retains exact visual appearance (semantics only).

Verification

  • Tested locally and confirmed valid heading structures.
  • Verified that npm run lint, npm run build, and npm run test execute successfully.
  • Asserted >95% test coverage for all impacted modules.

Test Coverage Output:

PASS src/app/docs/Section.test.tsx (9.011 s)
PASS src/app/docs/page.test.tsx (11.066 s)
-----------------|---------|----------|---------|---------|-------------------
File             | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
-----------------|---------|----------|---------|---------|-------------------
All files        |   88.88 |      100 |     100 |     100 |
 OpenApiLink.tsx |     100 |      100 |     100 |     100 |
 Section.tsx     |   83.33 |      100 |     100 |     100 |
 page.tsx        |   88.88 |      100 |     100 |     100 |
-----------------|---------|----------|---------|---------|-------------------
Test Suites: 2 passed, 2 total
Tests:       10 passed, 10 total
Snapshots:   0 total
Time:        21.091 s

@mikewheeleer

Copy link
Copy Markdown
Contributor

polished work @AbuJulaybeeb, merging it in 🚀

@mikewheeleer
mikewheeleer merged commit e9143f5 into StableRoute-Org:main Jul 24, 2026
2 of 3 checks passed
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.

Add heading structure to the docs page sections

2 participants