-
-
Notifications
You must be signed in to change notification settings - Fork 60
a11y plugin #326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
a11y plugin #326
Changes from all commits
Commits
Show all changes
76 commits
Select commit
Hold shift + click to select a range
3232379
wip: add A11y Devtools plugin with accessibility auditing features
LadyBluenotes 6bf0698
wip: enhance accessibility panel with improved issue handling and UI β¦
LadyBluenotes e52240c
wip: refine issue highlighting to respect threshold settings in accesβ¦
LadyBluenotes 83fb022
wip: implement settings panel for managing accessibility rules and coβ¦
LadyBluenotes c5b1138
wip: add custom accessibility rules for enhanced auditing and issue dβ¦
LadyBluenotes 2e2c405
wip: enhance tooltip positioning logic for better visibility and acceβ¦
LadyBluenotes fc24498
wip: remove live monitoring feature and related configurations
LadyBluenotes bde001a
wip: enhance tooltip functionality to display all issues per element β¦
LadyBluenotes 49e24f4
wip: reorganize plugin registry and update tags for accessibility plugin
LadyBluenotes faa6128
wip: add rootSelector option for scoped accessibility audits and enhaβ¦
LadyBluenotes b15c9f7
wip: implement live monitoring feature with customizable delay and enβ¦
LadyBluenotes ecb4333
ci: apply automated fixes
autofix-ci[bot] 9ec4090
wip: refactor to Solid etcetc using AI
LadyBluenotes 7be0dab
wip: refactor accessibility components and introduce issue filtering β¦
LadyBluenotes 91bda6f
ci: apply automated fixes
autofix-ci[bot] 93bb55c
wip: update type imports for panel styles in accessibility components
LadyBluenotes f048e64
wip: enhance accessibility styles and add runtime tests for overlay fβ¦
LadyBluenotes 6dde33a
fix(a11y): remount panel when devtools calls render with new theme
LadyBluenotes 6858d94
wip: enhance theme handling and update UI components with new design β¦
LadyBluenotes 356c3b7
feat: integrate A11yDevtoolsPanel with lazy loading and enhance buttoβ¦
LadyBluenotes 6154e6e
fix: standardize padding values in use-styles.ts
LadyBluenotes 9534006
feat(a11y): enhance theme handling and add solid support for accessibβ¦
LadyBluenotes 330e433
remove a11y from start example
LadyBluenotes b37cae8
rm preact
LadyBluenotes 50384e4
chore: remove preact support from package.json
LadyBluenotes 5c3eede
chore: remove preact support from package.json
LadyBluenotes b9abd46
fix(a11y): clean up imports and improve theme resolution logic
LadyBluenotes f6dd131
Merge branch 'main' into a11y
LadyBluenotes deb7383
fix test errors
LadyBluenotes d465d90
fix test errors
LadyBluenotes cb2040b
chore: remove optional peer dependencies for preact and vue
LadyBluenotes 9cc4d54
Merge branch 'TanStack:main' into a11y
LadyBluenotes 8c4daeb
chore: big changes
harry-whorlow 782729f
chore: even bigger changes
harry-whorlow 12d177e
ci: apply automated fixes
autofix-ci[bot] 483ae6a
chore: big fix
harry-whorlow 62f7633
chore: some more tweeks
harry-whorlow 22d3d48
chore: add a space
harry-whorlow 8379d43
Merge branch 'main' into a11y
harry-whorlow 8dbd806
fix:package lock and changeset
harry-whorlow e919a9d
fix: test
harry-whorlow 9ee38d3
fix: bunch of fixes
harry-whorlow eb019cf
chore: update befor giving up
harry-whorlow 3dab0c7
fix: even more bug fixes
harry-whorlow 1914a1e
fix: go for launch
harry-whorlow 7688da5
fix: ci errors
harry-whorlow e2a3bd6
fix: the greates bug fixes, nobody fixes bugs like me
harry-whorlow 1b4d8d2
ci: apply automated fixes
autofix-ci[bot] 2518ef8
chore: temp removal of portal
harry-whorlow a319478
ci: apply automated fixes
autofix-ci[bot] 74c76e7
fix(a11y): update default configuration and remove live monitoring opβ¦
LadyBluenotes 94c94fc
Merge branch 'main' into a11y
harry-whorlow f65b9f9
fix: sherif
harry-whorlow ae412b4
feat: solid demo
harry-whorlow 0c20ad2
fix(test & organisation): update docs org and fix sherif
harry-whorlow d19f3d5
fix(color): bump muted2 to contrast of ~4.5
harry-whorlow abde9b0
fix: build core/react/solid subpackages together
lachlancollins 905f647
Merge branch 'main' into a11y
lachlancollins 73d1cc4
Fix sherif
lachlancollins 99c517a
Merge branch 'main' into a11y
lachlancollins 32819ed
Merge branch 'main' into a11y
LadyBluenotes f00d11f
count issues meeting threshold in IssueList
LadyBluenotes cc70f2b
ci: apply automated fixes
autofix-ci[bot] 2a91949
update issue counting and threshold checks in accessibility components
LadyBluenotes c88ac0c
ci: apply automated fixes
autofix-ci[bot] 76378b9
fix: eslint errors
harry-whorlow 46a9c03
Merge remote-tracking branch 'origin/main' into a11y
harry-whorlow 5ace1c8
fix: sherif
harry-whorlow 25a6456
ci: apply automated fixes
autofix-ci[bot] f560f47
Merge remote-tracking branch 'origin/main' into a11y
harry-whorlow 41b3c5d
fix: update to new utils
harry-whorlow 8ac83ca
Merge remote-tracking branch 'origin/main' into a11y
harry-whorlow fab62d7
fix: changeset
harry-whorlow aa11d66
chore: pr comments
harry-whorlow 3172808
fix: knip
harry-whorlow a20fe4a
ci: apply automated fixes
autofix-ci[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| --- | ||
| '@tanstack/solid-devtools': patch | ||
| '@tanstack/devtools-a11y': patch | ||
| '@tanstack/devtools-ui': patch | ||
| '@tanstack/devtools': patch | ||
| --- | ||
|
|
||
| Adds tanstack Devtool plugin. PR also includes some minor patches |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,175 @@ | ||
| --- | ||
| title: Accessibility Plugin | ||
| id: a11y-plugin | ||
| --- | ||
|
|
||
| The TanStack Devtools Accessibility (A11y) Plugin provides real-time accessibility auditing for your web applications, powered by [axe-core](https://github.com/dequelabs/axe-core). It helps you identify and fix accessibility issues during development. | ||
|
|
||
| ## Features | ||
|
|
||
| - **Full Page Scanning** - Audit your entire page for accessibility violations | ||
| - **Component-Level Scanning** - Scope audits to specific components using React hooks | ||
| - **Visual Overlays** - Highlight problematic elements with severity-based colors | ||
| - **Click-to-Navigate** - Click on an issue to automatically scroll to and highlight the element | ||
| - **Dark Mode Support** - Automatically adapts to the devtools theme | ||
| - **Devtools-Aware** - Automatically excludes devtools panels from scanning | ||
| - **Configurable Rule Sets** - Support for WCAG 2.0/2.1/2.2 (A/AA/AAA), Section 508, and best practices | ||
| - **Export Reports** - Download results as JSON or CSV | ||
| - **Persistent Settings** - Configuration saved to localStorage | ||
|
|
||
| ## Installation | ||
|
|
||
| ```bash | ||
| npm install @tanstack/devtools-a11y | ||
| # or | ||
| pnpm add @tanstack/devtools-a11y | ||
| # or | ||
| yarn add @tanstack/devtools-a11y | ||
| ``` | ||
|
|
||
| ## Quick Start (React) | ||
|
|
||
| ```tsx | ||
| import { createRoot } from 'react-dom/client' | ||
| import { TanStackDevtools } from '@tanstack/react-devtools' | ||
| import { a11yDevtoolsPlugin } from '@tanstack/devtools-a11y/react' | ||
|
|
||
| createRoot(document.getElementById('root')!).render( | ||
| <> | ||
| <App /> | ||
| <TanStackDevtools plugins={[a11yDevtoolsPlugin()]} /> | ||
| </>, | ||
| ) | ||
| ``` | ||
|
|
||
| ## Quick Start (Solid) | ||
|
|
||
| ```tsx | ||
| import { render } from 'solid-js/web' | ||
| import { TanStackDevtools } from '@tanstack/solid-devtools' | ||
| import { a11yDevtoolsPlugin } from '@tanstack/devtools-a11y/solid' | ||
|
|
||
| render( | ||
| () => ( | ||
| <> | ||
| <App /> | ||
| <TanStackDevtools plugins={[a11yDevtoolsPlugin()]} /> | ||
| </> | ||
| ), | ||
| document.getElementById('root')!, | ||
| ) | ||
| ``` | ||
|
|
||
| ## Quick Start (Vue) | ||
|
|
||
| ```ts | ||
| import { createA11yDevtoolsVuePlugin } from '@tanstack/devtools-a11y/vue' | ||
|
|
||
| const plugins = [createA11yDevtoolsVuePlugin()] | ||
| ``` | ||
|
|
||
| ## Click-to-Navigate | ||
|
|
||
| When you click on an issue in the panel, the plugin will: | ||
|
|
||
| 1. **Scroll** the problematic element into view (centered in the viewport) | ||
| 2. **Highlight** the element with a pulsing overlay matching its severity color | ||
| 3. **Show a tooltip** with the rule ID and impact level | ||
|
|
||
| This makes it easy to locate and inspect issues directly on the page. | ||
|
|
||
| ## Panel Configuration | ||
|
|
||
| Initial configuration can be provided via the vanilla plugin API: | ||
|
|
||
| ```ts | ||
| import { createA11yPlugin } from '@tanstack/devtools-a11y' | ||
|
|
||
| const plugin = createA11yPlugin({ | ||
| threshold: 'serious', | ||
| ruleSet: 'wcag21aa', | ||
| showOverlays: true, | ||
| persistSettings: true, | ||
| disabledRules: [], | ||
| }) | ||
| ``` | ||
|
|
||
| Common `options` fields: | ||
|
|
||
| - `threshold`: minimum impact level to show | ||
| - `ruleSet`: rule preset (`'wcag2a' | 'wcag2aa' | 'wcag21aa' | 'wcag22aa' | 'section508' | 'best-practice' | 'all'`) | ||
| - `showOverlays`: highlight issues in the page | ||
| - `persistSettings`: store config in localStorage | ||
| - `disabledRules`: rule IDs to ignore | ||
|
|
||
| If you don't need to provide initial configuration, you can use the framework plugin helpers | ||
| directly (the settings UI persists changes to localStorage by default). | ||
|
|
||
| ## Severity Levels | ||
|
|
||
| Issues are categorized by impact level with corresponding overlay colors: | ||
|
|
||
| | Impact | Color | Description | | ||
| |--------|-------|-------------| | ||
| | Critical | Red | Must be fixed - prevents users from accessing content | | ||
| | Serious | Orange | Should be fixed - significantly impacts user experience | | ||
| | Moderate | Yellow | Consider fixing - affects some users | | ||
| | Minor | Blue | Optional improvement - minor impact | | ||
|
|
||
| ## Framework Support | ||
|
|
||
| The panel UI is implemented in Solid and wrapped for React, Solid, Preact, and Vue | ||
| using `@tanstack/devtools-utils`. | ||
|
|
||
| ## Export Formats | ||
|
|
||
| ### JSON Export | ||
|
|
||
| ```ts | ||
| import { exportToJSON } from '@tanstack/devtools-a11y' | ||
|
|
||
| const jsonString = exportToJSON(auditResult) | ||
| ``` | ||
|
|
||
| ### CSV Export | ||
|
|
||
| ```ts | ||
| import { exportToCSV } from '@tanstack/devtools-a11y' | ||
|
|
||
| const csvString = exportToCSV(auditResult) | ||
| ``` | ||
|
|
||
| ## Supported Standards | ||
|
|
||
| The plugin supports the following accessibility standards: | ||
|
|
||
| - **WCAG 2.0** Level A, AA, AAA | ||
| - **WCAG 2.1** Level A, AA, AAA | ||
| - **WCAG 2.2** Level AA | ||
| - **Section 508** | ||
| - **Best Practices** (non-standard recommendations) | ||
|
|
||
| ## Troubleshooting | ||
|
|
||
| ### Issues not appearing | ||
|
|
||
| 1. Check that the element is visible in the viewport | ||
| 2. Ensure the element is not excluded by `excludeSelectors` | ||
| 3. Verify the selected standard includes the relevant rule | ||
|
|
||
| ### Overlays not showing | ||
|
|
||
| 1. Confirm overlays are enabled in the panel settings | ||
| 2. Check for CSS conflicts with `z-index` or `pointer-events` | ||
| 3. Ensure the container element exists in the DOM | ||
|
|
||
| ## Example | ||
|
|
||
| See the full working example at: | ||
| `examples/react/a11y-devtools/` | ||
|
|
||
| Run it with: | ||
| ```bash | ||
| cd examples/react/a11y-devtools | ||
| pnpm dev | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| <!doctype html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="utf-8" /> | ||
| <link rel="icon" type="image/svg+xml" href="/emblem-light.svg" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
| <meta name="theme-color" content="#000000" /> | ||
|
|
||
| <title>A11y Devtools - TanStack Devtools</title> | ||
| </head> | ||
| <body> | ||
| <noscript>You need to enable JavaScript to run this app.</noscript> | ||
| <div id="root"></div> | ||
| <script type="module" src="/src/index.tsx"></script> | ||
| </body> | ||
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| { | ||
| "name": "@tanstack/react-devtools-a11y-example", | ||
| "private": true, | ||
| "type": "module", | ||
| "scripts": { | ||
| "dev": "vite --port=3002", | ||
| "build": "vite build", | ||
| "preview": "vite preview", | ||
| "test:types": "tsc" | ||
| }, | ||
| "dependencies": { | ||
| "@tanstack/devtools-a11y": "workspace:*", | ||
| "@tanstack/react-devtools": "^0.9.13", | ||
| "react": "^19.2.0", | ||
| "react-dom": "^19.2.0" | ||
| }, | ||
| "devDependencies": { | ||
| "@types/react": "^19.2.0", | ||
| "@types/react-dom": "^19.2.0", | ||
| "@vitejs/plugin-react": "^5.0.4", | ||
| "vite": "^7.1.7" | ||
| }, | ||
| "browserslist": { | ||
| "production": [ | ||
| ">0.2%", | ||
| "not dead", | ||
| "not op_mini all" | ||
| ], | ||
| "development": [ | ||
| "last 1 chrome version", | ||
| "last 1 firefox version", | ||
| "last 1 safari version" | ||
| ] | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
π§© Analysis chain
π Script executed:
Repository: TanStack/devtools
Length of output: 302
π Script executed:
Repository: TanStack/devtools
Length of output: 2976
π Script executed:
Repository: TanStack/devtools
Length of output: 553
Remove Vue and Preact quick-start sections; these frameworks are not exported.
The docs present quick-start code for Vue and claim Preact/Vue support, but the package only exports
./core,./react, and./solid. The import path@tanstack/devtools-a11y/vuedoes not exist and will fail. Remove the Vue section (lines 63β69) and update the framework support statement (line 121) to accurately reflect only React and Solid support.π€ Prompt for AI Agents