From 9637fb8a4379f56f76419ac6d5f39e6643d0ca6b Mon Sep 17 00:00:00 2001 From: fullex <106392080+0xfullex@users.noreply.github.com> Date: Thu, 4 Dec 2025 14:46:37 +0800 Subject: [PATCH] fix(a11y): improve screen reader (NVDA) support with aria-label attributes (#11678) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(a11y): improve screen reader support with aria-label attributes Add aria-label attributes to all interactive buttons and toolbar elements to improve accessibility for screen reader users (NVDA, etc.). Changes: - Add aria-label with i18n translations to all ActionIconButton components - Add role="button", tabIndex, and keyboard handlers for non-semantic elements - Fix hardcoded English aria-labels in WindowControls to use i18n - Add aria-pressed for toggle buttons to indicate state - Add aria-expanded for expandable menus - Add aria-disabled for disabled buttons Components updated: - SendMessageButton, CopyButton, SelectionToolbar - CodeToolbar, RichEditor toolbar, MinimalToolbar - WindowControls - 12 Inputbar tool buttons (WebSearch, Attachment, KnowledgeBase, etc.) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude * fix(a11y): enhance accessibility in CodeToolbar snapshot Added aria-label, role, and tabindex attributes to improve screen reader support for interactive elements in the CodeToolbar component. This change aligns with ongoing efforts to enhance accessibility across the application. --------- Co-authored-by: Claude --- .../__snapshots__/CodeToolbar.test.tsx.snap | 4 +++ .../src/components/CodeToolbar/button.tsx | 23 ++++++++++-- .../src/components/CodeToolbar/toolbar.tsx | 14 +++++++- src/renderer/src/components/CopyButton.tsx | 20 +++++++++-- .../src/components/RichEditor/toolbar.tsx | 4 ++- .../src/components/WindowControls/index.tsx | 8 +++-- .../pages/home/Inputbar/SendMessageButton.tsx | 19 ++++++++-- .../components/ActivityDirectoryButton.tsx | 2 +- .../tools/components/AttachmentButton.tsx | 14 ++++---- .../tools/components/GenerateImageButton.tsx | 16 ++++----- .../tools/components/KnowledgeBaseButton.tsx | 3 +- .../tools/components/MCPToolsButton.tsx | 5 ++- .../tools/components/MentionModelsButton.tsx | 5 ++- .../tools/components/NewContextButton.tsx | 4 ++- .../tools/components/QuickPhrasesButton.tsx | 2 +- .../tools/components/SlashCommandsButton.tsx | 6 +++- .../tools/components/ThinkingButton.tsx | 21 +++++------ .../tools/components/UrlContextbutton.tsx | 6 +++- .../tools/components/WebSearchButton.tsx | 14 ++++---- .../minapps/components/MinimalToolbar.tsx | 36 ++++++++++++++----- .../selection/toolbar/SelectionToolbar.tsx | 16 ++++++++- 21 files changed, 183 insertions(+), 59 deletions(-) diff --git a/src/renderer/src/components/CodeToolbar/__tests__/__snapshots__/CodeToolbar.test.tsx.snap b/src/renderer/src/components/CodeToolbar/__tests__/__snapshots__/CodeToolbar.test.tsx.snap index c2b4028e32..56fb14ccc4 100644 --- a/src/renderer/src/components/CodeToolbar/__tests__/__snapshots__/CodeToolbar.test.tsx.snap +++ b/src/renderer/src/components/CodeToolbar/__tests__/__snapshots__/CodeToolbar.test.tsx.snap @@ -64,7 +64,11 @@ exports[`CodeToolbar > basic rendering > should match snapshot with mixed tools data-title="code_block.more" >