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)
This commit is contained in:
Nicolas Varrot
2026-02-13 05:42:23 +00:00
parent 72f410566a
commit de6976bae8
3 changed files with 7 additions and 1 deletions

View File

@@ -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 ? <Check size={12} className="text-emerald-400" /> : <Copy size={12} />}
</button>

View File

@@ -181,7 +181,7 @@ export function Sidebar({ sessions, activeSession, onSwitch, onDelete, onSplit,
</div>
<span className="font-semibold text-sm text-pc-text tracking-wide">{t('sidebar.title')}</span>
</div>
<button onClick={onClose} className="lg:hidden p-1.5 rounded-xl hover:bg-[var(--pc-hover)] text-pc-text-secondary transition-colors">
<button onClick={onClose} className="lg:hidden p-1.5 rounded-xl hover:bg-[var(--pc-hover)] text-pc-text-secondary transition-colors" aria-label={t('sidebar.close')}>
<X size={16} />
</button>
</div>
@@ -204,6 +204,7 @@ export function Sidebar({ sessions, activeSession, onSwitch, onDelete, onSplit,
<button
onClick={() => updateFilter('')}
className="absolute right-2 top-1/2 -translate-y-1/2 text-pc-text-muted hover:text-pc-text"
aria-label={t('sidebar.clearSearch')}
>
<X size={12} />
</button>

View File

@@ -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<keyof typeof en, string> = {
'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',