feat: add real-time file processing progress indicators with async polling#214
Open
rajesh-puripanda wants to merge 2 commits into
Open
feat: add real-time file processing progress indicators with async polling#214rajesh-puripanda wants to merge 2 commits into
rajesh-puripanda wants to merge 2 commits into
Conversation
- Add in-memory JobRegistry for async job progress tracking - Add /api/status/<job_id> and /api/download/<job_id> endpoints - Refactor removeBg, merge-pdf, compress, upscale to async with polling - Create animated ProgressBar component with status colors - Create useJobPolling hook (500ms interval) - Update ToolPageTemplate with useAsyncProgress prop - Add progress indicators to RemoveBg, ImageCompress, ImageUpscale, PdfMerge - Fix dead duplicate code in compress route
- Remove unused variable in PdfSplit (max) - Remove unused useOutletContext import in ImageWatermark - Remove unused areValidDimensions function in ImageResize - Remove unused catch binding in ImageOCR - Remove unused file param in ImageMetadata - Remove unused error param in ErrorBoundary - Wrap addFiles in useCallback and fix onDrop deps in PdfMerge - Remove unused downloadTriggered state in ToolPageTemplate - Remove unused useState import and handleNavClick in LandingPage
Contributor
Author
|
@Durgeshwar-AI This PR is ready for review! The implementation includes:
Could you please add the appropriate labels?
Also, I can provide a screen recording of the progress bar in action would you like me to record one and share it here? Let me know if any changes are needed! |
Contributor
Author
Contributor
Author
|
Attaching images for your reference!! |
Owner
Screen.Recording.2026-06-04.121120.mp4Screen.Recording.2026-06-04.121323.mp4The first one is from the current main branch and the second one is what you have changed. Please check. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.









🔀 Pull Request
📌 Issue Reference
Closes #84
📝 Summary
Problem: File operations like background removal, PDF merge, image compression, and upscaling took noticeable time with only a spinner for feedback. Users had no visibility into processing progress.
Solution: Implemented an in-memory JobRegistry with async background processing. The backend returns a
job_idimmediately (HTTP 202), the frontend polls/api/status/<job_id>every 500ms, and an animated ProgressBar displays real-time progress (percentage + status messages) until completion, when the result auto-downloads.Major changes:
JobRegistrysingleton (thread-safe), new/api/status/and/api/download/endpoints, refactoredremoveBg,merge-pdf,compress, andupscaleroutes to async with staged progress updatesProgressBarcomponent (animated, color-coded), newuseJobPollinghook, updatedToolPageTemplatewithuseAsyncProgressprop, integrated into 4 pages✅ Checklist
💬 Additional Notes
useAsyncProgress={true}behave identically to beforeonSubmithandlers (PdfPng client-side, ImageOCR, ImageToSVG) continue to work unchangedcompressroute was removed