From f8867d83f84772bbc83a4ac77db64a109fa8d166 Mon Sep 17 00:00:00 2001 From: chihlasm Date: Fri, 6 Mar 2026 23:06:07 -0500 Subject: [PATCH] fix: use actual root node ID in orphan validation check AI-generated trees use descriptive IDs (e.g., "verify-account-exists") instead of "root", causing the root node to be falsely flagged as orphaned. Co-Authored-By: Claude Opus 4.6 --- frontend/src/store/treeEditorStore.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/store/treeEditorStore.ts b/frontend/src/store/treeEditorStore.ts index 271df0ba..d069ce66 100644 --- a/frontend/src/store/treeEditorStore.ts +++ b/frontend/src/store/treeEditorStore.ts @@ -855,7 +855,7 @@ export const useTreeEditorStore = create()( // Check for orphaned nodes (not root and not referenced) allNodeIds.forEach(id => { - if (id !== 'root' && !referencedIds.has(id)) { + if (id !== state.treeStructure?.id && !referencedIds.has(id)) { // Check if it's a direct child of another node (via children array) let isChildOfAny = false const checkIfChild = (node: TreeStructure) => {