Skip to content

feat(examples): add a11y inspector plugin#3

Closed
antfubot wants to merge 1 commit into
mainfrom
feat/a11y-inspector-plugin
Closed

feat(examples): add a11y inspector plugin#3
antfubot wants to merge 1 commit into
mainfrom
feat/a11y-inspector-plugin

Conversation

@antfubot

Copy link
Copy Markdown
Owner

What

A new devframe example — A11y 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.

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.
@antfubot

Copy link
Copy Markdown
Owner Author

Superseded by devframes#44 (opened against upstream instead). Closing.

@antfubot antfubot closed this Jun 22, 2026
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