LightCraft: An open-source non-destructive photo editor written by scratch in pure Rust
fix: expire relative-date view caches on minute change
ronibalthazar18c56f03d46d
diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rsindex 4ad5695dc..4ea007b30 100644--- a/crates/engine/src/lib.rs+++ b/crates/engine/src/lib.rs@@ -195,6 +195,17 @@ pub struct Interaction {/// The most photos an edit may touch for the view to follow it photo by photo; a larger edit is worked out whole.const MAX_FOLLOWED: usize = 256;+/// The established clock precision for relative-date views and sidebar counts.+fn clock_minute(now: &str) -> &str {+ now.get(..16).unwrap_or(now)+}++/// Whether a query can change membership without a catalog edit, including smart albums it tests.+fn filter_depends_on_clock(filter: &Filter, catalog: &Catalog) -> bool {+ filter.depends_on_now()+ || (!filter.albums_tested().is_empty() && catalog.albums().any(|album| album.smart.as_deref().is_some_and(Filter::depends_on_now)))+}+/// Source of [`Session::visible_shared`] generations (process-wide, so two sessions never share one).static VISIBLE_GEN: std::sync::atomic::AtomicU64 = std::sync::atomic::AtomicU64::new(1);static LIBRARY_GEN: std::sync::atomic::AtomicU64 = std::sync::atomic::AtomicU64::new(1);@@ -215,6 +226,8 @@ pub struct Session {/// Shared, so frontends can hold it across frames without copying ([`Session::visible_shared`]).visible: Arc<[PhotoId]>,visible_key: Option<(u64, String)>,+ /// The minute used for a cached view whose rules depend on the session clock.+ visible_clock_minute: Option<String>,/// A view holds the photos it shows until it is refreshed (`library.holdView`): an edit that makes a photo stop/// matching a smart album's rules, Picks or the filter bar leaves it where it is. Off: the photo goes at once.pub hold_view: bool,@@ -234,7 +247,7 @@ pub struct Session {/// is recomputed, so frontends can key their per-view caches on it instead of hashing the ids.visible_gen: u64,/// Photos in the current source with no filter on (cached like `visible`).- total: Option<((u64, String), usize)>,+ total: Option<((u64, String), usize, Option<String>)>,pub undo: Vec<UndoEntry>,/// Undo steps committed in this session, ever (the history drops its oldest past 1000, so/// its length can't tell how many steps a command just made; see [`Session::commits`]).@@ -429,6 +442,7 @@ impl Session {selection: Selection::default(),visible: Vec::new().into(),visible_key: None,+ visible_clock_minute: None,hold_view: false,base: None,view_followed: 0,@@ -1053,9 +1067,16 @@ impl Session {// the view fills in as the background checks find files gonekey.1.push_str(&format!("|{}", self.media.availability.generation()));}- if self.visible_key.as_ref() != Some(&key) {- // "in the last N days" rules count back from the session's clock- lightcraft_catalog::rules::set_now(Some((self.clock)()));+ let key_changed = self.visible_key.as_ref() != Some(&key);+ // A time-dependent cache needs one clock read to test its minute stamp. A new view also+ // needs one value for the query, even when its previous cached view did not use the clock.+ let current_now = (key_changed || self.visible_clock_minute.is_some()).then(|| (self.clock)());+ let current_minute = current_now.as_deref().map(clock_minute);+ let clock_changed = self.visible_clock_minute.as_deref().is_some_and(|cached| current_minute != Some(cached));+ if key_changed || clock_changed {+ // Use this same value to evaluate relative rules and stamp the result.+ let now = current_now.unwrap_or_else(|| (self.clock)());+ lightcraft_catalog::rules::set_now(Some(now.clone()));let f = self.view_filter(self.source, &self.filter);// A held view keeps the photos it shows that stopped matching what is asked of them (a smart album's// rules, a flag, the filter bar), as long as they are still where the view looks: in the library for@@ -1082,8 +1103,7 @@ impl Session {let whole = own_order || matches!(self.source, LibrarySource::RecentlyAdded | LibrarySource::Missing);// A view that asks about "the last N days" (itself, or through a smart album it looks into) changes// with the clock as well as with edits: a photo nobody touched can stop matching. It is asked whole.- let clocked = f.depends_on_now()- || (!f.albums_tested().is_empty() && self.catalog.albums().any(|al| al.smart.as_deref().is_some_and(Filter::depends_on_now)));+ let clocked = filter_depends_on_clock(&f, &self.catalog);let base = self.base.take().filter(|(of, _, _)| *of == view);// A small edit to the same view: the photos it touched are taken out, asked about again, and put back// at their place in the order. The others neither stopped matching nor moved.@@ -1157,6 +1177,7 @@ impl Session {self.visible = visible.into();self.visible_gen = VISIBLE_GEN.fetch_add(1, std::sync::atomic::Ordering::Relaxed);self.visible_key = Some(key);+ self.visible_clock_minute = clocked.then(|| clock_minute(&now).to_owned());}&self.visible}@@ -1189,12 +1210,20 @@ impl Session {/// view, so a list followed many times over is compared, not only one followed once.#[cfg(test)]pub(crate) fn visible_in_full(&mut self) -> Vec<PhotoId> {- let kept = (self.base.clone(), self.visible_key.clone(), self.visible.clone(), self.visible_gen, self.view_followed, self.view_worked_out);+ let kept = (+ self.base.clone(),+ self.visible_key.clone(),+ self.visible_clock_minute.clone(),+ self.visible.clone(),+ self.visible_gen,+ self.view_followed,+ self.view_worked_out,+ );self.never_follow = true;self.visible_key = None;let whole = self.visible().to_vec();self.never_follow = false;- (self.base, self.visible_key, self.visible, self.visible_gen, self.view_followed, self.view_worked_out) = kept;+ (self.base, self.visible_key, self.visible_clock_minute, self.visible, self.visible_gen, self.view_followed, self.view_worked_out) = kept;whole}@@ -1222,7 +1251,15 @@ impl Session {}}let key = (self.catalog.revision, format!("{:?}|{:?}|{:?}", self.source, self.browse, self.library_folder));- if self.total.as_ref().map(|t| &t.0) != Some(&key) {+ let key_changed = self.total.as_ref().map(|total| &total.0) != Some(&key);+ let cached_minute = self.total.as_ref().and_then(|total| total.2.as_deref());+ let current_now = cached_minute.map(|_| (self.clock)());+ let current_minute = current_now.as_deref().map(clock_minute);+ let clock_changed = cached_minute.is_some_and(|cached| current_minute != Some(cached));+ if key_changed || clock_changed {+ // The source count can be requested before `visible`; bind it to the session's clock itself.+ let now = current_now.unwrap_or_else(|| (self.clock)());+ lightcraft_catalog::rules::set_now(Some(now.clone()));let mut f = self.source.to_filter(&Filter::default(), &self.catalog);if self.source == LibrarySource::Folder {let b = self.browse.clone().unwrap_or_default();@@ -1234,7 +1271,8 @@ impl Session {}// (how many, not which: nothing to put in order)let n = self.catalog.count(&f);- self.total = Some((key, n));+ let clocked = filter_depends_on_clock(&f, &self.catalog);+ self.total = Some((key, n, clocked.then(|| clock_minute(&now).to_owned())));}self.total.as_ref().map(|t| t.1)}diff --git a/crates/engine/src/tests_hold_view.rs b/crates/engine/src/tests_hold_view.rsindex f7082498c..f30d08c4e 100644--- a/crates/engine/src/tests_hold_view.rs+++ b/crates/engine/src/tests_hold_view.rs@@ -1,11 +1,28 @@//! A view holds the photos it shows until it is refreshed (`library.holdView`): an edit that makes a photo stop//! matching a smart album's rules, Picks or the filter bar leaves it where it is, and the others where they are.-use lightcraft_catalog::PhotoId;+use lightcraft_catalog::{Op, Photo, PhotoId, Source};use serde_json::json;use crate::{LibrarySource, Session};+fn relative_clock_session(captures: &[&str]) -> (Session, std::sync::Arc<std::sync::Mutex<String>>, Vec<PhotoId>) {+ let mut s = Session::new();+ let now = std::sync::Arc::new(std::sync::Mutex::new("2026-10-24T12:00:00".to_string()));+ let clock = now.clone();+ s.clock = Box::new(move || clock.lock().unwrap().clone());+ let mut ids = Vec::new();+ for (index, captured) in captures.iter().enumerate() {+ let id = PhotoId(index as u64 + 1);+ let name = format!("synthetic-{index}.jpg");+ let mut photo = Photo::new(id, Source::Demo { scene: 0 }, &name, "JPEG", 2, 2, "2026-10-01T00:00:00");+ photo.captured = Some((*captured).to_string());+ s.catalog.apply(Op::AddPhoto { photo: Box::new(photo) }).unwrap();+ ids.push(id);+ }+ (s, now, ids)+}+/// The demo library with no photo keyworded, showing a smart album of the photos without keywords, at random.fn unkeyworded() -> Session {let mut s = Session::with_demo();@@ -198,3 +215,29 @@ fn asking_for_the_state_it_has_changes_nothing_and_a_word_is_not_a_bool() {assert!(s.execute("library.holdView", &json!({"on": "false"})).is_err());assert!(s.hold_view, "a refused call changes nothing");}++#[test]+fn relative_clock_held_view_keeps_expired_photos_admits_new_matches_and_refreshes() {+ let (mut s, now, ids) = relative_clock_session(&["2026-10-23T12:00:30", "2026-10-22T12:00:30"]);+ let rules = json!({+ "ruleSet": {+ "match": "any",+ "rules": [+ {"field": "captureDate", "op": "inLast", "value": 1},+ {"field": "captureDate", "op": "notInLast", "value": 2}+ ]+ }+ });+ s.execute("library.filter", &rules).unwrap();+ s.execute("library.holdView", &json!({"on": true})).unwrap();+ assert_eq!(s.visible_cloned(), vec![ids[0]], "only the soon-to-expire photo matches initially");++ *now.lock().unwrap() = "2026-10-24T12:01:00".to_string();+ let held = s.visible_cloned();+ assert_eq!(held.len(), 2, "the expired photo stays held while the newly matching photo enters: {held:?}");+ assert!(held.contains(&ids[0]), "the expired photo remains held");+ assert!(held.contains(&ids[1]), "the photo crossing the second relative boundary enters");++ s.execute("library.refresh", &json!({})).unwrap();+ assert_eq!(s.visible_cloned(), vec![ids[1]], "explicit refresh releases the expired photo");+}diff --git a/crates/engine/src/tests_view_follow.rs b/crates/engine/src/tests_view_follow.rsindex 391e38b3b..bdfa21c70 100644--- a/crates/engine/src/tests_view_follow.rs+++ b/crates/engine/src/tests_view_follow.rs@@ -113,6 +113,23 @@ fn edit(s: &mut Session, dice: &mut Dice, ids: &mut Vec<PhotoId>, album: u64) {};}+fn relative_clock_session(captures: &[&str]) -> (Session, std::sync::Arc<std::sync::Mutex<String>>, Vec<PhotoId>) {+ let mut s = Session::new();+ let now = std::sync::Arc::new(std::sync::Mutex::new("2026-10-24T12:00:00".to_string()));+ let clock = now.clone();+ s.clock = Box::new(move || clock.lock().unwrap().clone());+ let mut ids = Vec::new();+ for (index, captured) in captures.iter().enumerate() {+ let id = PhotoId(index as u64 + 1);+ let name = format!("synthetic-{index}.jpg");+ let mut photo = Photo::new(id, Source::Demo { scene: 0 }, &name, "JPEG", 2, 2, "2026-10-01T00:00:00");+ photo.captured = Some((*captured).to_string());+ s.catalog.apply(Op::AddPhoto { photo: Box::new(photo) }).unwrap();+ ids.push(id);+ }+ (s, now, ids)+}+#[test]fn following_an_edit_gives_the_list_worked_out_from_every_photo() {let (mut s, mut ids, album, smart) = library(240);@@ -161,6 +178,107 @@ fn following_an_edit_gives_the_list_worked_out_from_every_photo() {assert!(s.view_followed > 400, "followed {} times, worked out {} times", s.view_followed, s.view_worked_out);}+#[test]+fn relative_clock_filter_expires_without_catalog_or_history_mutation() {+ let (mut s, now, ids) = relative_clock_session(&["2026-10-23T12:00:30"]);+ s.execute("library.filter", &json!({"ruleSet": {"rules": [{"field": "captureDate", "op": "inLast", "value": 1}]}})).unwrap();+ let (before_generation, before) = s.visible_shared();+ assert_eq!(before.as_ref(), ids.as_slice());+ let revision = s.catalog.revision;+ let commits = s.commits;+ let undo = s.undo.len();+ let redo = s.redo.len();++ *now.lock().unwrap() = "2026-10-24T12:01:00".to_string();+ let (after_generation, after) = s.visible_shared();++ assert!(after.is_empty(), "a relative filter must expire when its minute changes");+ assert_ne!(after_generation, before_generation, "the changed list gets a new visible generation");+ assert_eq!(s.catalog.revision, revision, "clock expiry is not a catalog edit");+ assert_eq!(s.commits, commits, "clock expiry adds no undo step");+ assert_eq!(s.undo.len(), undo);+ assert_eq!(s.redo.len(), redo);+}++#[test]+fn relative_clock_direct_and_nested_smart_album_sources_expire() {+ for nested in [false, true] {+ let (mut s, now, ids) = relative_clock_session(&["2026-10-23T12:00:30"]);+ let recent = s+ .execute(+ "album.createSmart",+ &json!({"name": "Recent", "rules": {"ruleSet": {"rules": [{"field": "captureDate", "op": "inLast", "value": 1}]}}}),+ )+ .unwrap()["id"]+ .as_u64()+ .unwrap();+ let source = if nested {+ s.execute(+ "album.createSmart",+ &json!({"name": "In Recent", "rules": {"ruleSet": {"rules": [{"field": "album", "op": "is", "value": recent}]}}}),+ )+ .unwrap()["id"]+ .as_u64()+ .unwrap()+ } else {+ recent+ };+ s.execute("library.source", &json!({"kind": "album", "id": source})).unwrap();+ assert_eq!(s.visible_cloned(), ids);+ let revision = s.catalog.revision;++ *now.lock().unwrap() = "2026-10-24T12:01:00".to_string();+ assert!(s.visible_cloned().is_empty(), "nested={nested}");+ assert_eq!(s.catalog.revision, revision, "nested={nested}");+ }+}++#[test]+fn relative_clock_source_total_expires_before_or_after_visible_refresh() {+ for refresh_visible in [false, true] {+ let (mut s, now, _) = relative_clock_session(&["2026-10-23T12:00:30"]);+ let album = s+ .execute(+ "album.createSmart",+ &json!({"name": "Recent", "rules": {"ruleSet": {"rules": [{"field": "captureDate", "op": "inLast", "value": 1}]}}}),+ )+ .unwrap()["id"]+ .as_u64()+ .unwrap();+ s.execute("library.source", &json!({"kind": "album", "id": album})).unwrap();+ s.execute("library.filter", &json!({"text": "synthetic"})).unwrap();+ assert_eq!(s.source_total(), Some(1), "the initial total is computed without asking for visible photos");+ let revision = s.catalog.revision;++ *now.lock().unwrap() = "2026-10-24T12:01:00".to_string();+ if refresh_visible {+ s.execute("library.refresh", &json!({})).unwrap();+ assert!(s.visible_cloned().is_empty());+ }+ assert_eq!(s.source_total(), Some(0), "refresh_visible={refresh_visible}");+ assert_eq!(s.catalog.revision, revision, "refresh_visible={refresh_visible}");+ }+}++#[test]+fn relative_clock_absolute_and_same_minute_views_keep_their_generations() {+ let (mut absolute, absolute_now, _) = relative_clock_session(&["2026-10-23T12:00:30"]);+ absolute.execute("library.filter", &json!({"ruleSet": {"rules": [{"field": "captureDate", "op": "is", "value": "2026-10-23"}]}})).unwrap();+ let (absolute_generation, absolute_ids) = absolute.visible_shared();+ *absolute_now.lock().unwrap() = "2026-10-25T12:10:00".to_string();+ let (after_absolute_generation, after_absolute_ids) = absolute.visible_shared();+ assert_eq!(after_absolute_generation, absolute_generation);+ assert_eq!(after_absolute_ids, absolute_ids);++ let (mut relative, relative_now, _) = relative_clock_session(&["2026-10-23T12:00:30"]);+ relative.execute("library.filter", &json!({"ruleSet": {"rules": [{"field": "captureDate", "op": "inLast", "value": 1}]}})).unwrap();+ let (relative_generation, relative_ids) = relative.visible_shared();+ *relative_now.lock().unwrap() = "2026-10-24T12:00:45".to_string();+ let (same_minute_generation, same_minute_ids) = relative.visible_shared();+ assert_eq!(same_minute_generation, relative_generation);+ assert_eq!(same_minute_ids, relative_ids);+}+#[test]fn a_view_that_asks_about_the_last_days_follows_the_clock_too() {let (mut s, ids, _, _) = library(60);diff --git a/docs/gaps.md b/docs/gaps.mdindex 329dcf531..fce7910e7 100644--- a/docs/gaps.md+++ b/docs/gaps.md@@ -1,6 +1,6 @@# Gaps: where LightCraft falls short of Lightroom-> **Last reviewed:** 2026-10-11 · **Last updated:** 2026-10-23 · **Change:** minor (gap 28: ⌘L Enable Filters switches the filter off and on; gap 28: F8 shows / hides the right panel; import review album hierarchy, #2362; gap 20: Minolta MRW decodes; gap 10: 551 models verified; gap 15: Print Page Options — page numbers, page info, crop marks; gap 15: Print Page Options — page numbers, page info, crop marks; gap 28: `\` shows / hides the Filter Bar in the grids; gap 21: Indonesian interface shipped, every message but What's New; gap 27: the Windows x64 installer verified on Windows 11; the Settings → Apps uninstall confirmation remains)+> **Last reviewed:** 2026-10-11 · **Last updated:** 2026-10-24 · **Change:** minor (LR-LIB-SMARTALBUM: relative-date view and source-count caches expire on the session-clock minute; ranked gaps and readiness counts unchanged; gap 28: ⌘L Enable Filters switches the filter off and on; gap 28: F8 shows / hides the right panel; import review album hierarchy, #2362; gap 20: Minolta MRW decodes; gap 10: 551 models verified; gap 15: Print Page Options — page numbers, page info, crop marks; gap 15: Print Page Options — page numbers, page info, crop marks; gap 28: `\` shows / hides the Filter Bar in the grids; gap 21: Indonesian interface shipped, every message but What's New; gap 27: the Windows x64 installer verified on Windows 11; the Settings → Apps uninstall confirmation remains)Every known shortfall, one entry each, ranked by user impact (how many Lightroom users hit it, andhow hard it blocks them), then by effort. **Agents pick work from the top** (the first entry nobody is@@ -83,6 +83,7 @@ Beta-blocking gaps (B) total **~230–430 h**; with the stability and platform w## Revision history| Date | Change | Summary |+| 2026-10-24 | minor | LR-LIB-SMARTALBUM: relative-date views and source totals expire on the session-clock minute, including nested smart albums; ranked gaps and readiness counts unchanged ||---|---|---|| 2026-10-22 | patch | XMP namespace-prefix collisions no longer overwrite foreign metadata; ranked gaps and estimates unchanged || 2026-10-22 | patch | Issue #2519: PSD/PSB EXIF resource 1058 and XMP resource 1060 now use the common metadata extractor, and `.psb` files are accepted by import; no ranked gap or readiness count changes |diff --git a/docs/parity-checklist.md b/docs/parity-checklist.mdindex 9790523e1..be358c486 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-22 · **Change:** minor (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-24 · **Change:** patch (LR-LIB-SMARTALBUM: relative-date view and source-count caches expire on the session-clock minute; status and feature counts unchanged; earlier: 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.6The measured, row-by-row checklist: one row per Lightroom feature, menu item and shortcut, what wehave and what is missing. It answers *does the feature exist?* (feature breadth). Whether it is good@@ -96,7 +96,7 @@ differences and missing bindings are in [ui-parity.md](ui-parity.md#shortcuts).| LR-LIB-BYDATE | Browse by date | P1 | ✅ | `cmd:library.filter` (`date`), `crates/ui-egui/src/panels/left.rs` (`date_row`), `crates/catalog/src/query.rs` (`date_groups`) | year → month → day tree with library-wide counts; a row filters the current source by that date. Active filters show as removable chips under the grid header (`crates/ui-egui/src/panels/chips.rs`, with “+N more” and Clear all), the header counts “N of M photos” (matching of the source's total), a badge on the top-bar filter icon counts them, and an empty result says no photos match the active filters || LR-LIB-ALBUM | Albums | P0 | ✅ | `cmd:album.create`, `cmd:album.rename`, `cmd:album.delete`, `cmd:album.addPhotos`, `cmd:album.removePhotos`, `cmd:dialog.newAlbum`, `crates/engine/src/tests_albums_local.rs`, `crates/ui-egui/src/tests_panels.rs` | photos dragged from the grid onto an album row are added to it (LR-BEHAV-DRAGDROP); albums hold library photos (issue #684): `album.create {addSelected}`, `album.addPhotos` and `album.toggleTarget` (B) skip browsed Local photos and return `skipped` (a toast says so), a Local-only selection is an error and leaves Photo ▸ Add to Album, the grid's right-click Add to Album, a folder row's Add Selected Photos and a drop onto an album row off with the hint to Add to My Photos first (`button:contextAddToAlbum`, `button:contextAlbum:<id>`); right-click a photo ▸ Add to Album lists the albums and ends with New Album…, which creates one holding the selection — also when the library has no album yet (issue #676; `button:contextNewAlbum`); New Album's "Include selected photos" (`check:albumIncludeSelected`, on by default; `dialog.newAlbum {includeSelected}`) leaves the selection out when unticked, and, as in Lightroom, is only shown when something is selected (never for a folder) || LR-LIB-FOLDER | Folders of albums | P0 | ✅ | `cmd:album.create` (`folder`, `parent`), `cmd:album.move`, `cmd:album.reorder`, `cmd:album.sort`, `cmd:dialog.newAlbum` / `cmd:dialog.newFolder` / `cmd:dialog.smartAlbum` / `cmd:dialog.newSmartAlbum` (`parent`), `crates/ui-egui/src/panels/left.rs` (`albums_tree`, `folder_menu`, `disclosure_triangle`), `crates/ui-egui/src/tests_panels.rs` | Delete removes a folder and its nested albums as one undoable edit, keeps photos in the library and returns a deleted album view to All Photos (issue #501); folders nest and fold with the same disclosure triangle as Local / By Date / Folders / Keywords (`albumToggle:<id>`; the row folds them too; open by default); right-click a folder ▸ New ▸ Create Album… / Create Smart Album… / Create Smart Album from Filter… / Create Folder… creates inside it (the `dialog.new*` commands take `parent`), opening the folders down to the new row; creating is only allowed inside folders; moving: drag an album or folder row onto a folder (outlined when allowed; a closed folder opens after 0.6 s under the pointer; the "Albums" header takes an item that sits in a folder back to the top level while it is dragged), the Move to menu or `album.move` — one undo step each; not onto a plain album, itself or something inside it; drop on the top / bottom half of an album or the edge of a folder to place it there by hand (`cmd:album.reorder`, a line shows the place; ordered per folder, folders stay first, new albums go after the ordered ones; right-click ▸ Sort Contents A–Z or + ▸ Sort Albums A–Z = `cmd:album.sort`) |-| LR-LIB-SMARTALBUM | Smart albums | P1 | ✅ | `cmd:album.createSmart`, `cmd:album.setRules`, `cmd:library.holdView`, `cmd:library.refresh`, `crates/catalog/src/query.rs`, `crates/ui-egui/src/panels/filterbar.rs`, `crates/ui-egui/src/lib.rs` (`album_counts`) | saved filters (rating/flag/label/kind/edited/keyword/camera/lens/date range/text/album) or a rule set from the rule editor (match all / any / none, nested groups; see LRC-LIB-SMARTCOLL), live; sidebar counts are cached per catalog revision (and per minute while an “in the last…” rule is used), counted without building id lists; View ▸ Hold View Until Refreshed (`library.holdView`, off by default) keeps a photo that an edit made stop matching (a smart album, Picks, the filter bar) in the view until Refresh View, Reshuffle or another source, filter or sort |+| LR-LIB-SMARTALBUM | Smart albums | P1 | ✅ | `cmd:album.createSmart`, `cmd:album.setRules`, `cmd:library.holdView`, `cmd:library.refresh`, `crates/catalog/src/query.rs`, `crates/ui-egui/src/panels/filterbar.rs`, `crates/ui-egui/src/lib.rs` (`album_counts`) | saved filters (rating/flag/label/kind/edited/keyword/camera/lens/date range/text/album) or a rule set from the rule editor (match all / any / none, nested groups; see LRC-LIB-SMARTCOLL), live; views and source counts with direct or nested relative-date rules expire on the session-clock minute; sidebar counts remain cached without building id lists; View ▸ Hold View Until Refreshed (`library.holdView`, off by default) keeps a photo that an edit or clock expiry made stop matching (a smart album, Picks, the filter bar) in the view until Refresh View, Reshuffle or another source, filter or sort, while newly matching photos enter at once || LR-LIB-SHARED-ALBUM | Shared albums | P2 | ⬜ | | needs a sharing service || LR-LIB-OFFLINE | Keep album offline | P2 | 🚫 | | not applicable: local-first library || LR-LIB-TARGET | Target album | P2 | ✅ | `cmd:album.setTarget`, `cmd:album.toggleTarget` | see LRC-LIB-COLLECTIONS |@@ -797,6 +797,7 @@ Latin stays upright. Advanced Japanese composition remains open. Regression cove## Revision history| Date | Change | Summary |+| 2026-10-24 | patch | LR-LIB-SMARTALBUM: relative-date view and source-count caches expire on the session-clock minute, including nested smart albums; held views retain expired photos until refresh and admit new matches; status and feature counts unchanged ||---|---|---|| 2026-10-22 | patch | LR-META-XMP: namespace URI determines ownership; foreign namespaces using recognized prefixes survive saves and cannot supply native settings or ratings; status and counts unchanged || 2026-10-22 | patch | LR-EXP-PSD, LR-META-EXIF-FULL: PSD/PSB imports and image resources 1058/1060 now supply EXIF and XMP to metadata readers and All Metadata; Original with Remove Location Info refuses detected PSD/PSB GPS; statuses and feature counts unchanged |diff --git a/docs/whats-new.md b/docs/whats-new.mdindex c09dddc09..f4c4c4fca 100644--- a/docs/whats-new.md+++ b/docs/whats-new.md@@ -1,5 +1,13 @@# What's new in LightCraft+## 2026-10-24++### Relative-date filters and smart albums follow the clock+- A current view or source count using “in the last” rules now refreshes when the session clock moves into a new+ minute, even when no catalog edit occurred. This fixes stale photos remaining in the grid and stale counts for+ direct or nested smart albums. Held views keep photos that expired until Refresh View while admitting photos that+ newly match; expiry itself does not create an undo step.+## 2026-10-23### Tab leaves the name field in New Album, New Smart Album and the name prompts