From 5cfb6ffdaadefdc91cbaf9e4b17c153284c3148c Mon Sep 17 00:00:00 2001 From: majdyz Date: Wed, 15 Apr 2026 16:36:49 +0700 Subject: [PATCH] fix(copilot): use read-only aria-label on disabled mode/model toggles When readOnly=true, aria-label now describes the current state ("Advanced model active for this session") instead of announcing an unavailable switch action, per WCAG accessible name guidance. --- .../components/ChatInput/components/ModeToggleButton.tsx | 6 +++++- .../components/ChatInput/components/ModelToggleButton.tsx | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/ModeToggleButton.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/ModeToggleButton.tsx index 98abafbd8e..d6c76e616f 100644 --- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/ModeToggleButton.tsx +++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/ModeToggleButton.tsx @@ -26,7 +26,11 @@ export function ModeToggleButton({ mode, onToggle, readOnly = false }: Props) { readOnly && "cursor-default opacity-70", )} aria-label={ - isExtended ? "Switch to Fast mode" : "Switch to Extended Thinking mode" + readOnly + ? `${isExtended ? "Extended Thinking" : "Fast"} mode active for this session` + : isExtended + ? "Switch to Fast mode" + : "Switch to Extended Thinking mode" } title={ readOnly diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/ModelToggleButton.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/ModelToggleButton.tsx index e7808103ac..f2958be3b3 100644 --- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/ModelToggleButton.tsx +++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/ChatInput/components/ModelToggleButton.tsx @@ -30,7 +30,11 @@ export function ModelToggleButton({ readOnly && "cursor-default opacity-70", )} aria-label={ - isAdvanced ? "Switch to Standard model" : "Switch to Advanced model" + readOnly + ? `${isAdvanced ? "Advanced" : "Standard"} model active for this session` + : isAdvanced + ? "Switch to Standard model" + : "Switch to Advanced model" } title={ readOnly