Feat: Add cancel button for in-progress folder scan and AI tagging
Maintainers usually reply within 3 days
@anurag-sinha04 is already working on this.
Since Aug 24, 2026.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 52/100
Research direction
Start with backend/app/routes/folders.py and backend/app/database/folders.py, then trace post_folder_add_sequence(), post_AI_tagging_enabled_sequence(), image_util_process_folder_images(), and image_util_process_untagged_images(). Add backend tests for cooperative cancel behavior; done means the UI can cancel an active job, indexing becomes interrupted, completed work remains, and the app stays stable.
Written by the indexing model from the issue text.
Description
Describe the feature
Summary
PictoPy runs long background jobs when adding/syncing folders and when AI tagging is enabled, but users cannot stop them once started. If a wrong folder is added or tagging begins on a huge library, the user must wait or force-quit the app.
Why this is not a duplicate
I searched for: cancel scan, cancel index, cancel tagging.
- Closest: #811 (scan progress SSE) — shows progress, no cancel
- Closest: #1464 (parallel indexing) — performance, no cancel
- Closest: #1496 (corrupt image aborts batch) — error handling, not user cancel
Current behavior
- Add a large folder via Settings → Add Folder
- Backend submits
post_folder_add_sequence()onindexing_executor(backend/app/routes/folders.py) - UI shows indexing in progress (folder
indexing_status = in_progress) - User has no way to stop the job
Same for AI tagging via post_AI_tagging_enabled_sequence() on the single-worker executor.
Expected behavior
- User sees a Cancel button while indexing/tagging runs
- Cancel stops after the current file (cooperative cancel, not killing the process pool)
- Folder
indexing_statusbecomesinterrupted(status already exists inbackend/app/database/folders.py) - Partially indexed images remain; user can resume via folder sync later
- UI shows clear message: “Indexing cancelled. Sync folder to continue.”
Proposed solution (small scope)
Phase 1 — Folder indexing cancel
POST /folders/cancel-indexingwith{ folder_id }- Shared cancel flag (e.g.
multiprocessing.Managerdict) checked insideimage_util_process_folder_images()loop - On cancel: set
indexing_status = interrupted, return early
Phase 2 — AI tagging cancel
POST /folders/cancel-ai-tagging(or shared/jobs/cancel)- Cooperative flag checked in
image_util_process_untagged_images()/ clustering loop - Set
taggingCompletedappropriately so UI is not stuck forever
Frontend
- Cancel button on folder progress UI / settings folder row when status is
in_progress - Call cancel API, poll
/folders/all-foldersor existing progress hook
Acceptance criteria
- User can cancel folder indexing mid-run
- Cancelled folder shows
indexing_status = interrupted - App remains stable (no orphaned executor crash)
- Already-indexed images are kept
- Tests for cancel flag behavior in backend
Environment
- OS: Windows 11
- PictoPy: main (latest)
I want to work on this
Please review and assign. I will wait for maintainer label before opening a PR.
Add ScreenShots
Record
- I agree to follow this project's Code of Conduct
- I want to work on this issue
- Dominant language
- Python
- Stars
- 322
- Forks
- 793
- Avg merge
- 6d 10h
- Merged PRs (30d)
- 20
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from AOSSIE-Org/PictoPy
-
bug enhancement
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AOSSIE-Org/PictoPy#1802 · 2 comments ·
Maintainers usually reply within 3 days
-
BUG: XMP metadata export permanently overwrites file modification timestamp (mtime), destroying photo datesPossibly taken @swastiksharma45 claimed this 2 days ago. Openbug enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
AOSSIE-Org/PictoPy#1788 · 6 comments ·
Maintainers usually reply within 3 days
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
AOSSIE-Org/PictoPy#1786 · 1 comment ·
Maintainers usually reply within 3 days
-
BUG: Semantic search sees portrait phone photos sideways (SigLIP ignores EXIF orientation)Possibly taken @omkar-suryavanshi claimed this 3 days ago. Openbug enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
AOSSIE-Org/PictoPy#1780 · 5 comments ·
Maintainers usually reply within 3 days
-
BUG: Share password loses leading/trailing spaces so the password you set doesn't workPossibly taken @ManyaJain111 claimed this 2 days ago. Openbug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
AOSSIE-Org/PictoPy#1779 · 2 comments · 1 assignee ·
Maintainers usually reply within 3 days
All issues in AOSSIE-Org/PictoPy
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
hermes hooks doctor smoke test never checks the hook exit code — a crashing hook (exit=1) renders ✓ "ran clean" and "All shell hooks look healthy"Possibly taken @cestercian claimed this today. Opencomp/cli P2 type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
NousResearch/hermes-agent#162259 · 1 comment ·
Maintainers usually reply within 1 day
-
upstream update
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
conan-io/conan-center-index#31597 ·
Maintainers usually reply within 1 day
-
community-request
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
NVIDIA-NeMo/Run#727 ·
Maintainers usually reply within 1 day
-
bot-triaged module: higher order operators module: pickle module: pt2-dispatcher oncall: pt2 triaged
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
pytorch/pytorch#207247 · 1 comment ·
Maintainers usually reply within 1 day