Skip to content

fix(site/src/components): associate Filter validation error with search box - #31642

Merged
chrifro merged 1 commit into
mainfrom
a11y/form-error-field-not-identified
Nov 9, 2026
Merged

chrifro merged 1 commit into
mainfrom
a11y/form-error-field-not-identified

Conversation

@jeremyruppel

Copy link
Copy Markdown
Collaborator

The shared Filter renders API validation errors (for example Query param "resource_type" has invalid value) under its search box, but the message was not programmatically linked to the "Filter" textbox, so screen readers could not tell which field was in error (WCAG 3.3.1).

The error span now gets a useId id, and the search box references it with aria-describedby. SearchField gains an aria-describedby prop, which it forwards to the input. This covers every page that uses Filter (audit log, users, workspaces, templates, and so on).

Closes DEQ-495

Ticket UI surface Visible change
DEQ-495 Filter search box (reported on /audit) None (ARIA only)
Grouping and decision log
  • Batch form-error-field-not-identified has three tickets with three separate root causes, so it ships as three independent PRs: this one (DEQ-495, Filter), login password validation (DEQ-536), and template builder customizations (DEQ-38).
  • I used aria-describedby rather than aria-errormessage. The message renders whenever error is set, but aria-invalid is set only for API validation errors, and aria-errormessage is ignored unless aria-invalid="true". This matches FormField.
  • aria-describedby uses the same hasError(error) condition as the span it points at, so it never references a missing id.
  • Verified with axe-core in Storybook (pages/UsersPageView/WithError): the textbox is now described by the error text and the branch adds no violations. The heading-order (moderate) violation in that story also appears on main.
  • Pre-existing and out of scope, as follow-up candidates:
    • The error span is not a live region, so it is not announced when it appears after the debounced refetch (WCAG 4.1.3).
    • For non-validation errors the span renders empty.

🤖 Generated by Coder Agents on behalf of @jeremyruppel.

@linear-code

linear-code Bot commented Nov 2, 2026

Copy link
Copy Markdown

DEQ-495

@jeremyruppel
jeremyruppel marked this pull request as ready for review November 2, 2026 20:53

@chrifro chrifro left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean at 29a24ca. The Filter's validation error span now has a useId id that the "Filter" search box references through SearchField's new aria-describedby prop. This fixes DEQ-495 for /audit and every other page that uses Filter, and the new Vitest test checks the accessible description. No nits. Follow-up filed (pre-existing): DEQ-613, the Filter shows an empty error span for non-validation API errors and doesn't announce new errors.

🤖 Generated by Coder Agents on behalf of @chrifro.

@chrifro
chrifro merged commit 39f5514 into main Nov 9, 2026
54 of 55 checks passed
@chrifro
chrifro deleted the a11y/form-error-field-not-identified branch November 9, 2026 13:08
@chrifro
chrifro temporarily deployed to main November 9, 2026 13:08 — with GitHub Actions Inactive
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 9, 2026

This branch was previously deployed

1 inactive deployment
main — 29a24cac Deployed Nov 9, 2026 by chrifro via cla #252488
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants