From 1c09ccde2254952506f08e9dc4a8036790640203 Mon Sep 17 00:00:00 2001 From: Nicolas Varrot Date: Fri, 13 Feb 2026 10:42:10 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20improve=20accessibility=20=E2=80=94=20ad?= =?UTF-8?q?d=20ARIA=20attributes=20to=20ThemeSwitcher,=20ThinkingBlock,=20?= =?UTF-8?q?ThinkingIndicator,=20ErrorBoundary,=20SessionIcon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - ThemeSwitcher: aria-expanded, aria-haspopup, aria-pressed on theme/accent buttons, Escape to close, dialog role - ThinkingBlock: aria-expanded on toggle, region role on content - ThinkingIndicator: role=status, aria-label, decorative icon aria-hidden - ErrorBoundary: role=alert on error state - SessionIcon: aria-hidden on decorative SVG brand icons --- src/components/ErrorBoundary.tsx | 2 +- src/components/SessionIcon.tsx | 10 +++++----- src/components/ThemeSwitcher.tsx | 12 ++++++++++++ src/components/ThinkingBlock.tsx | 4 +++- src/components/ThinkingIndicator.tsx | 6 +++--- 5 files changed, 24 insertions(+), 10 deletions(-) diff --git a/src/components/ErrorBoundary.tsx b/src/components/ErrorBoundary.tsx index ba0e15f..707f88d 100644 --- a/src/components/ErrorBoundary.tsx +++ b/src/components/ErrorBoundary.tsx @@ -40,7 +40,7 @@ export class ErrorBoundary extends Component { if (this.props.fallback) return this.props.fallback; return ( -
+
💥

diff --git a/src/components/SessionIcon.tsx b/src/components/SessionIcon.tsx index 30880cb..c63f537 100644 --- a/src/components/SessionIcon.tsx +++ b/src/components/SessionIcon.tsx @@ -4,7 +4,7 @@ import type { Session } from '../types'; // SVG brand icons (not available in lucide) function DiscordIcon({ size = 15, className = '' }: { size?: number; className?: string }) { return ( - + ); @@ -12,7 +12,7 @@ function DiscordIcon({ size = 15, className = '' }: { size?: number; className?: function TelegramIcon({ size = 15, className = '' }: { size?: number; className?: string }) { return ( - + ); @@ -20,7 +20,7 @@ function TelegramIcon({ size = 15, className = '' }: { size?: number; className? function SignalIcon({ size = 15, className = '' }: { size?: number; className?: string }) { return ( - + ); @@ -28,7 +28,7 @@ function SignalIcon({ size = 15, className = '' }: { size?: number; className?: function WhatsAppIcon({ size = 15, className = '' }: { size?: number; className?: string }) { return ( - + ); @@ -36,7 +36,7 @@ function WhatsAppIcon({ size = 15, className = '' }: { size?: number; className? function SlackIcon({ size = 15, className = '' }: { size?: number; className?: string }) { return ( - + ); diff --git a/src/components/ThemeSwitcher.tsx b/src/components/ThemeSwitcher.tsx index 092e3ef..b5d3533 100644 --- a/src/components/ThemeSwitcher.tsx +++ b/src/components/ThemeSwitcher.tsx @@ -51,10 +51,15 @@ export function ThemeSwitcher() { ) return; setOpen(false); }; + const handleKeyDown = (e: KeyboardEvent) => { + if (e.key === 'Escape') setOpen(false); + }; document.addEventListener('mousedown', handleClickOutside); + document.addEventListener('keydown', handleKeyDown); window.addEventListener('resize', updatePos); return () => { document.removeEventListener('mousedown', handleClickOutside); + document.removeEventListener('keydown', handleKeyDown); window.removeEventListener('resize', updatePos); }; }, [open, updatePos]); @@ -64,6 +69,8 @@ export function ThemeSwitcher() {
@@ -86,6 +95,7 @@ export function ThemeSwitcher() { {open && ( -
+
{text}
)} diff --git a/src/components/ThinkingIndicator.tsx b/src/components/ThinkingIndicator.tsx index cf13f74..c549caf 100644 --- a/src/components/ThinkingIndicator.tsx +++ b/src/components/ThinkingIndicator.tsx @@ -27,13 +27,13 @@ export function ThinkingIndicator() { }; return ( -
+
- +