feat: FlowPilot AI — Phases 4 & 5 (Gallery, Export, Responsive, Enterprise, Analytics) #116

Merged
chihlasm merged 66 commits from feat/flowpilot-ai-session into main 2026-03-21 05:15:51 +00:00
Showing only changes of commit 60b380ae1e - Show all commits

View File

@@ -1,4 +1,4 @@
import { useEffect, useState } from 'react'
import { useEffect, useRef, useState } from 'react'
import { useParams, useSearchParams, useLocation } from 'react-router-dom'
import { Sparkles, Loader2 } from 'lucide-react'
import { useFlowPilotSession } from '@/hooks/useFlowPilotSession'
@@ -13,6 +13,15 @@ export default function FlowPilotSessionPage() {
const prefill = (location.state as { prefill?: string } | null)?.prefill || ''
const isPickup = searchParams.get('pickup') === 'true'
const fp = useFlowPilotSession()
const prefillHandledRef = useRef(false)
// Auto-submit when navigating from dashboard with prefilled problem
useEffect(() => {
if (prefill && !prefillHandledRef.current && !sessionId && !fp.session && !fp.isLoading) {
prefillHandledRef.current = true
fp.startSession({ intake_type: 'free_text', intake_content: { text: prefill } })
}
}, [prefill, sessionId, fp.session, fp.isLoading]) // eslint-disable-line react-hooks/exhaustive-deps
const [pickingUp, setPickingUp] = useState(false)
// Load existing session if ID in URL