diff --git a/crates/engine/src/cmd/missing.rs b/crates/engine/src/cmd/missing.rs index c06997eefb7..3f1f210d09b 100644 --- a/crates/engine/src/cmd/missing.rs +++ b/crates/engine/src/cmd/missing.rs @@ -92,7 +92,7 @@ fn stored_hash(p: &Photo) -> Option<&str> { /// The content hash of the file at `path` (as import computes it), if it can be read. Read in /// pieces: the file is whatever is on the disk, of any size. -fn file_hash(path: &str) -> Option { +pub(crate) fn file_hash(path: &str) -> Option { hash_reader(std::fs::File::open(path).ok()?) } diff --git a/crates/engine/src/sync.rs b/crates/engine/src/sync.rs index f20ad9c95ec..6369a6421e4 100644 --- a/crates/engine/src/sync.rs +++ b/crates/engine/src/sync.rs @@ -141,6 +141,12 @@ pub struct FolderMoved { pub id: u64, pub from: String, pub to: String, + /// The content hash the scan read at `to`. Synchronizing relinks only while the file there + /// still has it: a scan of a big folder is confirmed minutes later, and a file put in its + /// place by then is not the photo. `None` when the scan had no file probe, and then there is + /// nothing to compare. Not part of the command's reply. + #[serde(skip)] + pub hash: Option, } /// What [`synchronize`] does with the changes found. @@ -293,7 +299,10 @@ pub fn scan_with(input: SyncInput, progress: &SyncProgress) -> FolderChanges { let missing = std::mem::take(&mut changes.missing); for m in missing { match moved_from.get(&m.path) { - Some(to) => changes.moved.push(FolderMoved { id: m.id, from: m.path, to: to.clone() }), + Some(to) => { + let hash = out.probes.get(to).and_then(|p| p.content_hash.clone()); + changes.moved.push(FolderMoved { id: m.id, from: m.path, to: to.clone(), hash }); + } None => changes.missing.push(m), } } @@ -301,9 +310,18 @@ pub fn scan_with(input: SyncInput, progress: &SyncProgress) -> FolderChanges { changes } -/// Whether a photo is the same as far as synchronizing goes: its file, its place in the library -/// and what a sidecar is compared with. Face and pet regions found in the background meanwhile -/// don't make a scan stale. +/// Whether a photo is the same file in the same place in the library: what decides whether it +/// is missing or moved, and which files beside it are new. Its rating, keywords and edits are +/// the person's work, not the folder's state. +fn same_file(a: &Arc, b: &Arc) -> bool { + Arc::ptr_eq(a, b) + || (&a.source, a.deleted, a.local, a.copy_of, &a.content_hash, a.file_size) + == (&b.source, b.deleted, b.local, b.copy_of, &b.content_hash, b.file_size) +} + +/// Whether a photo is the same as far as reading its sidecar goes: its file, its place in the +/// library and what a sidecar is compared with. Face and pet regions found in the background +/// meanwhile don't make a scan stale. fn same_for_sync(a: &Arc, b: &Arc) -> bool { if Arc::ptr_eq(a, b) { return true; @@ -577,19 +595,35 @@ fn not_there(path: &str) -> EngineError { impl Session { /// The last scan ([`Session::folder_changes`]) if it is of folder `path` and still current: - /// the folder holds the same photos, none of them changed. What the person was shown is what - /// gets done. Used once. (Changes elsewhere in the library don't matter.) + /// the folder holds the same photos (virtual copies aside), each the same file in the same + /// place ([`same_file`]). + /// What the person was shown is what gets done. Used once. + /// + /// Work on the folder's photos since (ratings, labels, keywords, edits) leaves the scan + /// current: none of it changes which files are new, missing or moved, and a scan of a big + /// folder on a slow disk takes minutes in which the person is told to go on working. The one + /// thing such work does matter to is a sidecar the scan found news in: reading it would go + /// over that work, so for those photos nothing may have changed ([`same_for_sync`]). + /// (Changes elsewhere in the library don't matter.) pub fn take_folder_changes(&mut self, path: &str) -> Option { let c = self.folder_changes.take()?; if lightcraft_catalog::query::folder_key(&c.path) != lightcraft_catalog::query::folder_key(path) { return None; } let f = Filter { library_folder: Some(path.to_string()), ..Default::default() }; - let mut now: Vec = self.catalog.query(&f, &Sort::default()); - let mut then: Vec = c.seen.iter().map(|p| p.id).collect(); + // (virtual copies made or deleted meanwhile are not files: the folder holds what it held, + // except for copies of photos the scan relinks or removes, which are acted on by id and + // would be left behind) + let acted: std::collections::HashSet = c.moved.iter().map(|m| m.id).chain(c.missing.iter().map(|m| m.id)).collect(); + let counts = |p: &Photo| p.copy_of.is_none_or(|o| acted.contains(&o.0)); + let mut now: Vec = + self.catalog.query(&f, &Sort::default()).into_iter().filter(|id| self.catalog.photo(*id).is_some_and(|p| counts(p))).collect(); + let mut then: Vec = c.seen.iter().filter(|p| counts(p)).map(|p| p.id).collect(); now.sort(); then.sort(); - let unchanged = now == then && c.seen.iter().all(|p| self.catalog.photo(p.id).is_some_and(|q| same_for_sync(p, q))); + let read: std::collections::HashSet = c.metadata.iter().map(|m| m.id).collect(); + let same = |p: &Arc, q: &Arc| if read.contains(&p.id.0) { same_for_sync(p, q) } else { same_file(p, q) }; + let unchanged = now == then && c.seen.iter().filter(|p| p.copy_of.is_none()).all(|p| self.catalog.photo(p.id).is_some_and(|q| same(p, q))); unchanged.then_some(c) } } @@ -763,11 +797,22 @@ impl SyncWork { if cancel.load(Relaxed) { return; } - // still where the scan found it, and still gone from where the photo says - let checked = moved.len(); - let relink: Vec<(PhotoId, String)> = - moved.into_iter().filter(|m| Path::new(&m.to).is_file() && !Path::new(&m.from).exists()).map(|m| (PhotoId(m.id), m.to)).collect(); - step(checked); + // still where the scan found it (the same content, when the scan read it), and still gone + // from where the photo says + let mut relink: Vec<(PhotoId, String)> = Vec::with_capacity(moved.len()); + for m in moved { + // each file is read again when the scan hashed it: this can take a while on a share + if cancel.load(Relaxed) { + return; + } + let still_the_file = Path::new(&m.to).is_file() + && !Path::new(&m.from).exists() + && m.hash.as_deref().is_none_or(|h| crate::cmd::missing::file_hash(&m.to).is_some_and(|now| base_hash(&now) == base_hash(h))); + if still_the_file { + relink.push((PhotoId(m.id), m.to)); + } + step(1); + } if !relink.is_empty() && !send(SyncStep::Relink(relink)) { return; } diff --git a/crates/engine/src/tests/sync.rs b/crates/engine/src/tests/sync.rs index 8b1ec4f6721..2a283186be6 100644 --- a/crates/engine/src/tests/sync.rs +++ b/crates/engine/src/tests/sync.rs @@ -476,23 +476,92 @@ fn a_scan_stays_current_while_only_other_folders_change() { assert_eq!(r["imported"], 1, "{r}"); } +/// Work on the folder's photos while it is scanned (a rating, keywords, an edit) changes nothing +/// about what the scan found: a scan of a big folder on a slow disk takes minutes, and the +/// dialog says to go on working. Synchronize does what it showed. #[test] -fn a_change_to_the_folders_photos_makes_the_scan_stale() { - let dir = Scratch::new("stale-folder"); +fn working_on_the_folders_photos_meanwhile_leaves_the_scan_current() { + let dir = Scratch::new("worked-on"); let mut s = library(&dir); write_png(&dir.path("trip/c.png"), 3); scan(&mut s, &dir.path("trip")); let a = s.catalog.photos().find(|p| p.file_name == "a.png").unwrap().id; + s.selection = crate::Selection::single(a); s.execute("photo.rate", &json!({"ids": [a.0], "rating": 2})).unwrap(); - // the dialog asks for exactly what it showed: refused, never redone on the spot + s.execute("photo.setMeta", &json!({"ids": [a.0], "addKeywords": ["Trips|Alps", "snow"], "title": "A"})).unwrap(); + s.execute("photo.label", &json!({"ids": [a.0], "label": "red"})).unwrap(); + s.execute("photo.pick", &json!({"ids": [a.0]})).unwrap(); + s.execute("develop.set", &json!({"control": "light.exposure", "value": 0.5})).unwrap(); + // into several albums, a virtual copy made of it, and one of its edits undone + s.execute("photo.virtualCopy", &json!({"ids": [a.0]})).unwrap(); + s.selection = crate::Selection::single(a); + for name in ["One", "Two"] { + let album = s.execute("album.create", &json!({"name": name})).unwrap()["id"].as_u64().unwrap(); + s.execute("album.addPhotos", &json!({"id": album, "ids": [a.0]})).unwrap(); + } + s.execute("edit.undo", &json!({})).unwrap(); + s.execute("edit.redo", &json!({})).unwrap(); + let r = s.execute("folder.synchronize", &json!({"path": dir.path("trip"), "scanned": true})).unwrap(); + assert_eq!(r["imported"], 1, "what the scan showed is done: {r}"); + assert_eq!(s.catalog.photo(a).unwrap().rating, 2, "and the work stays"); +} + +/// A virtual copy made, meanwhile, of a photo whose file the scan found missing would be left +/// behind by removing the photo (the scan acts on exact ids): that scan is refused. +#[test] +fn a_virtual_copy_of_a_missing_photo_made_meanwhile_makes_the_scan_stale() { + let dir = Scratch::new("stale-copy-of-missing"); + let mut s = library(&dir); + let b = s.catalog.photos().find(|p| p.file_name == "b.png").unwrap().id; + std::fs::remove_file(dir.path("trip/day1/b.png")).unwrap(); + scan(&mut s, &dir.path("trip")); + s.selection = crate::Selection::single(b); + s.execute("photo.virtualCopy", &json!({"ids": [b.0]})).unwrap(); + let e = s.execute("folder.synchronize", &json!({"path": dir.path("trip"), "scanned": true, "removeMissing": true})).unwrap_err().to_string(); + assert!(e.contains("scan again"), "{e}"); +} + +/// What the scan found is no longer true once the folder holds other photos, or one of them is +/// another file now: then it is refused, never redone on the spot. +#[test] +fn a_change_to_which_photos_the_folder_holds_makes_the_scan_stale() { + let dir = Scratch::new("stale-folder"); + let mut s = library(&dir); + write_png(&dir.path("trip/c.png"), 3); + scan(&mut s, &dir.path("trip")); + let a = s.catalog.photos().find(|p| p.file_name == "a.png").unwrap().id; + s.selection = crate::Selection::single(a); + // one of its photos goes to Recently Deleted + s.execute("photo.delete", &json!({"ids": [a.0]})).unwrap(); let e = s.execute("folder.synchronize", &json!({"path": dir.path("trip"), "scanned": true})).unwrap_err().to_string(); assert!(e.contains("scan again"), "{e}"); - assert_eq!(s.catalog.photos().filter(|p| p.in_library()).count(), 2, "nothing was done"); + assert_eq!(s.catalog.photos().filter(|p| p.in_library()).count(), 1, "nothing was done"); // an agent that just asks to synchronize gets a fresh scan let r = s.execute("folder.synchronize", &json!({"path": dir.path("trip")})).unwrap(); assert_eq!(r["imported"], 1, "{r}"); } +/// A photo whose sidecar the scan found news in, changed here since: what the sidecar says would +/// go over that work, which the person was not shown. That scan is refused. +#[test] +fn a_change_to_a_photo_whose_sidecar_has_news_makes_the_scan_stale() { + let dir = Scratch::new("stale-sidecar"); + let mut s = library(&dir); + write_sidecar(&dir.path("trip/a.png"), 5, Duration::ZERO); + let found = scan(&mut s, &dir.path("trip")); + assert_eq!(found["metadata"].as_array().map(Vec::len), Some(1), "{found}"); + // work on another photo of the folder does not matter… + let (a, b) = (s.catalog.photos().find(|p| p.file_name == "a.png").unwrap().id, s.catalog.photos().find(|p| p.file_name == "b.png").unwrap().id); + s.selection = crate::Selection::single(b); + s.execute("photo.rate", &json!({"ids": [b.0], "rating": 1})).unwrap(); + assert!(s.folder_changes.is_some()); + // …work on the photo whose sidecar is to be read does + s.execute("photo.rate", &json!({"ids": [a.0], "rating": 2})).unwrap(); + let e = s.execute("folder.synchronize", &json!({"path": dir.path("trip"), "scanned": true, "readMetadata": true})).unwrap_err().to_string(); + assert!(e.contains("scan again"), "{e}"); + assert_eq!(s.catalog.photo(a).unwrap().rating, 2, "nothing was read over it"); +} + #[test] fn the_progress_counts_the_photos_checked_too() { use std::sync::atomic::Ordering::Relaxed; @@ -535,6 +604,22 @@ fn a_renamed_photo_with_no_content_hash_is_relinked_when_its_file_is_unmistakabl assert!(paths(&r, "missing").is_empty() && paths(&r, "new").is_empty(), "{r}"); } +#[test] +fn a_file_replaced_after_the_scan_is_not_relinked_to_the_photo() { + // a scan of a big folder takes minutes before it is confirmed: what stands at the new path by + // then may no longer be the photo's content + let dir = Scratch::new("replaced-after-scan"); + let mut s = library(&dir); + let a = s.catalog.photos().find(|p| p.file_name == "a.png").unwrap().id; + std::fs::rename(dir.path("trip/a.png"), dir.path("trip/day1/a-renamed.png")).unwrap(); + let r = scan(&mut s, &dir.path("trip")); + assert_eq!(r["moved"][0]["to"], dir.path("trip/day1/a-renamed.png"), "{r}"); + write_png(&dir.path("trip/day1/a-renamed.png"), 9); + let r = s.execute("folder.synchronize", &json!({"path": dir.path("trip"), "scanned": true, "removeMissing": false})).unwrap(); + assert_eq!(r["relinked"], 0, "{r}"); + assert_eq!(s.catalog.photo(a).unwrap().source, lightcraft_catalog::Source::File { path: dir.path("trip/a.png") }); +} + #[test] fn renamed_duplicates_are_each_relinked() { let dir = Scratch::new("dups"); diff --git a/crates/ui-egui/locales/cs-formats.json b/crates/ui-egui/locales/cs-formats.json index 1eb882f09d4..af2404e7ab3 100644 --- a/crates/ui-egui/locales/cs-formats.json +++ b/crates/ui-egui/locales/cs-formats.json @@ -305,5 +305,8 @@ "Could not read {name}: {e}": "Soubor {name} se nepodařilo přečíst: {e}", "Added {n} photo{}": "Přidáno fotografií: {n}{:.0}", "Where should the Lightroom catalog “{catalog}” go?": "Kam má jít katalog Lightroomu „{catalog}“?", - "Merge into the open library “{library}” ({count} photo{})": "Sloučit s otevřenou knihovnou „{library}“ (fotografie: {count}{:.0})" + "Merge into the open library “{library}” ({count} photo{})": "Sloučit s otevřenou knihovnou „{library}“ (fotografie: {count}{:.0})", + "Changes found: {n}": "Nalezené změny: {n}", + "“{name}” is still being scanned: wait for it, or stop it with ✕ on its row": "„{name}“ se ještě prohledává: počkejte, nebo hledání zastavte × na jeho řádku", + "Look at the changes found in “{name}” first, or dismiss them": "Nejprve si prohlédněte změny nalezené v „{name}“, nebo je zahoďte" } diff --git a/crates/ui-egui/locales/cs.json b/crates/ui-egui/locales/cs.json index 52ca94a524d..16cb9240adb 100644 --- a/crates/ui-egui/locales/cs.json +++ b/crates/ui-egui/locales/cs.json @@ -2408,5 +2408,11 @@ "Import dropped files without review": "Importovat přetažené soubory bez kontroly", "An import is running": "Import už běží", "An import is running. Drop photos when it has finished": "Import už běží. Fotky přetáhněte, až skončí", - "Finish Lightroom catalog import before adding photos": "Dokončete import katalogu Lightroom, než přidáte fotky" + "Finish Lightroom catalog import before adding photos": "Dokončete import katalogu Lightroom, než přidáte fotky", + "Continue in Background": "Pokračovat na pozadí", + "Folder not found": "Složka nenalezena", + "Dismiss": "Zavřít", + "Review…": "Prohlédnout…", + "Open Synchronize Folder with what the scan found": "Otevřít Synchronizovat složku s tím, co hledání našlo", + "You can go on working: a notice at the top left says when the scan is done.": "Můžete pracovat dál: až hledání skončí, oznámí to upozornění vlevo nahoře." } diff --git a/crates/ui-egui/locales/de-formats.json b/crates/ui-egui/locales/de-formats.json index 79390f13647..7322393e095 100644 --- a/crates/ui-egui/locales/de-formats.json +++ b/crates/ui-egui/locales/de-formats.json @@ -305,5 +305,8 @@ "Could not read {name}: {e}": "{name} konnte nicht gelesen werden: {e}", "Added {n} photo{}": "{n} Foto{} hinzugefügt", "Where should the Lightroom catalog “{catalog}” go?": "Wohin soll der Lightroom-Katalog „{catalog}“?", - "Merge into the open library “{library}” ({count} photo{})": "Mit der geöffneten Bibliothek „{library}“ zusammenführen ({count} Foto{})" + "Merge into the open library “{library}” ({count} photo{})": "Mit der geöffneten Bibliothek „{library}“ zusammenführen ({count} Foto{})", + "Changes found: {n}": "Gefundene Änderungen: {n}", + "“{name}” is still being scanned: wait for it, or stop it with ✕ on its row": "„{name}“ wird noch durchsucht: Warte darauf oder beende die Suche mit × in ihrer Zeile", + "Look at the changes found in “{name}” first, or dismiss them": "Sieh dir zuerst die in „{name}“ gefundenen Änderungen an oder verwirf sie" } diff --git a/crates/ui-egui/locales/de.json b/crates/ui-egui/locales/de.json index e2205db782f..65ddb4dc42a 100644 --- a/crates/ui-egui/locales/de.json +++ b/crates/ui-egui/locales/de.json @@ -3440,5 +3440,11 @@ "Import dropped files without review": "Abgelegte Dateien ohne Prüfung importieren", "An import is running": "Ein Import läuft", "An import is running. Drop photos when it has finished": "Ein Import läuft. Lege die Fotos ab, wenn er fertig ist", - "Finish Lightroom catalog import before adding photos": "Schließe den Import des Lightroom-Katalogs ab, bevor du Fotos hinzufügst" + "Finish Lightroom catalog import before adding photos": "Schließe den Import des Lightroom-Katalogs ab, bevor du Fotos hinzufügst", + "Continue in Background": "Im Hintergrund fortsetzen", + "Folder not found": "Ordner nicht gefunden", + "Dismiss": "Entfernen", + "Review…": "Ansehen…", + "Open Synchronize Folder with what the scan found": "„Ordner synchronisieren“ mit dem Ergebnis der Suche öffnen", + "You can go on working: a notice at the top left says when the scan is done.": "Du kannst weiterarbeiten: Ein Hinweis oben links meldet, wenn die Suche abgeschlossen ist." } diff --git a/crates/ui-egui/locales/es-formats.json b/crates/ui-egui/locales/es-formats.json index 33e5f52fc6e..afd1ee8bde0 100644 --- a/crates/ui-egui/locales/es-formats.json +++ b/crates/ui-egui/locales/es-formats.json @@ -305,5 +305,8 @@ "Could not read {name}: {e}": "No se pudo leer {name}: {e}", "Added {n} photo{}": "{n} foto{0} añadida{0}", "Where should the Lightroom catalog “{catalog}” go?": "¿Dónde debe ir el catálogo de Lightroom “{catalog}”?", - "Merge into the open library “{library}” ({count} photo{})": "Combinar con la biblioteca abierta “{library}” ({count} foto{})" + "Merge into the open library “{library}” ({count} photo{})": "Combinar con la biblioteca abierta “{library}” ({count} foto{})", + "Changes found: {n}": "Cambios encontrados: {n}", + "“{name}” is still being scanned: wait for it, or stop it with ✕ on its row": "“{name}” aún se está analizando: espera a que termine o detenlo con × en su fila", + "Look at the changes found in “{name}” first, or dismiss them": "Revisa primero los cambios encontrados en “{name}” o descártalos" } diff --git a/crates/ui-egui/locales/es.json b/crates/ui-egui/locales/es.json index 888af077ff2..c330327ec17 100644 --- a/crates/ui-egui/locales/es.json +++ b/crates/ui-egui/locales/es.json @@ -2358,5 +2358,11 @@ "Import dropped files without review": "Importar los archivos soltados sin revisión", "An import is running": "Hay una importación en curso", "An import is running. Drop photos when it has finished": "Hay una importación en curso. Suelta las fotos cuando termine", - "Finish Lightroom catalog import before adding photos": "Termina la importación del catálogo de Lightroom antes de añadir fotos" + "Finish Lightroom catalog import before adding photos": "Termina la importación del catálogo de Lightroom antes de añadir fotos", + "Continue in Background": "Continuar en segundo plano", + "Folder not found": "Carpeta no encontrada", + "Dismiss": "Descartar", + "Review…": "Revisar…", + "Open Synchronize Folder with what the scan found": "Abrir Sincronizar carpeta con lo que encontró la búsqueda", + "You can go on working: a notice at the top left says when the scan is done.": "Puedes seguir trabajando: un aviso arriba a la izquierda indica cuándo termina la búsqueda." } diff --git a/crates/ui-egui/locales/fi-formats.json b/crates/ui-egui/locales/fi-formats.json index 1daab3dab9f..b98e9523bee 100644 --- a/crates/ui-egui/locales/fi-formats.json +++ b/crates/ui-egui/locales/fi-formats.json @@ -305,5 +305,8 @@ "Drop to import {n} preset{}": "Pudota tuodaksesi esiasetuksia: {n}{:.0}", "Drop to review {n} item{} for import": "Pudota tarkistaaksesi ennen tuontia (kohteita: {n}){:.0}", "Where should the Lightroom catalog “{catalog}” go?": "Minne Lightroom-luettelo ”{catalog}” tuodaan?", - "Merge into the open library “{library}” ({count} photo{})": "Yhdistä avoimeen kirjastoon ”{library}” (kuvia: {count}{:.0})" + "Merge into the open library “{library}” ({count} photo{})": "Yhdistä avoimeen kirjastoon ”{library}” (kuvia: {count}{:.0})", + "Changes found: {n}": "Löydettyjä muutoksia: {n}", + "“{name}” is still being scanned: wait for it, or stop it with ✕ on its row": "Kohdetta ”{name}” skannataan vielä: odota tai pysäytä se rivin ×-painikkeella", + "Look at the changes found in “{name}” first, or dismiss them": "Katso ensin kohteesta ”{name}” löydetyt muutokset tai hylkää ne" } diff --git a/crates/ui-egui/locales/fi.json b/crates/ui-egui/locales/fi.json index e0a8c622a36..5fca10856ab 100644 --- a/crates/ui-egui/locales/fi.json +++ b/crates/ui-egui/locales/fi.json @@ -2327,5 +2327,11 @@ "Drop to open the face model": "Pudota avataksesi kasvomallin", "Dropped Files": "Pudotetut tiedostot", "Finish Lightroom catalog import before adding photos": "Viimeistele Lightroom-luettelon tuonti ennen kuvien lisäämistä", - "Import dropped files without review": "Tuo pudotetut tiedostot ilman tarkistusta" + "Import dropped files without review": "Tuo pudotetut tiedostot ilman tarkistusta", + "Continue in Background": "Jatka taustalla", + "Folder not found": "Kansiota ei löytynyt", + "Dismiss": "Hylkää", + "Review…": "Tarkista…", + "Open Synchronize Folder with what the scan found": "Avaa Synkronoi kansio skannauksen löytämillä muutoksilla", + "You can go on working: a notice at the top left says when the scan is done.": "Voit jatkaa työskentelyä: vasemmassa yläkulmassa oleva ilmoitus kertoo, kun skannaus on valmis." } diff --git a/crates/ui-egui/locales/fr-formats.json b/crates/ui-egui/locales/fr-formats.json index 294273781e0..125ae2414a7 100644 --- a/crates/ui-egui/locales/fr-formats.json +++ b/crates/ui-egui/locales/fr-formats.json @@ -305,5 +305,8 @@ "Could not read {name}: {e}": "Impossible de lire {name} : {e}", "Added {n} photo{}": "{n} photo{} ajoutée(s)", "Where should the Lightroom catalog “{catalog}” go?": "Où importer le catalogue Lightroom « {catalog} » ?", - "Merge into the open library “{library}” ({count} photo{})": "Fusionner avec la bibliothèque ouverte « {library} » ({count} photo{})" + "Merge into the open library “{library}” ({count} photo{})": "Fusionner avec la bibliothèque ouverte « {library} » ({count} photo{})", + "Changes found: {n}": "Modifications trouvées : {n}", + "“{name}” is still being scanned: wait for it, or stop it with ✕ on its row": "« {name} » est encore en cours d'analyse : attendez la fin ou arrêtez-la avec × sur sa ligne", + "Look at the changes found in “{name}” first, or dismiss them": "Examinez d'abord les modifications trouvées dans « {name} », ou ignorez-les" } diff --git a/crates/ui-egui/locales/fr.json b/crates/ui-egui/locales/fr.json index 3278d6ccda6..fb94cd4fb52 100644 --- a/crates/ui-egui/locales/fr.json +++ b/crates/ui-egui/locales/fr.json @@ -2390,5 +2390,11 @@ "Checking recent libraries": "Vérification des bibliothèques récentes", "The photos are imported once a library is open": "Les photos seront importées dès qu'une bibliothèque sera ouverte", "Open a library first, then drop the presets again": "Ouvrez d'abord une bibliothèque, puis déposez à nouveau les préréglages", - "This library couldn't be checked:": "Impossible de vérifier cette bibliothèque :" + "This library couldn't be checked:": "Impossible de vérifier cette bibliothèque :", + "Continue in Background": "Continuer en arrière-plan", + "Folder not found": "Dossier introuvable", + "Dismiss": "Retirer", + "Review…": "Examiner…", + "Open Synchronize Folder with what the scan found": "Ouvrir Synchroniser le dossier avec ce que l'analyse a trouvé", + "You can go on working: a notice at the top left says when the scan is done.": "Vous pouvez continuer à travailler : un avis en haut à gauche signale la fin de l'analyse." } diff --git a/crates/ui-egui/locales/id-formats.json b/crates/ui-egui/locales/id-formats.json index 7fc3255221e..24ac95ca2a6 100644 --- a/crates/ui-egui/locales/id-formats.json +++ b/crates/ui-egui/locales/id-formats.json @@ -305,5 +305,8 @@ "Drop to review {n} item{} for import": "Jatuhkan untuk meninjau {n} item sebelum impor{:.0}", "Inside: {names}": "Di dalam: {names}", "Where should the Lightroom catalog “{catalog}” go?": "Ke mana katalog Lightroom “{catalog}” diimpor?", - "Merge into the open library “{library}” ({count} photo{})": "Gabungkan ke pustaka yang terbuka “{library}” ({count} foto{:.0})" + "Merge into the open library “{library}” ({count} photo{})": "Gabungkan ke pustaka yang terbuka “{library}” ({count} foto{:.0})", + "Changes found: {n}": "Perubahan ditemukan: {n}", + "“{name}” is still being scanned: wait for it, or stop it with ✕ on its row": "“{name}” masih dipindai: tunggu, atau hentikan dengan × di barisnya", + "Look at the changes found in “{name}” first, or dismiss them": "Lihat dulu perubahan yang ditemukan di “{name}”, atau tutup" } diff --git a/crates/ui-egui/locales/id.json b/crates/ui-egui/locales/id.json index 0d6da9b8fb8..80cd029f96f 100644 --- a/crates/ui-egui/locales/id.json +++ b/crates/ui-egui/locales/id.json @@ -2339,5 +2339,11 @@ "Drop to open the face model": "Jatuhkan untuk membuka model wajah", "Dropped Files": "File yang dijatuhkan", "Finish Lightroom catalog import before adding photos": "Selesaikan impor katalog Lightroom sebelum menambahkan foto", - "Import dropped files without review": "Impor file yang dijatuhkan tanpa tinjauan" + "Import dropped files without review": "Impor file yang dijatuhkan tanpa tinjauan", + "Continue in Background": "Lanjutkan di Latar Belakang", + "Folder not found": "Folder tidak ditemukan", + "Dismiss": "Tutup", + "Review…": "Tinjau…", + "Open Synchronize Folder with what the scan found": "Buka Sinkronkan Folder dengan hasil pemindaian", + "You can go on working: a notice at the top left says when the scan is done.": "Anda dapat terus bekerja: pemberitahuan di kiri atas memberi tahu saat pemindaian selesai." } diff --git a/crates/ui-egui/locales/it-formats.json b/crates/ui-egui/locales/it-formats.json index 7efae90e945..9cd2cc0d6c7 100644 --- a/crates/ui-egui/locales/it-formats.json +++ b/crates/ui-egui/locales/it-formats.json @@ -305,5 +305,8 @@ "Could not read {name}: {e}": "Impossibile leggere {name}: {e}", "Added {n} photo{}": "Foto aggiunte: {n}{:.0}", "Where should the Lightroom catalog “{catalog}” go?": "Dove importare il catalogo Lightroom “{catalog}”?", - "Merge into the open library “{library}” ({count} photo{})": "Unisci alla libreria aperta “{library}” (foto: {count}{:.0})" + "Merge into the open library “{library}” ({count} photo{})": "Unisci alla libreria aperta “{library}” (foto: {count}{:.0})", + "Changes found: {n}": "Modifiche trovate: {n}", + "“{name}” is still being scanned: wait for it, or stop it with ✕ on its row": "“{name}” è ancora in analisi: attendi, oppure fermala con × sulla sua riga", + "Look at the changes found in “{name}” first, or dismiss them": "Guarda prima le modifiche trovate in “{name}”, oppure scartale" } diff --git a/crates/ui-egui/locales/it.json b/crates/ui-egui/locales/it.json index e159fd47d15..e969bc4a2cc 100644 --- a/crates/ui-egui/locales/it.json +++ b/crates/ui-egui/locales/it.json @@ -2361,5 +2361,11 @@ "Import dropped files without review": "Importa i file rilasciati senza revisione", "An import is running": "Un'importazione è in corso", "An import is running. Drop photos when it has finished": "Un'importazione è in corso. Trascina le foto quando è finita", - "Finish Lightroom catalog import before adding photos": "Termina l'importazione del catalogo Lightroom prima di aggiungere foto" + "Finish Lightroom catalog import before adding photos": "Termina l'importazione del catalogo Lightroom prima di aggiungere foto", + "Continue in Background": "Continua in background", + "Folder not found": "Cartella non trovata", + "Dismiss": "Rimuovi", + "Review…": "Esamina…", + "Open Synchronize Folder with what the scan found": "Apri Sincronizza cartella con ciò che ha trovato l'analisi", + "You can go on working: a notice at the top left says when the scan is done.": "Puoi continuare a lavorare: un avviso in alto a sinistra dice quando l'analisi è finita." } diff --git a/crates/ui-egui/locales/ja-formats.json b/crates/ui-egui/locales/ja-formats.json index 99c14bf16dc..75f5c86950d 100644 --- a/crates/ui-egui/locales/ja-formats.json +++ b/crates/ui-egui/locales/ja-formats.json @@ -305,5 +305,8 @@ "Could not read {name}: {e}": "{name} を読み取れませんでした: {e}", "Added {n} photo{}": "{n}枚を追加しました{:.0}", "Where should the Lightroom catalog “{catalog}” go?": "Lightroom カタログ「{catalog}」をどこに読み込みますか?", - "Merge into the open library “{library}” ({count} photo{})": "開いているライブラリ「{library}」に統合(写真{count}枚){:.0}" + "Merge into the open library “{library}” ({count} photo{})": "開いているライブラリ「{library}」に統合(写真{count}枚){:.0}", + "Changes found: {n}": "見つかった変更: {n}", + "“{name}” is still being scanned: wait for it, or stop it with ✕ on its row": "「{name}」はまだスキャン中です。終わるまで待つか、その行の × で停止してください", + "Look at the changes found in “{name}” first, or dismiss them": "先に「{name}」で見つかった変更を確認するか、閉じてください" } diff --git a/crates/ui-egui/locales/ja.json b/crates/ui-egui/locales/ja.json index e1834555bd7..6e12593cc51 100644 --- a/crates/ui-egui/locales/ja.json +++ b/crates/ui-egui/locales/ja.json @@ -2356,5 +2356,11 @@ "Import dropped files without review": "ドロップしたファイルを確認せずに読み込む", "An import is running": "読み込み中です", "An import is running. Drop photos when it has finished": "読み込み中です。完了してから写真をドロップしてください", - "Finish Lightroom catalog import before adding photos": "写真を追加する前に Lightroom カタログの読み込みを完了してください" + "Finish Lightroom catalog import before adding photos": "写真を追加する前に Lightroom カタログの読み込みを完了してください", + "Continue in Background": "バックグラウンドで続行", + "Folder not found": "フォルダが見つかりません", + "Dismiss": "消去", + "Review…": "確認…", + "Open Synchronize Folder with what the scan found": "スキャンの結果を「フォルダを同期」で開く", + "You can go on working: a notice at the top left says when the scan is done.": "作業を続けられます。スキャンが終わると左上に通知が表示されます。" } diff --git a/crates/ui-egui/locales/ka-formats.json b/crates/ui-egui/locales/ka-formats.json index 46036826186..c77fdf91c24 100644 --- a/crates/ui-egui/locales/ka-formats.json +++ b/crates/ui-egui/locales/ka-formats.json @@ -305,5 +305,8 @@ "Could not read {name}: {e}": "ვერ წაიკითხა {name}: {e}", "Added {n} photo{}": "დაემატა ფოტო: {n}{:.0}", "Where should the Lightroom catalog “{catalog}” go?": "სად გადავიტანოთ Lightroom-ის კატალოგი „{catalog}“?", - "Merge into the open library “{library}” ({count} photo{})": "გაერთიანება ღია ბიბლიოთეკასთან „{library}“ (ფოტოები: {count}){:.0}" + "Merge into the open library “{library}” ({count} photo{})": "გაერთიანება ღია ბიბლიოთეკასთან „{library}“ (ფოტოები: {count}){:.0}", + "Changes found: {n}": "ნაპოვნი ცვლილებები: {n}", + "“{name}” is still being scanned: wait for it, or stop it with ✕ on its row": "„{name}“ ჯერ კიდევ მოწმდება: დაელოდეთ, ან შეაჩერეთ ×-ით მის მწკრივზე", + "Look at the changes found in “{name}” first, or dismiss them": "ჯერ ნახეთ „{name}“-ში ნაპოვნი ცვლილებები, ან უარყავით ისინი" } diff --git a/crates/ui-egui/locales/ka.json b/crates/ui-egui/locales/ka.json index 32c40770018..97753ac66ba 100644 --- a/crates/ui-egui/locales/ka.json +++ b/crates/ui-egui/locales/ka.json @@ -2734,5 +2734,11 @@ "Import dropped files without review": "ჩაგდებული ფაილების იმპორტი გადახედვის გარეშე", "An import is running": "იმპორტი მიმდინარეობს", "An import is running. Drop photos when it has finished": "იმპორტი მიმდინარეობს. ფოტოები ჩააგდეთ, როცა დასრულდება", - "Finish Lightroom catalog import before adding photos": "ფოტოების დამატებამდე დაასრულეთ Lightroom-ის კატალოგის იმპორტი" + "Finish Lightroom catalog import before adding photos": "ფოტოების დამატებამდე დაასრულეთ Lightroom-ის კატალოგის იმპორტი", + "Continue in Background": "ფონურ რეჟიმში გაგრძელება", + "Folder not found": "საქაღალდე ვერ მოიძებნა", + "Dismiss": "დახურვა", + "Review…": "ნახვა…", + "Open Synchronize Folder with what the scan found": "საქაღალდის სინქრონიზაციის გახსნა შემოწმების შედეგით", + "You can go on working: a notice at the top left says when the scan is done.": "შეგიძლიათ მუშაობა გააგრძელოთ: შემოწმების დასრულებისას ზედა მარცხენა კუთხეში შეტყობინება გამოჩნდება." } diff --git a/crates/ui-egui/locales/pl-formats.json b/crates/ui-egui/locales/pl-formats.json index 20c7f840d6e..31d41c4b335 100644 --- a/crates/ui-egui/locales/pl-formats.json +++ b/crates/ui-egui/locales/pl-formats.json @@ -305,5 +305,8 @@ "Added {n} photo{}": "Dodano zdjęcia: {n}{:.0}", "Inside: {names}": "Wewnątrz: {names}", "Where should the Lightroom catalog “{catalog}” go?": "Dokąd zaimportować katalog Lightroom „{catalog}”?", - "Merge into the open library “{library}” ({count} photo{})": "Scal z otwartą biblioteką „{library}” (zdjęcia: {count}){:.0}" + "Merge into the open library “{library}” ({count} photo{})": "Scal z otwartą biblioteką „{library}” (zdjęcia: {count}){:.0}", + "Changes found: {n}": "Znalezione zmiany: {n}", + "“{name}” is still being scanned: wait for it, or stop it with ✕ on its row": "„{name}” jest jeszcze przeszukiwany: poczekaj albo zatrzymaj to × w jego wierszu", + "Look at the changes found in “{name}” first, or dismiss them": "Najpierw przejrzyj zmiany znalezione w „{name}” albo je odrzuć" } diff --git a/crates/ui-egui/locales/pl.json b/crates/ui-egui/locales/pl.json index adac22e62ad..fa745b8797f 100644 --- a/crates/ui-egui/locales/pl.json +++ b/crates/ui-egui/locales/pl.json @@ -2283,5 +2283,11 @@ "Import dropped files without review": "Importuj upuszczone pliki bez przeglądu", "An import is running": "Import jest w toku", "An import is running. Drop photos when it has finished": "Import jest w toku. Upuść zdjęcia, gdy się zakończy", - "Finish Lightroom catalog import before adding photos": "Zakończ import katalogu Lightrooma, zanim dodasz zdjęcia" + "Finish Lightroom catalog import before adding photos": "Zakończ import katalogu Lightrooma, zanim dodasz zdjęcia", + "Continue in Background": "Kontynuuj w tle", + "Folder not found": "Nie znaleziono folderu", + "Dismiss": "Odrzuć", + "Review…": "Przejrzyj…", + "Open Synchronize Folder with what the scan found": "Otwórz Synchronizuj folder z tym, co znalazło przeszukiwanie", + "You can go on working: a notice at the top left says when the scan is done.": "Możesz dalej pracować: komunikat w lewym górnym rogu powie, kiedy przeszukiwanie się skończy." } diff --git a/crates/ui-egui/locales/pt-br-formats.json b/crates/ui-egui/locales/pt-br-formats.json index f17f2c0fd4b..0d3d48c2c0f 100644 --- a/crates/ui-egui/locales/pt-br-formats.json +++ b/crates/ui-egui/locales/pt-br-formats.json @@ -305,5 +305,8 @@ "Could not read {name}: {e}": "Não foi possível ler {name}: {e}", "Added {n} photo{}": "{n} foto{0} adicionada{0}", "Where should the Lightroom catalog “{catalog}” go?": "Para onde vai o catálogo do Lightroom “{catalog}”?", - "Merge into the open library “{library}” ({count} photo{})": "Mesclar na biblioteca aberta “{library}” ({count} foto{})" + "Merge into the open library “{library}” ({count} photo{})": "Mesclar na biblioteca aberta “{library}” ({count} foto{})", + "Changes found: {n}": "Alterações encontradas: {n}", + "“{name}” is still being scanned: wait for it, or stop it with ✕ on its row": "“{name}” ainda está sendo verificada: aguarde ou interrompa com × na linha dela", + "Look at the changes found in “{name}” first, or dismiss them": "Revise primeiro as alterações encontradas em “{name}” ou dispense-as" } diff --git a/crates/ui-egui/locales/pt-br.json b/crates/ui-egui/locales/pt-br.json index e84fb7615b7..13e3e122d70 100644 --- a/crates/ui-egui/locales/pt-br.json +++ b/crates/ui-egui/locales/pt-br.json @@ -2202,5 +2202,11 @@ "Import dropped files without review": "Importar arquivos soltos sem revisão", "An import is running": "Uma importação está em andamento", "An import is running. Drop photos when it has finished": "Uma importação está em andamento. Solte as fotos quando ela terminar", - "Finish Lightroom catalog import before adding photos": "Conclua a importação do catálogo do Lightroom antes de adicionar fotos" + "Finish Lightroom catalog import before adding photos": "Conclua a importação do catálogo do Lightroom antes de adicionar fotos", + "Continue in Background": "Continuar em segundo plano", + "Folder not found": "Pasta não encontrada", + "Dismiss": "Dispensar", + "Review…": "Revisar…", + "Open Synchronize Folder with what the scan found": "Abrir Sincronizar pasta com o que a verificação encontrou", + "You can go on working: a notice at the top left says when the scan is done.": "Você pode continuar trabalhando: um aviso no canto superior esquerdo informa quando a verificação terminar." } diff --git a/crates/ui-egui/locales/ru-formats.json b/crates/ui-egui/locales/ru-formats.json index 76b7af42764..9d934e8de92 100644 --- a/crates/ui-egui/locales/ru-formats.json +++ b/crates/ui-egui/locales/ru-formats.json @@ -305,5 +305,8 @@ "Could not read {name}: {e}": "Не удалось прочитать {name}: {e}", "Added {n} photo{}": "Добавлено фото: {n}{:.0}", "Where should the Lightroom catalog “{catalog}” go?": "Куда импортировать каталог Lightroom «{catalog}»?", - "Merge into the open library “{library}” ({count} photo{})": "Объединить с открытой библиотекой «{library}» (фото: {count}){:.0}" + "Merge into the open library “{library}” ({count} photo{})": "Объединить с открытой библиотекой «{library}» (фото: {count}){:.0}", + "Changes found: {n}": "Найдено изменений: {n}", + "“{name}” is still being scanned: wait for it, or stop it with ✕ on its row": "«{name}» ещё просматривается: дождитесь окончания или остановите поиск кнопкой × в его строке", + "Look at the changes found in “{name}” first, or dismiss them": "Сначала просмотрите изменения, найденные в «{name}», или скройте их" } diff --git a/crates/ui-egui/locales/ru.json b/crates/ui-egui/locales/ru.json index 306804df045..c9c841da8d7 100644 --- a/crates/ui-egui/locales/ru.json +++ b/crates/ui-egui/locales/ru.json @@ -2349,5 +2349,11 @@ "Import dropped files without review": "Импортировать перетащенные файлы без проверки", "An import is running": "Импорт уже выполняется", "An import is running. Drop photos when it has finished": "Импорт уже выполняется. Перетащите фото, когда он закончится", - "Finish Lightroom catalog import before adding photos": "Завершите импорт каталога Lightroom, прежде чем добавлять фото" + "Finish Lightroom catalog import before adding photos": "Завершите импорт каталога Lightroom, прежде чем добавлять фото", + "Continue in Background": "Продолжить в фоне", + "Folder not found": "Папка не найдена", + "Dismiss": "Скрыть", + "Review…": "Просмотреть…", + "Open Synchronize Folder with what the scan found": "Открыть «Синхронизировать папку» с результатами поиска", + "You can go on working: a notice at the top left says when the scan is done.": "Можно продолжать работу: уведомление слева вверху сообщит, когда поиск завершится." } diff --git a/crates/ui-egui/locales/sv-formats.json b/crates/ui-egui/locales/sv-formats.json index 9a71a0288c4..777517eea7f 100644 --- a/crates/ui-egui/locales/sv-formats.json +++ b/crates/ui-egui/locales/sv-formats.json @@ -305,5 +305,8 @@ "Drop to review {n} item{} for import": "Släpp för att granska {n} objekt före import{:.0}", "Inside: {names}": "Inuti: {names}", "Where should the Lightroom catalog “{catalog}” go?": "Vart ska Lightroom-katalogen ”{catalog}” importeras?", - "Merge into the open library “{library}” ({count} photo{})": "Slå samman med det öppna biblioteket ”{library}” ({count} foto{:.0})" + "Merge into the open library “{library}” ({count} photo{})": "Slå samman med det öppna biblioteket ”{library}” ({count} foto{:.0})", + "Changes found: {n}": "Ändringar hittade: {n}", + "“{name}” is still being scanned: wait for it, or stop it with ✕ on its row": "”{name}” genomsöks fortfarande: vänta, eller stoppa den med × på dess rad", + "Look at the changes found in “{name}” first, or dismiss them": "Titta först på ändringarna som hittades i ”{name}”, eller avfärda dem" } diff --git a/crates/ui-egui/locales/sv.json b/crates/ui-egui/locales/sv.json index 66e69b7ba5d..623fa458d3f 100644 --- a/crates/ui-egui/locales/sv.json +++ b/crates/ui-egui/locales/sv.json @@ -2429,5 +2429,11 @@ "Drop to open the face model": "Släpp för att öppna ansiktsmodellen", "Dropped Files": "Släppta filer", "Finish Lightroom catalog import before adding photos": "Slutför importen av Lightroom-katalogen innan du lägger till foton", - "Import dropped files without review": "Importera släppta filer utan granskning" + "Import dropped files without review": "Importera släppta filer utan granskning", + "Continue in Background": "Fortsätt i bakgrunden", + "Folder not found": "Mappen hittades inte", + "Dismiss": "Avfärda", + "Review…": "Granska…", + "Open Synchronize Folder with what the scan found": "Öppna Synkronisera mapp med det genomsökningen hittade", + "You can go on working: a notice at the top left says when the scan is done.": "Du kan fortsätta arbeta: en avisering uppe till vänster berättar när genomsökningen är klar." } diff --git a/crates/ui-egui/locales/uk-formats.json b/crates/ui-egui/locales/uk-formats.json index 36022ac1a25..b5399d28774 100644 --- a/crates/ui-egui/locales/uk-formats.json +++ b/crates/ui-egui/locales/uk-formats.json @@ -305,5 +305,8 @@ "Could not read {name}: {e}": "Не вдалося прочитати {name}: {e}", "Added {n} photo{}": "Додано фото: {n}{:.0}", "Where should the Lightroom catalog “{catalog}” go?": "Куди імпортувати каталог Lightroom «{catalog}»?", - "Merge into the open library “{library}” ({count} photo{})": "Об’єднати з відкритою бібліотекою «{library}» (фото: {count}){:.0}" + "Merge into the open library “{library}” ({count} photo{})": "Об’єднати з відкритою бібліотекою «{library}» (фото: {count}){:.0}", + "Changes found: {n}": "Знайдено змін: {n}", + "“{name}” is still being scanned: wait for it, or stop it with ✕ on its row": "«{name}» ще переглядається: дочекайтеся завершення або зупиніть пошук кнопкою × у його рядку", + "Look at the changes found in “{name}” first, or dismiss them": "Спершу перегляньте зміни, знайдені в «{name}», або сховайте їх" } diff --git a/crates/ui-egui/locales/uk.json b/crates/ui-egui/locales/uk.json index ee694ed4fe0..601f5dc7ad6 100644 --- a/crates/ui-egui/locales/uk.json +++ b/crates/ui-egui/locales/uk.json @@ -2354,5 +2354,11 @@ "Import dropped files without review": "Імпортувати перетягнуті файли без перегляду", "An import is running": "Імпорт уже виконується", "An import is running. Drop photos when it has finished": "Імпорт уже виконується. Перетягніть фото, коли він завершиться", - "Finish Lightroom catalog import before adding photos": "Завершіть імпорт каталогу Lightroom, перш ніж додавати фото" + "Finish Lightroom catalog import before adding photos": "Завершіть імпорт каталогу Lightroom, перш ніж додавати фото", + "Continue in Background": "Продовжити у фоні", + "Folder not found": "Теку не знайдено", + "Dismiss": "Сховати", + "Review…": "Переглянути…", + "Open Synchronize Folder with what the scan found": "Відкрити «Синхронізувати теку» з результатами пошуку", + "You can go on working: a notice at the top left says when the scan is done.": "Можна працювати далі: сповіщення вгорі ліворуч повідомить, коли пошук завершиться." } diff --git a/crates/ui-egui/locales/vi-formats.json b/crates/ui-egui/locales/vi-formats.json index d5e28bff060..8c043868afa 100644 --- a/crates/ui-egui/locales/vi-formats.json +++ b/crates/ui-egui/locales/vi-formats.json @@ -305,5 +305,8 @@ "Drop to import {n} preset{}": "Thả để nhập {n} thiết lập sẵn{:.0}", "Drop to review {n} item{} for import": "Thả để xem lại {n} mục trước khi nhập{:.0}", "Where should the Lightroom catalog “{catalog}” go?": "Nhập danh mục Lightroom «{catalog}» vào đâu?", - "Merge into the open library “{library}” ({count} photo{})": "Gộp vào thư viện đang mở «{library}» ({count} ảnh{:.0})" + "Merge into the open library “{library}” ({count} photo{})": "Gộp vào thư viện đang mở «{library}» ({count} ảnh{:.0})", + "Changes found: {n}": "Thay đổi tìm thấy: {n}", + "“{name}” is still being scanned: wait for it, or stop it with ✕ on its row": "«{name}» vẫn đang được quét: hãy đợi, hoặc dừng bằng × trên dòng của nó", + "Look at the changes found in “{name}” first, or dismiss them": "Hãy xem trước các thay đổi tìm thấy trong «{name}», hoặc bỏ qua chúng" } diff --git a/crates/ui-egui/locales/vi.json b/crates/ui-egui/locales/vi.json index e4fb8feb81c..789033a615f 100644 --- a/crates/ui-egui/locales/vi.json +++ b/crates/ui-egui/locales/vi.json @@ -2235,5 +2235,11 @@ "Drop to open the face model": "Thả để mở mô hình khuôn mặt", "Dropped Files": "Tệp đã thả", "Finish Lightroom catalog import before adding photos": "Hoàn tất nhập danh mục Lightroom trước khi thêm ảnh", - "Import dropped files without review": "Nhập các tệp đã thả mà không xem lại" + "Import dropped files without review": "Nhập các tệp đã thả mà không xem lại", + "Continue in Background": "Tiếp tục ở nền", + "Folder not found": "Không tìm thấy thư mục", + "Dismiss": "Bỏ qua", + "Review…": "Xem lại…", + "Open Synchronize Folder with what the scan found": "Mở Đồng bộ thư mục với những gì quá trình quét tìm thấy", + "You can go on working: a notice at the top left says when the scan is done.": "Bạn có thể tiếp tục làm việc: thông báo ở góc trên bên trái cho biết khi quá trình quét xong." } diff --git a/crates/ui-egui/locales/zh-hans-formats.json b/crates/ui-egui/locales/zh-hans-formats.json index 7406c39b866..b76246b2a49 100644 --- a/crates/ui-egui/locales/zh-hans-formats.json +++ b/crates/ui-egui/locales/zh-hans-formats.json @@ -305,5 +305,8 @@ "Could not read {name}: {e}": "无法读取 {name}:{e}", "Added {n} photo{}": "已添加 {n} 张照片{:.0}", "Where should the Lightroom catalog “{catalog}” go?": "Lightroom 目录“{catalog}”要导入到哪里?", - "Merge into the open library “{library}” ({count} photo{})": "合并到当前打开的图库“{library}”({count} 张照片){:.0}" + "Merge into the open library “{library}” ({count} photo{})": "合并到当前打开的图库“{library}”({count} 张照片){:.0}", + "Changes found: {n}": "发现的更改:{n}", + "“{name}” is still being scanned: wait for it, or stop it with ✕ on its row": "“{name}”仍在扫描:请等待完成,或用其所在行的 × 停止", + "Look at the changes found in “{name}” first, or dismiss them": "请先查看在“{name}”中发现的更改,或将其忽略" } diff --git a/crates/ui-egui/locales/zh-hans.json b/crates/ui-egui/locales/zh-hans.json index 270af8a6251..7ace3a17384 100644 --- a/crates/ui-egui/locales/zh-hans.json +++ b/crates/ui-egui/locales/zh-hans.json @@ -2200,5 +2200,11 @@ "Import dropped files without review": "不经检查直接导入拖入的文件", "An import is running": "正在导入", "An import is running. Drop photos when it has finished": "正在导入。导入完成后再拖放照片", - "Finish Lightroom catalog import before adding photos": "添加照片前,请先完成 Lightroom 目录的导入" + "Finish Lightroom catalog import before adding photos": "添加照片前,请先完成 Lightroom 目录的导入", + "Continue in Background": "在后台继续", + "Folder not found": "未找到文件夹", + "Dismiss": "移除", + "Review…": "查看…", + "Open Synchronize Folder with what the scan found": "用扫描结果打开“同步文件夹”", + "You can go on working: a notice at the top left says when the scan is done.": "你可以继续工作:扫描完成时左上角会出现通知。" } diff --git a/crates/ui-egui/locales/zh-hant-formats.json b/crates/ui-egui/locales/zh-hant-formats.json index d5c4eb279a2..66cecdb36d4 100644 --- a/crates/ui-egui/locales/zh-hant-formats.json +++ b/crates/ui-egui/locales/zh-hant-formats.json @@ -305,5 +305,8 @@ "Could not read {name}: {e}": "無法讀取 {name}:{e}", "Added {n} photo{}": "已加入 {n} 張照片{:.0}", "Where should the Lightroom catalog “{catalog}” go?": "Lightroom 目錄「{catalog}」要匯入到哪裡?", - "Merge into the open library “{library}” ({count} photo{})": "合併到目前開啟的照片庫「{library}」({count} 張照片){:.0}" + "Merge into the open library “{library}” ({count} photo{})": "合併到目前開啟的照片庫「{library}」({count} 張照片){:.0}", + "Changes found: {n}": "找到的變更:{n}", + "“{name}” is still being scanned: wait for it, or stop it with ✕ on its row": "「{name}」仍在掃描:請等待完成,或用其所在列的 × 停止", + "Look at the changes found in “{name}” first, or dismiss them": "請先檢視在「{name}」中找到的變更,或將其忽略" } diff --git a/crates/ui-egui/locales/zh-hant.json b/crates/ui-egui/locales/zh-hant.json index 0408e23ec87..28e7fbe3e8a 100644 --- a/crates/ui-egui/locales/zh-hant.json +++ b/crates/ui-egui/locales/zh-hant.json @@ -2157,5 +2157,11 @@ "Import dropped files without review": "不經檢查直接匯入拖放的檔案", "An import is running": "正在匯入", "An import is running. Drop photos when it has finished": "正在匯入。匯入完成後再拖放照片", - "Finish Lightroom catalog import before adding photos": "新增照片前,請先完成 Lightroom 目錄的匯入" + "Finish Lightroom catalog import before adding photos": "新增照片前,請先完成 Lightroom 目錄的匯入", + "Continue in Background": "在背景繼續", + "Folder not found": "找不到資料夾", + "Dismiss": "移除", + "Review…": "檢視…", + "Open Synchronize Folder with what the scan found": "以掃描結果開啟「同步資料夾」", + "You can go on working: a notice at the top left says when the scan is done.": "你可以繼續工作:掃描完成時左上角會出現通知。" } diff --git a/crates/ui-egui/src/app.rs b/crates/ui-egui/src/app.rs index fa10210f0a3..be29b508363 100644 --- a/crates/ui-egui/src/app.rs +++ b/crates/ui-egui/src/app.rs @@ -104,6 +104,8 @@ impl LightcraftApp { scan: None, sync: None, sync_owns_changes: false, + sync_scanned_at: f64::NEG_INFINITY, + sync_ready: None, sync_run: None, lightroom: None, lightroom_last: None, diff --git a/crates/ui-egui/src/app/frame.rs b/crates/ui-egui/src/app/frame.rs index 6e92091c780..0c4929a2572 100644 --- a/crates/ui-egui/src/app/frame.rs +++ b/crates/ui-egui/src/app/frame.rs @@ -269,7 +269,12 @@ impl LightcraftApp { if self.shown_library == Some(generation) { return; } - self.shown_library = Some(generation); + // (another library than the one shown before: at launch there was none, and nothing of + // an earlier library to let go of) + let switched = self.shown_library.replace(generation).is_some(); + if switched { + sync::library_changed(self); + } if let Some(l) = self.session.library.as_ref().filter(|l| l.on_disk) { let path = l.dir.to_string_lossy().into_owned(); panels::settings::remember_library(&mut self.ui.settings.recent_libraries, &path); diff --git a/crates/ui-egui/src/dialogs.rs b/crates/ui-egui/src/dialogs.rs index 64628822031..27500a62298 100644 --- a/crates/ui-egui/src/dialogs.rs +++ b/crates/ui-egui/src/dialogs.rs @@ -356,6 +356,8 @@ fn ok_label(app: &LightcraftApp, dlg: &Dialog, informational: bool, sam: &SamSta Dialog::LightroomCatalog { .. } => "Import Lightroom Catalog…", d @ Dialog::LightroomDestination { .. } => crate::lightroom_destination::ok_label(d), Dialog::SynchronizeFolder { .. } if informational => "Close", + // the scan need not be waited for + Dialog::SynchronizeFolder { counts: None, .. } => "Continue in Background", Dialog::SynchronizeFolder { .. } => "Synchronize", Dialog::SamModel { .. } => return sam_ok_label(dlg, sam).to_string(), Dialog::RenamePerson { from, to, .. } if person_rename_plan(&app.session.catalog, from, to).needs_merge => "Merge", @@ -375,9 +377,9 @@ fn sam_ok_label(dlg: &Dialog, sam: &SamState) -> &'static str { } } -/// Whether the confirm button works: installing waits for the licence to be accepted (and Synchronize waits for the -/// scan), a rename waits for its conflicts to be settled, smart-album rules that can't mean anything wait to be fixed. -fn can_confirm(app: &LightcraftApp, dlg: &Dialog, informational: bool) -> bool { +/// Whether the confirm button works: installing waits for the licence to be accepted (and Synchronize for the short +/// settle after its scan), a rename waits for its conflicts to be settled, smart-album rules that can't mean anything wait to be fixed. +fn can_confirm(app: &LightcraftApp, ctx: &egui::Context, dlg: &Dialog, informational: bool) -> bool { let rename_blocked = match dlg { Dialog::RenamePerson { from, to, merge } => { let plan = person_rename_plan(&app.session.catalog, from, to); @@ -385,10 +387,9 @@ fn can_confirm(app: &LightcraftApp, dlg: &Dialog, informational: bool) -> bool { } _ => false, }; - let waiting = matches!( - dlg, - Dialog::DenoiseModel { accepted: false, .. } | Dialog::FaceModel { accepted: false, .. } | Dialog::SynchronizeFolder { counts: None, .. } - ); + let waiting = matches!(dlg, Dialog::DenoiseModel { accepted: false, .. } | Dialog::FaceModel { accepted: false, .. }) + // (Synchronize, just after its button stopped being Continue in Background) + || (matches!(dlg, Dialog::SynchronizeFolder { counts: Some(_), .. }) && !crate::sync::settled(app, ctx)); let bad_rules = matches!(dlg, Dialog::SmartRules { id, rules, .. } if !rules.check_for(&app.session.catalog, id.map(lightcraft_catalog::AlbumId)).is_empty()); !rename_blocked && (informational || (!waiting && !bad_rules)) @@ -401,7 +402,7 @@ fn button_row(app: &LightcraftApp, ui: &mut egui::Ui, dlg: &Dialog, close: &mut let cancel = cancel_label(dlg, &sam); let ok = ok_label(app, dlg, informational, &sam); let ok = ok.as_str(); - let can_confirm = can_confirm(app, dlg, informational); + let can_confirm = can_confirm(app, ui.ctx(), dlg, informational); let primary = !informational && can_confirm && confirm_style(dlg) == ConfirmStyle::Primary; use crate::button::{Button, Kind}; // (each kind of dialog its own buttons: the keyboard's place doesn't carry from a diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs index 9db7035c1d0..68be9a53b4d 100644 --- a/crates/ui-egui/src/lib.rs +++ b/crates/ui-egui/src/lib.rs @@ -293,6 +293,10 @@ pub struct LightcraftApp { pub sync: Option, /// `session.folder_changes` came from the Synchronize Folder dialog (and goes with it). pub sync_owns_changes: bool, + /// When (app time, s) the open Synchronize Folder dialog got its scan ([`sync::settled`]). + pub sync_scanned_at: f64, + /// A Synchronize Folder scan that finished in the background and waits to be looked at. + pub sync_ready: Option, /// A Synchronize Folder at work in the background. pub sync_run: Option, /// A Lightroom catalog inspect/import in progress. diff --git a/crates/ui-egui/src/panels/activity.rs b/crates/ui-egui/src/panels/activity.rs index dffdd1c4d33..6a09b5e8ec9 100644 --- a/crates/ui-egui/src/panels/activity.rs +++ b/crates/ui-egui/src/panels/activity.rs @@ -56,14 +56,19 @@ fn detail_line(t: &TaskInfo) -> String { /// Draw the stack (called every frame, after the panels and dialogs). pub fn show(app: &mut LightcraftApp, ctx: &egui::Context) { let all = app.session.activity.list(); + // a scan that finished in the background and waits to be looked at + let ready = app.sync_ready.clone(); if all.is_empty() { app.activity_expanded = false; - return; + if ready.is_none() { + return; + } + } else { + // look again soon: a young task becomes due, bars move + ctx.request_repaint_after(std::time::Duration::from_millis(100)); } - // look again soon: a young task becomes due, bars move - ctx.request_repaint_after(std::time::Duration::from_millis(100)); let tasks: Vec<&TaskInfo> = all.iter().filter(|t| t.age_ms >= SHOW_AFTER_MS).collect(); - if tasks.is_empty() { + if tasks.is_empty() && ready.is_none() { return; } let t = Tokens::get(ctx); @@ -72,6 +77,7 @@ pub fn show(app: &mut LightcraftApp, ctx: &egui::Context) { let max_height = (ctx.content_rect().height() - t.top_bar_h - 60.0).max(80.0); let mut cancel = None; let mut toggle = false; + let mut notice = None; let frame = egui::Frame::NONE.fill(t.chrome).stroke(Stroke::new(1.0, t.field_border)).corner_radius(6).inner_margin(Margin::same(MARGIN)); egui::Area::new(egui::Id::unique("activity-stack")).order(egui::Order::Middle).fixed_pos(pos2(8.0, t.top_bar_h + 8.0)).show(ctx, |ui| { // An area lays out in the size it had last frame, and the scroll area would take that as all the room there @@ -83,6 +89,12 @@ pub fn show(app: &mut LightcraftApp, ctx: &egui::Context) { ui.set_width(inner); ui.spacing_mut().item_spacing.y = 3.0; egui::ScrollArea::vertical().max_height(max_height).auto_shrink([false, true]).show(ui, |ui| { + if let Some(ready) = &ready { + notice = scan_notice(ui, &t, ready, inner); + if !tasks.is_empty() { + ui.add_space(6.0); + } + } for (i, task) in tasks.iter().take(shown).enumerate() { if i > 0 { ui.add_space(6.0); @@ -104,6 +116,11 @@ pub fn show(app: &mut LightcraftApp, ctx: &egui::Context) { if let Some(id) = cancel { self::cancel(app, id); } + match notice { + Some(Notice::Review) => crate::sync::review(app), + Some(Notice::Dismiss) => crate::sync::dismiss(app), + None => {} + } if toggle { app.activity_expanded = !app.activity_expanded; } @@ -115,6 +132,65 @@ pub(crate) fn cancel(app: &mut LightcraftApp, id: u64) { let _ = app.session.execute("activity.cancel", &json!({"id": id})); } +/// What was done with a notice. +enum Notice { + Review, + Dismiss, +} + +/// The notice of a Synchronize Folder scan that finished in the background (widgets +/// `activity:scanReady`, its `:title`, `:review` and `:dismiss`): what it found and in which folder. A +/// click on it opens the dialog with the result; ✕ lets go of it. It stays until one of +/// the two: the person looks when ready. +fn scan_notice(ui: &mut egui::Ui, t: &Tokens, ready: &crate::sync::SyncReady, width: f32) -> Option { + let mut dismissed = false; + let title = if ready.counts.offline { tr("Folder not found").to_string() } else { tr_format!("Changes found: {n}", n = ready.changes()) }; + let mut reviewed = false; + let r = ui + .vertical(|ui| { + ui.set_width(width); + ui.horizontal(|ui| { + let label_w = width - CROSS - 6.0; + let title_rect = ui + .allocate_ui_with_layout(vec2(label_w, 18.0), Layout::left_to_right(Align::Center), |ui| { + ui.set_width(label_w); + ui.add(egui::Label::new(RichText::new(title).font(t.font(12.5)).color(t.text)).truncate()); + }) + .response + .rect; + // (the title opens the result like the part below it; it ends before the ✕. Mouse only: the + // part below stays the one keyboard and screen-reader target, so no unnamed second stop) + let title_click = ui + .interact(title_rect, egui::Id::unique("activity-scan-ready-title"), Sense::CLICK) + .on_hover_cursor(egui::CursorIcon::PointingHand); + register(ui, "activity:scanReady:title", title_rect); + reviewed = title_click.on_hover_text(tr("Open Synchronize Folder with what the scan found")).clicked(); + let (rect, resp) = ui.allocate_exact_size(vec2(CROSS, CROSS), Sense::click()); + paint(ui.painter(), rect.shrink(2.0), Icon::Close, if resp.hovered() { t.text } else { t.icon }); + register(ui, "activity:scanReady:dismiss", rect); + dismissed = resp.on_hover_text(tr("Dismiss")).clicked(); + }); + // (the parts either side of the ✕ take the click, so they never overlap it) + let body = ui + .vertical(|ui| { + ui.set_width(width); + ui.add(egui::Label::new(RichText::new(ready.name.as_str()).font(t.font(11.0)).color(t.text_dim)).truncate()); + ui.add(egui::Label::new(RichText::new(tr("Review…")).font(t.font(11.0)).color(t.accent))); + }) + .response; + let click = + ui.interact(body.rect, egui::Id::unique("activity-scan-ready"), Sense::click()).on_hover_cursor(egui::CursorIcon::PointingHand); + register(ui, "activity:scanReady:review", body.rect); + reviewed |= click.on_hover_text(tr("Open Synchronize Folder with what the scan found")).clicked(); + }) + .response; + register(ui, "activity:scanReady", r.rect); + if dismissed { + return Some(Notice::Dismiss); + } + reviewed.then_some(Notice::Review) +} + /// One task: name and ✕, the bar, the detail line. True when ✕ was clicked. fn row(ui: &mut egui::Ui, t: &Tokens, task: &TaskInfo, width: f32) -> bool { let mut clicked = false; diff --git a/crates/ui-egui/src/sync.rs b/crates/ui-egui/src/sync.rs index 25d7cd84c5a..f70205a10b2 100644 --- a/crates/ui-egui/src/sync.rs +++ b/crates/ui-egui/src/sync.rs @@ -3,6 +3,10 @@ //! changed and what to do about it. Synchronize runs `folder.synchronize`, which acts on exactly //! the scan the dialog showed (see `lightcraft_engine::sync`). Both the scan and the run show a row in the activity //! stack (issue #345); its ✕ stops them like the dialog's Cancel. +//! +//! The scan need not be waited for: Continue in Background closes the dialog and the scan goes +//! on under its row. When it is done, a notice in the activity stack says so ([`SyncReady`]); +//! a click on it opens the dialog with what was found, whenever the person is ready for it. use std::sync::Arc; use std::sync::atomic::Ordering; @@ -20,6 +24,12 @@ pub struct SyncTask { path: String, /// What the dialog calls the folder (its row's detail). name: String, + disk: bool, + /// The dialog was closed with Continue in Background: the scan goes on without it. + background: bool, + /// What was ticked in the dialog when it was closed that way (a dialog that had scanned + /// before and was scanning again keeps its ticks): the dialog opens with them again. + choice: SyncChoice, progress: Arc, rx: std::sync::mpsc::Receiver, /// Its row in the activity stack; ✕ cancels the scan and closes the dialog. @@ -44,10 +54,20 @@ fn listing_text(folders: usize, files: usize) -> String { crate::i18n::tr_format!("Listing folders — folders: {folders}, files: {files}", folders = folders, files = files) } -/// Open the dialog for folder `path` (called `name` in it) and start scanning. +/// Open the dialog for folder `path` (called `name` in it) and start scanning. One folder at a +/// time: while another folder is scanned in the background, or what was found in it waits to +/// be looked at, this is refused (minutes of scanning are not thrown away unasked); the same +/// folder is scanned afresh. pub fn open(app: &mut LightcraftApp, path: &str, name: &str, disk: bool) -> Result<(), String> { - cancel(app); + if let Some(other) = app.sync.as_ref().filter(|t| t.background && t.path != path) { + return Err(crate::i18n::tr_format!("“{name}” is still being scanned: wait for it, or stop it with ✕ on its row", name = other.name)); + } + if let Some(other) = app.sync_ready.as_ref().filter(|r| r.path != path) { + return Err(crate::i18n::tr_format!("Look at the changes found in “{name}” first, or dismiss them", name = other.name)); + } + // (a folder that can't be synchronized leaves what there is alone) let input = SyncInput::new(&mut app.session, path, disk).map_err(|e| e.to_string())?; + cancel(app); let progress = Arc::new(SyncProgress::default()); let (tx, rx) = std::sync::mpsc::channel(); let p = progress.clone(); @@ -60,7 +80,16 @@ pub fn open(app: &mut LightcraftApp, path: &str, name: &str, disk: bool) -> Resu job(); let guard = app.session.activity.start("sync", "Looking for changes", Cancel::Flag(progress.files.cancel.clone())); guard.detail(name); - app.sync = Some(SyncTask { path: path.to_string(), name: name.to_string(), progress, rx, guard }); + app.sync = Some(SyncTask { + path: path.to_string(), + name: name.to_string(), + disk, + background: false, + choice: SyncChoice::default(), + progress, + rx, + guard, + }); let d = SyncChoice::default(); app.ui.dialog = Some(Dialog::SynchronizeFolder { path: path.to_string(), @@ -75,12 +104,72 @@ pub fn open(app: &mut LightcraftApp, path: &str, name: &str, disk: bool) -> Resu Ok(()) } +/// A scan that finished in the background, waiting to be looked at: the notice in the activity +/// stack. Its changes are `session.folder_changes`. +#[derive(Clone, Debug, PartialEq, Eq)] +pub struct SyncReady { + pub path: String, + /// What the dialog calls the folder. + pub name: String, + pub disk: bool, + pub counts: SyncCounts, + /// What was ticked when the dialog was closed. + pub choice: SyncChoice, +} + +impl SyncReady { + /// How many changes there are to look at. + pub fn changes(&self) -> usize { + let c = &self.counts; + c.new + c.moved + c.missing + c.metadata + } +} + +/// A click on the notice: open the dialog with what the background scan found. +pub fn review(app: &mut LightcraftApp) { + // (a dialog that is open is not taken away; the notice waits) + if app.ui.dialog.is_some() { + return; + } + let Some(ready) = app.sync_ready.take() else { return }; + let d = ready.choice; + app.ui.dialog = Some(Dialog::SynchronizeFolder { + path: ready.path, + name: ready.name, + disk: ready.disk, + counts: Some(ready.counts), + import_new: d.import_new, + relink_moved: d.relink_moved, + remove_missing: d.remove_missing, + read_metadata: d.read_metadata, + }); +} + +/// ✕ on the notice: what the scan found is let go of. +pub fn dismiss(app: &mut LightcraftApp) { + if app.sync_ready.is_some() { + cancel(app); + } +} + +/// Another library was opened: a scan of the one before, running or waiting to be looked at, +/// says nothing about this one. +pub(crate) fn library_changed(app: &mut LightcraftApp) { + if app.sync.is_some() || app.sync_ready.is_some() || app.sync_owns_changes { + cancel(app); + if matches!(app.ui.dialog, Some(Dialog::SynchronizeFolder { .. })) { + app.ui.dialog = None; + } + } +} + /// Stop a running scan and let go of a finished one the dialog made (one an agent made with /// `folder.scanChanges` is the agent's). fn cancel(app: &mut LightcraftApp) { if let Some(t) = app.sync.take() { t.progress.files.cancel.store(true, Ordering::Relaxed); } + app.sync_ready = None; if std::mem::take(&mut app.sync_owns_changes) { app.session.folder_changes = None; } @@ -93,21 +182,25 @@ pub fn poll(app: &mut LightcraftApp, ctx: &egui::Context) { Some(Dialog::SynchronizeFolder { path, .. }) => Some(path.clone()), _ => None, }; - let Some(open_for) = open_for else { - if app.sync.is_some() || app.sync_owns_changes { + let background = app.sync.as_ref().is_some_and(|t| t.background); + if open_for.is_none() && !background { + // (what a background scan found is kept for its notice) + if app.sync.is_some() || (app.sync_owns_changes && app.sync_ready.is_none()) { cancel(app); } return; - }; + } let Some(task) = app.sync.as_ref() else { return }; - if task.path != open_for { + if !background && open_for.as_deref() != Some(task.path.as_str()) { cancel(app); return; } if task.guard.is_cancelled() { // ✕ on its row: a scan stopped part-way has nothing to show cancel(app); - app.ui.dialog = None; + if !background { + app.ui.dialog = None; + } return; } let (done, total, detail) = scan_row(&task.progress, &task.name); @@ -119,12 +212,14 @@ pub fn poll(app: &mut LightcraftApp, ctx: &egui::Context) { Err(std::sync::mpsc::TryRecvError::Empty) => return, Err(_) => { app.sync = None; - app.ui.dialog = None; + if !background { + app.ui.dialog = None; + } app.toast(ctx, crate::i18n::tr("Scan failed")); return; } }; - app.sync = None; + let Some(task) = app.sync.take() else { return }; let c = SyncCounts { offline: changes.offline, new: changes.new.len(), @@ -134,13 +229,38 @@ pub fn poll(app: &mut LightcraftApp, ctx: &egui::Context) { metadata: changes.metadata.len(), moved: changes.moved.len(), }; + if background { + let ready = SyncReady { path: task.path.clone(), name: task.name.clone(), disk: task.disk, counts: c, choice: task.choice }; + if !ready.counts.offline && ready.changes() == 0 { + // nothing to look at: said and done + app.toast(ctx, format!("{}: {}", ready.name, crate::i18n::tr("The library is up to date with this folder."))); + return; + } + app.session.folder_changes = Some(changes); + app.sync_owns_changes = true; + app.sync_ready = Some(ready); + return; + } app.session.folder_changes = Some(changes); app.sync_owns_changes = true; if let Some(Dialog::SynchronizeFolder { counts, .. }) = &mut app.ui.dialog { *counts = Some(c); + // the button was Continue in Background until now: Synchronize waits a moment + app.sync_scanned_at = ctx.input(|i| i.time); + ctx.request_repaint_after(std::time::Duration::from_secs_f64(SETTLE_SECONDS)); } } +/// How long Synchronize stays unavailable after the scan ended (s). The dialog's one button +/// reads Continue in Background while the folder is scanned and Synchronize after: a click meant +/// for the first, landing as the scan ends, must not start the second. +pub const SETTLE_SECONDS: f64 = 0.6; + +/// Whether the dialog's Synchronize can be pressed yet ([`SETTLE_SECONDS`]). +pub fn settled(app: &LightcraftApp, ctx: &egui::Context) -> bool { + ctx.input(|i| i.time) - app.sync_scanned_at >= SETTLE_SECONDS +} + /// How far the scan is: the folders and files listed while it lists the folder, else the files /// and photos checked (done, of how many). enum ScanStage { @@ -176,6 +296,9 @@ pub fn body(app: &LightcraftApp, ui: &mut egui::Ui, dlg: &mut Dialog) { _ => ui.label(crate::i18n::tr("Scanning…")), } }); + ui.label( + egui::RichText::new(crate::i18n::tr("You can go on working: a notice at the top left says when the scan is done.")).color(t.text_dim), + ); return; }; if c.offline { @@ -222,6 +345,24 @@ pub fn body(app: &LightcraftApp, ui: &mut egui::Ui, dlg: &mut Dialog) { /// stale (the folder's photos changed meanwhile) is refused and made again, keeping the choices. /// A folder that is up to date has nothing to hand over: confirming it only closes the dialog. pub fn confirm(app: &mut LightcraftApp, dlg: &Dialog) -> Result { + if matches!(dlg, Dialog::SynchronizeFolder { counts: None, .. }) { + // Continue in Background: the scan goes on without the dialog, which the caller closes + return match &mut app.sync { + Some(task) => { + task.background = true; + if let Dialog::SynchronizeFolder { import_new, relink_moved, remove_missing, read_metadata, .. } = dlg { + task.choice = SyncChoice { + import_new: *import_new, + relink_moved: *relink_moved, + remove_missing: *remove_missing, + read_metadata: *read_metadata, + }; + } + Ok(json!({"background": true})) + } + None => Err("the folder is still being scanned".into()), + }; + } let Dialog::SynchronizeFolder { path, name, disk, counts: Some(counts), import_new, relink_moved, remove_missing, read_metadata, .. } = dlg else { return Err("the folder is still being scanned".into()); diff --git a/crates/ui-egui/src/tests/sync.rs b/crates/ui-egui/src/tests/sync.rs index 84cda586021..dc40523318d 100644 --- a/crates/ui-egui/src/tests/sync.rs +++ b/crates/ui-egui/src/tests/sync.rs @@ -261,19 +261,42 @@ fn a_scan_gone_stale_in_the_dialog_is_made_again_in_the_background() { let mut h = changed_folder(&dir); open_and_scan(&mut h, &dir.path("trip")); tick_remove_missing(&mut h); - // a photo of the folder changes while the dialog is open - let a = h.app.session.catalog.photos().find(|p| p.file_name == "a.png").unwrap().id; - let r = h.request("engine.execute", json!({"command": "photo.rate", "params": {"ids": [a.0], "rating": 3}}), T); + // the folder gets another photo some other way while the dialog is open + write_png(&dir.path("trip/d.png"), 4); + let r = h.request("engine.execute", json!({"command": "library.import", "params": {"paths": [dir.path("trip/d.png")]}}), T); assert_eq!(r["ok"], true, "{r}"); let r = h.request("ui.dialog.confirm", json!({}), T); assert_eq!(r["ok"], false, "not done on a stale scan: {r}"); - assert_eq!(in_library(&h), vec!["a.png", "b.png"]); + assert_eq!(in_library(&h), vec!["a.png", "b.png", "d.png"]); assert!(matches!(h.app.ui.dialog, Some(Dialog::SynchronizeFolder { .. })), "the dialog stays open"); let rescanned = h.step_until(T, |h| matches!(&h.app.ui.dialog, Some(Dialog::SynchronizeFolder { counts: Some(_), .. }))); assert!(rescanned, "and scans again"); assert!(matches!(h.app.ui.dialog, Some(Dialog::SynchronizeFolder { remove_missing: true, .. })), "keeping what was ticked"); synchronize(&mut h); - assert_eq!(in_library(&h), vec!["a.png", "c.png"], "c came in, the missing b went"); + assert_eq!(in_library(&h), vec!["a.png", "c.png", "d.png"], "c came in, the missing b went"); +} + +/// Tagging and rating the folder's photos while the dialog is open (the scan of a big folder +/// takes minutes, and the dialog says to go on working) does not send Synchronize back to +/// scanning: it does what the dialog shows. +#[test] +fn working_on_the_folders_photos_while_the_dialog_is_open_does_not_restart_the_scan() { + let dir = Scratch::new("worked-on"); + let mut h = changed_folder(&dir); + open_and_scan(&mut h, &dir.path("trip")); + let a = h.app.session.catalog.photos().find(|p| p.file_name == "a.png").unwrap().id; + for (command, params) in [ + ("library.select", json!({"ids": [a.0]})), + ("photo.rate", json!({"ids": [a.0], "rating": 3})), + ("photo.setMeta", json!({"ids": [a.0], "addKeywords": ["Places|Italy|Rome", "Transport|Ferry"]})), + ] { + let r = h.request("engine.execute", json!({"command": command, "params": params}), T); + assert_eq!(r["ok"], true, "{command}: {r}"); + } + synchronize(&mut h); + assert_eq!(in_library(&h), vec!["a.png", "b.png", "c.png"], "the new photo came in"); + assert!(h.app.sync.is_none(), "no second scan"); + assert_eq!(h.app.session.catalog.photo(a).unwrap().meta.keywords.len(), 2, "and the keywords stay"); } #[test] @@ -423,3 +446,344 @@ fn while_the_folder_is_listed_its_row_says_what_was_listed_and_its_bar_moves_on_ p.checked.store(10, Relaxed); assert_eq!(crate::sync::scan_row(&p, "photos/Various"), (10, 64085, "photos/Various".to_string())); } + +// ---- the scan need not be waited for ---- +// +// * While the folder is scanned, the dialog's button is Continue in Background: the dialog +// closes, the scan goes on under its row, and the app is free for other things. +// * When the scan is done nothing pops up: a notice in the activity stack says what was found. +// A click on it opens the dialog with that result; ✕ lets go of it. +// * A scan that found nothing to do only says so. +// * ✕ on the scan's row stops a background scan too, and no notice follows. + +/// A gate for the scan of `h`: it can't finish until the returned flag is set (reading the new +/// file waits on it). +fn gated(h: &mut Headless) -> std::sync::Arc { + let gate = std::sync::Arc::new(std::sync::atomic::AtomicBool::new(false)); + let g = gate.clone(); + h.app.session.media.file_probe = Some(std::sync::Arc::new(move |_: &str| { + while !g.load(std::sync::atomic::Ordering::Relaxed) { + std::thread::sleep(Duration::from_millis(5)); + } + Ok(lightcraft_engine::media::ProbeInfo { format: "PNG".into(), ..Default::default() }) + })); + gate +} + +/// Open the dialog on `trip` and press Continue in Background while the scan is held. +fn scan_in_background(h: &mut Headless, dir: &Scratch) { + crate::sync::open(&mut h.app, &dir.path("trip"), "trip", false).unwrap(); + let hidden = |h: &Headless| h.app.ui.dialog.is_none(); + for _ in 0..5 { + h.step(); + let r = h.request("ui.clickWidget", json!({"id": "button:dialogOk"}), T); + assert_eq!(r["ok"], true, "{r}"); + if h.step_until(Duration::from_secs(3), hidden) { + break; + } + } + assert!(h.app.ui.dialog.is_none(), "the dialog closes: {:?}", h.app.ui.dialog); + assert!(h.app.sync.is_some(), "and the scan goes on"); +} + +fn has_widget(h: &Headless, id: &str) -> bool { + h.app.widgets.iter().any(|(w, _)| w == id) +} + +fn click_widget(h: &mut Headless, id: &str, landed: impl Fn(&Headless) -> bool) { + for _ in 0..5 { + h.step(); + let r = h.request("ui.clickWidget", json!({"id": id}), T); + assert_eq!(r["ok"], true, "{id}: {r}"); + if h.step_until(Duration::from_secs(3), &landed) { + return; + } + } + panic!("the click on {id} never landed: {:?}", h.app.ui.dialog); +} + +#[test] +fn a_scan_continued_in_the_background_ends_in_a_notice_that_opens_its_result() { + let dir = Scratch::new("background"); + let mut h = changed_folder(&dir); + let gate = gated(&mut h); + scan_in_background(&mut h, &dir); + let rows = h.app.session.activity.list(); + assert_eq!((rows.len(), rows[0].label.as_str()), (1, "Looking for changes"), "its row stays: {rows:?}"); + + // meanwhile the app is free: a photo is rated, frames go by + let id = h.app.session.catalog.photos().find(|p| p.file_name == "a.png").map(|p| p.id.0).unwrap(); + assert!(h.app.run("library.select", json!({"ids": [id]})).is_ok()); + assert!(h.app.run("photo.rate", json!({"rating": 3})).is_ok()); + for _ in 0..5 { + h.step(); + } + assert!(h.app.sync.is_some() && h.app.sync_ready.is_none(), "still scanning"); + + gate.store(true, std::sync::atomic::Ordering::Relaxed); + assert!(h.step_until(T, |h| h.app.sync.is_none()), "the scan ends"); + h.step(); + h.step(); + assert!(h.app.ui.dialog.is_none(), "nothing pops up: {:?}", h.app.ui.dialog); + let ready = h.app.sync_ready.clone().expect("a notice waits"); + assert_eq!((ready.counts.new, ready.counts.missing, ready.changes()), (1, 1, 2), "{ready:?}"); + assert!(has_widget(&h, "activity:scanReady"), "shown in the activity stack"); + assert!(h.app.session.activity.list().is_empty(), "the scan's own row is gone"); + // it stays until it is looked at + for _ in 0..20 { + h.step(); + } + assert!(h.app.sync_ready.is_some() && h.app.session.folder_changes.is_some()); + + click_widget(&mut h, "activity:scanReady:review", |h| matches!(&h.app.ui.dialog, Some(Dialog::SynchronizeFolder { counts: Some(_), .. }))); + let c = counts(&h); + assert_eq!((c.new, c.missing), (1, 1), "the dialog shows what the scan found: {c:?}"); + assert!(h.app.sync_ready.is_none() && h.app.sync.is_none(), "without scanning again"); + // (with the rating undone the folder's photos are as scanned: the scan is still current) + h.app.session.undo_step().unwrap(); + synchronize(&mut h); + assert_eq!(in_library(&h), vec!["a.png", "b.png", "c.png"]); +} + +#[test] +fn clicking_the_notice_title_opens_the_result_too() { + let dir = Scratch::new("title"); + let mut h = changed_folder(&dir); + let gate = gated(&mut h); + scan_in_background(&mut h, &dir); + gate.store(true, std::sync::atomic::Ordering::Relaxed); + assert!(h.step_until(T, |h| h.app.sync_ready.is_some()), "a notice waits"); + h.step(); + // the title ends before the ✕, so the two don't overlap + let title = crate::control::widget_rect(&h.app, "activity:scanReady:title"); + let cross = crate::control::widget_rect(&h.app, "activity:scanReady:dismiss"); + assert!(title.zip(cross).is_some_and(|(t, c)| !t.intersects(c)), "title {title:?}, ✕ {cross:?}"); + + click_widget(&mut h, "activity:scanReady:title", |h| matches!(&h.app.ui.dialog, Some(Dialog::SynchronizeFolder { counts: Some(_), .. }))); + assert!(h.app.sync_ready.is_none(), "the notice is let go of once its result is open"); +} + +#[test] +fn dismissing_the_notice_lets_go_of_what_the_scan_found() { + let dir = Scratch::new("dismiss"); + let mut h = changed_folder(&dir); + let gate = gated(&mut h); + scan_in_background(&mut h, &dir); + gate.store(true, std::sync::atomic::Ordering::Relaxed); + assert!(h.step_until(T, |h| h.app.sync_ready.is_some()), "a notice waits"); + + click_widget(&mut h, "activity:scanReady:dismiss", |h| h.app.sync_ready.is_none()); + + assert!(h.app.session.folder_changes.is_none(), "the scan is let go of"); + assert!(h.app.ui.dialog.is_none()); + h.step(); + assert!(!has_widget(&h, "activity:scanReady")); + assert_eq!(in_library(&h), vec!["a.png", "b.png"], "nothing was changed"); +} + +#[test] +fn a_background_scan_that_found_nothing_only_says_so() { + let dir = Scratch::new("background-none"); + let mut h = changed_folder(&dir); + // bring the library up to date first + open_and_scan(&mut h, &dir.path("trip")); + tick_remove_missing(&mut h); + synchronize(&mut h); + h.settle(SETTLE); + + crate::sync::open(&mut h.app, &dir.path("trip"), "trip", false).unwrap(); + let dlg = h.app.ui.dialog.take().expect("the dialog is open"); + // (pressed before the scan can have ended: no frame has run since it started) + let r = crate::panels::dialogs::confirm_dialog(&mut h.app, &dlg); + assert!(r.is_ok(), "{r:?}"); + assert!(h.step_until(T, |h| h.app.sync.is_none()), "the scan ends"); + assert!(h.app.sync_ready.is_none(), "no notice: there is nothing to look at"); + let toast = h.app.ui.toast.as_ref().map(|t| t.0.clone()).unwrap_or_default(); + assert!(toast.contains("up to date"), "{toast:?}"); + assert!(h.app.session.folder_changes.is_none()); +} + +#[test] +fn the_cross_on_its_row_stops_a_background_scan_without_a_notice() { + let dir = Scratch::new("background-stop"); + let mut h = changed_folder(&dir); + let gate = gated(&mut h); + scan_in_background(&mut h, &dir); + // another dialog is open meanwhile: it is not closed by the scan ending + h.app.ui.dialog = Some(Dialog::About); + let rows = h.app.session.activity.list(); + h.app.session.activity.cancel(rows[0].id).unwrap(); + h.step(); + assert!(h.app.sync.is_none(), "✕ stops the scan"); + assert!(matches!(h.app.ui.dialog, Some(Dialog::About)), "{:?}", h.app.ui.dialog); + gate.store(true, std::sync::atomic::Ordering::Relaxed); + h.app.ui.dialog = None; + h.settle(SETTLE); + assert!(h.app.sync_ready.is_none() && h.app.ui.dialog.is_none(), "a stopped scan says nothing later"); +} + +#[test] +fn opening_the_dialog_again_replaces_a_waiting_notice() { + let dir = Scratch::new("background-again"); + let mut h = changed_folder(&dir); + let gate = gated(&mut h); + scan_in_background(&mut h, &dir); + gate.store(true, std::sync::atomic::Ordering::Relaxed); + assert!(h.step_until(T, |h| h.app.sync_ready.is_some())); + // Synchronize Folder… from the menu once more: a fresh scan, not two answers + open_and_scan(&mut h, &dir.path("trip")); + assert!(h.app.sync_ready.is_none(), "the old notice is gone"); + let c = counts(&h); + assert_eq!((c.new, c.missing), (1, 1), "{c:?}"); +} + +#[test] +fn a_result_looked_at_after_the_folder_changed_is_scanned_again_not_acted_on() { + let dir = Scratch::new("background-stale"); + let mut h = changed_folder(&dir); + let gate = gated(&mut h); + scan_in_background(&mut h, &dir); + gate.store(true, std::sync::atomic::Ordering::Relaxed); + assert!(h.step_until(T, |h| h.app.sync_ready.is_some())); + // one of the folder's photos left the library before the person looked + let id = h.app.session.catalog.photos().find(|p| p.file_name == "a.png").map(|p| p.id.0).unwrap(); + h.app.run("library.select", json!({"ids": [id]})).unwrap(); + h.app.run("photo.delete", json!({})).unwrap(); + crate::sync::review(&mut h.app); + let dlg = h.app.ui.dialog.take().expect("the dialog is open"); + let before = in_library(&h); + let r = crate::panels::dialogs::confirm_dialog(&mut h.app, &dlg); + assert!(r.is_err() && h.app.sync_run.is_none(), "what was shown is no longer so: {r:?}"); + assert_eq!(in_library(&h), before); + assert!(h.app.sync.is_some(), "it is scanned again"); +} + +/// The person went on working in the folder while it was scanned in the background (ratings, +/// keywords, a colour label, albums): what the scan found still holds, and Synchronize does it. +#[test] +fn a_result_looked_at_after_work_on_the_folders_photos_is_acted_on() { + let dir = Scratch::new("background-worked-on"); + let mut h = changed_folder(&dir); + let gate = gated(&mut h); + scan_in_background(&mut h, &dir); + gate.store(true, std::sync::atomic::Ordering::Relaxed); + assert!(h.step_until(T, |h| h.app.sync_ready.is_some())); + let id = h.app.session.catalog.photos().find(|p| p.file_name == "a.png").map(|p| p.id.0).unwrap(); + h.app.run("library.select", json!({"ids": [id]})).unwrap(); + h.app.run("photo.rate", json!({"rating": 3})).unwrap(); + h.app.run("photo.label", json!({"label": "red"})).unwrap(); + h.app.run("photo.pick", json!({})).unwrap(); + h.app.run("photo.setMeta", json!({"addKeywords": ["Places|Italy|Rome", "Transport|Ferry"], "title": "A"})).unwrap(); + for name in ["One", "Two"] { + let album = h.app.run("album.create", json!({"name": name})).unwrap()["id"].as_u64().unwrap(); + h.app.run("album.addPhotos", json!({"id": album})).unwrap(); + } + crate::sync::review(&mut h.app); + synchronize(&mut h); + assert_eq!(in_library(&h), vec!["a.png", "b.png", "c.png"], "the new photo came in"); + assert!(h.app.sync.is_none(), "and nothing was scanned again"); +} + +#[test] +fn another_folder_is_not_scanned_over_a_background_scan_or_its_notice() { + let dir = Scratch::new("background-other"); + write_png(&dir.path("other/x.png"), 9); + let mut h = changed_folder(&dir); + h.app.session.execute("library.import", &json!({"paths": [dir.path("other")]})).unwrap(); + let gate = gated(&mut h); + scan_in_background(&mut h, &dir); + + let e = crate::sync::open(&mut h.app, &dir.path("other"), "other", false).unwrap_err(); + assert!(e.contains("still being scanned") && e.contains("trip"), "{e}"); + assert!(h.app.sync.is_some() && h.app.ui.dialog.is_none(), "the scan goes on"); + + gate.store(true, std::sync::atomic::Ordering::Relaxed); + assert!(h.step_until(T, |h| h.app.sync_ready.is_some())); + let e = crate::sync::open(&mut h.app, &dir.path("other"), "other", false).unwrap_err(); + assert!(e.contains("changes found in") && e.contains("trip"), "{e}"); + // and a folder that can't be synchronized at all takes nothing away either + assert!(crate::sync::open(&mut h.app, &dir.path("nowhere"), "nowhere", false).is_err()); + assert!(h.app.sync_ready.is_some() && h.app.session.folder_changes.is_some(), "the notice still waits"); + + // once it is dismissed the other folder can be scanned + crate::sync::dismiss(&mut h.app); + assert!(crate::sync::open(&mut h.app, &dir.path("other"), "other", false).is_ok()); +} + +#[test] +fn what_was_ticked_comes_back_with_the_result() { + let dir = Scratch::new("background-ticks"); + let mut h = changed_folder(&dir); + let gate = gated(&mut h); + crate::sync::open(&mut h.app, &dir.path("trip"), "trip", false).unwrap(); + // a dialog that had scanned before and scans again still has its ticks + let mut dlg = h.app.ui.dialog.take().expect("the dialog is open"); + if let Dialog::SynchronizeFolder { import_new, remove_missing, .. } = &mut dlg { + (*import_new, *remove_missing) = (false, true); + } + assert!(crate::panels::dialogs::confirm_dialog(&mut h.app, &dlg).is_ok()); + gate.store(true, std::sync::atomic::Ordering::Relaxed); + assert!(h.step_until(T, |h| h.app.sync_ready.is_some())); + // another dialog is open: the notice waits rather than take it away + h.app.ui.dialog = Some(Dialog::About); + crate::sync::review(&mut h.app); + assert!(matches!(h.app.ui.dialog, Some(Dialog::About)) && h.app.sync_ready.is_some()); + h.app.ui.dialog = None; + crate::sync::review(&mut h.app); + assert!( + matches!(h.app.ui.dialog, Some(Dialog::SynchronizeFolder { import_new: false, remove_missing: true, counts: Some(_), .. })), + "{:?}", + h.app.ui.dialog + ); + // closing the dialog lets go of the scan, as for one that was never in the background + h.app.ui.dialog = None; + h.step(); + assert!(h.app.session.folder_changes.is_none()); +} + +#[test] +fn a_folder_that_isnt_there_is_a_notice_too_and_another_library_gets_none() { + let dir = Scratch::new("background-offline"); + let mut h = changed_folder(&dir); + std::fs::rename(dir.0.join("trip"), dir.0.join("trip-elsewhere")).unwrap(); + crate::sync::open(&mut h.app, &dir.path("trip"), "trip", false).unwrap(); + let dlg = h.app.ui.dialog.take().expect("the dialog is open"); + assert!(crate::panels::dialogs::confirm_dialog(&mut h.app, &dlg).is_ok()); + assert!(h.step_until(T, |h| h.app.sync_ready.is_some()), "a notice waits"); + assert!(h.app.sync_ready.as_ref().is_some_and(|r| r.counts.offline)); + + // File ▸ Open Library: the notice was about the library before + crate::sync::library_changed(&mut h.app); + assert!(h.app.sync_ready.is_none() && h.app.session.folder_changes.is_none()); +} + +#[test] +fn synchronize_waits_a_moment_after_its_button_stopped_being_continue_in_background() { + let dir = Scratch::new("settle"); + let mut h = changed_folder(&dir); + open_and_scan(&mut h, &dir.path("trip")); + // a click meant for Continue in Background, landing as the scan ends + let before = in_library(&h); + let r = h.request("ui.clickWidget", json!({"id": "button:dialogOk"}), T); + assert_eq!(r["ok"], true, "{r}"); + h.step(); + assert!(h.app.sync_run.is_none() && matches!(h.app.ui.dialog, Some(Dialog::SynchronizeFolder { .. })), "nothing was started"); + assert_eq!(in_library(&h), before); + assert!(!crate::sync::settled(&h.app, &h.view.ctx)); +} + +#[test] +fn a_dialog_opened_before_the_first_frame_is_not_taken_for_another_librarys() { + let dir = Scratch::new("first-frame"); + write_png(&dir.path("trip/a.png"), 1); + let mut session = lightcraft_engine::Session::new().with_fs(); + session.execute("library.import", &json!({"paths": [dir.path("trip")]})).unwrap(); + write_png(&dir.path("trip/c.png"), 3); + let app = LightcraftApp::new(session, Services { png: None, ..Default::default() }); + let mut h = Headless::new(app, [1400.0, 900.0], 1.0); + // no frame has run yet: the library is shown for the first time on the next one + crate::sync::open(&mut h.app, &dir.path("trip"), "trip", false).unwrap(); + let scanned = h.step_until(T, |h| matches!(&h.app.ui.dialog, Some(Dialog::SynchronizeFolder { counts: Some(_), .. }))); + assert!(scanned, "the scan is its own library's: {:?}", h.app.ui.dialog); + assert_eq!(counts(&h).new, 1); +} diff --git a/docs/parity-checklist.md b/docs/parity-checklist.md index 90cfc248f60..b17feb639f6 100644 --- a/docs/parity-checklist.md +++ b/docs/parity-checklist.md @@ -1,6 +1,6 @@ # Lightroom parity checklist -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-25 · **Change:** minor (LR-BEHAV-TITLEBAR: a double-click follows the system setting, and a panel over the bar keeps the window still; KEYC-METADATA, LRC-LIB-KEYWORDS: ⌥0 / ⌥⇧0 go to the next / previous keyword set; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; KEYC-METADATA: ⌘K / Ctrl+K Add Keywords; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings) · **Target:** Adobe Lightroom Classic 15.5 / Lightroom 9.6 +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-25 · **Change:** minor (LRC-LIB-LIBFOLDERS: Synchronize Folder's scan can continue in the background; LR-BEHAV-TITLEBAR: a double-click follows the system setting, and a panel over the bar keeps the window still; KEYC-METADATA, LRC-LIB-KEYWORDS: ⌥0 / ⌥⇧0 go to the next / previous keyword set; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; KEYC-METADATA: ⌘K / Ctrl+K Add Keywords; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings) · **Target:** Adobe Lightroom Classic 15.5 / Lightroom 9.6 The measured, row-by-row checklist: one row per Lightroom feature, menu item and shortcut, what we have and what is missing. It answers *does the feature exist?* (feature breadth). Whether it is good @@ -703,7 +703,7 @@ From `08-lightroom-classic-extras.md` (Classic-only features) and part 2 of `06- | LRC-LIB-CATALOG-LOCK | Catalog open in one program at a time | P1 | ✅ | `cmd:app.openLibrary`, `crates/catalog/src/lock.rs`, `crates/engine/src/library.rs` (`open_library`) | exclusive OS lock on `catalog.lock` for the session (app and `lightcraft-cli --library`); a second opener is refused with who has it (`catalog.lock.owner`: program, process, computer); released by the OS on a crash, so never stale; file systems without locks open unprotected with a warning (the app's notices, `library.info` → `settingsWarnings`, and the CLI's stderr; issue #171); no read-only mode; the browser build (OPFS) has no guard across tabs yet. A library that can't be opened at launch (locked, unreadable, newer format, drive missing) shows a window — Try Again, Choose Another Library…, Continue Without Saving (then a banner; nothing written), Quit — instead of a silent demo session (`crates/ui-egui/src/panels/library_problem.rs`); the lock is released explicitly when the library closes, not by letting its file handle close, so a program another thread is starting at that moment (which holds a copy of every file handle until it is launched) cannot keep the library "already open" for a moment (issue #680) | | LRC-LIB-CATALOG-SWITCH | New / Open Recent catalog, catalog name shown | P1 | ✅ | `cmd:app.newLibrary`, `cmd:app.openLibrary`, `cmd:app.recentLibraries`, `cmd:app.clearRecentLibraries`, `crates/ui-egui/src/dialogs/settings.rs`, `crates/ui-egui/src/panels/left.rs`, `crates/ui-egui/src/panels/library_problem.rs` (`launch_plan`, `show_chooser`), `crates/ui-egui/src/tests/launch_library.rs` | File ▸ New Library… (name, then location), File ▸ Open Recent Library (last 8; missing ones greyed out, dropped when opened; Remove from List ▸ one entry, or `app.recentLibraries {remove}`, which forgets only the path; Clear), the open library's name under My Photos and in the window title (issue #902); Open/New refused during imports and their folder scans; a library that can't be opened leaves the current one and its reference pin intact; a successful switch clears the catalog-local reference pin; ⌘O (Ctrl+O on Windows and Linux) runs Open Library… and asks for a folder once (`crates/ui-egui/src/tests/keymap.rs`: `cmd_o_opens_the_library_picker_once`); a dialog or a text field with the focus keeps the key; Settings ▸ General ▸ At launch: Open the last library (default) or Ask me, a window listing the recent libraries (name, folder, when last opened; missing, unreadable or no-longer-library ones greyed out with the reason, checked read-only — nothing is locked or written, so a library another program has open is reported, with who has it, when Open is pressed; the last one selected; Open, Open Another…, New Library…, Remove from List, Quit; ↑ ↓ Return Esc), also shown once when Alt/Option is held in the first 2 s after the window appears (macOS reports an Option key held since before launch only once it changes); `--library` and `LIGHTCRAFT_LIBRARY` come first and `lightcraft-cli` never asks (issue #1290) | | LRC-LIB-FOLDERS | Disk folder tree | P1 | ✅ | `cmd:library.browse`, `cmd:folder.rename`, `cmd:folder.move`, `crates/ui-egui/src/panels/left.rs` (`local_section`, `folder_tree`) | standard places + the browsed folder + Browse Folder…, each an expandable tree of subfolders, breadcrumb navigation; context menu: Rename Folder…, Move Folder To…, Show in Finder (on disk, photos relinked; one undo step each: undo / redo move the folder back and forth, refused when the destination is taken) | -| LRC-LIB-LIBFOLDERS | Library folders | P1 | ✅ | `cmd:library.folders`, `cmd:library.source` (`libraryFolder`), `cmd:library.filter` (`libraryFolder`), `cmd:library.removeFolder`, `cmd:folder.rename`, `cmd:folder.move`, `cmd:folder.label`, `cmd:folder.create`, `cmd:photo.moveToFolder`, `cmd:folder.scanChanges`, `cmd:folder.synchronize`, `crates/catalog/src/folders.rs`, `crates/engine/src/sync.rs`, `crates/ui-egui/src/sync.rs`, `crates/ui-egui/src/panels/left.rs` (`folders_section`, `folder_menu_for_library`, `row_menu`), `crates/ui-egui/src/tests/panels.rs` | sidebar Folders: the folders the library's photos were imported from, with photo counts (subfolders included), as another way to explore the library next to By Date and Keywords; Local stays the way to browse any folder on disk. Each disk is a row of its own and starts open: a drive letter, a Windows share (`\\server\share`, `\\?\UNC\…`, `\\wsl$\…`), a macOS share or disk (`/Volumes/tokyo`), a Linux mount (`/media`, `/run/media`, `/mnt`, gvfs `smb-share:…`, `/net/`), NFS (`/Network/Servers/`), else “This Computer” — told apart from the stored paths alone, so an offline share lists like a mounted one and the sidebar never waits on a network. Only folders that hold imported photos are listed (browsed, deleted and demo photos don't count); every folder is a row of its own (`Users` → `me` → `Pictures`), and a folder that holds nothing itself and leads to one folder starts open; every level indents one step more than its parent however deep it goes (16 pt while the deepest open row of any sidebar tree fits the panel with room for its name and count; narrower in bands of 14, 12, 10 and 8 pt when it would not, the same for every tree, chosen from the last frame; issue #2298): past 8 pt the whole sidebar (Albums, Local, By Date, Folders, Keywords) scrolls sideways when its widest row is wider than the panel (rows are measured one frame behind; Create Album and the counts stay at the visible edge); a name that does not fit ends in an ellipsis at the count (the full name on hover; a row asks for room for at most 140 pt of its name, so depth, not one long name, makes the sidebar scroll), as does the grid title; selection and hover bars end at the panel's edge; click makes the folder the source, like an album or a Local folder (its photos and those of the folders inside it fill the grid, titled “photos/travel”; the filter bar narrows it further; `library.source` `libraryFolder` + `path`; kept with the library's view), and its row is always opened into view; the shown folder follows a rename or move and their undo (engine-tested; the sidebar test covers rename), is dropped back to All Photos when it is removed or no longer holds a photo, and a smart album made from the view keeps it, also when its rules are edited (the editor has no folder field). Only a folder that shows exactly its own photos can be shown (not the startup disk, not `/Volumes`-like folders above disks, not an empty one). A row that would cover other disks' photos too (the startup disk, `/Volumes`, `/mnt`…) only opens. Right-click (row or triangle): Rename Folder…, Move Folder To…, New Folder on Disk… (`folder.create`; one undo step, undo removes it while empty), Move Selected Photos Here (`photo.moveToFolder`, also *Move to Folder…* in the photo context menu, and photos dragged from the grid onto a Folders row: the row lights up, the dragged label says “Move 3 photos to “Trip””, a closed folder held under the pointer opens, a row covering several disks and Local photos are refused with the reason, photos already there say so; a drop asks first (“Move 2 photos to “Porto”?”, Don't ask again, Settings → Confirm before moving photos to another folder on disk), and photos that leave the view leave the selection; files and XMP sidecars move, virtual copies follow, across volumes copied (streamed) and verified before the source goes, a name taken in the destination refuses the whole move, one undo step; an undo with the share offline or read-only is refused with the reason and kept until it can run, nothing deleted), Show in Finder (on disk, photos relinked, as in Local), Set Color Label ▸ (the five colours with their custom names, None, Edit Label Names…; `folder.label`, one undo step; the row shows the label's dot before its count and says it with its name; kept in the catalog as a folder record under the folder's identity, so it follows Rename / Move and their undo and redo, the folders inside going along), Synchronize Folder… (the dialog opens at once and scans the folder and the folders inside it on a worker thread — the look for new files beside parallel checks of the library's photos — then offers Import new photos (checked; files only browsed in Local count as new), Relink photos whose file was renamed or moved within the folder (checked; matched by content — a Duplicate's too — or, for a photo with no hash on record such as one from a Lightroom catalog, by file size and dimensions when exactly one file agrees), Remove missing photos from the library (to Recently Deleted) and Read metadata updates from XMP sidecars (saved after the photo came in or was last edited here, and saying something the library doesn't; the sidecar wins), with counts and skipped duplicates / unreadable files; a folder with none of these changes only says the library is up to date with it, with one Close and no choices, and closing it starts no job; `folder.scanChanges` / `folder.synchronize`, which acts on exactly the scan shown — a scan whose folder's photos changed meanwhile is refused and made again in the background — and is one undo step, also with a full history; a folder that isn't there (an unplugged disk) is reported as such, not as every photo missing; a whole disk or a folder holding disks needs `disk: true`; Esc stops the scan; Synchronize hands everything to a worker thread — the import, the checks that moved and missing files are still as found, the sidecar reads — and commits its steps between frames, shown in the activity stack with ✕ to stop, so no file is touched on the UI thread) and Remove from Library… (asks; moves the folder's photos to Recently Deleted, one undo step, no file touched); a disk row (not the startup disk) offers Set Color Label ▸, Synchronize Folder… and Remove Disk from Library… (the command needs `disk: true` for a whole disk or a folder spanning several). Limits: names are compared as written (macOS `/Volumes/tokyo` vs `/Volumes/TOKYO` are two disks; `/Volumes/Macintosh HD/…` and `/…` two rows); no disk capacity / online status; no “include subfolders” switch (a folder always includes the ones inside it); photos can't yet be dragged onto a folder row (use the menus); a name clash on moving photos is refused rather than renamed -1, -2; folders can't be filtered or sorted by label, and a label stays with the old path when the folder is moved outside LightCraft (Find Missing relinks photos, not folder records); Synchronize has no “show import dialog first” or “show missing photos” option, and only knows when a photo came in or was last developed here: a rating, label or metadata change made here (auto-write off) after another app saved the sidecar is listed as an update, and reading it restores the sidecar's older value (reading is never the default); the walk for new files stops when the scan is cancelled, and its depth/entry limits are only logged | +| LRC-LIB-LIBFOLDERS | Library folders | P1 | ✅ | `cmd:library.folders`, `cmd:library.source` (`libraryFolder`), `cmd:library.filter` (`libraryFolder`), `cmd:library.removeFolder`, `cmd:folder.rename`, `cmd:folder.move`, `cmd:folder.label`, `cmd:folder.create`, `cmd:photo.moveToFolder`, `cmd:folder.scanChanges`, `cmd:folder.synchronize`, `crates/catalog/src/folders.rs`, `crates/engine/src/sync.rs`, `crates/ui-egui/src/sync.rs`, `crates/ui-egui/src/panels/left.rs` (`folders_section`, `folder_menu_for_library`, `row_menu`), `crates/ui-egui/src/tests/panels.rs` | sidebar Folders: the folders the library's photos were imported from, with photo counts (subfolders included), as another way to explore the library next to By Date and Keywords; Local stays the way to browse any folder on disk. Each disk is a row of its own and starts open: a drive letter, a Windows share (`\\server\share`, `\\?\UNC\…`, `\\wsl$\…`), a macOS share or disk (`/Volumes/tokyo`), a Linux mount (`/media`, `/run/media`, `/mnt`, gvfs `smb-share:…`, `/net/`), NFS (`/Network/Servers/`), else “This Computer” — told apart from the stored paths alone, so an offline share lists like a mounted one and the sidebar never waits on a network. Only folders that hold imported photos are listed (browsed, deleted and demo photos don't count); every folder is a row of its own (`Users` → `me` → `Pictures`), and a folder that holds nothing itself and leads to one folder starts open; every level indents one step more than its parent however deep it goes (16 pt while the deepest open row of any sidebar tree fits the panel with room for its name and count; narrower in bands of 14, 12, 10 and 8 pt when it would not, the same for every tree, chosen from the last frame; issue #2298): past 8 pt the whole sidebar (Albums, Local, By Date, Folders, Keywords) scrolls sideways when its widest row is wider than the panel (rows are measured one frame behind; Create Album and the counts stay at the visible edge); a name that does not fit ends in an ellipsis at the count (the full name on hover; a row asks for room for at most 140 pt of its name, so depth, not one long name, makes the sidebar scroll), as does the grid title; selection and hover bars end at the panel's edge; click makes the folder the source, like an album or a Local folder (its photos and those of the folders inside it fill the grid, titled “photos/travel”; the filter bar narrows it further; `library.source` `libraryFolder` + `path`; kept with the library's view), and its row is always opened into view; the shown folder follows a rename or move and their undo (engine-tested; the sidebar test covers rename), is dropped back to All Photos when it is removed or no longer holds a photo, and a smart album made from the view keeps it, also when its rules are edited (the editor has no folder field). Only a folder that shows exactly its own photos can be shown (not the startup disk, not `/Volumes`-like folders above disks, not an empty one). A row that would cover other disks' photos too (the startup disk, `/Volumes`, `/mnt`…) only opens. Right-click (row or triangle): Rename Folder…, Move Folder To…, New Folder on Disk… (`folder.create`; one undo step, undo removes it while empty), Move Selected Photos Here (`photo.moveToFolder`, also *Move to Folder…* in the photo context menu, and photos dragged from the grid onto a Folders row: the row lights up, the dragged label says “Move 3 photos to “Trip””, a closed folder held under the pointer opens, a row covering several disks and Local photos are refused with the reason, photos already there say so; a drop asks first (“Move 2 photos to “Porto”?”, Don't ask again, Settings → Confirm before moving photos to another folder on disk), and photos that leave the view leave the selection; files and XMP sidecars move, virtual copies follow, across volumes copied (streamed) and verified before the source goes, a name taken in the destination refuses the whole move, one undo step; an undo with the share offline or read-only is refused with the reason and kept until it can run, nothing deleted), Show in Finder (on disk, photos relinked, as in Local), Set Color Label ▸ (the five colours with their custom names, None, Edit Label Names…; `folder.label`, one undo step; the row shows the label's dot before its count and says it with its name; kept in the catalog as a folder record under the folder's identity, so it follows Rename / Move and their undo and redo, the folders inside going along), Synchronize Folder… (the dialog opens at once and scans the folder and the folders inside it on a worker thread — the look for new files beside parallel checks of the library's photos — then offers Import new photos (checked; files only browsed in Local count as new), Relink photos whose file was renamed or moved within the folder (checked; matched by content — a Duplicate's too — or, for a photo with no hash on record such as one from a Lightroom catalog, by file size and dimensions when exactly one file agrees), Remove missing photos from the library (to Recently Deleted) and Read metadata updates from XMP sidecars (saved after the photo came in or was last edited here, and saying something the library doesn't; the sidecar wins), with counts and skipped duplicates / unreadable files; a folder with none of these changes only says the library is up to date with it, with one Close and no choices, and closing it starts no job; `folder.scanChanges` / `folder.synchronize`, which acts on exactly the scan shown — a scan whose folder's photos changed meanwhile is refused and made again in the background — and is one undo step, also with a full history; a folder that isn't there (an unplugged disk) is reported as such, not as every photo missing; a whole disk or a folder holding disks needs `disk: true`; Esc stops the scan; Continue in Background closes the dialog while the scan goes on under its activity row, and its end is a notice in the activity stack (changes found, or folder not found) that opens the dialog with the result on a click and is let go of with ✕ — nothing pops up, a scan with nothing to do only says so in a toast, one folder at a time (another folder's Synchronize is refused while a background scan runs or its notice waits), another library opened lets go of it, and Synchronize is unavailable for 0.6 s after the scan ends so a click meant for Continue in Background can't start it; Synchronize hands everything to a worker thread — the import, the checks that moved and missing files are still as found, the sidecar reads — and commits its steps between frames, shown in the activity stack with ✕ to stop, so no file is touched on the UI thread) and Remove from Library… (asks; moves the folder's photos to Recently Deleted, one undo step, no file touched); a disk row (not the startup disk) offers Set Color Label ▸, Synchronize Folder… and Remove Disk from Library… (the command needs `disk: true` for a whole disk or a folder spanning several). Limits: names are compared as written (macOS `/Volumes/tokyo` vs `/Volumes/TOKYO` are two disks; `/Volumes/Macintosh HD/…` and `/…` two rows); no disk capacity / online status; no “include subfolders” switch (a folder always includes the ones inside it); photos can't yet be dragged onto a folder row (use the menus); a name clash on moving photos is refused rather than renamed -1, -2; folders can't be filtered or sorted by label, and a label stays with the old path when the folder is moved outside LightCraft (Find Missing relinks photos, not folder records); Synchronize has no “show import dialog first” or “show missing photos” option, and only knows when a photo came in or was last developed here: a rating, label or metadata change made here (auto-write off) after another app saved the sidecar is listed as an update, and reading it restores the sidecar's older value (reading is never the default); the walk for new files stops when the scan is cancelled, and its depth/entry limits are only logged | | LRC-LIB-COLLECTIONS | Collections & sets | P1 | ✅ | `cmd:album.create`, `cmd:album.createSmart`, `cmd:album.toggleTarget`, `cmd:album.setTarget`, `cmd:album.clearQuick` | albums + folders (sets), smart albums (rule editor; rules incl. File Path — the whole string, either separator, case-insensitive), Quick Collection and target album (B in the grids adds / removes the selection; album menu ▸ Set as Target Album; the target is marked +) | | LRC-LIB-SMARTCOLL | Smart-collection rules | P1 | ✅ | `cmd:album.createSmart`, `cmd:album.setRules`, `cmd:album.ruleFields`, `cmd:dialog.smartAlbum`, `crates/catalog/src/rules.rs`, `crates/ui-egui/src/dialogs/rules_editor.rs` | rule editor: match all / any / none, nested groups (⌥+ or + Group), 47 fields. The field menu shows Rating, Pick Flag, Color Label and Any Searchable Text, then one submenu per group (`FIELD_GROUPS`; `album.ruleFields` reports each field's `group`): Source (album — a plain or a smart album, so one smart album can include or exclude another; a rule that would make an album include itself, directly or through others, is refused, and a loop saved anyway can't recurse: inside it, the album being evaluated counts as holding no photos, so an "isn't" rule on it matches every photo, and the sidebar marks it ⚠ —, virtual copy, copy name, in a stack), File (filename, extension, file path, type, format, video duration), Date (capture / import / edit), Keywords & People (keywords, keyword count, people on named faces, people count), Description (title, caption, alt text, creator, copyright, copyright status), Camera Info (camera, lens, focal length, aperture, shutter speed as 1/250, ISO), Location (any, city, state / province, country, GPS), Size (long / short edge, aspect ratio and megapixels, all of the photo as shown: oriented and cropped), Develop (has edits, cropped, treatment), Assisted Culling (focus, best of similar shots); text / number / date / in-the-last operators; live match count; also usable as a library filter (`ruleSet`). Missing vs Classic: develop preset, flash, exposure bias, camera serial, colour profile / bit depth, IPTC Job, smart-preview status. Choice values read as words in every language (Public Domain, Black & White; `album.ruleFields` gives `choiceLabels`), while rules store the ids; yes/no fields read Yes / No and take `true`/`false`, `"yes"`/`"no"`, `"true"`/`"false"` or 1/0. Every value is checked against its field (`RuleSet::check`): numbers (rating 0–5), shutter speeds, dates (`2026`, `2026-08`, `2026-08-14`, then `T10`, `T10:00` or `T10:00:00`, a space working as the `T`, and after whole seconds a fraction and a time zone as imported capture times carry them (`.250+02:00`); no 30 February; `rules::rule_date` is the one reading for the check and the matcher; each date field has a calendar picker, `crates/ui-egui/src/widgets/date_picker.rs`, that picks a year, a month or a day and keeps a "between" in order), between = two bounds in order, in the last = more than 0 of a known unit, choices (ids, the flag's picked / rejected, a colour label's custom name), text with something to look for, an existing album (plain or smart, not a folder), no empty groups; each problem names its rule (`rule 2.1: no rating 0–5 is 9`), and album.createSmart / setRules / library.filter refuse them. The editor marks each bad rule under its row (inside groups too), keeps OK disabled until they are fixed (and its confirm refuses them before renaming anything), picks an Album rule's album with an album picker (`crates/ui-egui/src/widgets/album_picker.rs`: the sidebar's tree with folders, or type part of a name or folder; ↑ / ↓ / Enter; albums that can't be picked shown greyed with the reason) (is / isn't; a folder can't be tested), and drawing it never changes a rule: a rating of 9, "in the last 0 days" or 20,000 days, a "between" that isn't a pair all stay as stored (and are marked where they can't match) until edited. Album rules saved with an old operator (≥, between) are read as the "isn't" they always meant (`RuleSet::upgrade`). Saved smart albums whose rules no longer check are marked ⚠ in the sidebar (tooltip: what to fix; `albums.list` `problems`, `Catalog::smart_album_problems`); the name and rules of an album are saved as one undo step (`album.setRules` `name`). Problems read as the field's name and the issue in the editor's language (“Titel: braucht einen Suchbegriff”; `Problem::issue` / `field`, `Issue::text`, translated in every locale), while commands keep the English `rule 2.1: …` message for agents | | LRC-LIB-PUBLISH | Publish services | P2 | ⬜ | | | diff --git a/docs/whats-new.md b/docs/whats-new.md index c6c25920034..ed798b94f96 100644 --- a/docs/whats-new.md +++ b/docs/whats-new.md @@ -830,6 +830,17 @@ - Compare and Reference View panes say "Rendering…" (or that the photo can't be opened) the same way, so a magnified preview isn't taken for the photo when checking focus at 1:1. +### Synchronize Folder: no need to wait for the scan +- While Synchronize Folder… scans a folder (a large one on a network share can take minutes), its button is + **Continue in Background**: the dialog closes, the scan goes on under its row in the activity stack, and you can + go on working. When it is done nothing pops up: a notice in the activity stack says how many changes were found. + Click it to open the dialog with the result, or ✕ to let go of it. A scan that found nothing to do only says so. + Cancel and the row's ✕ stop the scan as before. One folder is scanned at a time. +- Working on the folder's photos while it is scanned (ratings, flags, colour labels, keywords, edits, albums, + virtual copies) no longer sends Synchronize back to scanning. What the scan found still holds, and Synchronize + does it. It scans again only when the folder holds other photos than it did, one of them is another file now, or + a photo whose sidecar is about to be read was changed here since. + ### Lens corrections - Sony A7R VI (ILCE-7RM6) raws are corrected for lens distortion from the table the camera records in each file, under Optics ▸ Enable Lens Corrections, on by default for newly imported photos. On 33 photos shot with the camera's