From 0c9264e8b34e273c99accf0ee22468b738c2c788 Mon Sep 17 00:00:00 2001 From: MokireddySampath <120497218+MokireddySampath@users.noreply.github.com> Date: Thu, 4 Jan 2024 19:37:16 +0530 Subject: [PATCH] Bug 2819239:Screen reader does not announce the loading information which appears on invoking the 'Send' button. (#1703) * Alert has been added and content also added accordign to the loader state * Snapshot of tests have been updated --- .../QueryCopilot/QueryCopilotPromptbar.tsx | 14 ++++++++++- .../Footer/__snapshots__/Footer.test.tsx.snap | 24 +++++++++---------- src/hooks/useQueryCopilot.ts | 2 +- 3 files changed, 26 insertions(+), 14 deletions(-) diff --git a/src/Explorer/QueryCopilot/QueryCopilotPromptbar.tsx b/src/Explorer/QueryCopilot/QueryCopilotPromptbar.tsx index e51867ca8..a35d26a75 100644 --- a/src/Explorer/QueryCopilot/QueryCopilotPromptbar.tsx +++ b/src/Explorer/QueryCopilot/QueryCopilotPromptbar.tsx @@ -303,6 +303,16 @@ export const QueryCopilotPromptbar: React.FC = ({ resetButtonState(); }; + const getAriaLabel = () => { + if (isGeneratingQuery === null) { + return " "; + } else if (isGeneratingQuery) { + return "Content is loading"; + } else { + return "Content is updated"; + } + }; + React.useEffect(() => { showTeachingBubble(); useTabs.getState().setIsQueryErrorThrown(false); @@ -379,7 +389,9 @@ export const QueryCopilotPromptbar: React.FC = ({ onClick={() => startGenerateQueryProcess()} aria-label="Send" /> - {isGeneratingQuery && } +
+ {isGeneratingQuery && } +
{showSamplePrompts && ( ({ correlationId: "", query: "SELECT * FROM c", selectedQuery: "", - isGeneratingQuery: false, + isGeneratingQuery: null, isGeneratingExplanation: false, isExecuting: false, dislikeQuery: undefined,