Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .jules/palette.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

## 2024-05-23 - Enhanced Accessibility of Icon-Only Composer Buttons
**Learning:** Textual icons (like `>`) and raw SVG icons inside buttons are frequently missed by screen readers or read confusingly without appropriate ARIA labels and `aria-hidden` attributes. Keyboard focus visibility must also be explicitly set for a fully accessible interface.
**Action:** When adding or updating icon-only buttons, always ensure they have an `aria-label`, an optional `title` for hover, `aria-hidden="true"` on the internal icon elements, and `focus-visible` styling (`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#175B37]`).
6 changes: 4 additions & 2 deletions src/components/discussion/composer/ComposerInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,11 @@ export default function ComposerInput({
type="button"
onClick={() => void send()}
disabled={sending || historyLoading || sessionUnavailable || !message.trim() || !agentId}
class="flex h-11 w-11 shrink-0 items-center justify-center rounded-xl bg-[#175B37] text-white disabled:opacity-40"
class="flex h-11 w-11 shrink-0 items-center justify-center rounded-xl bg-[#175B37] text-white disabled:opacity-40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#175B37] focus-visible:ring-offset-2"
aria-label="Envoyer le message"
title="Envoyer le message"
>
>
<span aria-hidden="true">&gt;</span>
</button>
</div>
</div>
Expand Down
6 changes: 4 additions & 2 deletions src/components/discussion/composer/DiscussionHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,12 @@ export default function DiscussionHeader({
</button>
<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]"
onClick={() => setHeaderMenuOpen((v: boolean) => !v)}
aria-label="Ouvrir le menu d'options"
title="Options"
>
Comment on lines 114 to 120

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

Since this button toggles the visibility of a dropdown menu (headerMenuOpen), it should indicate its expanded state and popup nature to screen readers using aria-haspopup="true" and aria-expanded={headerMenuOpen}. This ensures that assistive technologies are aware of the menu's state.

        <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 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#175B37]"
          onClick={() => setHeaderMenuOpen((v: boolean) => !v)}
          aria-label="Ouvrir le menu d'options"
          title="Options"
          aria-haspopup="true"
          aria-expanded={headerMenuOpen}
        >

<svg class="h-5 w-5" fill="currentColor" viewBox="0 0 24 24">
<svg class="h-5 w-5" fill="currentColor" viewBox="0 0 24 24" aria-hidden="true">
<path d="M12 8a2 2 0 110-4 2 2 0 010 4zm0 6a2 2 0 110-4 2 2 0 010 4zm0 6a2 2 0 110-4 2 2 0 010 4z" />
</svg>
</button>
Expand Down