Skip to content

🎨 Palette: Add explicit focus states and ARIA labels to section item buttons#520

Closed
aafre wants to merge 1 commit into
mainfrom
palette/ux-focus-outlines-on-custom-controls-541238815875527125
Closed

🎨 Palette: Add explicit focus states and ARIA labels to section item buttons#520
aafre wants to merge 1 commit into
mainfrom
palette/ux-focus-outlines-on-custom-controls-541238815875527125

Conversation

@aafre
Copy link
Copy Markdown
Owner

@aafre aafre commented May 10, 2026

What: Added explicit focus-visible Tailwind classes (focus-visible:ring-2 focus-visible:ring-offset-1, etc.) and type="button" to item deletion buttons in ExperienceItem.tsx, EducationItem.tsx, and GenericSection.tsx. Also added these to the description point removal and addition buttons in ExperienceItem.tsx.
Why: Inline removal/addition controls inside dynamically mapped lists were losing default browser focus outlines due to custom Tailwind padding and colors, making keyboard navigation difficult for users relying on screen readers or keyboard navigation.
Before/After: The buttons now show clear focus rings when navigating via keyboard (red for destructive actions, accent color for additive actions).
Accessibility: Improved keyboard navigability by ensuring focus visibility. Added explicit type="button" to prevent accidental form submissions, and aria-labels for screen reader accessibility on icon-only buttons (like the description point removal button).


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

…buttons

Added explicit focus-visible Tailwind classes and type="button" to item deletion buttons and addition buttons to improve keyboard navigability and prevent accidental form submissions.

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 enhances accessibility and keyboard navigation by adding type="button" attributes and explicit focus-visible ring styles to action buttons across several components, including EducationItem, ExperienceItem, and GenericSection. Documentation was also updated to include these focus outline standards. Feedback suggests improving consistency by using the standard MdDelete icon for removal buttons, making removal handlers optional to allow for conditional rendering, and extracting repeated Tailwind focus classes into a shared constant to reduce duplication.

Comment on lines +184 to 188
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

The removal button for description points is inconsistent with other removal buttons in the application. It should use the MdDelete icon and standard styling. To align with repository rules, ensure the removal handler prop is optional and the button is conditionally rendered only when the prop is provided. Additionally, consider extracting the repeated focus ring classes to a shared constant to avoid data duplication.

Suggested change
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"
>
className="p-2 text-gray-400 hover:text-red-600 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"
>
<MdDelete className="text-xl" />
References
  1. For optional UI elements like a delete button, make the corresponding handler prop (e.g., onDelete) optional and conditionally render the element only when the prop is provided.
  2. To avoid data duplication, import shared constants from a single source of truth and map over them to add component-specific metadata if needed.

type="button"
onClick={() => handleRemoveItem(index)}
className="p-2 text-gray-400 hover:text-red-600 hover:bg-red-50 rounded-lg transition-colors flex-shrink-0"
className="p-2 text-gray-400 hover:text-red-600 hover:bg-red-50 rounded-lg transition-colors flex-shrink-0 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-red-500 focus-visible:ring-offset-1"
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

The focus ring classes (focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-red-500 focus-visible:ring-offset-1) are repeated identically across multiple buttons. To improve maintainability and avoid data duplication, consider extracting these shared Tailwind classes into a single source of truth (e.g., a shared constant), as per the repository rules.

References
  1. To avoid data duplication, import shared constants from a single source of truth and map over them to add component-specific metadata if needed.

@aafre
Copy link
Copy Markdown
Owner Author

aafre commented May 25, 2026

Closing duplicate — the most recent version of this change is PR #524.

@aafre aafre closed this May 25, 2026
@google-labs-jules
Copy link
Copy Markdown
Contributor

Closing duplicate — the most recent version of this change is PR #524.

Understood. Acknowledging that this work is a duplicate and stopping work on 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