Automation final fixes
This commit is contained in:
@@ -58,11 +58,6 @@ const GlobalProgressBar: React.FC<GlobalProgressBarProps> = ({
|
||||
stages,
|
||||
initialSnapshot,
|
||||
}) => {
|
||||
// Animated progress state - moves 1% every 10 seconds
|
||||
const [animatedPercent, setAnimatedPercent] = React.useState(0);
|
||||
const lastRealPercent = React.useRef(0);
|
||||
const animationTimer = React.useRef<ReturnType<typeof setInterval> | null>(null);
|
||||
|
||||
// Don't render if no run or run is completed with 100%
|
||||
if (!currentRun) {
|
||||
return null;
|
||||
@@ -105,42 +100,10 @@ const GlobalProgressBar: React.FC<GlobalProgressBarProps> = ({
|
||||
};
|
||||
|
||||
const { percentage: realPercent, completed, total } = calculateGlobalProgress();
|
||||
|
||||
// Animated progress: moves 1% per 10 seconds, within current stage bounds
|
||||
React.useEffect(() => {
|
||||
if (realPercent > lastRealPercent.current) {
|
||||
lastRealPercent.current = realPercent;
|
||||
setAnimatedPercent(realPercent);
|
||||
}
|
||||
|
||||
if (animationTimer.current) {
|
||||
clearInterval(animationTimer.current);
|
||||
}
|
||||
|
||||
if (currentRun.status !== 'running') {
|
||||
return;
|
||||
}
|
||||
|
||||
// Calculate ceiling based on current stage (each stage is ~14% of total)
|
||||
const stageCeiling = Math.min(currentRun.current_stage * 14, realPercent + 10);
|
||||
|
||||
animationTimer.current = setInterval(() => {
|
||||
setAnimatedPercent(prev => {
|
||||
if (prev >= stageCeiling || prev >= realPercent + 5) {
|
||||
return prev;
|
||||
}
|
||||
return Math.min(prev + 1, stageCeiling);
|
||||
});
|
||||
}, 10000); // 1% every 10 seconds
|
||||
|
||||
return () => {
|
||||
if (animationTimer.current) {
|
||||
clearInterval(animationTimer.current);
|
||||
}
|
||||
};
|
||||
}, [currentRun.status, realPercent, currentRun.current_stage]);
|
||||
|
||||
const percentage = Math.max(animatedPercent, realPercent);
|
||||
|
||||
// REMOVED: Animated progress that was causing confusion
|
||||
// Now using real percentage directly from backend
|
||||
const percentage = realPercent;
|
||||
|
||||
// Hide if completed and at 100%
|
||||
if (currentRun.status === 'completed' && percentage >= 100) {
|
||||
|
||||
Reference in New Issue
Block a user