From cad24f1f881cbf19a0b37751aaec829e11251bff Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Fri, 16 Jun 2023 17:16:36 -0300 Subject: [PATCH 1/2] fix(chatComponent): add isBuilt dependency to useEffect hook to avoid stale closure and improve performance --- src/frontend/src/components/chatComponent/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/frontend/src/components/chatComponent/index.tsx b/src/frontend/src/components/chatComponent/index.tsx index 17c32e500..2bea3eeb3 100644 --- a/src/frontend/src/components/chatComponent/index.tsx +++ b/src/frontend/src/components/chatComponent/index.tsx @@ -16,7 +16,7 @@ export default function Chat({ flow }: ChatType) { const handleKeyDown = (event: KeyboardEvent) => { if ( (event.key === "K" || event.key === "k") && - (event.metaKey || event.ctrlKey) + (event.metaKey || event.ctrlKey) && isBuilt ) { event.preventDefault(); setOpen((oldState) => !oldState); @@ -26,7 +26,7 @@ export default function Chat({ flow }: ChatType) { return () => { document.removeEventListener("keydown", handleKeyDown); }; - }, []); + }, [isBuilt]); useEffect(() => { // Define an async function within the useEffect hook From 39707f9f80280d5671ea7a2f3fc740314ab9068f Mon Sep 17 00:00:00 2001 From: Rodrigo Nader Date: Fri, 16 Jun 2023 17:19:49 -0300 Subject: [PATCH 2/2] Refactor error message for build trigger component Changed the error message in the build trigger component to clarify which components need to be checked before retrying. Updated the list to include instructions on how to inspect the component status. --- .../src/components/chatComponent/buildTrigger/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontend/src/components/chatComponent/buildTrigger/index.tsx b/src/frontend/src/components/chatComponent/buildTrigger/index.tsx index 105f68111..564cfed6a 100644 --- a/src/frontend/src/components/chatComponent/buildTrigger/index.tsx +++ b/src/frontend/src/components/chatComponent/buildTrigger/index.tsx @@ -48,7 +48,7 @@ export default function BuildTrigger({ if(!allNodesValid) { setErrorData({ title: "Oops! Looks like you missed something", - list: ["Check nodes and retry. Hover over 🔴 node for status."], + list: ["Check components and retry. Hover over component status icon 🔴 to inspect."], }); } } catch (error) {