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.
This commit is contained in:
majdyz
2026-04-15 16:36:49 +07:00
parent f49a9f728c
commit 5cfb6ffdaa
2 changed files with 10 additions and 2 deletions

View File

@@ -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

View File

@@ -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