Skip to content

LR-IMP-ADD-DIALOG: library.import reports what its folder walk skipped (#4319) - #4321

Merged
FredApps merged 11 commits into
storytold:mainfrom
Bruno-Alumn:fix/import-reports-skipped-4319
Nov 28, 2026
Merged

FredApps merged 11 commits into
storytold:mainfrom
Bruno-Alumn:fix/import-reports-skipped-4319

Conversation

@Bruno-Alumn

@Bruno-Alumn Bruno-Alumn commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #4319.

library.importPreview says what its folder walk left out (skipped: {unreadable, unsupported}), but library.import didn't. A script or MCP client that imports a folder directly had no way to tell a file that was skipped from one that is missing.

Change

  • ImportJob::prepare now expands with expand_report, the same walk the preview uses. It carries the two counts in Prepared.skipped into ImportReport.skipped. ImportJob::expand returns the same files as before.
  • The library.import reply now has skipped: {unreadable, unsupported}. It counts the same way as the preview: XMP sidecars aren't counted, and a file named directly in paths is always tried (and lands in failed if it isn't a photo), so it never counts as skipped.
  • The library.import spec text, the LR-IMP-ADD-DIALOG checklist row and whats-new.md are updated.

The app's own import review already shows these counts (#2944). The UI import task, which expands the folders itself and prepares the files in chunks, is unchanged.

Test
tests::import::import_reports_what_the_folder_walk_skipped imports a folder with two PNGs, an XMP sidecar, a .txt and a .md. It checks that the reply reports {"unreadable": 0, "unsupported": 2} and matches the preview, and that a .txt named on its own fails rather than counting as skipped. Before the change, skipped was missing (Null).

fmt, clippy -D warnings, engine (1698) and UI (1935) tests, cargo xtask wasm and cargo xtask parity all pass locally.

Written with AI assistance (Claude), reviewed and tested by me.

Summary by CodeRabbit

  • Bug Fixes
    • Folder imports now report counts for unreadable folders and unsupported files that were skipped, consistent with import previews. Directly named unsupported files are still attempted and reported as failed rather than counted as skipped.
  • Documentation
    • Updated import command documentation and release notes to describe the skipped-file counts and clarify how these counts are reported.

@coderabbitai

coderabbitai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • Resume reviews
  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

library.import now reports unreadable and unsupported entries omitted during folder walking. The import report receives counts from folder expansion. Documentation describes the response field alongside library.importPreview.

Changes: Import skipped-file reporting

Layer / File(s) Summary
Capture and return skipped counts
crates/engine/src/import/types.rs, crates/engine/src/import.rs, crates/engine/src/import/job.rs, crates/engine/src/import/commit.rs, crates/engine/src/import/files.rs
Prepared records unreadable and unsupported folder-walk counts. commit_prepared copies those counts into ImportReport.skipped, which is publicly re-exported.
Validate and document skipped counts
crates/engine/src/tests/import.rs, crates/engine/src/cmd/library/specs.rs, docs/parity-checklist.md, docs/whats-new.md
A regression test compares import skipped counts with preview counts and checks that a directly named unsupported file is reported as failed, not skipped. Command documentation and release notes describe the skipped counts.

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Feature · Severity of issue fixed: Medium

Sequence Diagram(s)

sequenceDiagram
  participant ImportJob
  participant expand_report
  participant Prepared
  participant commit_prepared
  participant ImportReport
  ImportJob->>expand_report: Expand folder and collect walk counts
  ImportJob->>Prepared: Store files and skipped counts
  Prepared->>commit_prepared: Provide prepared import
  commit_prepared->>ImportReport: Copy skipped counts
Loading

Suggested reviewers: aiongg, eliets2

Merge Risk: Minimal · previous review dd7b9

library.import replies now include counts of unreadable folders and unsupported files skipped during a folder walk, matching library.importPreview. The change is additive and has regression coverage, and no merge-blocking risk is evident.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the ticket prefix and the behavior change: library.import now reports what its folder walk skipped. The changeset adds skipped counts (unreadable, unsupported) to the import reply, and…
Linked Issues check Passed Issue #4319 asks that library.import report what its folder walk left out, as library.importPreview does, using skipped: {unreadable, unsupported}. At head dd7b982, ImportJob::prepare in `cra…
Out of Scope Changes check Passed The raw summary lists changed files: cmd/library/specs.rs (spec text), import.rs (re-export of Skipped), import/commit.rs (copies counts into the report), import/files.rs (test-only `expand_…
Full details: Title check

Explanation

The title names the ticket prefix and the behavior change: library.import now reports what its folder walk skipped. The changeset adds skipped counts (unreadable, unsupported) to the import reply, and the title matches that main change. The ticket prefix LR-IMP-ADD-DIALOG refers to a parity checklist row the PR also updates, so the title is specific and accurate.

Full details: Linked Issues check

Explanation

Issue #4319 asks that library.import report what its folder walk left out, as library.importPreview does, using skipped: {unreadable, unsupported}. At head dd7b982, ImportJob::prepare in crates/engine/src/import/job.rs calls expand_report and sets Prepared.skipped from the walk's unreadable and unsupported counts. ImportJob::expand returns expand_report(paths).files, so the returned file list is unchanged. The raw summary reports that commit_prepared copies prepared.skipped into ImportReport.skipped and that types.rs adds Skipped and ImportReport.skipped. The library.import spec documents the field. The change since the previous review is limited to the head that the previous assessment already covered, and the job.rs content at head matches that assessment. The test import_reports_what_the_folder_walk_skipped could not be verified at head. The file read was truncated before the test, and the whole-PR diff for tests/import.rs was unavailable because changed blobs are missing from the checkout. The author reports the test passes. This review did not run it. The implementation evidence supports the objective and the issue's expected behaviour.

Full details: Out of Scope Changes check

Explanation

The raw summary lists changed files: cmd/library/specs.rs (spec text), import.rs (re-export of Skipped), import/commit.rs (copies counts into the report), import/files.rs (test-only expand_knowing gating and a Default fill-in for Prepared), import/job.rs (carries walk counts through Prepared), import/types.rs (adds Skipped and ImportReport.skipped), tests/import.rs (new test), docs/parity-checklist.md (LR-IMP-ADD-DIALOG row) and docs/whats-new.md. Each file supports the #4319 objective or its documentation. The UI import task is not in the changed-file list, which matches the PR description. The head content of job.rs matches the summary. The text diffs for the other files could not be read because changed blobs are missing, so this verdict rests on the summary and the job.rs head content.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between dfbff20 and dd7b982.

Files selected for processing: 2

  • docs/parity-checklist.md
  • docs/whats-new.md
Files skipped from review as they are similar to previous changes: 2

  • docs/parity-checklist.md
  • docs/whats-new.md

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.

emmertex referenced this pull request in emmertex/chromaforge Nov 17, 2026
library.import now returns skipped: {unreadable, unsupported}, as
library.importPreview does, so a script can tell a skipped file from a
missing one. ImportJob::prepare walks with expand_report and carries the
counts through Prepared into ImportReport; a file named on its own is
still tried and never counted.

Adapted from upstream #4321 (the fork keeps import in one module and the
tests in tests_import.rs).

Manual: docs/manual/import-export.md (command-line section)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@FredApps FredApps left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The skipped-count change is still needed: current main reports it in Preview but not Import. I verified that the preview and import regressions passed on Ubuntu and Windows in the November 19 merge preview. This branch now conflicts with current main, where ImportJob::expand reuses the already-listed folders and files to avoid repeat checks on network shares. When resolving the conflict, keep that path and use its report-returning walker to carry the skipped counts into the direct command result. Please verify both named regressions on the integrated head and retain the existing no-repeat-check behavior. The older passing runs do not cover that combination.

@FredApps FredApps left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Re-reviewed the current head. Direct import now returns the same skipped counts as import preview, while still trying files named explicitly. The shared folder walk preserves reuse of already-listed files and folders, avoiding repeat checks on network shares. Both hosted Ubuntu and Windows gates passed the two skipped-count regressions and the listed-folder reuse tests.

@FredApps FredApps left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Re-approving after merging current main (changelog conflict kept both sections). CI is green on cdedaa4.

@FredApps
FredApps merged commit 4d83814 into storytold:main Nov 28, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Import: library.import does not report files it skipped as unsupported (library.importPreview does)

2 participants