Skip to content

🎨 Palette: Add for attributes to labels for form accessibility#84

Open
longestmt wants to merge 1 commit into
mainfrom
palette/fix-label-for-attributes-13525237096484999903
Open

🎨 Palette: Add for attributes to labels for form accessibility#84
longestmt wants to merge 1 commit into
mainfrom
palette/fix-label-for-attributes-13525237096484999903

Conversation

@longestmt
Copy link
Copy Markdown
Owner

πŸ’‘ What
Added explicit for attributes to 12 missing <label> tags across the application's forms and modals, linking them to their corresponding id of inputs, textareas, and selects.

Files updated:

  • src/pages/exercises.js (6 labels in "Add Custom Exercise" modal)
  • src/pages/plans.js (3 labels in Plan creation form)
  • src/pages/workout.js (1 label for "Gym Notes" textarea)
  • src/components/rm-calculator.js (2 labels for "Weight" and "Reps" inputs)

🎯 Why
Previously, these labels were implicitly wrapping nothing or only visually associated with inputs. Screen readers rely heavily on the for attribute (or aria-labelledby) to establish a relationship. Adding for makes the forms far more accessible to assistive technologies and also allows users to click the text of the label to properly focus the form field, improving interaction smoothness for all users.

πŸ“Έ Before/After
There is no visual change in the layout.
(See attached verification screenshots for the preserved layouts of the Add Custom Exercise modal and the RM calculator)

β™Ώ Accessibility
Greatly improved form accessibility. Screen readers will now announce "Name: e.g. Zercher Squat" instead of reading a disassociated label and then encountering an unlabeled input. Keyboard navigation and screen reader form modes will now behave as expected natively.


PR created automatically by Jules for task 13525237096484999903 started by @longestmt

Added `for` attributes to `<label>` elements matching their corresponding inputs across the application (Exercises, Plans, Workout, and RM Calculator components). This ensures screen readers can accurately associate the labels with inputs and improves focus management when the user clicks the labels.

Co-authored-by: longestmt <1509654+longestmt@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
Contributor

πŸ‘‹ Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a πŸ‘€ emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

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