feat(scan): show the current directory in the scan progress toast (#430)#432
Conversation
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.
|
No actionable comments were generated in the recent review. π βΉοΈ Recent review infoβοΈ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: π Files selected for processing (1)
π WalkthroughWalkthroughLe scan transmet dΓ©sormais le rΓ©pertoire courant dans ChangesProgression de scan en direct
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Γ©
Possibly related PRs
π₯ Pre-merge checks | β 5β Passed checks (5 passed)
β¨ Finishing Touchesπ Generate docstrings
π§ͺ Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
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
π Files selected for processing (20)
docs/features/library.mdsrc-tauri/crates/app/src/commands/scan.rssrc/components/common/ScanProgressToast.tsxsrc/i18n/locales/ar.jsonsrc/i18n/locales/de.jsonsrc/i18n/locales/en.jsonsrc/i18n/locales/es.jsonsrc/i18n/locales/fr.jsonsrc/i18n/locales/hi.jsonsrc/i18n/locales/id.jsonsrc/i18n/locales/it.jsonsrc/i18n/locales/ja.jsonsrc/i18n/locales/ko.jsonsrc/i18n/locales/nl.jsonsrc/i18n/locales/pt-BR.jsonsrc/i18n/locales/pt.jsonsrc/i18n/locales/ru.jsonsrc/i18n/locales/tr.jsonsrc/i18n/locales/zh-CN.jsonsrc/i18n/locales/zh-TW.json
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.
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
scan.rs): addcurrent_dir: Option<String>to thescan:progresspayload β the parent directory of the file just processed. Filled at bothmaybe_emit_progresssites (Phase 1 skip fast-path + Phase 2 extract loop);Noneon the initial + final ticks, which carry no specific file. Throttle unchanged (every 25 files).ScanProgressToast.tsx): render a live "β¦/Parent/Album" line under the bar β last two path segments for readability, full path in thetitletooltip.scanProgress.scanningInkey propagated to all 17 locales.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