diff --git a/ui/desktop/src/components/ChatView.tsx b/ui/desktop/src/components/ChatView.tsx index dd69b5cf1f..59533d3a20 100644 --- a/ui/desktop/src/components/ChatView.tsx +++ b/ui/desktop/src/components/ChatView.tsx @@ -97,6 +97,7 @@ function ChatContent({ const [droppedFiles, setDroppedFiles] = useState([]); const scrollRef = useRef(null); + const hasSentPromptRef = useRef(false); const { summaryContent, @@ -278,6 +279,14 @@ function ChatContent({ } }, [messages]); + useEffect(() => { + const prompt = recipeConfig?.prompt; + if (prompt && !hasSentPromptRef.current) { + append(prompt); + hasSentPromptRef.current = true; + } + }, [recipeConfig?.prompt, append]); + // Handle submit const handleSubmit = (e: React.FormEvent) => { window.electron.startPowerSaveBlocker(); @@ -476,7 +485,6 @@ function ChatContent({ const handleDragOver = (e: React.DragEvent) => { e.preventDefault(); }; - return (
{/* Loader when generating recipe */} diff --git a/ui/desktop/src/main.ts b/ui/desktop/src/main.ts index 55bf7bbbf6..d06196912a 100644 --- a/ui/desktop/src/main.ts +++ b/ui/desktop/src/main.ts @@ -285,10 +285,11 @@ const windowMap = new Map(); interface RecipeConfig { id: string; - name: string; + title: string; description: string; instructions: string; activities: string[]; + prompt: string; } const createChat = async (