Skip to content

🎨 Palette: Add keyboard focus styles and ARIA labels to list controls#524

Open
aafre wants to merge 1 commit into
mainfrom
palette-focus-visible-324531667006514486
Open

🎨 Palette: Add keyboard focus styles and ARIA labels to list controls#524
aafre wants to merge 1 commit into
mainfrom
palette-focus-visible-324531667006514486

Conversation

@aafre
Copy link
Copy Markdown
Owner

@aafre aafre commented May 12, 2026

💡 What: Added explicit keyboard focus rings (focus-visible:ring-2) and type="button" to add/remove controls in Experience, Education, and Generic sections. Added an aria-label to the description point removal button.
🎯 Why: Interactive elements inside dynamically mapped lists were losing their default browser focus outlines due to custom Tailwind styling, making them difficult for keyboard users to navigate. Missing type="button" can also cause accidental form submissions in some contexts.
📸 Before/After: Focus states were previously invisible on these buttons. Now they have clear, contextual focus rings (red for destructive, dark for additive). Screen readers now hear "Remove description point" instead of just "✕".
♿ Accessibility: Improved keyboard navigability by ensuring all list controls have visible focus states (focus-visible classes). Added a missing aria-label to an icon-only button and ensured all buttons have explicit type="button".


PR created automatically by Jules for task 324531667006514486 started by @aafre

Co-authored-by: aafre <8656674+aafre@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.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request improves the accessibility of interactive list controls across the EducationItem, ExperienceItem, and GenericSection components by adding explicit focus-visible ring styles and ensuring buttons have the correct type="button" attribute. It also updates the .Jules/palette.md documentation with new guidelines regarding focus states for drag-and-drop list controls. A review comment suggests further enhancing accessibility by including item indices in the aria-label and title attributes of removal buttons to provide better context for screen reader users.

Comment on lines +182 to +186
type="button"
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"
title="Remove description point"
aria-label="Remove description point"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

When rendering multiple interactive elements in a list, it's best practice to include the item's index or a unique identifier in the 'aria-label' and 'title'. This provides necessary context for screen reader users to distinguish between multiple 'Remove' buttons and ensures clearer tooltips for sighted users.

Suggested change
type="button"
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"
title="Remove description point"
aria-label="Remove description point"
type="button"
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 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-red-500 focus-visible:ring-offset-1"
title={'Remove description point ' + (descIndex + 1)}
aria-label={'Remove description point ' + (descIndex + 1)}

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