Merge PR #2858: LRC-LIB-LIBFOLDERS: Don't ask again when moving photos is kept only when the move started

docs/parity-checklist.md: header keeps main's newer date plus the PR's item; revision rows are the union.
This commit is contained in:
aiongg
2026-10-31 02:08:19 +00:00
4 changed files with 51 additions and 4 deletions
+5 -2
View File
@@ -212,10 +212,13 @@ pub fn confirm_dialog(app: &mut LightcraftApp, dlg: &Dialog) -> Result<serde_jso
if *library != app.session.library_generation() {
return Err(crate::i18n::tr("Another library was opened since the photos were dropped: nothing was moved").to_string());
}
if *dont_ask {
let moved = crate::panels::left::move_photos(app, Some(ids), folder)?;
// only a move that began turns the question off: one refused, or that found the photos there already,
// leaves it as it was
if *dont_ask && moved > 0 {
app.ui.settings.ask_before_move = false;
}
crate::panels::left::move_photos(app, Some(ids), folder).map(|n| json!({"moved": n}))
Ok(json!({"moved": moved}))
}
// the catalog found: no file dialog; none: File ▸ Import Lightroom Catalog… asks for it
Dialog::LightroomCatalog { catalog, .. } => {
+40
View File
@@ -328,6 +328,46 @@ fn dont_ask_again_moves_the_next_drop_at_once() {
let _ = std::fs::remove_dir_all(&root);
}
#[test]
fn dont_ask_again_is_kept_only_when_the_move_began() {
let (root, trip, home) = folders("dont-ask-refused");
let mut h = app(&[(trip.join("beach.png"), false), (home.join("garden.png"), false)]);
click(&mut h, &format!("libraryFolderToggle:{}", folder_key(&root)));
let target = folder_row(&h, &home).unwrap();
let beach = id_of(&h, "beach.png");
// a file of that name is in the folder already (not in the library): the move is refused
std::fs::copy(trip.join("beach.png"), home.join("beach.png")).unwrap();
drop_beach(&mut h, beach, target);
click(&mut h, "check:moveDontAsk");
assert!(matches!(h.app.ui.dialog, Some(crate::state::Dialog::MovePhotos { dont_ask: true, .. })), "ticked");
click(&mut h, "button:dialogOk");
assert!(h.app.ui.dialog.is_none(), "the refusal closes the question");
assert!(trip.join("beach.png").is_file(), "nothing moved");
assert!(h.app.ui.settings.ask_before_move, "a refused move leaves the question on");
let _ = std::fs::remove_dir_all(&root);
}
/// A confirmation that finds the photos in the folder already (they were moved there while the question was
/// open, or a folder synchronization relinked them) moves nothing, so it doesn't turn the question off either.
#[test]
fn dont_ask_again_is_kept_only_when_a_photo_moved() {
let (root, trip, home) = folders("dont-ask-already");
let mut h = app(&[(trip.join("beach.png"), false), (home.join("garden.png"), false)]);
click(&mut h, &format!("libraryFolderToggle:{}", folder_key(&root)));
let target = folder_row(&h, &home).unwrap();
let beach = id_of(&h, "beach.png");
drop_beach(&mut h, beach, target);
click(&mut h, "check:moveDontAsk");
assert!(matches!(h.app.ui.dialog, Some(crate::state::Dialog::MovePhotos { dont_ask: true, .. })), "ticked");
// the photo gets there some other way while the question is open
h.app.run("photo.moveToFolder", json!({"folder": home.to_string_lossy(), "ids": [beach]})).unwrap();
assert!(home.join("beach.png").is_file());
click(&mut h, "button:dialogOk");
assert!(h.app.ui.dialog.is_none());
assert!(h.app.ui.settings.ask_before_move, "nothing moved: the question stays on");
let _ = std::fs::remove_dir_all(&root);
}
#[test]
fn a_question_left_open_while_another_library_opens_moves_nothing() {
let (root, trip, home) = folders("other-library");
File diff suppressed because one or more lines are too long
+3
View File
@@ -13,6 +13,9 @@
## 2026-10-24
### A refused move no longer switches the Move Photos question off
- Ticking Don't ask again in the question that appears when you drop photos on a Folders row used to be remembered even when the move was then refused (for example because a file of the same name is already in that folder). The choice is now kept only once the move has started, so a refused move leaves the question on.
### Relative-date filters and smart albums follow the clock
- A current view or source count using “in the last” rules now refreshes when the session clock moves into a new
minute, even when no catalog edit occurred. This fixes stale photos remaining in the grid and stale counts for