Connect form errors to their fields (accessibility)

Open
#140 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
55/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
react, typescript

Research direction

Start with apps/web/src/components/AuthForm.tsx, which already links hints with aria-describedby, and use it as the pattern. Then audit ContactPage.tsx, ReportForm.tsx and AvatarEditor.tsx for error messages that lack ids or field links. Done means each error is tied to its field, focus moves to the first invalid field after a failed submit, and the change passes npm run typecheck and npm test with the screen reader named in the PR.

Written by the indexing model from the issue text.

Description

accessibility good first issue web

Difficulty: Beginner to Intermediate · Estimated size: half a day

Context

AuthForm.tsx already links hints with aria-describedby. Error messages in other forms (contact, reports, profile editor, composer) may not be linked to their fields.

Problem or goal

Screen readers should read the error when the invalid field gets focus, and focus should go to the first error after a failed submit.

Suggested approach

  • Audit each form. For every error message add an id, set aria-invalid="true" on the field and point aria-describedby at the error.
  • On a failed submit, move focus to the first invalid field.
  • Errors from the server should use role="alert".

Where to look

  • apps/web/src/components/AuthForm.tsx
  • apps/web/src/pages/ContactPage.tsx
  • apps/web/src/components/ReportForm.tsx
  • apps/web/src/components/AvatarEditor.tsx

Acceptance criteria

  • Tested with a screen reader (say which in the PR).
  • No duplicate announcements.
  • Visual design is unchanged.

How to work on it

  1. Comment here to claim it, so two people do not do the same work.
  2. Fork the repo and branch from main (feat/short-name or fix/short-name). Setup steps are in docs/DEVELOPMENT.md.
  3. Keep the change focused and add tests for backend logic.
  4. Run npm run typecheck, npm test and npm run lint and npm run format before opening the pull request.
  5. Use a Conventional Commits title (for example feat(web): add bookmarks). More in CONTRIBUTING.md.

Stuck? Ask in this issue. Questions are welcome.


Generated by Claude Code

Dominant language
TypeScript
Stars
6
Forks
6
Avg merge
1h 59m
Merged PRs (30d)
59

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Haseeb-MernStack/commune

All issues in Haseeb-MernStack/commune

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.