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:
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user