Skip to content

fix(site/src/pages/TemplateBuilder): associate customization errors with their fields - #31644

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

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

Conversation

@jeremyruppel

Copy link
Copy Markdown
Collaborator

On /templates/new/builder?step=customizations, the audit found that Create Template sent an empty organization_id and showed the server error Request body must be valid JSON. invalid UUID length: 0, which names no field (WCAG 3.3.1). #28081 has since added client-side validation, so that request no longer goes out. However, the inline Organization and Description errors were still not programmatically linked to their controls.

Both fields now render through FormField's control prop, as ChatProjectDialog does. FormField sets aria-invalid and aria-describedby and renders the linked error, which matches the step's other fields (Display name, ID, Icon).

Closes DEQ-38

Ticket UI surface Visible change
DEQ-38 Template builder Customizations step (Organization, Description) None (ARIA only). The asterisk moves by less than 1px because FormField separates it with a text space instead of ml-1, matching the other required fields.
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: Filter (DEQ-495), login (DEQ-536), and this one (DEQ-38).
  • Self-review flagged a first version that hand-wired useId and ARIA attributes, because FormField already provides this (RO1/FE3). It was replaced with FormField.
  • The new Vitest test asserts both accessible descriptions and that onCreate is not called. I removed the duplicate onCreate assertion from the MissingOrganizationError story's play function (FE1).
  • Verified with axe-core in MissingOrganizationError and MissingNameError: no violations, and the organization combobox is described by "Select an organization to continue." A pixel diff of MissingOrganizationError against main changes 28 pixels, all on the asterisk.
  • Pre-existing and out of scope, as a follow-up candidate: while the permitted-organizations query is loading or has failed, the Organization field is hidden. In that state, submitting is blocked by the required-org check with no visible error.

🤖 Generated by Coder Agents on behalf of @jeremyruppel.

@linear-code

linear-code Bot commented Nov 2, 2026

Copy link
Copy Markdown

DEQ-38

@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 bb8c0d5. Organization and Description now render through FormField's control prop, so their inline errors get aria-invalid and aria-describedby, and I confirmed both reach the DOM. The reported invalid UUID length: 0 request is already blocked by the required-organization check from #28081, so this closes DEQ-38. No nits. Follow-ups filed (pre-existing): DEQ-614, the builder's duplicate-ID 409 has no Validations and shows only a page-level alert; DEQ-612, Create Template does nothing when the organizations query is loading or has failed.

🤖 Generated by Coder Agents on behalf of @chrifro.

@chrifro
chrifro merged commit 7f9bc09 into main Nov 9, 2026
54 of 55 checks passed
@chrifro
chrifro deleted the a11y/form-error-field-not-identified-3 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 — bb8c0d5f Deployed Nov 9, 2026 by chrifro via cla #252489
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