From 8ca7280e2b2048d085dbd83b50e087918c94fa97 Mon Sep 17 00:00:00 2001 From: Bruno-Alumn <171815746+Bruno-Alumn@users.noreply.github.com> Date: Thu, 29 Oct 2026 14:53:12 +0100 Subject: [PATCH] LRC-LIB-CATALOG-SWITCH: a library missing at launch is reported instead of being made anew with demo photos (#3239) When the library last opened was missing at launch (its drive or network share not connected yet, or moved), LightCraft created an empty library at that path, seeded it with the demo photos and opened it. The launch plan now marks the library remembered in Settings, and when it holds no library the session opens nothing and the can't-open window offers Try Again, Choose Another Library, Continue Without Saving and Quit. The default location, --library and LIGHTCRAFT_LIBRARY are still created when missing, as before. --- apps/lightcraft/src/session.rs | 17 +++++++++-- apps/lightcraft/src/tests.rs | 31 +++++++++++++++++++- crates/ui-egui/src/panels/library_problem.rs | 12 +++++--- crates/ui-egui/src/tests/launch_library.rs | 25 +++++++++------- docs/parity-checklist.md | 2 +- docs/whats-new.md | 10 +++++++ 6 files changed, 78 insertions(+), 19 deletions(-) diff --git a/apps/lightcraft/src/session.rs b/apps/lightcraft/src/session.rs index b886b472f..3cd66317b 100644 --- a/apps/lightcraft/src/session.rs +++ b/apps/lightcraft/src/session.rs @@ -253,7 +253,7 @@ pub(crate) fn services(cc: &eframe::CreationContext<'_>, log_file: Option<&std:: pub(crate) fn open_session(in_memory: bool, launch: &Launch, seed_demo: bool) -> (Session, Option) { let (mut s, problem) = match launch { Launch::Ask => (Session::new().with_fs().with_default_denoise_models().with_system_clock(), None), - Launch::Open { dir, .. } => open_library_session(in_memory, dir.clone(), seed_demo), + Launch::Open { dir, remembered, .. } => open_library_session(in_memory, dir.clone(), *remembered, seed_demo), }; s.face_models_dir = lightcraft_engine::config::default_face_models_dir(); s.slide_templates_dir = lightcraft_engine::config::config_dir().map(|d| d.join(lightcraft_engine::slide_template::DIR_NAME)); @@ -267,7 +267,9 @@ pub(crate) fn open_session(in_memory: bool, launch: &Launch, seed_demo: bool) -> /// If the library can't be opened the session is empty and in memory — never seeded with the /// demo photos, never written anywhere — and the problem is returned: the window then says so /// and offers Try Again / Choose Another Library… / Continue Without Saving / Quit (issue #100). -fn open_library_session(in_memory: bool, dir: Option, seed_demo: bool) -> (Session, Option) { +/// So is a `remembered` library (the one last opened) that isn't there any more: opening would +/// make a new, empty one in its place, e.g. on an unmounted drive's path (issue #3239). +fn open_library_session(in_memory: bool, dir: Option, remembered: bool, seed_demo: bool) -> (Session, Option) { if in_memory { return (if seed_demo { Session::with_demo() } else { Session::new() }.with_fs().with_default_denoise_models().with_system_clock(), None); } @@ -276,9 +278,18 @@ fn open_library_session(in_memory: bool, dir: Option, seed_d log::warn!("no library location (set --library or LIGHTCRAFT_LIBRARY)"); return (unopened(), Some(LibraryProblem::new("", "There is no home folder to keep the library in. Choose a folder for it."))); }; + if remembered && !lightcraft_engine::library::is_library(&dir) { + log::error!("library {} is missing", dir.display()); + let why = if dir.exists() { + "There is no LightCraft library in this folder any more." + } else { + "The library isn't there: it was moved or renamed, or its drive or network share isn't connected." + }; + return (unopened(), Some(LibraryProblem::new(dir.to_string_lossy(), why))); + } let t0 = std::time::Instant::now(); let mut s = Session::new().with_fs().with_default_denoise_models().with_system_clock(); - match s.open_library(&dir, seed_demo) { + match s.open_library(&dir, seed_demo && !remembered) { Ok(r) => { let (replayed, torn) = (r.replayed, r.torn_bytes); log::info!( diff --git a/apps/lightcraft/src/tests.rs b/apps/lightcraft/src/tests.rs index 0afbc4b2c..518c7b8fe 100644 --- a/apps/lightcraft/src/tests.rs +++ b/apps/lightcraft/src/tests.rs @@ -29,7 +29,7 @@ fn launch_arguments_never_walk_a_drive_or_the_home_folder() { /// adds to Apple Photos on a worker (headless sessions wait instead). #[test] fn the_desktop_session_adds_to_apple_photos_in_the_background() { - let (s, problem) = open_session(true, &Launch::Open { dir: None, alt_asks: false }, false); + let (s, problem) = open_session(true, &Launch::Open { dir: None, alt_asks: false, remembered: false }, false); assert!(problem.is_none()); assert!(s.apple_photos_background); assert!(!lightcraft_engine::Session::new().apple_photos_background); @@ -63,6 +63,35 @@ fn asking_at_launch_opens_nothing_and_still_saves_the_settings() { let _ = std::fs::remove_dir_all(&d); } +/// Issue #3239: the library remembered in Settings whose folder is missing at launch (a disk or +/// network share not connected) is reported in the library problem window. Nothing is created +/// there (not the folder, not its parents) and no demo photos are added. +#[test] +fn a_remembered_library_missing_at_launch_is_reported_not_made_anew() { + let d = dir("missing-library"); + let gone = d.join("gone"); + let lib = gone.join("Lib"); + let launch = Launch::Open { dir: Some(lib.clone()), alt_asks: true, remembered: true }; + let (s, problem) = open_session(false, &launch, true); + let problem = problem.expect("the missing library is reported"); + assert_eq!(problem.path, lib.to_string_lossy()); + assert!(problem.can_retry, "Try Again once the drive is back"); + assert!(!gone.exists(), "nothing is created where the library was"); + assert!(s.library.is_none() && s.catalog.is_empty(), "no library, no demo photos"); + // a remembered folder that is there but holds no library is reported too + std::fs::create_dir_all(&lib).unwrap(); + let (s, problem) = open_session(false, &launch, true); + assert!(problem.is_some() && s.library.is_none() && s.catalog.is_empty()); + assert!(!lightcraft_engine::library::is_library(&lib), "nothing written in it"); + // the default location (or --library) is still made when it's missing, with the demo photos + let fresh = d.join("fresh").join("Lib"); + let (s, problem) = open_session(false, &Launch::Open { dir: Some(fresh.clone()), alt_asks: true, remembered: false }, true); + assert!(problem.is_none() && s.library.is_some() && !s.catalog.is_empty(), "{problem:?}"); + assert!(lightcraft_engine::library::is_library(&fresh)); + drop(s); + let _ = std::fs::remove_dir_all(&d); +} + /// Issue #103: a damaged ui.json (which holds the library location) is kept aside and /// reported, not silently replaced by the defaults. #[test] diff --git a/crates/ui-egui/src/panels/library_problem.rs b/crates/ui-egui/src/panels/library_problem.rs index 544e29449..9e2b084f4 100644 --- a/crates/ui-egui/src/panels/library_problem.rs +++ b/crates/ui-egui/src/panels/library_problem.rs @@ -274,7 +274,9 @@ pub const ALT_SECONDS: f64 = 2.0; pub enum Launch { /// Open this library folder (`None`: there is nowhere to keep one; the problem window says /// so). `alt_asks`: holding Alt/Option as the window appears offers the recent libraries. - Open { dir: Option, alt_asks: bool }, + /// `remembered`: `dir` is the library last opened (Settings), not the default location, so a + /// missing one is reported instead of created anew (issue #3239). + Open { dir: Option, alt_asks: bool, remembered: bool }, /// Open nothing yet: the window lists the recent libraries ([`LibraryProblem::choose`]). Ask, } @@ -284,16 +286,18 @@ pub enum Launch { /// `settings` is `None` without a settings file; `memory` (`--memory`) never asks. pub fn launch_plan(memory: bool, flag: Option, env: Option, settings: Option<&AppSettings>, default: Option) -> Launch { if memory { - return Launch::Open { dir: None, alt_asks: false }; + return Launch::Open { dir: None, alt_asks: false, remembered: false }; } if let Some(dir) = flag.or(env) { - return Launch::Open { dir: Some(dir), alt_asks: false }; + return Launch::Open { dir: Some(dir), alt_asks: false, remembered: false }; } if settings.is_some_and(|s| s.at_launch == LaunchLibrary::Ask) { return Launch::Ask; } let last = settings.map(|s| s.library_path.clone()).filter(|p| !p.is_empty()).map(PathBuf::from); - Launch::Open { dir: last.or(default), alt_asks: true } + // the default location is made when it's missing (first launch); a remembered library isn't + let remembered = last.as_ref().is_some_and(|l| default.as_ref() != Some(l)); + Launch::Open { dir: last.or(default), alt_asks: true, remembered } } /// One library in the launch window's list. diff --git a/crates/ui-egui/src/tests/launch_library.rs b/crates/ui-egui/src/tests/launch_library.rs index 448bb735a..b0b7abf7f 100644 --- a/crates/ui-egui/src/tests/launch_library.rs +++ b/crates/ui-egui/src/tests/launch_library.rs @@ -50,30 +50,35 @@ fn path(s: &str) -> Option { Some(PathBuf::from(s)) } -/// `--library`, then `LIGHTCRAFT_LIBRARY`, then the setting; `--memory` never asks. +/// `--library`, then `LIGHTCRAFT_LIBRARY`, then the setting; `--memory` never asks. Only the +/// library remembered in Settings is `remembered` (issue #3239: a missing one is reported, not +/// made anew), and not when it is the default location. #[test] fn the_launch_plan_puts_the_flag_and_the_variable_before_the_setting() { let ask = AppSettings { at_launch: LaunchLibrary::Ask, library_path: "/last".into(), ..AppSettings::default() }; let last = AppSettings { library_path: "/last".into(), recent_libraries: vec!["/last".into(), "/older".into()], ..AppSettings::default() }; + let at_default = AppSettings { library_path: "/default".into(), ..AppSettings::default() }; let fresh = AppSettings::default(); - let open = |dir: &str, alt_asks| Launch::Open { dir: path(dir), alt_asks }; + let open = |dir: &str, alt_asks, remembered| Launch::Open { dir: path(dir), alt_asks, remembered }; // --library, then LIGHTCRAFT_LIBRARY, whatever the setting says; neither asks on Alt for s in [None, Some(&ask), Some(&last)] { - assert_eq!(launch_plan(false, path("/flag"), path("/env"), s, path("/default")), open("/flag", false)); - assert_eq!(launch_plan(false, None, path("/env"), s, path("/default")), open("/env", false)); + assert_eq!(launch_plan(false, path("/flag"), path("/env"), s, path("/default")), open("/flag", false, false)); + assert_eq!(launch_plan(false, None, path("/env"), s, path("/default")), open("/env", false, false)); } // Ask me asks, with or without a recent list assert_eq!(launch_plan(false, None, None, Some(&ask), path("/default")), Launch::Ask); let ask_empty = AppSettings { at_launch: LaunchLibrary::Ask, ..AppSettings::default() }; assert_eq!(launch_plan(false, None, None, Some(&ask_empty), None), Launch::Ask); // Open the last library: the last one, else the default place; Alt can still ask - assert_eq!(launch_plan(false, None, None, Some(&last), path("/default")), open("/last", true)); - assert_eq!(launch_plan(false, None, None, Some(&fresh), path("/default")), open("/default", true)); - assert_eq!(launch_plan(false, None, None, None, path("/default")), open("/default", true)); - assert_eq!(launch_plan(false, None, None, None, None), Launch::Open { dir: None, alt_asks: true }); + assert_eq!(launch_plan(false, None, None, Some(&last), path("/default")), open("/last", true, true)); + assert_eq!(launch_plan(false, None, None, Some(&last), None), open("/last", true, true)); + assert_eq!(launch_plan(false, None, None, Some(&at_default), path("/default")), open("/default", true, false)); + assert_eq!(launch_plan(false, None, None, Some(&fresh), path("/default")), open("/default", true, false)); + assert_eq!(launch_plan(false, None, None, None, path("/default")), open("/default", true, false)); + assert_eq!(launch_plan(false, None, None, None, None), Launch::Open { dir: None, alt_asks: true, remembered: false }); // --memory never asks and opens no folder - assert_eq!(launch_plan(true, None, None, Some(&ask), path("/default")), Launch::Open { dir: None, alt_asks: false }); - assert_eq!(launch_plan(true, path("/flag"), None, Some(&last), None), Launch::Open { dir: None, alt_asks: false }); + assert_eq!(launch_plan(true, None, None, Some(&ask), path("/default")), Launch::Open { dir: None, alt_asks: false, remembered: false }); + assert_eq!(launch_plan(true, path("/flag"), None, Some(&last), None), Launch::Open { dir: None, alt_asks: false, remembered: false }); } /// Each listed library is checked when the window opens; the last one opened is selected. diff --git a/docs/parity-checklist.md b/docs/parity-checklist.md index 90cfc248f..2f532c711 100644 --- a/docs/parity-checklist.md +++ b/docs/parity-checklist.md @@ -701,7 +701,7 @@ From `08-lightroom-classic-extras.md` (Classic-only features) and part 2 of `06- | LRC-LIB-CATALOG-PANEL | Catalog sets | P1 | ✅ | `cmd:library.source` (`missing`) | all, recently added, picks, recently deleted, missing photos (when any) | | LRC-LIB-CATALOG-IMPORT | Native Lightroom Classic catalog import | P1 | 🟡 | `cmd:library.inspectLightroom`, `cmd:library.importLightroom`, `cmd:file.importLightroom`, `crates/engine/src/lightroom_catalog.rs`, `crates/ui-egui/src/dialogs/lightroom_destination.rs`, `crates/ui-egui/src/tests/lightroom_destination.rs`, `docs/lightroom-catalog-import.md` | before the import starts, File ▸ Import Lightroom Catalog… asks where the catalog goes: merge into the open library (named, with its photo count; preselected when it is empty) or create a new library (named after the catalog file, next to the open library, both editable), which is made and opened following File ▸ New Library…'s rules before the import; Cancel does nothing; Settings ▸ General ▸ "When importing a Lightroom catalog" (Ask where to import it / Always merge into the open library) or the window's "Don't ask again" turns it off; `file.importLightroom` takes `into` (`open` / `new`), `name`, `location` to choose without the window; a session in memory merges without asking (issue #2672); read-only `.lrcat` plus committed WAL pages (also WAL-only tables with main schema format 0), in-tree read-only Rust SQLite B-tree reader; on-demand main-file pages up to 16 GiB with existing table/record bounds (WAL still capped at 1 GiB, issue #798); background inspection/import with progress/cancellation, per-open library identity checks; persistent result with destination library, offline-original counts and Show in Library, dismissed when switching libraries; offline Local records are promoted without probing missing files; originals in place, ratings/flags/labels, XMP, hierarchical keywords, collection sets/regular collections, virtual copies, mapped develop settings; stable reimport identities, undo, missing-file placeholders, a root folder not found at its recorded path looked up relative to the catalog (Lightroom's `relativePathFromCatalog`, so a project folder copied from another computer stays linked; reported as a warning), existing edits preserved. Best-effort deduplicated recovery archives retain settings/history/snapshots/collection rules (32 MiB each, eight archives/128 MiB aggregate); archive limits/write failures and optional-table limits warn without blocking photo import; unrelated unsupported tables and opaque SQL BLOBs skipped. Custom white balance on relative-WB raws (`RAW` in Lightroom's terms) stays As Shot and is reported, since the catalog keeps no as-shot white to shift from (issue #510). An image whose file, folder or root folder record is missing from the catalog, or whose original path is empty, is skipped with its virtual copies instead of failing the whole import; the report lists them as data (`skipped`: image id and reason) and the result window counts them in the UI language (PR #2230). Adobe rendering, AI data and native history replay remain incomplete; no writes to Lightroom catalogs. Open Library given a Lightroom catalog folder, an `.lrdata` / `.lrcat-data` folder or the `.lrcat` makes no library there and offers this import with the catalog found (`cmd:app.openLibrary`, `crates/engine/src/lightroom_folder.rs`; issue #891) | | 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-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); the library last opened that is missing at launch (moved, or on a drive or network share that isn't connected) opens the can't-open window (Try Again, Choose Another, Continue Without Saving, Quit) instead of a new library with demo photos in its place (`apps/lightcraft/src/tests.rs`: `a_remembered_library_missing_at_launch_is_reported_not_made_anew`, issue #3239) | | 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-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 +) | diff --git a/docs/whats-new.md b/docs/whats-new.md index c6c259200..88ce76a2b 100644 --- a/docs/whats-new.md +++ b/docs/whats-new.md @@ -1,5 +1,15 @@ # What's new in LightCraft +## 2026-10-29 + +### A library on a disconnected drive is reported at launch, not replaced +- When the library LightCraft last opened is missing at launch, because its drive or network share isn't connected + yet or it was moved, the window now says it couldn't open the library and offers Try Again, Choose Another + Library…, Continue Without Saving and Quit. Before, LightCraft quietly made a new, empty library at that path, + filled it with the demo photos and opened it, so it looked as if the photos and edits were gone. Nothing is + written there now. A library given with `--library` or `LIGHTCRAFT_LIBRARY`, and the default location on first + launch, are still created as before. + ## 2026-10-24 ### Relative-date filters and smart albums follow the clock