From 0207f3cc0483c8f30d40cbbf528eb6e80c8ed652 Mon Sep 17 00:00:00 2001 From: v-darkora <134300273+v-darkora@users.noreply.github.com> Date: Tue, 29 Aug 2023 16:15:23 +0200 Subject: [PATCH] Fix teaching bubble timeout display (#1593) --- src/Explorer/QueryCopilot/QueryCopilotTab.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Explorer/QueryCopilot/QueryCopilotTab.tsx b/src/Explorer/QueryCopilot/QueryCopilotTab.tsx index 934183517..921252752 100644 --- a/src/Explorer/QueryCopilot/QueryCopilotTab.tsx +++ b/src/Explorer/QueryCopilot/QueryCopilotTab.tsx @@ -330,10 +330,9 @@ export const QueryCopilotTab: React.FC = ({ explorer }: Query return [executeQueryBtn, saveQueryBtn]; }; const showTeachingBubble = (): void => { - const shouldShowTeachingBubble = !inputEdited.current && userPrompt.trim() === ""; - if (shouldShowTeachingBubble) { + if (!inputEdited.current) { setTimeout(() => { - if (shouldShowTeachingBubble) { + if (!inputEdited.current) { toggleCopilotTeachingBubbleVisible(); inputEdited.current = true; } @@ -380,6 +379,7 @@ export const QueryCopilotTab: React.FC = ({ explorer }: Query }} onKeyDown={(e) => { if (e.key === "Enter") { + inputEdited.current = true; startGenerateQueryProcess(); } }} @@ -450,6 +450,7 @@ export const QueryCopilotTab: React.FC = ({ explorer }: Query onClick={() => { setUserPrompt(history); setShowSamplePrompts(false); + inputEdited.current = true; }} onRenderIcon={() => } styles={promptStyles} @@ -479,6 +480,7 @@ export const QueryCopilotTab: React.FC = ({ explorer }: Query onClick={() => { setUserPrompt(prompt.text); setShowSamplePrompts(false); + inputEdited.current = true; }} onRenderIcon={() => } styles={promptStyles}