Topic 4 of 4 · 4 min read
Accessibility and UI states agents skip
Goal: Review agent-built UI for missing states and accessibility failures that a single screenshot hides.
A screenshot shows one state at one size for one kind of user, so agent-built UI needs a deliberate review of everything the screenshot cannot show. Agents copy the happy path they were shown, and the happy path is the part that already looks right.
Check yourself · 1 of 3
Why can a screenshot not prove that a page is accessible?
Why it matters
Real users tab through forms with a keyboard, use screen readers, open the page on a phone, and hit slow networks and empty accounts. If the agent skipped those, the page passes your quick look and fails them.
What to check
- Keyboard. Can you reach every control with Tab, in a sensible order, and see where focus is? Does Escape close a dialog? A clickable
divis a common agent shortcut and cannot be reached by keyboard. - Names and labels. Every input has a visible label tied to it. Icon-only buttons have an accessible name. Images have useful alternative text, or an empty one if decorative.
- Contrast. Text must be readable against its background. WCAG 2.2 sets minimum contrast ratios; check them with a tool rather than by eye.
- Loading, empty and error states. What shows while data loads, when the list is empty, and when the request fails? An error should say what failed and what to do, inside the place where the action happened.
- Sizes. Resize from phone width to wide desktop. Look for text that overflows, buttons that fall off screen and two-column layouts that never stack.
- Long and odd content. A 60-character name, a right-to-left language, a large font setting.
Before and after
- <label for="email">Email</label>
- <input id="email" type="email" />
+ <div class="field" onclick="focusEmail()">
+ <span>Email</span>
+ <input type="email" />
+ </div>
The agent turned a labelled input into a lookalike. Clicking works; screen readers and keyboard users lose the label. Ask for the real label and for pairing back.
What goes wrong
- Only the happy path. The list renders with five rows; with zero rows the page is blank.
- Color-only meaning. Errors shown in red alone are invisible to some users. Add text or an icon.
- Fixed sizes. Widths in pixels break on narrow screens.
- Self-review. Asking the agent "is this accessible?" gets a confident yes. Ask it to run an automated checker and to list each state it handled.
Examples
A review prompt for states
For the OrdersTable change, list the loading, empty, error and long-content cases and where each is handled.
Then run the accessibility checker on /orders and report violations.
The agent has to point to code for each case, which exposes the ones it skipped.
A keyboard pass
Unplug the mouse for two minutes. Tab through the new screen. If you cannot tell where focus is, cannot open the menu, or reach a control that does nothing, send those exact steps back to the agent as the bug report.
Key points
- A single screenshot hides keyboard behavior, screen reader labels, other screen sizes and non-happy states.
- Clickable div elements and lookalike inputs are common agent shortcuts that break keyboard and screen reader use.
- Every data view needs a loading, an empty and an error state, each with a specific message.
- Check contrast with a tool against the WCAG 2.2 requirements rather than by eye.
- Ask for an automated accessibility check and a list of handled states instead of asking whether it is accessible.
Common mistakes
- Approving UI after one desktop screenshot with sample data.
- Using color alone to show an error or a required field.
- Asking the agent whether the page is accessible and trusting the answer.
- Showing a generic "Something went wrong" instead of what failed and what to do next.
Check yourself · 2 of 3
An agent replaces a button with a clickable div. What is the main problem?
Check yourself · 3 of 3
A list view shows five rows in the demo. Which extra check does it most need?
Practice items, not counted towards your mastery.
Start here
- Playwright MCP server (Microsoft) (opens in a new tab)ToolFree
The common way to let an agent drive a real browser and take screenshots.
- Chrome DevTools MCP (opens in a new tab)ToolFree
Gives an agent console, network and performance data from Chrome.
- WCAG 2 Quick Reference (W3C) (opens in a new tab)StandardFree
The accessibility success criteria to check agent-built UI against.
More for this topic
- ARIA Authoring Practices Guide (opens in a new tab)ArticleFree
Shows expected keyboard behavior for dialogs, menus, tabs and other widgets.
- Learn Accessibility (web.dev) (opens in a new tab)CourseFree
A free course on labels, focus, color and testing that you can send to a team.