Skip to content

fix: preserve SSG styles and accessible names - #33

Merged
smiggleworth merged 2 commits into
mainfrom
fix/ssg-styles-accessibility
Aug 1, 2026
Merged

fix: preserve SSG styles and accessible names#33
smiggleworth merged 2 commits into
mainfrom
fix/ssg-styles-accessibility

Conversation

@smiggleworth

@smiggleworth smiggleworth commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • emit the initial theme style registry during static generation
  • verify every generated route has exactly one nonempty registry and rules for every generated class
  • hide the visual keyboard shortcut from the search button accessible name
  • give the footer root destination the distinct accessible name Home

TDD evidence

  • red: semantic tests exposed both accessible-name collisions and raw static output lacked the initial style registry
  • red: review coverage exposed that a route with no generated classes could bypass the registry requirement
  • green: npm run check passed with 24 tests, a 340-route build, full static verification, and 33,343 API anchors
  • browser QA passed on desktop and mobile with no console errors, no layout shift, working search interactions, and Lighthouse accessibility 1.00

Closes #31
Closes #32

Copilot AI review requested due to automatic review settings August 1, 2026 10:44

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses two regressions introduced after upgrading Askr packages: missing theme-generated CSS in statically generated HTML (causing potential CLS/FOUC) and accessibility issues from conflicting or ambiguous accessible names.

Changes:

  • Wrap the SSG document renderer with withThemeStyles so the initial generated style registry is emitted during static generation.
  • Extend static output verification to assert presence/consistency of the generated-style registry and per-class rules.
  • Adjust accessible names by hiding the search shortcut from the accessibility tree and renaming the footer root link to “Home”, with regression tests.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
ssg.config.ts Wraps SSG document rendering with withThemeStyles to serialize initial theme styles into generated HTML.
scripts/verify-static-output.ts Adds verification for generated ak-style-* usage vs. presence/contents of the style registry in built HTML.
src/pages/docs/search.tsx Hides the visual shortcut <kbd> from the accessibility tree while keeping the button’s accessible name stable.
src/pages/site-footer.tsx Renames the root destination link text from “Overview” to “Home” to avoid identical-link ambiguity.
tests/accessibility-contract.test.tsx Adds semantic regression tests for the search trigger labeling and footer home link text.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scripts/verify-static-output.ts Outdated
Comment thread tests/accessibility-contract.test.tsx
@smiggleworth
smiggleworth merged commit 6b3b744 into main Aug 1, 2026
1 check passed
@smiggleworth
smiggleworth deleted the fix/ssg-styles-accessibility branch August 1, 2026 11:06
smiggleworth added a commit that referenced this pull request Aug 1, 2026
* fix: preserve SSG styles and accessible names

* fix: enforce static style registry contract
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.

fix: align docs search and repeated link accessible names fix: serialize generated theme styles into SSG documents

2 participants