Improve form accessibility by linking errors to fields
Description
The quote, new-pair, and webhooks forms render error text in a standalone role="alert" paragraph that is not programmatically tied to the input that failed — e.g. src/app/quote/page.tsx and src/app/pairs/new/page.tsx use bare <label>/<input> with a separate error node. Screen-reader users cannot tell which field is invalid. The repo already has an accessible src/components/TextField.tsx that wires aria-invalid/aria-describedby correctly; this issue brings the forms up to that standard.
Requirements and context
- Repository scope: StableRoute-Org/Stableroute-frontend only.
- Refactor the quote and new-pair inputs to use
TextField, passing the error prop so aria-invalid and aria-describedby are set on the failing input.
- Move focus to the first invalid field on a failed submit so keyboard/AT users land on the error.
- Keep the existing validation rules and
role="alert" semantics (now field-scoped where appropriate).
- Apply the same pattern to the webhooks URL/events inputs in
src/app/webhooks/page.tsx.
Suggested execution
- Fork the repo and create a branch
git checkout -b a11y/forms-30-field-error-association
- Implement changes
- Test and commit
Test and commit
- Run
npm run lint, npm test, and npm run build.
- Cover edge cases: single invalid field, multiple invalid, valid submit clears
aria-invalid, and focus lands correctly.
- Include the full
npm test output and a11y notes in the PR description.
Example commit message
a11y: associate form validation errors with fields via aria attributes
Guidelines
- Minimum 95 percent test coverage for impacted modules.
- Clear, reviewer-focused documentation.
- Timeframe: 96 hours.
Community & contribution rewards
- 💬 Join the StableRoute community on Discord for questions, reviews, and faster merges: https://discord.gg/37aCpusvx
- ⭐ This is a GrantFox OSS / Official Campaign task and may be rewarded. When your PR is merged you'll be prompted to rate the project — if this issue and the maintainers helped you ship, we'd be grateful for a 5-star rating. Clear questions in Discord and tidy, well-tested PRs are the fastest path to a merge and a reward.
Improve form accessibility by linking errors to fields
Description
The quote, new-pair, and webhooks forms render error text in a standalone
role="alert"paragraph that is not programmatically tied to the input that failed — e.g.src/app/quote/page.tsxandsrc/app/pairs/new/page.tsxuse bare<label>/<input>with a separate error node. Screen-reader users cannot tell which field is invalid. The repo already has an accessiblesrc/components/TextField.tsxthat wiresaria-invalid/aria-describedbycorrectly; this issue brings the forms up to that standard.Requirements and context
TextField, passing theerrorprop soaria-invalidandaria-describedbyare set on the failing input.role="alert"semantics (now field-scoped where appropriate).src/app/webhooks/page.tsx.Suggested execution
git checkout -b a11y/forms-30-field-error-associationsrc/app/quote/page.tsx,src/app/pairs/new/page.tsx,src/app/webhooks/page.tsxusingsrc/components/TextField.tsx.src/app/quote/page.test.tsxand add page tests assertingaria-invalidandaria-describedbylinkage.README.md.Test and commit
npm run lint,npm test, andnpm run build.aria-invalid, and focus lands correctly.npm testoutput and a11y notes in the PR description.Example commit message
a11y: associate form validation errors with fields via aria attributesGuidelines
Community & contribution rewards