feat: show "Generating your brief..." badge during brief generation
All checks were successful
Build & Push / build-and-push (push) Successful in 1m57s
All checks were successful
Build & Push / build-and-push (push) Successful in 1m57s
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) <noreply@anthropic.com>
This commit is contained in:
@@ -55,6 +55,7 @@ export default function VoiceAgent({ locale, onComplete }: VoiceAgentProps) {
|
|||||||
transcript,
|
transcript,
|
||||||
selections,
|
selections,
|
||||||
isAnalyzingSite,
|
isAnalyzingSite,
|
||||||
|
isGeneratingBrief,
|
||||||
agentAmplitude,
|
agentAmplitude,
|
||||||
startConversation,
|
startConversation,
|
||||||
endConversation,
|
endConversation,
|
||||||
@@ -176,7 +177,7 @@ export default function VoiceAgent({ locale, onComplete }: VoiceAgentProps) {
|
|||||||
)}
|
)}
|
||||||
</motion.div>
|
</motion.div>
|
||||||
|
|
||||||
{/* Analyzing site badge */}
|
{/* Status badges */}
|
||||||
<AnimatePresence>
|
<AnimatePresence>
|
||||||
{isAnalyzingSite && (
|
{isAnalyzingSite && (
|
||||||
<motion.div
|
<motion.div
|
||||||
@@ -191,6 +192,19 @@ export default function VoiceAgent({ locale, onComplete }: VoiceAgentProps) {
|
|||||||
{t('voice.analyzingSite')}
|
{t('voice.analyzingSite')}
|
||||||
</motion.div>
|
</motion.div>
|
||||||
)}
|
)}
|
||||||
|
{isGeneratingBrief && !completedBrief && (
|
||||||
|
<motion.div
|
||||||
|
initial={{ opacity: 0, y: -4 }}
|
||||||
|
animate={{ opacity: 1, y: 0 }}
|
||||||
|
exit={{ opacity: 0, y: -4 }}
|
||||||
|
className="flex items-center gap-1.5 px-3 py-1.5 rounded-full bg-primary/10 text-primary-dark text-xs font-medium"
|
||||||
|
>
|
||||||
|
<motion.div animate={{ rotate: 360 }} transition={{ duration: 1, repeat: Infinity, ease: 'linear' }}>
|
||||||
|
<Loader2 size={11} />
|
||||||
|
</motion.div>
|
||||||
|
{locale === 'fr' ? 'Génération de votre brief...' : 'Generating your brief...'}
|
||||||
|
</motion.div>
|
||||||
|
)}
|
||||||
</AnimatePresence>
|
</AnimatePresence>
|
||||||
|
|
||||||
{/* Error message */}
|
{/* Error message */}
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ interface VoiceAgentContextValue {
|
|||||||
transcript: TranscriptEntry[];
|
transcript: TranscriptEntry[];
|
||||||
selections: Partial<WizardFormData>;
|
selections: Partial<WizardFormData>;
|
||||||
isAnalyzingSite: boolean;
|
isAnalyzingSite: boolean;
|
||||||
|
isGeneratingBrief: boolean;
|
||||||
userAmplitude: number;
|
userAmplitude: number;
|
||||||
agentAmplitude: number;
|
agentAmplitude: number;
|
||||||
startConversation: () => Promise<void>;
|
startConversation: () => Promise<void>;
|
||||||
@@ -127,6 +128,7 @@ export default function VoiceAgentProvider({ locale, children }: VoiceAgentProvi
|
|||||||
const [transcript, setTranscript] = useState<TranscriptEntry[]>([]);
|
const [transcript, setTranscript] = useState<TranscriptEntry[]>([]);
|
||||||
const [selections, setSelections] = useState<Partial<WizardFormData>>({});
|
const [selections, setSelections] = useState<Partial<WizardFormData>>({});
|
||||||
const [isAnalyzingSite, setIsAnalyzingSite] = useState(false);
|
const [isAnalyzingSite, setIsAnalyzingSite] = useState(false);
|
||||||
|
const [isGeneratingBrief, setIsGeneratingBrief] = useState(false);
|
||||||
const [userAmplitude, setUserAmplitude] = useState(0);
|
const [userAmplitude, setUserAmplitude] = useState(0);
|
||||||
const [agentAmplitude, setAgentAmplitude] = useState(0);
|
const [agentAmplitude, setAgentAmplitude] = useState(0);
|
||||||
const [completedBrief, setCompletedBrief] = useState<string | null>(null);
|
const [completedBrief, setCompletedBrief] = useState<string | null>(null);
|
||||||
@@ -195,6 +197,7 @@ export default function VoiceAgentProvider({ locale, children }: VoiceAgentProvi
|
|||||||
// Prevent duplicate submissions
|
// Prevent duplicate submissions
|
||||||
if (briefSubmittedRef.current) return JSON.stringify({ success: true, message: 'Brief already submitted' });
|
if (briefSubmittedRef.current) return JSON.stringify({ success: true, message: 'Brief already submitted' });
|
||||||
briefSubmittedRef.current = true;
|
briefSubmittedRef.current = true;
|
||||||
|
setIsGeneratingBrief(true);
|
||||||
console.log('[VoiceAgent] complete_brief called, generating...');
|
console.log('[VoiceAgent] complete_brief called, generating...');
|
||||||
try {
|
try {
|
||||||
const formData = { ...DEFAULT_FORM_DATA, ...(args as Partial<WizardFormData>), locale };
|
const formData = { ...DEFAULT_FORM_DATA, ...(args as Partial<WizardFormData>), locale };
|
||||||
@@ -475,6 +478,7 @@ export default function VoiceAgentProvider({ locale, children }: VoiceAgentProvi
|
|||||||
transcript,
|
transcript,
|
||||||
selections,
|
selections,
|
||||||
isAnalyzingSite,
|
isAnalyzingSite,
|
||||||
|
isGeneratingBrief,
|
||||||
userAmplitude,
|
userAmplitude,
|
||||||
agentAmplitude,
|
agentAmplitude,
|
||||||
startConversation,
|
startConversation,
|
||||||
|
|||||||
Reference in New Issue
Block a user