From 3227bc605971bb3d3d3f058f23a8f12bacc860f3 Mon Sep 17 00:00:00 2001 From: Philipinho <16838612+Philipinho@users.noreply.github.com> Date: Mon, 4 May 2026 23:04:26 +0100 Subject: [PATCH] fix: a11y --- apps/client/public/locales/en-US/translation.json | 2 ++ .../src/ee/ai-chat/components/ai-chat-sidebar.tsx | 3 ++- .../ee/ai-chat/components/aside-chat-panel.tsx | 15 +++++++++++++-- .../src/ee/ai-chat/components/chat-input.tsx | 6 ++++++ .../src/ee/ai-chat/components/chat-tool-group.tsx | 9 +++++++++ .../src/ee/ai-chat/styles/ai-chat.module.css | 4 ++-- .../src/ee/ai-chat/styles/chat-input.module.css | 2 +- .../src/ee/ai-chat/styles/chat-sidebar.module.css | 4 ++-- .../home/components/home-ai-prompt.module.css | 2 +- 9 files changed, 38 insertions(+), 9 deletions(-) diff --git a/apps/client/public/locales/en-US/translation.json b/apps/client/public/locales/en-US/translation.json index 38fd5f2d..8cccd2ad 100644 --- a/apps/client/public/locales/en-US/translation.json +++ b/apps/client/public/locales/en-US/translation.json @@ -870,6 +870,8 @@ "Previous 7 days": "Previous 7 days", "Previous 30 days": "Previous 30 days", "Search chats...": "Search chats...", + "Search chats": "Search chats", + "Ask anything... Use @ to mention pages": "Ask anything... Use @ to mention pages", "Start a new chat to see it here.": "Start a new chat to see it here.", "Summarize this page": "Summarize this page", "Toggle AI Chat": "Toggle AI Chat", diff --git a/apps/client/src/ee/ai-chat/components/ai-chat-sidebar.tsx b/apps/client/src/ee/ai-chat/components/ai-chat-sidebar.tsx index 8ce06e02..ea616f43 100644 --- a/apps/client/src/ee/ai-chat/components/ai-chat-sidebar.tsx +++ b/apps/client/src/ee/ai-chat/components/ai-chat-sidebar.tsx @@ -137,7 +137,8 @@ export default function AiChatSidebar() { } size="xs" value={search} diff --git a/apps/client/src/ee/ai-chat/components/aside-chat-panel.tsx b/apps/client/src/ee/ai-chat/components/aside-chat-panel.tsx index bd2b9569..610ed579 100644 --- a/apps/client/src/ee/ai-chat/components/aside-chat-panel.tsx +++ b/apps/client/src/ee/ai-chat/components/aside-chat-panel.tsx @@ -178,6 +178,7 @@ export default function AsideChatPanel() { href="/ai" variant="subtle" color="dark" + aria-label={t("New chat")} onClick={handleNewChat} > @@ -185,13 +186,23 @@ export default function AsideChatPanel() { - + - + diff --git a/apps/client/src/ee/ai-chat/components/chat-input.tsx b/apps/client/src/ee/ai-chat/components/chat-input.tsx index d003adfb..2e2bada7 100644 --- a/apps/client/src/ee/ai-chat/components/chat-input.tsx +++ b/apps/client/src/ee/ai-chat/components/chat-input.tsx @@ -225,6 +225,10 @@ export default function ChatInput({ }), ], editorProps: { + attributes: { + "aria-label": placeholder || t("Ask anything... Use @ to mention pages"), + "aria-multiline": "true", + }, handleDOMEvents: { keydown: (_view, event) => { if ( @@ -275,6 +279,8 @@ export default function ChatInput({ type="file" accept={ACCEPTED_FILE_TYPES} multiple + aria-label={t("Add files")} + tabIndex={-1} style={{ display: "none" }} onChange={(e) => handleFileSelect(e.target.files)} /> diff --git a/apps/client/src/ee/ai-chat/components/chat-tool-group.tsx b/apps/client/src/ee/ai-chat/components/chat-tool-group.tsx index b4e002f6..8e9b70d0 100644 --- a/apps/client/src/ee/ai-chat/components/chat-tool-group.tsx +++ b/apps/client/src/ee/ai-chat/components/chat-tool-group.tsx @@ -31,7 +31,16 @@ export default function ChatToolGroup({ toolCalls, isStreaming }: Props) {
setExpanded((prev) => !prev)} + onKeyDown={(event) => { + if (event.key === "Enter" || event.key === " ") { + event.preventDefault(); + setExpanded((prev) => !prev); + } + }} > {activeLabel ? ( diff --git a/apps/client/src/ee/ai-chat/styles/ai-chat.module.css b/apps/client/src/ee/ai-chat/styles/ai-chat.module.css index 27b0f0c0..30766907 100644 --- a/apps/client/src/ee/ai-chat/styles/ai-chat.module.css +++ b/apps/client/src/ee/ai-chat/styles/ai-chat.module.css @@ -98,7 +98,7 @@ font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; - color: light-dark(var(--mantine-color-gray-6), var(--mantine-color-dark-2)); + color: var(--mantine-color-dimmed); margin-bottom: var(--mantine-spacing-xs); } @@ -125,7 +125,7 @@ .suggestionsLabel { font-size: var(--mantine-font-size-xs); font-weight: 500; - color: light-dark(var(--mantine-color-gray-5), var(--mantine-color-dark-3)); + color: var(--mantine-color-dimmed); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: var(--mantine-spacing-sm); diff --git a/apps/client/src/ee/ai-chat/styles/chat-input.module.css b/apps/client/src/ee/ai-chat/styles/chat-input.module.css index 20b287c1..da8d1546 100644 --- a/apps/client/src/ee/ai-chat/styles/chat-input.module.css +++ b/apps/client/src/ee/ai-chat/styles/chat-input.module.css @@ -43,7 +43,7 @@ margin-top: 6px; text-align: center; font-size: var(--mantine-font-size-xs); - color: light-dark(var(--mantine-color-gray-5), var(--mantine-color-dark-3)); + color: var(--mantine-color-dimmed); } .attachmentChips { diff --git a/apps/client/src/ee/ai-chat/styles/chat-sidebar.module.css b/apps/client/src/ee/ai-chat/styles/chat-sidebar.module.css index c7991147..62dcb29f 100644 --- a/apps/client/src/ee/ai-chat/styles/chat-sidebar.module.css +++ b/apps/client/src/ee/ai-chat/styles/chat-sidebar.module.css @@ -36,7 +36,7 @@ padding: 4px var(--mantine-spacing-xs); font-size: var(--mantine-font-size-xs); font-weight: 600; - color: light-dark(var(--mantine-color-gray-6), var(--mantine-color-dark-2)); + color: var(--mantine-color-dimmed); user-select: none; } @@ -104,7 +104,7 @@ .chatItemDate { font-size: var(--mantine-font-size-xs); - color: light-dark(var(--mantine-color-gray-5), var(--mantine-color-dark-3)); + color: var(--mantine-color-dimmed); white-space: nowrap; transition: opacity 150ms; } diff --git a/apps/client/src/features/home/components/home-ai-prompt.module.css b/apps/client/src/features/home/components/home-ai-prompt.module.css index e6d81606..8a6d57e1 100644 --- a/apps/client/src/features/home/components/home-ai-prompt.module.css +++ b/apps/client/src/features/home/components/home-ai-prompt.module.css @@ -16,7 +16,7 @@ .subtitle { font-size: var(--mantine-font-size-sm); - color: light-dark(var(--mantine-color-gray-6), var(--mantine-color-dark-2)); + color: var(--mantine-color-dimmed); text-align: center; margin-top: 6px; margin-bottom: var(--mantine-spacing-lg);