From de6976bae8557717d4d5bde300706c282d516270 Mon Sep 17 00:00:00 2001 From: Nicolas Varrot Date: Fri, 13 Feb 2026 05:42:23 +0000 Subject: [PATCH] fix: add missing aria-labels to icon-only buttons for accessibility - Sidebar close button: aria-label for screen readers - Sidebar search clear button: aria-label - ChatMessage raw JSON copy button: aria-label - Added i18n keys: sidebar.close, sidebar.clearSearch (EN + FR) --- src/components/ChatMessage.tsx | 1 + src/components/Sidebar.tsx | 3 ++- src/lib/i18n.ts | 4 ++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/ChatMessage.tsx b/src/components/ChatMessage.tsx index c6acea9..b0c0d20 100644 --- a/src/components/ChatMessage.tsx +++ b/src/components/ChatMessage.tsx @@ -338,6 +338,7 @@ function RawJsonPanel({ message }: { message: ChatMessageType }) { onClick={handleCopy} className="h-6 w-6 rounded-md flex items-center justify-center text-pc-text-secondary hover:text-pc-accent-light transition-colors" title={copied ? t('message.copied') : t('message.copy')} + aria-label={copied ? t('message.copied') : t('message.copy')} > {copied ? : } diff --git a/src/components/Sidebar.tsx b/src/components/Sidebar.tsx index 659503a..4c140f4 100644 --- a/src/components/Sidebar.tsx +++ b/src/components/Sidebar.tsx @@ -181,7 +181,7 @@ export function Sidebar({ sessions, activeSession, onSwitch, onDelete, onSplit, {t('sidebar.title')} - @@ -204,6 +204,7 @@ export function Sidebar({ sessions, activeSession, onSwitch, onDelete, onSplit, diff --git a/src/lib/i18n.ts b/src/lib/i18n.ts index 3feac0a..cb9ef37 100644 --- a/src/lib/i18n.ts +++ b/src/lib/i18n.ts @@ -60,6 +60,8 @@ const en = { 'sidebar.deleteConfirm': 'Delete this session? This cannot be undone.', 'sidebar.deleteCancel': 'Cancel', 'sidebar.openSplit': 'Open in split view', + 'sidebar.close': 'Close sidebar', + 'sidebar.clearSearch': 'Clear search', 'split.close': 'Close split view', // Thinking @@ -175,6 +177,8 @@ const fr: Record = { 'sidebar.deleteConfirm': 'Supprimer cette session ? Cette action est irréversible.', 'sidebar.deleteCancel': 'Annuler', 'sidebar.openSplit': 'Ouvrir en vue scindée', + 'sidebar.close': 'Fermer la barre latérale', + 'sidebar.clearSearch': 'Effacer la recherche', 'split.close': 'Fermer la vue scindée', 'thinking.label': 'Réflexion',