LRC-LIB-LIBFOLDERS: Don't ask again in the Move Photos question is kept only when the move started

This commit is contained in:
Nathaniel Ledford
2026-10-27 06:45:09 -04:00
parent 662df66f1c
commit 0320e8774c
4 changed files with 28 additions and 3 deletions
+3 -1
View File
@@ -212,10 +212,12 @@ 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());
}
let moved = crate::panels::left::move_photos(app, Some(ids), folder)?;
// only a move that began turns the question off: one refused leaves it as it was
if *dont_ask {
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, .. } => {
+19
View File
@@ -328,6 +328,25 @@ 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);
}
#[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
@@ -2,6 +2,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