Skip to content

feat(atomic-a11y): add browser capture, LLM client, and supporting au…#7188

Draft
y-lakhdar wants to merge 8 commits intofeat/a11y-delta-workflowfrom
feat/a11y-browser-llm
Draft

feat(atomic-a11y): add browser capture, LLM client, and supporting au…#7188
y-lakhdar wants to merge 8 commits intofeat/a11y-delta-workflowfrom
feat/a11y-browser-llm

Conversation

@y-lakhdar
Copy link
Contributor

@y-lakhdar y-lakhdar commented Mar 3, 2026

Context

This is PR 5b — the infrastructure modules that the AI audit orchestrator (5c) depends on.

What this PR does

Browser capture (browser-capture.ts — 355 lines):

  • Playwright-based automation for Storybook components
  • Captures screenshots at multiple viewports (desktop, tablet, mobile)
  • Hover state detection on interactive elements
  • Focus state capture for keyboard navigation audit
  • Text spacing override injection (WCAG 1.4.12)
  • Target size measurement (WCAG 2.5.8)

LLM client (llm-client.ts — 241 lines):

  • OpenAI API wrapper with configurable model/temperature
  • Retry logic with exponential backoff and rate limit handling
  • Response validation and structured JSON parsing
  • Result merging across multiple evaluation calls

Supporting modules:

  • accessibility-tree.ts (77 lines) — A11y tree diffing, pruning, and truncation
  • progress.ts (75 lines) — Progress file save/load/clear for resume capability
  • component-groups.ts (109 lines) — Component grouping logic for batch processing

PR Chain (5b of 7)

# PR Branch Description
1 #7111 feat/a11y-package-scaffold Package scaffolding
2 #7122 feat/a11y-shared-foundation Shared types, constants, utilities
3 #7123 feat/a11y-reporter VitestA11yReporter
4 #7124 feat/a11y-openacr OpenACR report generator
5a #7187 feat/a11y-delta-workflow Shared foundation + delta workflow + issue generator
5b #7188 feat/a11y-browser-llm Browser capture + LLM client modules ← this PR
5c #7189 feat/a11y-audit-orchestrator AI WCAG audit orchestrator + prompts
6 #7126 feat/a11y-reporter-wiring Wire reporter into atomic vitest config
7 #7117 feat/a11y-ci-integration Weekly a11y scan workflow

Replaces #7125 (split into 5a/5b/5c)

KIT-5471

@y-lakhdar y-lakhdar added the a11y Accessibility issues label Mar 3, 2026
@y-lakhdar y-lakhdar temporarily deployed to Prerelease (CDN) March 3, 2026 16:13 — with GitHub Actions Inactive
@y-lakhdar y-lakhdar force-pushed the feat/a11y-browser-llm branch from bb0f142 to f8c310c Compare March 3, 2026 16:34
@y-lakhdar y-lakhdar temporarily deployed to Prerelease (CDN) March 3, 2026 16:39 — with GitHub Actions Inactive
@y-lakhdar y-lakhdar temporarily deployed to Prerelease (CDN) March 3, 2026 16:39 — with GitHub Actions Inactive
…dit modules

Add Playwright-based browser automation for capturing screenshots, hover
states, and target sizes. Add OpenAI client wrapper with retry logic and
rate limiting. Include accessibility tree utilities, progress tracking,
and component grouping modules.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant