Skip to content

feat(a11y): rework inspector (routes, dashboard, pins, config) + message→dock navigation#134

Merged
antfu merged 13 commits into
mainfrom
feat/a11y-nuxt-rework
Jul 24, 2026
Merged

feat(a11y): rework inspector (routes, dashboard, pins, config) + message→dock navigation#134
antfu merged 13 commits into
mainfrom
feat/a11y-nuxt-rework

Conversation

@antfubot

@antfubot antfubot commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

Reworks @devframes/plugin-a11y — taking cues from nuxt/a11y — onto the plugin's existing Solid + BroadcastChannel-first architecture, and adds a reusable "click a message to navigate to a dock" capability to the hub + messages plugin.

a11y inspector rework

  • Route-aware tracking — buckets violations by location.pathname, detected framework-neutrally (History-API patch + popstate/hashchange); the agent owns the authoritative route→report map, persisted in sessionStorage, and broadcasts the whole aggregate so the panel is a pure render.
  • Segmented tabs — a Dashboard (totals, severity breakdown, per-route inventory, auto-scan toggle, clear controls) and a Violations tab listing all tracked routes, grouped, active route marked and expanded, with global impact + best-practice filters (empty groups hidden).
  • Pin + numbered highlights — hover previews; clicking a rule pins all its elements, clicking one toggles it; globally-numbered badges drawn in the page; <html>/<body> get a corner notice instead of a viewport ring. Pins clear on route change; defaultHighlight sets the initial state.
  • Constant scanning — DOM MutationObserver plus debounced mouse/keyboard/touch rescans, toggleable (persisted per tab).
  • Broadened axe scope — WCAG 2.0–2.2 A/AA + best-practice, best-practice tagged and filterable.
  • Console logging — newly-appeared violations logged (deduped).
  • ConfigurablecreateA11yDevframe({ autoScan, logIssues, defaultHighlight, axe }) flows through get-config to the panel, which forwards the runtime slice to the agent over the channel (agent stays RPC-free).

Message → dock navigation

  • Adds an optional actions field to DevframeMessageEntry (a discriminated union; activate implemented) built on the existing hub:docks:activate primitive.
  • The messages panel renders actions in the detail pane, only when a hub docks-activate capability is present (no dead buttons standalone).
  • Each mirrored a11y feed entry carries an action deep-linked to its rule + route (summary → Dashboard); the a11y panel honours the activation, focuses the tab, expands + scrolls the card, and pins the offending elements in the page.

Verification

pnpm lint, pnpm typecheck (19/19), pnpm build, and the affected test suites (a11y, messages, hub, API-export snapshots) all pass. New Storybook stories cover the Dashboard and grouped Violations; new vitest coverage for the route/config/protocol logic and the navigation actions.

This PR was created with the help of an agent.

Example playground (examples/a11y-messages-playground)

Adds a focused hub example that pairs the a11y + messages plugins over an intentionally-broken, multi-route app under test, so the whole rework — live scanning, per-route tracking, pin/highlight, and message→dock navigation — can be exercised end to end. Mirrors the minimal-vite-devframe-hub host shape, trimmed to the two plugins; run with pnpm --filter a11y-messages-playground dev.

antfubot added 2 commits July 24, 2026 05:17
Add an optional `actions` field to `DevframeMessageEntry` (a discriminated
union, `activate` implemented) so a message can request the viewer switch its
focused dock, deep-linking via the existing `hub:docks:activate` primitive. The
messages panel renders the actions in the detail pane and only when a hub
docks-activate capability is present, so standalone panels show no dead buttons.

Co-authored-with an agent.
…nfig

Rework the a11y inspector to track violations per route, present them through a
Dashboard + grouped Violations tab, and highlight with a preview ring plus
pinned, numbered badges (root-element targets get a corner notice). The agent
detects routes framework-neutrally (History-API patch + popstate/hashchange),
persists its route→report map in sessionStorage, broadens the axe tag set to
WCAG 2.0–2.2 + best-practice (tagged and filterable), adds interaction-driven
auto-scan, and logs newly-appeared violations to the console.

Author options (auto-scan, logging, default-highlight, axe tags/options) flow
through `get-config` to the panel, which forwards the runtime slice to the agent
over the BroadcastChannel. Each mirrored messages-feed entry carries a
navigation action back to the deep-linked rule/route, and the panel honours dock
activations from other docks.

Co-authored-with an agent.
@netlify

netlify Bot commented Jul 24, 2026

Copy link
Copy Markdown

Deploy Preview for devfra ready!

Name Link
🔨 Latest commit 427bd15
🔍 Latest deploy log https://app.netlify.com/projects/devfra/deploys/6a634248f867e600084fe08f
😎 Deploy Preview https://deploy-preview-134--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 and others added 11 commits July 24, 2026 05:49
Add a focused hub example that pairs the a11y and messages plugins over an
intentionally-broken, multi-route app under test. It exercises live axe
scanning, per-route tracking (History-API navigation), pin/highlight, and the
message→dock navigation feature end to end: a11y scan messages carry actions
that activate the a11y dock deep-linked to the offending rule + route.

Mirrors the minimal-vite-devframe-hub host shape, trimmed to the two plugins.

Co-authored-with an agent.
- Collapse the Dashboard/Violations tabs into one scrolling page: a sticky
  summary band (severity chips + counts + auto-scan/best-practice/clear
  controls) over the grouped, per-route violation list.
- Tighten the violation rows, chips, and group headers for a denser list.
- Fix icon rendering: pair every icon with a companion utility class (and mark
  it aria-hidden), matching how @antfu/design renders icons — a bare
  single-class `i-ph-*` span isn't extracted by UnoCSS, so Rescan/pin/clear
  icons were blank.
- Show the messages-feed entries under a short `a11y` category instead of the
  `devframes_plugin_a11y` dock id.

Co-authored-with an agent.
- Highlighting is now driven by selecting a violation (a checkbox on each rule
  card) rather than clicking inner elements. Selected cards get a distinct
  visual state and draw globally-numbered badges over all their elements.
- Add a 'Generate fix prompts' nav button that opens an accessible dialog with
  a single paste-ready AI prompt gathering the selected violations' context —
  rule metadata, WCAG tags, docs, and each element's selector/markup/failure
  summary, grouped by route — with a copy button.

Co-authored-with an agent.
- Use i-ph-person-simple-circle-duotone as the single a11y icon everywhere
  (dock definition, panel brand, and the playground rail/header).
- Hovering (or focusing) a summary severity chip now previews every element of
  that impact in the page, restoring the selection highlight on leave.

Co-authored-with an agent.
Resolve the messages-plugin refactor (main split App.vue/MessagesView.vue into
MessageList/MessageDetail/MessageFilterBar + useMessageFilters and removed
src/types.ts): re-apply the message->dock navigation onto the new components —
canActivate probe + onActivate in App.vue, threaded through MessagesView to the
new MessageDetail, which renders the action buttons. Types now come from
@devframes/hub/types. Regenerate the tsnapi API snapshots against the merged
build.
- Split the multi-component files (header/violations/icons/summary/fix-prompts)
  into one component per file: Header, MetaLine, Summary, SummaryBar, Switch,
  EmptyState, ViolationRow, RouteGroup, ViolationList, FixPromptsDialog. Shared
  view types + helpers move to lib/violation-view.ts.
- Replace the ~920-line bespoke styles.css with UnoCSS utilities built on
  @antfu/design semantic tokens (bg-base/color-muted/border-base/…). The one
  domain color (WCAG severity) rides an inline --impact CSS var consumed by
  arbitrary-value utilities. styles.css now only carries the root reset,
  scrollbar, and reduced-motion guard.
- Add a Storybook story for every component.

Co-authored-with an agent.
Add selection controls to the summary bar: a Select all / Unselect all toggle
(over the currently-visible, filtered violations) and a Clear selection action
(clears the whole selection, including any hidden by the filter) with a live
count. Selecting drives the in-page highlight + the fix-prompt set as before.

Co-authored-with an agent.
Replace the select-all/unselect-all toggle with three distinct actions:
Select all (visible), Invert (flip each visible violation's selected state),
and Clear selection.
@antfu
antfu merged commit db15526 into main Jul 24, 2026
11 of 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