From 2f5ec140f6741fece3370b4fb512d247ec48adfb Mon Sep 17 00:00:00 2001 From: Desktop Date: Tue, 11 Nov 2025 01:54:41 +0500 Subject: [PATCH] Update ProgressModal.tsx --- .../src/components/common/ProgressModal.tsx | 45 ++++++++++++++----- 1 file changed, 33 insertions(+), 12 deletions(-) diff --git a/frontend/src/components/common/ProgressModal.tsx b/frontend/src/components/common/ProgressModal.tsx index 37396976..e92b3c1e 100644 --- a/frontend/src/components/common/ProgressModal.tsx +++ b/frontend/src/components/common/ProgressModal.tsx @@ -55,15 +55,12 @@ const getSuccessMessage = (functionId?: string, title?: string, stepLogs?: any[] return 'Clustering complete\nKeywords mapped and grouped into clusters'; } if (funcName.includes('idea')) { - const clusterCount = extractCount(/(\d+)\s+cluster/i, stepLogs || []); const ideaCount = extractCount(/(\d+)\s+idea/i, stepLogs || []); if (ideaCount) { - return `Content ideas created successfully — ${ideaCount} idea${ideaCount !== '1' ? 's' : ''} generated.`; - } else if (clusterCount) { - return `Content ideas created successfully — generated for ${clusterCount} cluster${clusterCount !== '1' ? 's' : ''}.`; + return `Content ideas & outlines created successfully`; } - return 'Content ideas and outlines created successfully.'; + return 'Content ideas & outlines created successfully'; } if (funcName.includes('content')) { const taskCount = extractCount(/(\d+)\s+task/i, stepLogs || []); @@ -106,11 +103,11 @@ const getStepsForFunction = (functionId?: string, title?: string): Array<{phase: if (funcName.includes('idea')) { return [ - { phase: 'INIT', label: 'Validating clusters' }, - { phase: 'PREP', label: 'Loading cluster data' }, - { phase: 'AI_CALL', label: 'Generating blog ideas' }, - { phase: 'PARSE', label: 'Structuring outlines' }, - { phase: 'SAVE', label: 'Saving ideas' }, + { phase: 'INIT', label: 'Verifying cluster integrity' }, + { phase: 'PREP', label: 'Loading cluster keywords' }, + { phase: 'AI_CALL', label: 'AI started processing clusters' }, + { phase: 'PARSE', label: 'High-opportunity ideas generated' }, + { phase: 'SAVE', label: 'Content Outline for Ideas generated' }, ]; } @@ -306,11 +303,32 @@ export default function ProgressModal({ return message; } } else if (funcName.includes('idea')) { - if (stepPhase === 'PARSE') { + if (stepPhase === 'INIT') { + // For INIT: Show "Verifying cluster integrity" + return 'Verifying cluster integrity'; + } else if (stepPhase === 'PREP') { + // For PREP: Show "Loading cluster keywords" + return 'Loading cluster keywords'; + } else if (stepPhase === 'AI_CALL') { + // For AI_CALL: Show "AI started processing clusters" + return 'AI started processing clusters'; + } else if (stepPhase === 'PARSE') { + // For PARSE: Show "X high-opportunity ideas generated" const ideaCount = extractCount(/(\d+)\s+idea/i); if (ideaCount) { - return `${ideaCount} idea${ideaCount !== '1' ? 's' : ''} created`; + return `${ideaCount} high-opportunity idea${ideaCount !== '1' ? 's' : ''} generated`; } + // Try to find idea count in any step log + for (const log of allStepLogs) { + const count = log.message?.match(/(\d+)\s+idea/i); + if (count && count[1]) { + return `${count[1]} high-opportunity idea${count[1] !== '1' ? 's' : ''} generated`; + } + } + return message; + } else if (stepPhase === 'SAVE') { + // For SAVE: Show "Content Outline for Ideas generated" + return 'Content Outline for Ideas generated'; } } else if (funcName.includes('content')) { if (stepPhase === 'PARSE') { @@ -490,6 +508,9 @@ export default function ProgressModal({ return `Mapping ${keywordCountMatch[1]} Keywords into Keyword Clusters`; } } + } else if (funcName.includes('idea')) { + // For idea generation, use fixed heading + return 'Generating Content Ideas & Outline'; } return title; })()}