From fdc3be57ed6448aa131b4feca9e37b62df782038 Mon Sep 17 00:00:00 2001 From: chihlasm Date: Sat, 7 Mar 2026 01:19:36 -0500 Subject: [PATCH] feat: include flow name and description in AI Assist context Both editors now send name and description alongside the flow structure, so the AI can reference what the flow is about when responding. Co-Authored-By: Claude Opus 4.6 --- frontend/src/pages/ProceduralEditorPage.tsx | 4 +++- frontend/src/pages/TreeEditorPage.tsx | 9 +++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/frontend/src/pages/ProceduralEditorPage.tsx b/frontend/src/pages/ProceduralEditorPage.tsx index 0874a1c4..b9505cac 100644 --- a/frontend/src/pages/ProceduralEditorPage.tsx +++ b/frontend/src/pages/ProceduralEditorPage.tsx @@ -55,10 +55,12 @@ export function ProceduralEditorPage() { treeId: id, getFlowContext: useCallback(() => { return { + name, + description, steps: steps as unknown as Record[], intake_form: intakeForm, } - }, [steps, intakeForm]), + }, [steps, intakeForm, name, description]), }) const isMaintenance = treeType === 'maintenance' diff --git a/frontend/src/pages/TreeEditorPage.tsx b/frontend/src/pages/TreeEditorPage.tsx index b760b869..a604b488 100644 --- a/frontend/src/pages/TreeEditorPage.tsx +++ b/frontend/src/pages/TreeEditorPage.tsx @@ -36,6 +36,7 @@ export function TreeEditorPage() { const { name, + description, isDirty, isLoading, isSaving, @@ -87,8 +88,12 @@ export function TreeEditorPage() { treeId: id, getFlowContext: useCallback(() => { if (!treeStructure) return null - return treeStructure as unknown as Record - }, [treeStructure]), + return { + name, + description, + tree_structure: treeStructure as unknown as Record, + } + }, [treeStructure, name, description]), }) const previousEditingNodeRef = useRef(null)