fix(filesharing): convey required vs optional fields to assistive tech#283
Conversation
The recipient attribute-entry form did not clearly communicate which fields are required or optional to screenreader users. - Email (required): add `aria-required="true"`, a visible red asterisk in the label (hidden from the a11y tree, since the state is conveyed by aria-required), an explanatory "Fields marked with * are required" legend, and `aria-describedby` linking the input to that legend. - Optional attributes (phone number, date of birth, full name): append a muted "(optional)" suffix to each label so the accessible name announces optionality. - Add EN/NL translations and a Playwright a11y regression test. Closes #268 Closes #269 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
Verdict: APPROVE — posted as COMMENT only because GitHub blocks a bot from approving its own PR (
dobby-coder[bot]authored and reviewed). Treat this as a sign-off, not withholding. The PR is being flipped to ready-for-review so a maintainer review can gate the merge.
Rules + review gatekeeper pass — clean.
Per-rule check (one Haiku sub-agent per applicable rule) came back clean: WCAG 2.2 AA (1.3.1 / 3.3.2 / 1.4.1 all satisfied — required state via aria-required not color alone, asterisk aria-hidden, textual legend), conventional-commit PR title, tests-required-on-fixes (3 new Playwright a11y tests), Closes #268/Closes #269 keywords, promised-vs-delivered (diff matches the body claim-for-claim), EN/NL i18n parity, and repo conventions (CSS design tokens, email normalization handled upstream in SendButton). Build + full Playwright suite green (7 passed). The default-prs-to-ready flag was a false-fire — draft is the correct intermediate state for the pipeline and is being lifted now.
One non-blocking nit inline (does not block — see approve-when-ready).
What & why
The recipient attribute-entry form on
/filesharedid not clearly communicate field requirements to screenreader users:This PR makes required/optional state explicit for both sighted and assistive-technology users, in line with the org-wide WCAG 2.2 AA goal (criteria 1.3.1 Info and Relationships, 3.3.2 Labels or Instructions, 1.4.1 Use of Color).
Changes
Required email field (
RecipientSelectionFields.svelte)aria-required="true"(nativerequiredis kept for browser validation).aria-hidden="true"so the required state isn't double-announced (it comes fromaria-required).aria-describedby="required-fields-legend".Required-fields legend (
RecipientSelection.svelte)Optional attributes (
MultiInput.svelte)i18n — added
encryptPanel.requiredFieldsLegendandattributes.optionalkeys in bothen.jsonandnl.json.Tests — added
tests/attribute-form-a11y.test.ts(Playwright) asserting the email'saria-required/asterisk/legend wiring and that optional attribute fields expose(optional)in their accessible name.Verification
npm run check— 0 errors / 0 warningsnpm run build— cleannpx playwright test— 7 passed (3 new a11y tests + existing RSS tests)prettier --check+eslinton changed files — cleanCloses #268
Closes #269