Created a new, simplified progress bar component that works reliably for both synchronous and asynchronous processing modes.
The previous progress system had several issues:
- AsyncTaskProgress - Showed static progress (queued=10%, processing=50%) without real-time updates
- UnifiedProgress - Complex component that was overkill for this use case
- No mode detection - Couldn't distinguish between sync (fast) and async (slow) processing
- Inconsistent updates - Progress didn't animate smoothly
Created a new lightweight component (SimpleProgress.vue) with these features:
-
Smooth Progress Animation
- Animates progress changes over 500ms for visual smoothness
- Prevents jarring jumps in progress percentage
- Uses CSS transitions for buttery smooth movement
-
Dual Mode Support
- Sync Mode: Fast processing (usually < 10 seconds)
- Async Mode: Longer processing with queue management
- Automatically detects which mode based on metadata
-
Real-time Backend Updates
- Watches globalProgress store for changes
- Updates immediately when backend sends new progress
- Counts number of progress updates received
-
Smart Completion Detection
- Recognizes when progress reaches 100%
- Shows success state with checkmark
- Auto-hides after 2 seconds on completion
-
Error Handling
- Displays error messages clearly
- Shows warning icon for failed processing
- Stops timers appropriately on error
-
Processing Stats
- Elapsed Time: Shows real-time elapsed duration
- Processing Mode: Displays "Sync Mode" or "Async Mode"
- Update Count: Shows how many progress updates received
┌─────────────────────────────────────────────────┐
│ [SPINNER] Processing Content │
│ Extracting citations... │
├─────────────────────────────────────────────────┤
│ ████████████████░░░░░░░░ 45% │
├─────────────────────────────────────────────────┤
│ 🕐 12s 💻 Sync Mode Updates: 8 │
└─────────────────────────────────────────────────┘
File: casestrainer-vue-new/src/components/SimpleProgress.vue
<template>
<div v-if="isProcessing" class="simple-progress-container">
<!-- Header with icon (spinner/checkmark/error) -->
<!-- Progress bar with smooth animation -->
<!-- Stats row with elapsed time and mode -->
</div>
</template>const animateProgress = (targetPercent) => {
const startPercent = displayPercent.value
const diff = targetPercent - startPercent
// Animate over 500ms in 10 steps
const steps = 10
const increment = diff / steps
smoothProgressTimer = setInterval(() => {
displayPercent.value += increment
}, 50)
}watch(() => globalProgress.progressState, (newState) => {
// Extract progress percentage
const newPercent = newState.totalProgress || 0
// Animate to new value
animateProgress(newPercent)
// Update message
currentMessage.value = newState.currentStep
// Check for completion
if (newPercent >= 100) {
isComplete.value = true
// Auto-hide after 2 seconds
}
}, { deep: true, immediate: true })onMounted(() => {
// Extract mode from metadata
const metadata = globalProgress.progressState.metadata || {}
processingMode.value = metadata.processing_mode || ''
// Shows "sync" or "async"
})File: casestrainer-vue-new/src/views/HomeView.vue
import SimpleProgress from '@/components/SimpleProgress.vue'<!-- Real-time Progress Display - Works for both sync and async -->
<SimpleProgress component-id="home" />// At start of processing
globalProgress.progressState.metadata = {
processing_mode: 'sync',
input_type: activeTab.value
}
// If async detected
if (processingMode === 'queued' && jobId) {
globalProgress.progressState.metadata = {
processing_mode: 'async',
input_type: activeTab.value,
job_id: jobId
}
}User submits → Analyze starts
↓
globalProgress initialized (mode: 'sync')
↓
SimpleProgress appears with spinner
↓
Backend polling: /processing_progress?request_id=...
↓
Progress updates: 0% → 25% → 50% → 75% → 100%
↓
SimpleProgress animates smoothly
↓
Completion: Shows checkmark, hides after 2s
User submits → Server queues job
↓
globalProgress initialized (mode: 'sync')
↓
Response includes job_id → Switch to 'async' mode
↓
SimpleProgress shows "Async Mode"
↓
Backend polling: /task_status/{job_id}
↓
Progress updates: 10% → 20% → ... → 100%
↓
SimpleProgress animates smoothly
↓
Completion: Shows checkmark, hides after 2s
- Single component handles both modes
- Less code to maintain
- Easier to debug
- Direct connection to globalProgress store
- No complex state management
- Fewer edge cases
- Smooth CSS animations
- Efficient reactivity
- Minimal re-renders
- Clear visual feedback
- Mode indicator (sync/async)
- Processing stats
- Smooth progress animation
- Auto-hiding on completion
- Go to home page
- Paste a small text (< 2KB)
- Click "Analyze Content"
- Expected:
- Progress bar appears immediately
- Shows "Sync Mode"
- Animates 0% → 100% in 5-10 seconds
- Shows checkmark and hides
- Go to home page
- Submit a large PDF URL
- Click "Analyze Content"
- Expected:
- Progress bar shows "Queued" initially
- Switches to "Async Mode"
- Animates over 30-60 seconds
- Shows real progress from backend
- Completes at 100%
| Feature | Old (AsyncTaskProgress) | New (SimpleProgress) |
|---|---|---|
| Progress Type | Static (10%, 50%, 100%) | Real-time from backend |
| Animation | None | Smooth 500ms transitions |
| Mode Display | No | Yes (Sync/Async) |
| Stats | Task ID only | Elapsed time, mode, updates |
| Auto-hide | No | Yes (2s after completion) |
| Error Display | Basic | Clear with icon |
| Code Lines | ~385 lines | ~350 lines (simpler) |
casestrainer-vue-new/src/components/SimpleProgress.vue(NEW)- Complete progress bar component
- ~350 lines with full styling
-
casestrainer-vue-new/src/views/HomeView.vue- Import SimpleProgress (line 455)
- Use SimpleProgress component (lines 403-406)
- Set metadata for mode detection (lines 1278-1281, 1384-1388)
-
BETTER_PROGRESS_BAR.md(NEW - this file)- Complete documentation
✅ Frontend rebuilt - Ready to deploy
cd d:\dev\casestrainer
./cslaunch- Navigate to home page
- Try both sync (paste text) and async (submit URL) processing
- Watch progress bar animate smoothly
- Verify mode indicator shows correct mode
- Check that progress stops at 100% and auto-hides
- Pause/Resume: Add ability to pause long-running tasks
- Cancel Button: Allow users to cancel processing
- Progress History: Show list of recent processing jobs
- Estimated Completion: Calculate ETA based on current progress
- Multi-task Display: Show multiple jobs in parallel
- Sound Notifications: Play sound when processing completes
✅ Created SimpleProgress component - Works for both sync and async
✅ Smooth animations - 500ms transitions for visual polish
✅ Mode detection - Shows "Sync Mode" or "Async Mode"
✅ Real-time updates - Connected to backend progress
✅ Processing stats - Elapsed time, update count
✅ Auto-completion - Hides 2s after reaching 100%
✅ Error handling - Clear error display
✅ Frontend rebuilt - Ready to test
The new progress bar provides a much better user experience with clear feedback for both fast (sync) and slow (async) processing!