Fix discovery phase appearing frozen

Scanner now updates message every 250 files during os.walk so the UI
shows a live count. Progress bar switches to an indeterminate animated
pulse during discovery and takeout phases (no known total yet), then
reverts to a normal percentage bar once indexing begins.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
tocmo
2026-04-05 01:25:41 -04:00
parent 6e7bb241ad
commit b519e065cb
2 changed files with 21 additions and 2 deletions

View File

@@ -492,6 +492,12 @@ def run_scan(folder_path: str, scan_id: int, mode: str = "incremental"):
ext = Path(fname).suffix.lower()
if ext in SUPPORTED_EXT:
all_files.append(os.path.join(root, fname))
# Live count update every 250 files so UI doesn't look frozen
if len(all_files) % 250 == 0:
scan_state["message"] = f"Discovering... {len(all_files):,} files found"
if scan_state["cancel_requested"]:
break
scan_state["total"] = len(all_files)
scan_state["message"] = f"Found {len(all_files):,} files"