From 5011db9bd7fbb4b0ee42c2118be000eb1b384653 Mon Sep 17 00:00:00 2001 From: Cyril Date: Tue, 3 Feb 2026 12:09:22 +0100 Subject: [PATCH] =?UTF-8?q?=E2=99=BF=EF=B8=8F(frontend)=20announce=20ai=20?= =?UTF-8?q?status=20with=20aria-live?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit notify screen readers about ai thinking, writing, ready, or error --- .../docs/doc-editor/components/AI/AIMenu.tsx | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/frontend/apps/impress/src/features/docs/doc-editor/components/AI/AIMenu.tsx b/src/frontend/apps/impress/src/features/docs/doc-editor/components/AI/AIMenu.tsx index f1f51ce9..a624dfed 100644 --- a/src/frontend/apps/impress/src/features/docs/doc-editor/components/AI/AIMenu.tsx +++ b/src/frontend/apps/impress/src/features/docs/doc-editor/components/AI/AIMenu.tsx @@ -194,6 +194,25 @@ export const AIMenu = (props: AIMenuProps) => { return t('Ask anything...'); }, [aiResponseStatus, t]); + const ariaLiveMessage = useMemo(() => { + if (aiResponseStatus === 'thinking') { + return t('AI is thinking'); + } + if (aiResponseStatus === 'ai-writing') { + return t('AI is writing'); + } + if (aiResponseStatus === 'user-reviewing') { + return t('AI response ready for review'); + } + if (aiResponseStatus === 'error') { + return t('AI request failed'); + } + + return ''; + }, [aiResponseStatus, t]); + + const ariaLiveMode = aiResponseStatus === 'error' ? 'assertive' : 'polite'; + const IconInput = useMemo(() => { if (aiResponseStatus === 'thinking') { return ; @@ -256,6 +275,9 @@ export const AIMenu = (props: AIMenuProps) => { return ( + + {ariaLiveMessage} +