From 3eae92e1c17fff4b5c4be3ba0ef956ededd160bc Mon Sep 17 00:00:00 2001 From: Matt Date: Sat, 28 Mar 2026 14:58:56 +0100 Subject: [PATCH] feat: show "Generating your brief..." badge during brief generation Visual feedback while the complete_brief API call runs (~15s). Badge appears below the orb with a spinner animation. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/components/configurator/VoiceAgent.tsx | 16 +++++++++++++++- .../configurator/VoiceAgentProvider.tsx | 4 ++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/components/configurator/VoiceAgent.tsx b/src/components/configurator/VoiceAgent.tsx index b47b56c..92c8b57 100644 --- a/src/components/configurator/VoiceAgent.tsx +++ b/src/components/configurator/VoiceAgent.tsx @@ -55,6 +55,7 @@ export default function VoiceAgent({ locale, onComplete }: VoiceAgentProps) { transcript, selections, isAnalyzingSite, + isGeneratingBrief, agentAmplitude, startConversation, endConversation, @@ -176,7 +177,7 @@ export default function VoiceAgent({ locale, onComplete }: VoiceAgentProps) { )} - {/* Analyzing site badge */} + {/* Status badges */} {isAnalyzingSite && ( )} + {isGeneratingBrief && !completedBrief && ( + + + + + {locale === 'fr' ? 'Génération de votre brief...' : 'Generating your brief...'} + + )} {/* Error message */} diff --git a/src/components/configurator/VoiceAgentProvider.tsx b/src/components/configurator/VoiceAgentProvider.tsx index 18dcded..2aaf7b6 100644 --- a/src/components/configurator/VoiceAgentProvider.tsx +++ b/src/components/configurator/VoiceAgentProvider.tsx @@ -21,6 +21,7 @@ interface VoiceAgentContextValue { transcript: TranscriptEntry[]; selections: Partial; isAnalyzingSite: boolean; + isGeneratingBrief: boolean; userAmplitude: number; agentAmplitude: number; startConversation: () => Promise; @@ -127,6 +128,7 @@ export default function VoiceAgentProvider({ locale, children }: VoiceAgentProvi const [transcript, setTranscript] = useState([]); const [selections, setSelections] = useState>({}); const [isAnalyzingSite, setIsAnalyzingSite] = useState(false); + const [isGeneratingBrief, setIsGeneratingBrief] = useState(false); const [userAmplitude, setUserAmplitude] = useState(0); const [agentAmplitude, setAgentAmplitude] = useState(0); const [completedBrief, setCompletedBrief] = useState(null); @@ -195,6 +197,7 @@ export default function VoiceAgentProvider({ locale, children }: VoiceAgentProvi // Prevent duplicate submissions if (briefSubmittedRef.current) return JSON.stringify({ success: true, message: 'Brief already submitted' }); briefSubmittedRef.current = true; + setIsGeneratingBrief(true); console.log('[VoiceAgent] complete_brief called, generating...'); try { const formData = { ...DEFAULT_FORM_DATA, ...(args as Partial), locale }; @@ -475,6 +478,7 @@ export default function VoiceAgentProvider({ locale, children }: VoiceAgentProvi transcript, selections, isAnalyzingSite, + isGeneratingBrief, userAmplitude, agentAmplitude, startConversation,