🎨 Palette: Improve accessibility of experience list controls#527
Conversation
Co-authored-by: aafre <8656674+aafre@users.noreply.github.com>
|
👋 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 New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
There was a problem hiding this comment.
Code Review
This pull request updates the accessibility documentation in .Jules/palette.md and applies these standards to the ExperienceItem component. The changes include adding type="button", focus-visible ring styles, and aria-label attributes to improve keyboard navigation and screen reader support. Feedback was provided to enhance the aria-label for removing description points by making it unique with an index, providing better context for assistive technologies.
| onClick={() => handleDescRemove(descIndex)} | ||
| className="text-red-600 hover:text-red-800 p-2 hover:bg-red-50 rounded-lg transition-colors flex-shrink-0 mt-2" | ||
| className="text-red-600 hover:text-red-800 p-2 hover:bg-red-50 rounded-lg transition-colors flex-shrink-0 mt-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-red-500 focus-visible:ring-offset-1" | ||
| aria-label="Remove description point" |
There was a problem hiding this comment.
To improve accessibility for screen reader users, especially when navigating through multiple description points, consider making the aria-label unique by including the index of the item. This provides clearer context on which specific point is being targeted for removal. Additionally, ensure this removal button is only rendered if the removal handler is provided.
| aria-label="Remove description point" | |
| aria-label={"Remove description point " + (descIndex + 1)} |
References
- When rendering dynamic lists, use a prefixed index to create unique identifiers for list items.
- Conditionally render optional UI elements like delete buttons only when their corresponding handler prop is provided.
|
Closing duplicate — the most recent version of this change is PR #545. |
Understood. Acknowledging that this work is a duplicate and stopping work on this task. |
What: Added proper ARIA labels,
type="button", and explicit keyboard focus rings (focus-visible) to the add/remove controls within experience items.Why: To ensure that users navigating via keyboard can clearly see which control has focus, and to prevent accidental form submissions or screen reader ambiguity.
Before/After: Visually similar, but adding a visible ring on keyboard focus.
Accessibility: Improved screen reader context for the "Remove description point" button and added focus outlines for keyboard navigation.
PR created automatically by Jules for task 3959323074322675156 started by @aafre