Skip to content

[codex] Fix audited accessibility issues on website and calculator#955

Merged
MaxGhenis merged 3 commits intocodex/spm-calculator-launchfrom
codex/a11y-policyengine-followups
Apr 13, 2026
Merged

[codex] Fix audited accessibility issues on website and calculator#955
MaxGhenis merged 3 commits intocodex/spm-calculator-launchfrom
codex/a11y-policyengine-followups

Conversation

@MaxGhenis
Copy link
Copy Markdown
Contributor

Summary

  • only render the mobile navigation drawer while it is open so hidden controls drop out of the tab order
  • replace the research filter wrapper/button pattern with a single labeled checkbox control
  • darken the audited website CTA, filter badge, and calculator/report status treatments that were below AA contrast
  • repair the calculator launch page heading hierarchy so feature cards no longer skip levels

Why

The accessibility audit found keyboard-focus leakage, unnamed checkbox semantics, contrast failures, and heading-level skips on the audited website and calculator surfaces.

Impact

Keyboard users no longer tab into hidden menu controls, filter checkboxes are announced with labels, and the audited CTA/status treatments use stronger contrast.

Validation

  • bun run design-system:build
  • bun run --filter=@policyengine/website typecheck
  • bun run --filter=@policyengine/website lint
  • bun run --filter=policyengine-app-v2 typecheck

Refs #951
Refs #952
Refs #953
Refs #954
Builds on #947

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 12, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
policyengine-app-v2 Ready Ready Preview, Comment Apr 13, 2026 10:22am
policyengine-calculator Ready Ready Preview, Comment Apr 13, 2026 10:22am
policyengine-website Ready Ready Preview, Comment Apr 13, 2026 10:22am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
policyengine-calculator-next Skipped Skipped Apr 13, 2026 10:22am

Request Review

Copy link
Copy Markdown

@policyengine policyengine bot left a comment

Choose a reason for hiding this comment

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

This PR successfully addresses all four accessibility issues from the audit:

1. Mobile navigation keyboard trap fix (Header.tsx)
The mobile menu now only renders when open, preventing keyboard users from tabbing into hidden controls. The conditional rendering with {mobileOpen && <MobileMenu ... />} is the right approach. ARIA attributes are correctly set on the toggle button.

2. Research filter checkbox semantics (ResearchClient.tsx)
Excellent fix replacing the wrapper div pattern with proper label/checkbox structure. The checkboxes now have accessible labels via aria-labelledby, and the entire row is a clickable label element - exactly what screen readers need.

3. Contrast improvements
All the color changes move elements to stronger contrast ratios:

  • Filter badges: primary[500] → primary[600]
  • Action button (secondary variant): primary[500] → primary[600]
  • Various status text: gray[400] → gray[500] or gray[600]
  • Ready status icon: primary[500] → primary[600]

These changes meet AA contrast requirements while maintaining the visual hierarchy.

4. Heading hierarchy fix (CalculatorLaunchPage.tsx)
The feature cards now use h2 (order={2}) and the section headings use h3 (order={3}), fixing the heading level skip. This creates the proper document outline without visual changes.

The implementation is clean, focused, and follows accessibility best practices. No bugs or edge cases spotted.

@vercel vercel bot temporarily deployed to Preview – policyengine-calculator-next April 13, 2026 10:21 Inactive
@MaxGhenis MaxGhenis marked this pull request as ready for review April 13, 2026 10:23
@MaxGhenis MaxGhenis merged commit c8c2a44 into codex/spm-calculator-launch Apr 13, 2026
5 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.

1 participant