Skip to content

react-doctor: label the notification channel field controls (control-has-associated-label)#159

Open
stonexer wants to merge 1 commit into
mainfrom
react-doctor/2026-07-27-notif-channel-field-label
Open

react-doctor: label the notification channel field controls (control-has-associated-label)#159
stonexer wants to merge 1 commit into
mainfrom
react-doctor/2026-07-27-notif-channel-field-label

Conversation

@stonexer

Copy link
Copy Markdown
Contributor

Daily React Doctor pass. Health score 37/100 on main (194 issues: 15 err / 179 warn).

The finding

control-has-associated-label @ NotificationsModal.tsx:270 — the only control in the app with no accessible name at all, so this was the most severe safely-actionable finding on the board.

The New-channel form's field loop rendered a visible <label> with no htmlFor next to either a <select> (the Slack channel picker) or an <input>. Sighted users see the label; a screen reader announced nothing for the control.

The fix

One id per field (notif-field-<key>), shared by the two mutually exclusive control branches (only one ever renders, so the id is never duplicated), with the label pointing at it. Field keys are already unique within a spec — they key the wrapping <div> — so no collisions across fields.

Purely additive markup: no behavior, styling, or state change.

Same family as the merged #125 (control-has-associated-label ×6 via aria-label) and #157 (placeholder-only fields ×4 via htmlFor/id).

Verification

  • control-has-associated-label fully cleared (×1 → 0)
  • label-has-associated-control 11 → 10 (this site is one DOM pair in both families)
  • Accessibility warnings 13 → 11; Bugs errors unchanged at 15, Bugs warnings unchanged at 104 — no new findings (totals reconcile exactly)
  • pnpm -r typecheck clean
  • pnpm --filter @loopany/server test — 702 passed, 3 skipped

Scope note

This is a deliberate single-site fix, not a migration. The label-side label-has-associated-control family (10 remaining, 8 of them in LoopForm.tsx) stays untouched — it's migration-scale and still awaiting owner sign-off on the approach.

…has-associated-label)

The New-channel form rendered a visible <label> with no htmlFor next to
either a <select> (Slack channel picker) or an <input>, so the control had
no accessible name at all - a screen reader announced nothing for it.

Give each field one id (notif-field-<key>) shared by the two mutually
exclusive control branches and point the label at it. Same family as the
merged #125 and #157.

Verified: control-has-associated-label fully cleared (1 to 0),
label-has-associated-control 11 to 10, Accessibility 13 to 11 warnings, no
new findings; pnpm -r typecheck clean, server suite 702 passed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant