[accessibility-3549715]: [Screen reader - Cosmos DB Query Copilot - Query Faster with Copilot>Enable Query Advisor]: Screen reader does not announce status information which appears on invoking the 'Send' button.

This commit is contained in:
Satyapriya Bai 2024-10-29 16:18:45 +05:30
parent 82de81f2b6
commit 8800f2ef25

View File

@ -305,7 +305,7 @@ export const QueryCopilotPromptbar: React.FC<QueryCopilotPromptProps> = ({
if (isGeneratingQuery === null) { if (isGeneratingQuery === null) {
return " "; return " ";
} else if (isGeneratingQuery) { } else if (isGeneratingQuery) {
return "Content is loading"; return "Thinking";
} else { } else {
return "Content is updated"; return "Content is updated";
} }
@ -400,6 +400,7 @@ export const QueryCopilotPromptbar: React.FC<QueryCopilotPromptProps> = ({
<IconButton <IconButton
iconProps={{ iconName: "Send" }} iconProps={{ iconName: "Send" }}
disabled={isGeneratingQuery || !userPrompt.trim()} disabled={isGeneratingQuery || !userPrompt.trim()}
allowDisabledFocus={true}
style={{ background: "none" }} style={{ background: "none" }}
onClick={() => startGenerateQueryProcess()} onClick={() => startGenerateQueryProcess()}
aria-label="Send" aria-label="Send"
@ -706,32 +707,35 @@ export const QueryCopilotPromptbar: React.FC<QueryCopilotPromptProps> = ({
)} )}
</Stack> </Stack>
)} )}
{(showFeedbackBar || isGeneratingQuery) && (
<span role="alert" className="screenReaderOnly" aria-label={getAriaLabel()} />
)}
{isGeneratingQuery && ( {isGeneratingQuery && (
<ProgressIndicator <ProgressIndicator
label="Thinking..." label="Thinking..."
ariaLabel={getAriaLabel()} ariaLabel={getAriaLabel()}
barHeight={4} barHeight={4}
styles={{ styles={{
root: { root: {
fontSize: 12, fontSize: 12,
width: "100%", width: "100%",
bottom: 0, bottom: 0,
}, },
itemName: { itemName: {
padding: "0px 8px", padding: "0px 8px",
}, },
itemProgress: { itemProgress: {
borderBottomLeftRadius: 8, borderBottomLeftRadius: 8,
borderBottomRightRadius: 8, borderBottomRightRadius: 8,
padding: 0, padding: 0,
}, },
progressBar: { progressBar: {
backgroundImage: backgroundImage:
"linear-gradient(90deg, rgba(0, 0, 0, 0) 0%, rgb(24, 90, 189) 35%, rgb(71, 207, 250) 70%, rgb(180, 124, 248) 92%, rgba(0, 0, 0, 0))", "linear-gradient(90deg, rgba(0, 0, 0, 0) 0%, rgb(24, 90, 189) 35%, rgb(71, 207, 250) 70%, rgb(180, 124, 248) 92%, rgba(0, 0, 0, 0))",
animationDuration: "5s", animationDuration: "5s",
}, },
}} }}
/> />
)} )}
</Stack> </Stack>
<IconButton <IconButton