Skip to content

Refuse Open/New Library while an import is running (#1509) - #1578

Merged
echelon merged 1 commit into
storytold:mainfrom
MarekSpodBiedry:issue-1509
Oct 14, 2026
Merged

echelon merged 1 commit into
storytold:mainfrom
MarekSpodBiedry:issue-1509

Conversation

@MarekSpodBiedry

Copy link
Copy Markdown
Contributor

Fixes #1509.

app.openLibrary and app.newLibrary only refused to switch while a Lightroom catalog import ran. An ordinary import (app.import) kept going after the switch, and its remaining batches were committed into the newly opened library with the old run's options and album ids. The folder scan that comes before an import (app.scan) had the same problem: it finishes into an import, or the review, against whatever library is open by then.

Changes in crates/ui-egui:

  • panels/settings.rs: a new can_switch_library guard that both commands call. It keeps the Lightroom check and also refuses while app.import or app.scan is running. That matches the Lightroom import's own busy() check (app.import.is_some() || app.scan.is_some() → "an import is running"). The error asks the user to wait for the import to finish.
  • menus.rs / menubar.rs: File ▸ Open Library…, New Library… and the Open Recent Library items use the same guard. They are greyed out during an import, as they already are during a Lightroom import. File ▸ Add Folder keeps its previous rule.

The switch is refused rather than cancelling or draining the import. Nothing in flight is thrown away, and this is the behaviour the Lightroom guard already has.

Tests (in panels/settings.rs):

  • Open Library and New Library return the error while an import runs, and the import stays.
  • Open Library is refused while an import scan runs.
  • The Open/New Library menu items are enabled when nothing runs and disabled during an import.

@echelon

echelon commented Oct 14, 2026

Copy link
Copy Markdown
Member

Thank you @MarekSpodBiedry! This landed on main in integration batch 35 (#1682).

If you haven't already, please join our Discord: https://discord.gg/artcraft. We'd love to have you there.

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.

Open or New Library leaves an ordinary import committing batches into the new library

2 participants