Skip to content

feat(scan): show the current directory in the scan progress toast (#430)#432

Merged
InstaZDLL merged 2 commits into
mainfrom
feat/430-scan-progress-directory
Jul 25, 2026
Merged

feat(scan): show the current directory in the scan progress toast (#430)#432
InstaZDLL merged 2 commits into
mainfrom
feat/430-scan-progress-directory

Conversation

@InstaZDLL

@InstaZDLL InstaZDLL commented Jul 25, 2026

Copy link
Copy Markdown
Owner

Closes #430.

Problem

The scan progress toast already had a counter + percentage bar, but a bare N / M files gives no sense of where the scan actually is β€” the user's ask was to "see progressing thru the folder with changing directories".

Change

  • Backend (scan.rs): add current_dir: Option<String> to the scan:progress payload β€” the parent directory of the file just processed. Filled at both maybe_emit_progress sites (Phase 1 skip fast-path + Phase 2 extract loop); None on the initial + final ticks, which carry no specific file. Throttle unchanged (every 25 files).
  • Frontend (ScanProgressToast.tsx): render a live "…/Parent/Album" line under the bar β€” last two path segments for readability, full path in the title tooltip.
  • i18n: new scanProgress.scanningIn key propagated to all 17 locales.
  • Docs: new "Live progress" bullet in docs/features/library.md.

Validation

  • bun run typecheck βœ…
  • bun run lint βœ…
  • cargo clippy -p waveflow --all-targets βœ…

Small, additive change β€” an optional field on an existing event and one extra line in an existing toast. No new command, no schema change.

Summary by CodeRabbit

  • Nouvelles fonctionnalitΓ©s
    • Affichage en temps rΓ©el de l’avancement du scan via une notification β€œLive progress”.
    • Affiche le rΓ©pertoire actuellement analysΓ©, avec une ligne dΓ©diΓ©e pendant le scan.
    • Le rΓ©capitulatif final dΓ©taille les Γ©lΓ©ments ajoutΓ©s, mis Γ  jour et ignorΓ©s.
  • Localisation
    • Mise Γ  jour des libellΓ©s de progression et des rΓ©sultats dans toutes les langues prises en charge, ajout de l’intitulΓ© β€œscanning in”.
  • Correctifs
    • Progression mieux harmonisΓ©e pour reflΓ©ter Γ©galement les branches d’erreur lors du scan.

The progress toast already surfaced a counter + percentage bar, but a bare
"N / M files" gives no sense of where the scan is. Add current_dir to the
scan:progress payload β€” the parent directory of the file just processed β€”
and render a live "…/Parent/Album" line under the bar so the user can watch
the scan walk through folders. current_dir is None on the initial + final
ticks, which carry no specific file. New i18n key scanProgress.scanningIn
propagated to all 17 locales.
@InstaZDLL InstaZDLL added scope: frontend React/Vite frontend (src/) scope: backend Rust/Tauri backend (src-tauri/) scope: i18n Translations (src/i18n/) scope: docs Docs, README, assets type: feat New feature size: m 50-200 lines labels Jul 25, 2026
@InstaZDLL InstaZDLL self-assigned this Jul 25, 2026
@InstaZDLL InstaZDLL added this to the v1.7.0 milestone Jul 25, 2026
@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. πŸŽ‰

ℹ️ Recent review info
βš™οΈ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: a0cf2262-3fc4-4e3b-ab79-afafbc534834

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 7512077 and 1c38390.

πŸ“’ Files selected for processing (1)
  • src-tauri/crates/app/src/commands/scan.rs

πŸ“ Walkthrough

Walkthrough

Le scan transmet dΓ©sormais le rΓ©pertoire courant dans scan:progress. ScanProgressToast l’affiche pendant l’analyse, les traductions sont mises Γ  jour dans les locales disponibles et la documentation dΓ©crit le nouveau comportement.

Changes

Progression de scan en direct

Layer / File(s) RΓ©sumΓ©
Payload du scan et Γ©mission des Γ©vΓ©nements
src-tauri/crates/app/src/commands/scan.rs
ScanProgress inclut current_dir, calculΓ© depuis le chemin traitΓ© ; les ticks initial et final l’envoient Γ  None, et les erreurs d’extraction Γ©mettent Γ©galement un tick contextualisΓ©.
Affichage dans le toast et traductions
src/components/common/ScanProgressToast.tsx, src/i18n/locales/*
Le toast affiche les deux derniers segments du rΓ©pertoire courant et les textes scanningIn ainsi que le rΓ©capitulatif final sont actualisΓ©s dans les locales.
Documentation du flux
docs/features/library.md
La documentation dΓ©crit les mΓ©triques de scan:progress, les ticks initial/final et l’affichage par ScanProgressToast.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Scanner
  participant ScanProgress
  participant ScanProgressToast
  participant TranslationCatalog
  Scanner->>ScanProgress: Γ©met current, total, compteurs et current_dir
  ScanProgress->>ScanProgressToast: transmet l’évΓ©nement scan:progress
  ScanProgressToast->>ScanProgressToast: extrait le libellΓ© du rΓ©pertoire
  ScanProgressToast->>TranslationCatalog: demande scanningIn
  TranslationCatalog-->>ScanProgressToast: retourne le texte localisΓ©
Loading

Possibly related PRs

πŸš₯ Pre-merge checks | βœ… 5
βœ… Passed checks (5 passed)
Check name Status Explanation
Title check βœ… Passed Le titre dΓ©crit bien l’ajout du dossier courant dans le toast de progression du scan.
Description check βœ… Passed La description couvre le problΓ¨me, le changement, la validation et le lien vers l’issue, malgrΓ© des sections du template incomplΓ¨tes.
Linked Issues check βœ… Passed La PR rΓ©pond Γ  #430 en affichant la progression du scan et le rΓ©pertoire courant pendant l’analyse.
Out of Scope Changes check βœ… Passed Je ne vois pas de changement hors sujet : code, i18n et docs restent alignΓ©s avec l’objectif du scan progress.
Docstring Coverage βœ… Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing Touches
πŸ“ Generate docstrings
  • Create stacked PR
  • Commit on current branch
πŸ§ͺ Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/430-scan-progress-directory

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

πŸ€– Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src-tauri/crates/app/src/commands/scan.rs`:
- Around line 1176-1183: Ensure the error branches in the scan loop emit
progress after incrementing summary.errors. In the handling of Ok(Err(_)) and
Err(_), call maybe_emit_progress with the current path before each continue,
preferably through a shared helper to avoid duplication; preserve the existing
successful extraction progress behavior.
πŸͺ„ Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
βš™οΈ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 9c7eb4fb-746d-41c4-a366-3b4fc2785195

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 09b36aa and 7512077.

πŸ“’ Files selected for processing (20)
  • docs/features/library.md
  • src-tauri/crates/app/src/commands/scan.rs
  • src/components/common/ScanProgressToast.tsx
  • src/i18n/locales/ar.json
  • src/i18n/locales/de.json
  • src/i18n/locales/en.json
  • src/i18n/locales/es.json
  • src/i18n/locales/fr.json
  • src/i18n/locales/hi.json
  • src/i18n/locales/id.json
  • src/i18n/locales/it.json
  • src/i18n/locales/ja.json
  • src/i18n/locales/ko.json
  • src/i18n/locales/nl.json
  • src/i18n/locales/pt-BR.json
  • src/i18n/locales/pt.json
  • src/i18n/locales/ru.json
  • src/i18n/locales/tr.json
  • src/i18n/locales/zh-CN.json
  • src/i18n/locales/zh-TW.json

Comment thread src-tauri/crates/app/src/commands/scan.rs Outdated
The Phase 2 error arms (Ok(Err) / Err) incremented summary.errors then
continue'd without emitting, so a run of failed extractions froze the
toast counter and error tally until the next success. Add a shared
emit_tick closure β€” used by both error arms and the success path β€” so
progress advances uniformly. Captures only Copy handles, stays a plain Fn.
@InstaZDLL
InstaZDLL merged commit 20aca84 into main Jul 25, 2026
14 checks passed
@InstaZDLL
InstaZDLL deleted the feat/430-scan-progress-directory branch July 25, 2026 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: backend Rust/Tauri backend (src-tauri/) scope: docs Docs, README, assets scope: frontend React/Vite frontend (src/) scope: i18n Translations (src/i18n/) size: m 50-200 lines type: feat New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Scan Progress

1 participant