Skip to content

feat(plugins): add a11y inspector plugin#44

Merged
antfu merged 3 commits into
devframes:mainfrom
antfubot:feat/a11y-inspector-plugin
Jun 24, 2026
Merged

feat(plugins): add a11y inspector plugin#44
antfu merged 3 commits into
devframes:mainfrom
antfubot:feat/a11y-inspector-plugin

Conversation

@antfubot

@antfubot antfubot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

What

A new first-party devframe plugin under plugins/a11yA11y Inspector — that audits a host application for accessibility issues:

  • axe-core scans the live page and reports WCAG A/AA violations.
  • A Solid SPA panel lists them grouped by severity (critical / serious / moderate / minor), each rule expandable to its offending nodes with selectors and fix guidance.
  • Hovering a warning highlights the offending element in the page via an injected agent — drawing a focus ring and scrolling it into view when off-screen. Keyboard focus does the same.

How it stays mode-agnostic

devframe deliberately exposes no access to the host app's DOM, so the plugin ships its own bridge:

  • an agent (src/inject) loaded into the host page (axe scan + highlight overlay),
  • the panel (src/client) in the devtools iframe,
  • a node side (get-config RPC) for the impact taxonomy.

The agent and panel communicate over a same-origin BroadcastChannel, not the devframe backend — so the scan + highlight loop works identically whether the plugin runs as a dev server (WebSocket RPC) or a baked static build. get-config is a static RPC, resolving live in dev and from the baked dump in a build. A same-origin demo (demo/) exercises both modes against an intentionally-broken page with a docked panel.

Note on the framework

The request was for SolidStart. SolidStart runs on Vinxi, which pins Vite 6, conflicting with this Vite-8 monorepo (and the shared source-alias map) and making the relative-base, mount-portable SPA output devframe expects hard to produce. vite-plugin-solid supports Vite 8 cleanly, so the panel is built with Solid + Vite — the same Solid component code, without the incompatible toolchain wrapper. This was confirmed with the requester before implementing.

Verification

  • dev-server test: serves the SPA + connection meta, answers get-config over WebSocket RPC.
  • static-build test: relative-asset SPA copy, backend: static meta, get-config baked into the RPC dump.
  • Manually verified in a browser in both dev and static modes: list renders, hover highlights the element (incl. off-screen scroll), expand shows node detail.

Catalog deps added: solid-js, axe-core (frontend), vite-plugin-solid (build). Wired into turbo.json and the vitest projects list.


This PR was created with the help of an agent.

@netlify

netlify Bot commented Jun 22, 2026

Copy link
Copy Markdown

Deploy Preview for devfra ready!

Name Link
🔨 Latest commit f17c1da
🔍 Latest deploy log https://app.netlify.com/projects/devfra/deploys/6a3b5bfd1607790008108f45
😎 Deploy Preview https://deploy-preview-44--devfra.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@antfubot antfubot changed the title feat(examples): add a11y inspector plugin feat(plugins): add a11y inspector plugin Jun 22, 2026
@antfubot antfubot force-pushed the feat/a11y-inspector-plugin branch from bcf4e99 to f973b3c Compare June 24, 2026 02:12
antfubot added 2 commits June 24, 2026 02:18
A devframe example that audits a host application for accessibility
issues. axe-core scans the live page, a Solid SPA lists the WCAG A/AA
violations grouped by severity, and hovering a warning highlights the
offending element in the page (scrolling it into view when off-screen).

The injected agent (host page) and the panel (devtools iframe) talk over
a same-origin BroadcastChannel rather than the devframe backend, so the
scan + highlight loop behaves identically whether the plugin runs as a
dev server (WebSocket RPC) or a baked static build. The get-config RPC
carries the impact taxonomy — live in dev, from the baked dump in a build.

Ships a same-origin demo (intentional a11y bugs + docked panel) for both
modes, plus dev-server and static-build tests.
Reclassify the accessibility inspector as a first-party plugin: relocate
it from examples/a11y-inspector to plugins/a11y, add a plugins/* workspace
glob, and rename the package to @devframes/a11y. Updates the turbo tasks,
the vitest project entry, and the in-tree path references to match.
@antfubot antfubot force-pushed the feat/a11y-inspector-plugin branch from f973b3c to 75b7649 Compare June 24, 2026 02:20
@antfu antfu merged commit cd7e199 into devframes:main Jun 24, 2026
12 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.

2 participants