progress mdoal
This commit is contained in:
@@ -73,7 +73,15 @@ const getSuccessMessage = (functionId?: string, title?: string, stepLogs?: any[]
|
|||||||
}
|
}
|
||||||
return 'Article drafted successfully.';
|
return 'Article drafted successfully.';
|
||||||
}
|
}
|
||||||
if (funcName.includes('image') && (funcName.includes('prompt') || funcName.includes('extract'))) {
|
// Check for image generation from prompts FIRST (more specific)
|
||||||
|
if (funcName.includes('image') && funcName.includes('from')) {
|
||||||
|
// Image generation from prompts
|
||||||
|
const imageCount = extractCount(/(\d+)\s+image/i, stepLogs || []);
|
||||||
|
if (imageCount) {
|
||||||
|
return `${imageCount} image${imageCount !== '1' ? 's' : ''} generated successfully`;
|
||||||
|
}
|
||||||
|
return 'Images generated successfully';
|
||||||
|
} else if (funcName.includes('image') && (funcName.includes('prompt') || funcName.includes('extract'))) {
|
||||||
// Image prompt generation
|
// Image prompt generation
|
||||||
// Try to extract from SAVE step message first (most reliable)
|
// Try to extract from SAVE step message first (most reliable)
|
||||||
const saveStepLog = stepLogs?.find(log => log.stepName === 'SAVE');
|
const saveStepLog = stepLogs?.find(log => log.stepName === 'SAVE');
|
||||||
@@ -120,13 +128,6 @@ const getSuccessMessage = (functionId?: string, title?: string, stepLogs?: any[]
|
|||||||
|
|
||||||
// Default message
|
// Default message
|
||||||
return 'Featured Image and X In‑article Image Prompts ready for image generation';
|
return 'Featured Image and X In‑article Image Prompts ready for image generation';
|
||||||
} else if (funcName.includes('image') && funcName.includes('from')) {
|
|
||||||
// Image generation from prompts
|
|
||||||
const imageCount = extractCount(/(\d+)\s+image/i, stepLogs || []);
|
|
||||||
if (imageCount) {
|
|
||||||
return `${imageCount} image${imageCount !== '1' ? 's' : ''} generated successfully`;
|
|
||||||
}
|
|
||||||
return 'Images generated successfully';
|
|
||||||
}
|
}
|
||||||
return 'Task completed successfully.';
|
return 'Task completed successfully.';
|
||||||
};
|
};
|
||||||
@@ -165,16 +166,8 @@ const getStepsForFunction = (functionId?: string, title?: string): Array<{phase:
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (funcName.includes('image') && (funcName.includes('prompt') || funcName.includes('extract'))) {
|
// Check for image generation from prompts FIRST (more specific)
|
||||||
// Image prompt generation
|
if (funcName.includes('image') && funcName.includes('from')) {
|
||||||
return [
|
|
||||||
{ phase: 'INIT', label: 'Checking content and image slots' },
|
|
||||||
{ phase: 'PREP', label: 'Mapping Content for X Image Prompts' },
|
|
||||||
{ phase: 'AI_CALL', label: 'Writing Featured Image Prompts' },
|
|
||||||
{ phase: 'PARSE', label: 'Writing X In‑article Image Prompts' },
|
|
||||||
{ phase: 'SAVE', label: 'Assigning Prompts to Dedicated Slots' },
|
|
||||||
];
|
|
||||||
} else if (funcName.includes('image') && funcName.includes('from')) {
|
|
||||||
// Image generation from prompts
|
// Image generation from prompts
|
||||||
return [
|
return [
|
||||||
{ phase: 'INIT', label: 'Validating image prompts' },
|
{ phase: 'INIT', label: 'Validating image prompts' },
|
||||||
@@ -183,6 +176,15 @@ const getStepsForFunction = (functionId?: string, title?: string): Array<{phase:
|
|||||||
{ phase: 'PARSE', label: 'Processing image URLs' },
|
{ phase: 'PARSE', label: 'Processing image URLs' },
|
||||||
{ phase: 'SAVE', label: 'Saving image URLs' },
|
{ phase: 'SAVE', label: 'Saving image URLs' },
|
||||||
];
|
];
|
||||||
|
} else if (funcName.includes('image') && (funcName.includes('prompt') || funcName.includes('extract'))) {
|
||||||
|
// Image prompt generation
|
||||||
|
return [
|
||||||
|
{ phase: 'INIT', label: 'Checking content and image slots' },
|
||||||
|
{ phase: 'PREP', label: 'Mapping Content for X Image Prompts' },
|
||||||
|
{ phase: 'AI_CALL', label: 'Writing Featured Image Prompts' },
|
||||||
|
{ phase: 'PARSE', label: 'Writing X In‑article Image Prompts' },
|
||||||
|
{ phase: 'SAVE', label: 'Assigning Prompts to Dedicated Slots' },
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Default fallback
|
// Default fallback
|
||||||
@@ -390,7 +392,57 @@ export default function ProgressModal({
|
|||||||
return `${articleCount} article${articleCount !== '1' ? 's' : ''} created`;
|
return `${articleCount} article${articleCount !== '1' ? 's' : ''} created`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (funcName.includes('image')) {
|
} else if (funcName.includes('image') && funcName.includes('from')) {
|
||||||
|
// Image generation from prompts
|
||||||
|
if (stepPhase === 'PREP') {
|
||||||
|
// Extract image count from PREP step message
|
||||||
|
const imageCount = extractCount(/(\d+)\s+image/i);
|
||||||
|
if (imageCount) {
|
||||||
|
return `Preparing to generate ${imageCount} image${imageCount !== '1' ? 's' : ''}`;
|
||||||
|
}
|
||||||
|
if (stepLog?.message) {
|
||||||
|
const match = stepLog.message.match(/Preparing to generate (\d+)\s+image/i);
|
||||||
|
if (match && match[1]) {
|
||||||
|
return `Preparing to generate ${match[1]} image${match[1] !== '1' ? 's' : ''}`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 'Preparing image generation queue';
|
||||||
|
} else if (stepPhase === 'AI_CALL') {
|
||||||
|
// Extract current image number from message
|
||||||
|
const match = stepLog?.message?.match(/Generating.*image (\d+)/i);
|
||||||
|
if (match && match[1]) {
|
||||||
|
return `Generating image ${match[1]} with AI`;
|
||||||
|
}
|
||||||
|
return 'Generating images with AI';
|
||||||
|
} else if (stepPhase === 'PARSE') {
|
||||||
|
// Extract image count from PARSE step
|
||||||
|
const imageCount = extractCount(/(\d+)\s+image/i);
|
||||||
|
if (imageCount) {
|
||||||
|
return `${imageCount} image${imageCount !== '1' ? 's' : ''} generated successfully`;
|
||||||
|
}
|
||||||
|
if (stepLog?.message) {
|
||||||
|
const match = stepLog.message.match(/(\d+)\s+image.*generated/i);
|
||||||
|
if (match && match[1]) {
|
||||||
|
return `${match[1]} image${match[1] !== '1' ? 's' : ''} generated successfully`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 'Processing image URLs';
|
||||||
|
} else if (stepPhase === 'SAVE') {
|
||||||
|
// Extract image count from SAVE step
|
||||||
|
const imageCount = extractCount(/(\d+)\s+image/i);
|
||||||
|
if (imageCount) {
|
||||||
|
return `Saving ${imageCount} image${imageCount !== '1' ? 's' : ''}`;
|
||||||
|
}
|
||||||
|
if (stepLog?.message) {
|
||||||
|
const match = stepLog.message.match(/Saved image (\d+)/i);
|
||||||
|
if (match && match[1]) {
|
||||||
|
return `Saving image ${match[1]}`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 'Saving image URLs';
|
||||||
|
}
|
||||||
|
} else if (funcName.includes('image') && (funcName.includes('prompt') || funcName.includes('extract'))) {
|
||||||
|
// Image prompt generation
|
||||||
if (stepPhase === 'PREP') {
|
if (stepPhase === 'PREP') {
|
||||||
// Extract total image count from PREP step message
|
// Extract total image count from PREP step message
|
||||||
// Look for "Mapping Content for X Image Prompts"
|
// Look for "Mapping Content for X Image Prompts"
|
||||||
@@ -606,17 +658,31 @@ export default function ProgressModal({
|
|||||||
} else if (funcName.includes('idea')) {
|
} else if (funcName.includes('idea')) {
|
||||||
// For idea generation, use fixed heading
|
// For idea generation, use fixed heading
|
||||||
return 'Generating Content Ideas & Outline';
|
return 'Generating Content Ideas & Outline';
|
||||||
} else if (funcName.includes('image')) {
|
} else if (funcName.includes('image') && funcName.includes('from')) {
|
||||||
// For image prompts, use fixed heading
|
// For image generation from prompts
|
||||||
|
return 'Generate Images';
|
||||||
|
} else if (funcName.includes('image') && (funcName.includes('prompt') || funcName.includes('extract'))) {
|
||||||
|
// For image prompt generation
|
||||||
return 'Smart Image Prompts';
|
return 'Smart Image Prompts';
|
||||||
|
} else if (funcName.includes('image')) {
|
||||||
|
// Fallback for other image functions
|
||||||
|
return 'Generate Images';
|
||||||
}
|
}
|
||||||
return title;
|
return title;
|
||||||
})()}
|
})()}
|
||||||
</h3>
|
</h3>
|
||||||
{/* Subtitle for image prompts */}
|
{/* Subtitle for image functions */}
|
||||||
{(() => {
|
{(() => {
|
||||||
const funcName = (functionId || title || '').toLowerCase();
|
const funcName = (functionId || title || '').toLowerCase();
|
||||||
if (funcName.includes('image')) {
|
if (funcName.includes('image') && funcName.includes('from')) {
|
||||||
|
// Image generation from prompts
|
||||||
|
return (
|
||||||
|
<p className="text-sm text-gray-500 dark:text-gray-400 text-center mt-1">
|
||||||
|
Generating images from prompts using AI
|
||||||
|
</p>
|
||||||
|
);
|
||||||
|
} else if (funcName.includes('image') && (funcName.includes('prompt') || funcName.includes('extract'))) {
|
||||||
|
// Image prompt generation
|
||||||
return (
|
return (
|
||||||
<p className="text-sm text-gray-500 dark:text-gray-400 text-center mt-1">
|
<p className="text-sm text-gray-500 dark:text-gray-400 text-center mt-1">
|
||||||
Powered by Igny8 Visual Intelligence
|
Powered by Igny8 Visual Intelligence
|
||||||
@@ -626,7 +692,24 @@ export default function ProgressModal({
|
|||||||
return null;
|
return null;
|
||||||
})()}
|
})()}
|
||||||
{!showSuccess && status !== 'completed' && (
|
{!showSuccess && status !== 'completed' && (
|
||||||
<p className="text-sm text-gray-600 dark:text-gray-400 text-center">{message}</p>
|
<p className="text-sm text-gray-600 dark:text-gray-400 text-center">
|
||||||
|
{(() => {
|
||||||
|
const funcName = (functionId || title || '').toLowerCase();
|
||||||
|
// For image generation, show a more specific message
|
||||||
|
if (funcName.includes('image') && funcName.includes('from')) {
|
||||||
|
// Get current step message from step logs
|
||||||
|
const currentStepLog = stepLogs.find(log => log.stepName === currentPhase);
|
||||||
|
if (currentStepLog?.message) {
|
||||||
|
return currentStepLog.message;
|
||||||
|
}
|
||||||
|
// Fallback to step label
|
||||||
|
const currentStep = steps.find(s => s.phase === currentPhase);
|
||||||
|
return currentStep?.label || 'Generating images...';
|
||||||
|
}
|
||||||
|
// For other functions, use the message prop
|
||||||
|
return message;
|
||||||
|
})()}
|
||||||
|
</p>
|
||||||
)}
|
)}
|
||||||
{status === 'completed' && !allStepsVisuallyCompleted && (
|
{status === 'completed' && !allStepsVisuallyCompleted && (
|
||||||
<p className="text-sm text-gray-600 dark:text-gray-400 text-center">Processing...</p>
|
<p className="text-sm text-gray-600 dark:text-gray-400 text-center">Processing...</p>
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import React from 'react';
|
|||||||
import Badge from '../../components/ui/badge/Badge';
|
import Badge from '../../components/ui/badge/Badge';
|
||||||
import ContentImageCell, { ContentImageData } from '../../components/common/ContentImageCell';
|
import ContentImageCell, { ContentImageData } from '../../components/common/ContentImageCell';
|
||||||
import { ContentImagesGroup } from '../../services/api';
|
import { ContentImagesGroup } from '../../services/api';
|
||||||
|
import { BoltIcon } from '../../icons';
|
||||||
|
|
||||||
export interface ColumnConfig {
|
export interface ColumnConfig {
|
||||||
key: string;
|
key: string;
|
||||||
|
|||||||
Reference in New Issue
Block a user