From e811a5dd6c037f0c69616b4c89b3e6bcee491713 Mon Sep 17 00:00:00 2001 From: Ahmed yasser <26207361+1AhmedYasser@users.noreply.github.com> Date: Fri, 12 Jun 2026 14:32:04 +0300 Subject: [PATCH 1/4] chore(1068): Added chat id to predefinedInputKeys (#1071) --- GUI/src/components/FlowElementsPopup/PreviousVariables.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/GUI/src/components/FlowElementsPopup/PreviousVariables.tsx b/GUI/src/components/FlowElementsPopup/PreviousVariables.tsx index 5a39a4917..45261b99e 100644 --- a/GUI/src/components/FlowElementsPopup/PreviousVariables.tsx +++ b/GUI/src/components/FlowElementsPopup/PreviousVariables.tsx @@ -109,6 +109,11 @@ const PreviousVariables: FC = ({ node }) => { key: 'Empty Content Type', value: stringToTemplate(''), }, + { + id: predefinedInputKeys[1], + key: 'Chat Id', + value: stringToTemplate('chatId'), + }, ]; setAssignedVariables([...assignElements, ...predefinedInputElements, ...newAssignElements]); From ef79980fabf24dd6d3503eef6b3757742e58ba69 Mon Sep 17 00:00:00 2001 From: 1AhmedYasser <26207361+1AhmedYasser@users.noreply.github.com> Date: Fri, 12 Jun 2026 14:56:30 +0300 Subject: [PATCH 2/4] fix(1059): Fixed Branch Edge Merge After Node Deletion --- GUI/src/hooks/flow/useOnNodeDelete.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/GUI/src/hooks/flow/useOnNodeDelete.ts b/GUI/src/hooks/flow/useOnNodeDelete.ts index 875177a52..876a7e028 100644 --- a/GUI/src/hooks/flow/useOnNodeDelete.ts +++ b/GUI/src/hooks/flow/useOnNodeDelete.ts @@ -77,7 +77,8 @@ const processDeletedNodes = ( updatedNodes = [...updatedNodes.filter((n) => n.id !== node.id), ...newGhostNodes]; updatedEdges = [...getRemainingEdges(updatedEdges, getConnectedEdges([node], updatedEdges)), ...newEdges]; } else { - if (outgoers.length === 0 || outgoers.length > 1) { + const edgesWithoutDeleted = getRemainingEdges(updatedEdges, getConnectedEdges([node], updatedEdges)); + if (outgoers.length === 0 || outgoers.length > 1 || (outgoers.length === 1 && getIncomers(outgoers[0], updatedNodes, edgesWithoutDeleted).length > 0)) { const ghostNode: Node = { id: generateUniqueId(), type: 'ghost', From 26fbb00492e9dc535561841d1d1adbb12bcacfc4 Mon Sep 17 00:00:00 2001 From: 1AhmedYasser <26207361+1AhmedYasser@users.noreply.github.com> Date: Fri, 12 Jun 2026 14:57:53 +0300 Subject: [PATCH 3/4] fix(1059): Fixed format --- GUI/src/hooks/flow/useOnNodeDelete.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/GUI/src/hooks/flow/useOnNodeDelete.ts b/GUI/src/hooks/flow/useOnNodeDelete.ts index 876a7e028..5c1bf6565 100644 --- a/GUI/src/hooks/flow/useOnNodeDelete.ts +++ b/GUI/src/hooks/flow/useOnNodeDelete.ts @@ -78,7 +78,11 @@ const processDeletedNodes = ( updatedEdges = [...getRemainingEdges(updatedEdges, getConnectedEdges([node], updatedEdges)), ...newEdges]; } else { const edgesWithoutDeleted = getRemainingEdges(updatedEdges, getConnectedEdges([node], updatedEdges)); - if (outgoers.length === 0 || outgoers.length > 1 || (outgoers.length === 1 && getIncomers(outgoers[0], updatedNodes, edgesWithoutDeleted).length > 0)) { + if ( + outgoers.length === 0 || + outgoers.length > 1 || + (outgoers.length === 1 && getIncomers(outgoers[0], updatedNodes, edgesWithoutDeleted).length > 0) + ) { const ghostNode: Node = { id: generateUniqueId(), type: 'ghost', From 80e0213842518b7233253ed9c00d2f0679bb81e1 Mon Sep 17 00:00:00 2001 From: 1AhmedYasser <26207361+1AhmedYasser@users.noreply.github.com> Date: Fri, 12 Jun 2026 15:32:52 +0300 Subject: [PATCH 4/4] fix(1062): Fixed Loop Target Layout Breaking Upstream Nodes --- GUI/src/hooks/flow/useEdgeAdd.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/GUI/src/hooks/flow/useEdgeAdd.ts b/GUI/src/hooks/flow/useEdgeAdd.ts index 95e6bcb98..0c6c47aef 100644 --- a/GUI/src/hooks/flow/useEdgeAdd.ts +++ b/GUI/src/hooks/flow/useEdgeAdd.ts @@ -114,7 +114,16 @@ function useEdgeAdd(id: string) { let newEdges: Edge[] = []; setEdges((edges) => { - newEdges = edges.filter((e) => e.id !== id).concat([sourceEdge], targetEdge ?? [], ghostEdges); + const edgeIndex = edges.findIndex((e) => e.id === id); + const remainingEdges = edges.filter((e) => e.id !== id); + const insertIndex = edgeIndex === -1 ? remainingEdges.length : edgeIndex; + newEdges = [ + ...remainingEdges.slice(0, insertIndex), + sourceEdge, + ...(targetEdge ? [targetEdge] : []), + ...ghostEdges, + ...remainingEdges.slice(insertIndex), + ]; return newEdges; });