Skip to content

🎨 Palette: [UX improvement] Add ARIA labels to icon-only buttons#31

Open
bobdivx wants to merge 1 commit into
devfrom
palette/aria-labels-icon-buttons-5523120068416955368
Open

🎨 Palette: [UX improvement] Add ARIA labels to icon-only buttons#31
bobdivx wants to merge 1 commit into
devfrom
palette/aria-labels-icon-buttons-5523120068416955368

Conversation

@bobdivx
Copy link
Copy Markdown
Owner

@bobdivx bobdivx commented May 12, 2026

💡 What: Added aria-label, aria-expanded, aria-haspopup, and title attributes to icon-only buttons in DiscussionHeader.tsx and OllamaTab.tsx. Also added keyboard focus states (focus-visible:ring-2) to these buttons.
🎯 Why: Icon-only buttons without labels are inaccessible to screen readers. Focus states improve keyboard navigation.
📸 Before/After: Focus outline now clearly visible when navigating via keyboard. Screen readers now announce button actions.
♿ Accessibility: Improved screen reader and keyboard accessibility for critical interaction points.


PR created automatically by Jules for task 5523120068416955368 started by @bobdivx

Co-authored-by: bobdivx <6737167+bobdivx@users.noreply.github.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 12, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
forge Ready Ready Preview, Comment May 12, 2026 5:55pm

@google-labs-jules
Copy link
Copy Markdown

👋 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

@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 focus visibility for buttons in the DiscussionHeader and OllamaTab components by adding ARIA attributes and focus-visible styles. Review feedback suggests further improving button robustness and consistency by explicitly setting type="button", ensuring title attributes are as descriptive as aria-label, and using rounded-full classes. Additionally, it is recommended to move hardcoded hex colors to the Tailwind configuration and verify that menu containers have the appropriate ARIA roles to match the aria-haspopup attribute.

{inst.enabled ? 'Désactiver' : 'Activer'}
</button>
<button onClick={() => startEdit(inst)} class="p-2 text-gray-400 hover:text-gray-600 transition-colors">
<button onClick={() => startEdit(inst)} class="p-2 text-gray-400 hover:text-gray-600 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 rounded" aria-label={`Modifier l'instance ${inst.name}`} title="Modifier l'instance">
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The title attribute should be as descriptive as the aria-label to provide the same context to sighted users on hover. Additionally, it's a best practice to include type="button" to prevent any potential form submission issues, and using rounded-full would maintain visual consistency with other icon buttons in the application.

Suggested change
<button onClick={() => startEdit(inst)} class="p-2 text-gray-400 hover:text-gray-600 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 rounded" aria-label={`Modifier l'instance ${inst.name}`} title="Modifier l'instance">
<button type="button" onClick={() => startEdit(inst)} class="p-2 text-gray-400 hover:text-gray-600 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 rounded-full" aria-label={`Modifier l'instance ${inst.name}`} title={`Modifier l'instance ${inst.name}`}>

<svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z" /></svg>
</button>
<button onClick={() => deleteInstance(inst.id)} class="p-2 text-gray-400 hover:text-red-600 transition-colors">
<button onClick={() => deleteInstance(inst.id)} class="p-2 text-gray-400 hover:text-red-600 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-red-500 rounded" aria-label={`Supprimer l'instance ${inst.name}`} title="Supprimer l'instance">
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Similar to the edit button, the delete button's title should be updated to include the instance name for better clarity. Adding type="button" and using rounded-full will also improve consistency and robustness.

Suggested change
<button onClick={() => deleteInstance(inst.id)} class="p-2 text-gray-400 hover:text-red-600 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-red-500 rounded" aria-label={`Supprimer l'instance ${inst.name}`} title="Supprimer l'instance">
<button type="button" onClick={() => deleteInstance(inst.id)} class="p-2 text-gray-400 hover:text-red-600 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-red-500 rounded-full" aria-label={`Supprimer l'instance ${inst.name}`} title={`Supprimer l'instance ${inst.name}`}>

<button
type="button"
class="flex h-11 w-11 items-center justify-center rounded-full border border-gray-200 text-gray-500 transition hover:bg-gray-50 hover:text-gray-800"
class="flex h-11 w-11 items-center justify-center rounded-full border border-gray-200 text-gray-500 transition hover:bg-gray-50 hover:text-gray-800 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#175B37]"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The hex color #175B37 is hardcoded here and in several other places in the file. To improve maintainability and ensure a single source of truth for brand colors, consider moving this value to your Tailwind configuration (e.g., as a primary or brand color).

class="flex h-11 w-11 items-center justify-center rounded-full border border-gray-200 text-gray-500 transition hover:bg-gray-50 hover:text-gray-800 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#175B37]"
aria-label="Menu d'options"
aria-expanded={headerMenuOpen}
aria-haspopup="menu"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Using aria-haspopup="menu" indicates to assistive technologies that this button triggers a menu. For this to be fully accessible, the target container (at line 127) should have role="menu" and its children should have role="menuitem". If the popup is not a formal menu, aria-haspopup="true" might be more appropriate.

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