From ca7c4d2c86309ab20d0c70503cdfea9107d7aa09 Mon Sep 17 00:00:00 2001 From: yyh Date: Thu, 15 Jan 2026 19:12:40 +0800 Subject: [PATCH] fix(skill): improve accessibility for file tree and tabs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Convert div with onClick to proper button elements for keyboard access - Add focus-visible ring styles to all interactive elements - Add ARIA attributes (role, aria-selected, aria-expanded) to tree nodes - Add keyboard navigation (Enter/Space) support to tree items - Mark decorative icons with aria-hidden="true" - Add missing i18n keys for accessibility labels - Fix typography: use ellipsis character (…) instead of three dots --- .../workflow/skill/editor-tab-item.tsx | 47 +++++++++++-------- .../workflow/skill/file-node-menu.tsx | 6 ++- .../workflow/skill/folder-node-menu.tsx | 6 ++- .../workflow/skill/sidebar-search-add.tsx | 5 +- .../components/workflow/skill/tree-node.tsx | 37 ++++++++++++--- web/i18n/en-US/workflow.json | 6 ++- 6 files changed, 74 insertions(+), 33 deletions(-) diff --git a/web/app/components/workflow/skill/editor-tab-item.tsx b/web/app/components/workflow/skill/editor-tab-item.tsx index 341b29fd14..1f6815ee94 100644 --- a/web/app/components/workflow/skill/editor-tab-item.tsx +++ b/web/app/components/workflow/skill/editor-tab-item.tsx @@ -42,39 +42,48 @@ const EditorTabItem: FC = ({ return (
-
- - {isDirty && ( - - )} -
- - - {name} - +
+ + {isDirty && ( + + )} +
+ + + {name} + +
) diff --git a/web/app/components/workflow/skill/file-node-menu.tsx b/web/app/components/workflow/skill/file-node-menu.tsx index 68869718c0..d31be13a27 100644 --- a/web/app/components/workflow/skill/file-node-menu.tsx +++ b/web/app/components/workflow/skill/file-node-menu.tsx @@ -28,9 +28,10 @@ const MenuItem: React.FC = ({ icon: Icon, label, onClick, disable className={cn( 'flex w-full items-center gap-2 rounded-lg px-3 py-2', 'hover:bg-state-base-hover disabled:cursor-not-allowed disabled:opacity-50', + 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-components-input-border-active', )} > - +