Update ProgressModal.tsx

This commit is contained in:
Desktop
2025-11-11 01:54:41 +05:00
parent 1b6d431971
commit 2f5ec140f6

View File

@@ -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;
})()}