LightCraft: An open-source non-destructive photo editor written by scratch in pure Rust
Folders: round-4 review fixes (counts at the edge, edge-space names, smart albums)
Nathaniel Ledford198286e58976
diff --git a/crates/catalog/src/query.rs b/crates/catalog/src/query.rsindex 6f02b2286..ad14cd0ac 100644--- a/crates/catalog/src/query.rs+++ b/crates/catalog/src/query.rs@@ -223,7 +223,9 @@ impl Filter {/// [`Filter::library_folder`] as a folder identity ([`folder_key`]); `None` without a choice.fn library_root(&self) -> Option<String> {- self.library_folder.as_deref().map(str::trim).filter(|d| !d.is_empty()).map(folder_key)+ // as given: a folder may be named with spaces at its edge, and trimming would make it+ // another folder+ self.library_folder.as_deref().filter(|d| !d.trim().is_empty()).map(folder_key)}/// [`Filter::matches`] with the library folder already turned into its identity, so a query@@ -302,7 +304,7 @@ impl Filter {return false;}if let Some(root) = root- && !(!p.local && crate::local::folder_of(p).is_some_and(|f| key_within(&f, root)))+ && !photo_in_root(p, root){return false;}@@ -523,8 +525,30 @@ pub fn folder_within(path: &str, root: &str) -> bool {key_within(&folder_key(path), &folder_key(root))}+/// Whether a library photo (not one only browsed in Local) lies in the folder whose+/// [`folder_key`] is `root`. A plain POSIX path (no `\`, `.`, `..`, repeated or trailing+/// separators) is its own identity, so it is read without building a key for it: the check runs+/// for every photo of the library on each refresh, and this keeps it cheap.+pub(crate) fn photo_in_root(p: &Photo, root: &str) -> bool {+ if p.local {+ return false;+ }+ let crate::Source::File { path } = &p.source else { return false };+ let plain = path.starts_with('/')+ && !path.starts_with("//")+ && !path.ends_with('/')+ && !path.contains(['\\'])+ && !path.contains("//")+ && !path.contains("/.");+ if !cfg!(windows) && plain && root.starts_with('/') && !root.starts_with("//") {+ let r = root.trim_end_matches('/');+ return path.strip_prefix(r).is_some_and(|rest| rest.starts_with('/'));+ }+ crate::local::folder_of(p).is_some_and(|f| key_within(&f, root))+}+/// [`folder_within`] for two paths already turned into their [`folder_key`].-fn key_within(p: &str, r: &str) -> bool {+pub(crate) fn key_within(p: &str, r: &str) -> bool {// `.` or `a/..` name no folder: not "everything"if r.is_empty() {return false;diff --git a/crates/catalog/src/tests_folders.rs b/crates/catalog/src/tests_folders.rsindex 1a5a6128e..556f77def 100644--- a/crates/catalog/src/tests_folders.rs+++ b/crates/catalog/src/tests_folders.rs@@ -344,3 +344,61 @@ fn disk_roots_are_told_from_folders() {}assert!(is_startup_disk("/") && is_startup_disk("//") && !is_startup_disk("/Volumes/nas") && !is_startup_disk("C:"));}++#[test]+fn a_folder_name_with_spaces_at_its_edge_is_its_own_folder() {+ // legal on macOS and Linux: `/p/shoot ` is not `/p/shoot`+ let c = library(&["/p/shoot /a.jpg", "/p/shoot/b.jpg", "/p/other/c.jpg"]);+ let tree = c.folder_tree();+ let shoot_space = find(&tree, "/p/shoot ").expect("its own row");+ let shoot = find(&tree, "/p/shoot").expect("and the other");+ for (node, want) in [(shoot_space, "a.jpg"), (shoot, "b.jpg")] {+ let f = Filter { library_folder: Some(node.path.clone()), ..Default::default() };+ let ids = c.query(&f, &Sort::default());+ let names: Vec<&str> = ids.iter().filter_map(|id| c.photo(*id)).map(|p| p.file_name.as_str()).collect();+ assert_eq!(names, [want], "{:?} shows its own photo", node.path);+ }+}++#[test]+fn a_local_photo_never_counts_as_imported_even_when_a_disk_folder_is_also_shown() {+ let mut c = Catalog::new();+ let browsed = add_with(&mut c, "/pics/trip/b.jpg", |p| p.local = true);+ let f = Filter { folder: Some("/pics/trip".into()), library_folder: Some("/pics/trip".into()), ..Default::default() };+ assert!(!f.matches(c.photo(browsed).unwrap(), &c));+}++#[test]+fn the_quick_check_agrees_with_the_careful_one() {+ use crate::query::{folder_key, key_within, photo_in_root};+ let paths = [+ "/a/b/c.jpg",+ "/a/b/d/e.jpg",+ "/a/bc/x.jpg",+ "/a/./b/x.jpg",+ "/a/../a/b/x.jpg",+ "/a//b/x.jpg",+ "/a\\b\\x.jpg",+ "/a/b ",+ "/a/b /x.jpg",+ "/.hidden/x.jpg",+ "/a/.b/x.jpg",+ "/x.jpg",+ "//srv/share/x.jpg",+ "C:\\a\\b\\x.jpg",+ "relative/a/b/x.jpg",+ "/Volumes/tokyo/a/x.jpg",+ "/日本/写真/x.jpg",+ ];+ let roots = ["/", "/a", "/a/b", "/a/b/", "/a/bc", "/a/b ", "/Volumes/tokyo", "//srv/share", "C:\\a", "/日本", "relative", "/a/../a/b"];+ for p in paths {+ let mut c = Catalog::new();+ let id = add(&mut c, p);+ let photo = c.photo(id).unwrap();+ for r in roots {+ let root = folder_key(r);+ let slow = crate::local::folder_of(photo).is_some_and(|f| key_within(&f, &root));+ assert_eq!(photo_in_root(photo, &root), slow, "{p:?} in {r:?}");+ }+ }+}diff --git a/crates/engine/src/cmd/library.rs b/crates/engine/src/cmd/library.rsindex 9c374942c..b16aa9fab 100644--- a/crates/engine/src/cmd/library.rs+++ b/crates/engine/src/cmd/library.rs@@ -269,7 +269,7 @@ pub fn specs() -> Vec<CommandSpec> {LibrarySource::Album(a)}"libraryFolder" => {- let path = str_param(p, "path").map(str::trim).filter(|d| !lightcraft_catalog::query::folder_key(d).is_empty());+ let path = str_param(p, "path").filter(|d| !d.trim().is_empty() && !lightcraft_catalog::query::folder_key(d).is_empty());let path = path.ok_or_else(|| bad("library.source", "libraryFolder needs the `path` of a folder from library.folders"))?;if lightcraft_catalog::folders::is_startup_disk(path) {return Err(bad("library.source", "the startup disk's path covers every disk: choose a folder in it"));@@ -307,6 +307,9 @@ pub fn specs() -> Vec<CommandSpec> {let mut v = serde_json::to_value(&s.filter).unwrap_or_default();lightcraft_develop::presets::deep_merge(&mut v, p);let f: Filter = serde_json::from_value(v).map_err(|e| bad("library.filter", e.to_string()))?;+ let mut f = f;+ // a blank folder is no folder: no hidden "filters active" state+ f.library_folder = f.library_folder.filter(|d| !d.trim().is_empty());if f.library_folder.is_some() && s.source == LibrarySource::LibraryFolder {return Err(bad("library.filter", "a folder is already shown (library.source): show another source first"));}@@ -332,7 +335,7 @@ pub fn specs() -> Vec<CommandSpec> {always,|s, p| {const C: &str = "library.removeFolder";- let path = str_param(p, "path").map(str::trim).filter(|d| !d.is_empty()).ok_or_else(|| bad(C, "missing `path`"))?;+ let path = str_param(p, "path").filter(|d| !d.trim().is_empty()).ok_or_else(|| bad(C, "missing `path`"))?;if lightcraft_catalog::query::folder_key(path).is_empty() {return Err(bad(C, format!("{path}: not a folder")));}@@ -801,8 +804,16 @@ pub fn specs() -> Vec<CommandSpec> {let rules = if bool_or(p, "fromView", false) {view_rules(s)} else {- let base = if bool_or(p, "replace", false) { Default::default() } else { cur };- merge_rules(&base, p.get("rules").unwrap_or(&Value::Null), "album.setRules")?+ let replace = bool_or(p, "replace", false);+ let folder = cur.library_folder.clone();+ let base = if replace { Default::default() } else { cur };+ let mut r = merge_rules(&base, p.get("rules").unwrap_or(&Value::Null), "album.setRules")?;+ // the rules dialog has no folder field: replacing its rules keeps the folder+ // unless the call says (`libraryFolder: null`) to drop it+ if replace && p.get("rules").and_then(|r| r.get("libraryFolder")).is_none() {+ r.library_folder = folder;+ }+ r};s.commit("Edit Smart Album", Op::SetAlbumRules { id, rules: Box::new(rules) })?;Ok(json!({"count": s.catalog.album_count(id)}))diff --git a/crates/engine/src/cmd/query.rs b/crates/engine/src/cmd/query.rsindex 9b0777b37..3fcb68a56 100644--- a/crates/engine/src/cmd/query.rs+++ b/crates/engine/src/cmd/query.rs@@ -88,7 +88,7 @@ pub fn specs() -> Vec<CommandSpec> {let n = s.visible().len();Ok(json!({"source": s.source,- "libraryFolder": s.library_folder,+ "libraryFolder": s.library_folder.as_ref().filter(|_| s.source == LibrarySource::LibraryFolder),"sourceLabel": label,"filter": s.filter,"sort": s.sort,diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rsindex 97cda1080..10fd86455 100644--- a/crates/engine/src/lib.rs+++ b/crates/engine/src/lib.rs@@ -615,6 +615,13 @@ impl Session {f.library_folder = Some(self.library_folder.clone().unwrap_or_else(|| ".".into()));}let mut visible = self.catalog.query(&f, &self.sort);+ if visible.is_empty() && self.source == LibrarySource::LibraryFolder && !self.folder_holds_photos() {+ // the shown folder lost its last photo (deleted, moved, removed): everything, not+ // an empty grid under the name of a folder that is gone from the sidebar+ self.source = LibrarySource::All;+ self.library_folder = None;+ return self.visible();+ }if matches!(self.source, LibrarySource::Album(_))&& self.sort.key == lightcraft_catalog::SortKey::CaptureDate&& let LibrarySource::Album(a) = self.source@@ -651,6 +658,13 @@ impl Session {&self.visible}+ /// Whether the library still holds a photo imported from the folder a `LibraryFolder` source+ /// shows.+ fn folder_holds_photos(&self) -> bool {+ let f = Filter { library_folder: self.library_folder.clone(), ..Default::default() };+ self.library_folder.is_some() && !self.catalog.query(&f, &Sort::default()).is_empty()+ }+/// Photos in the current source (folder, album, …) before the filter bar and search narrow/// them; `None` where that is not a separate number (Missing Photos).pub fn source_total(&mut self) -> Option<usize> {diff --git a/crates/engine/src/library.rs b/crates/engine/src/library.rsindex ef1c1e368..3d24ae247 100644--- a/crates/engine/src/library.rs+++ b/crates/engine/src/library.rs@@ -516,7 +516,8 @@ impl Session {let view = ViewFile {source: self.source,browse: self.browse.clone(),- library_folder: self.library_folder.clone(),+ // only while it is shown: a leftover would be a stale choice nobody made+ library_folder: self.library_folder.clone().filter(|_| self.source == LibrarySource::LibraryFolder),sort: self.sort,selection: self.selection.clone(),};diff --git a/crates/engine/src/tests_folders.rs b/crates/engine/src/tests_folders.rsindex 5bd6a9a20..6dd5fe22b 100644--- a/crates/engine/src/tests_folders.rs+++ b/crates/engine/src/tests_folders.rs@@ -344,12 +344,13 @@ fn a_folder_source_and_a_folder_filter_never_disagree() {}#[test]-fn a_folder_source_with_no_folder_shows_nothing() {+fn a_folder_source_with_no_folder_falls_back_to_all_photos() {let mut s = session();s.source = LibrarySource::LibraryFolder;s.library_folder = None;- assert_eq!(s.visible().len(), 0, "not everything");- assert_eq!(s.source_total(), Some(0));+ assert_eq!(s.visible().len(), 3, "everything, not an empty grid under no name");+ assert_eq!((s.source, s.library_folder.as_deref()), (LibrarySource::All, None));+ assert_eq!(s.source_total(), Some(3));}#[test]@@ -377,3 +378,73 @@ fn removing_a_folder_above_a_disk_needs_asking_by_name_even_with_one_disk() {assert_eq!(s.execute("library.removeFolder", &json!({"path": "/Volumes/nas/a"})).unwrap()["removed"], 1, "a folder on the disk is just a folder");assert_eq!(s.visible().len(), 1);}++#[test]+fn a_folder_name_with_spaces_at_its_edge_is_never_mistaken_for_its_neighbour() {+ let mut s = Session::new();+ for p in ["/p/shoot /a.jpg", "/p/shoot/b.jpg", "/p/other/c.jpg"] {+ add(&mut s, p);+ }+ assert_eq!(source_folder(&mut s, "/p/shoot ")["count"], 1);+ let shown: Vec<String> = s.visible().to_vec().iter().filter_map(|id| s.catalog.photo(*id)).map(|p| p.file_name.clone()).collect();+ assert_eq!(s.library_folder.as_deref(), Some("/p/shoot "), "kept as the tree gave it");+ assert_eq!(shown.len(), 1);+ let before: Vec<_> = s.catalog.photos().filter(|p| p.deleted).map(|p| p.id).collect();+ assert!(before.is_empty());+ let r = s.execute("library.removeFolder", &json!({"path": "/p/shoot "})).unwrap();+ assert_eq!(r["removed"], 1);+ let gone: Vec<String> = s+ .catalog+ .photos()+ .filter(|p| p.deleted)+ .map(|p| match &p.source {+ Source::File { path } => path.clone(),+ Source::Demo { .. } => String::new(),+ })+ .collect();+ assert_eq!(gone, ["/p/shoot /a.jpg"], "the folder named, not its neighbour");+}++#[test]+fn editing_a_smart_album_made_from_a_folder_view_keeps_the_folder() {+ let mut s = session();+ source_folder(&mut s, "/pics/trip");+ let r = s.execute("album.createSmart", &json!({"name": "Trip"})).unwrap();+ let id = r["id"].as_u64().unwrap();+ // the rules dialog saves what it shows (no folder field) with `replace`+ let r = s.execute("album.setRules", &json!({"id": id, "replace": true, "rules": {"ruleSet": {"rules": []}}})).unwrap();+ assert_eq!(r["count"], 2, "the folder is not something the dialog can show, so it is kept: {r}");+ let r = s.execute("album.setRules", &json!({"id": id, "replace": true, "rules": {"libraryFolder": null}})).unwrap();+ assert_eq!(r["count"], 3, "and can be dropped on purpose");+}++#[test]+fn a_shown_folder_that_loses_its_last_photo_gives_way_to_all_photos() {+ let mut s = session();+ source_folder(&mut s, "/pics/home");+ s.execute("photo.delete", &json!({})).unwrap();+ assert_eq!(s.visible().len(), 2, "back to everything that is left");+ assert_eq!((s.source, s.library_folder.as_deref()), (LibrarySource::All, None));+ // a folder whose photos are only hidden by the filter bar stays+ let mut s = session();+ source_folder(&mut s, "/pics/trip");+ s.execute("library.filter", &json!({"rating": 5})).unwrap();+ assert_eq!(s.visible().len(), 0);+ assert_eq!(s.source, LibrarySource::LibraryFolder, "the filters hide them, the folder is still there");+}++#[test]+fn the_state_names_a_folder_only_while_it_is_shown() {+ let mut s = session();+ source_folder(&mut s, "/pics/trip");+ assert_eq!(s.execute("library.state", &json!({})).unwrap()["libraryFolder"], "/pics/trip");+ s.execute("library.source", &json!({"kind": "all"})).unwrap();+ assert!(s.execute("library.state", &json!({})).unwrap()["libraryFolder"].is_null(), "not a stale leftover");+}++#[test]+fn a_blank_folder_filter_is_no_filter() {+ let mut s = session();+ s.execute("library.filter", &json!({"libraryFolder": " "})).unwrap();+ assert_eq!(s.filter, lightcraft_catalog::Filter::default(), "no hidden 'filters active' state");+}diff --git a/crates/ui-egui/src/panels/dialogs.rs b/crates/ui-egui/src/panels/dialogs.rsindex 4e71684e4..8f1660d05 100644--- a/crates/ui-egui/src/panels/dialogs.rs+++ b/crates/ui-egui/src/panels/dialogs.rs@@ -222,7 +222,7 @@ pub fn show(app: &mut LightcraftApp, ctx: &egui::Context) {}});}- Dialog::SmartRules { name, rules, .. } => {+ Dialog::SmartRules { id, name, rules } => {let r = ui.add(egui::TextEdit::singleline(name).hint_text(crate::i18n::tr("Name")).desired_width(f32::INFINITY));crate::widgets::register(ui.ctx(), "field:smartName", r.rect);ui.add_space(6.0);@@ -230,7 +230,9 @@ pub fn show(app: &mut LightcraftApp, ctx: &egui::Context) {crate::panels::rules_editor::edit(ui, rules, "rules", 0);});let problems = rules.problems();- let f = lightcraft_catalog::Filter { rule_set: Some(rules.clone()), ..Default::default() };+ // the folder an album made from a folder view carries is not in the editor, but it counts+ let folder = id.and_then(|id| app.session.catalog.album(lightcraft_catalog::AlbumId(id))).and_then(|a| a.smart.as_deref().and_then(|f| f.library_folder.clone()));+ let f = lightcraft_catalog::Filter { rule_set: Some(rules.clone()), library_folder: folder, ..Default::default() };let n = if problems.is_empty() { app.session.catalog.query(&f, &Default::default()).len() } else { 0 };ui.add_space(4.0);ui.label(diff --git a/crates/ui-egui/src/panels/left.rs b/crates/ui-egui/src/panels/left.rsindex dfab97282..3e98e2d79 100644--- a/crates/ui-egui/src/panels/left.rs+++ b/crates/ui-egui/src/panels/left.rs@@ -81,8 +81,18 @@ fn row_named();let mut needed = label_rect.right() - r.left() + 18.0;if let Some(n) = count.filter(|_| app.ui.show_counts) {- let c = ui.painter().text(pos2(r.right() - 18.0, r.center().y), Align2::RIGHT_CENTER, n.to_string(), t.font(12.5), t.text_dim);- needed += c.width() + 16.0;+ // the count stays at the visible edge when the sidebar is scrolled sideways+ let visible_right: f32 = ui.data(|d| d.get_temp(egui::Id::new("left-visible-right"))).unwrap_or(f32::MAX);+ let galley = ui.painter().layout_no_wrap(n.to_string(), t.font(12.5), t.text_dim);+ let right = r.right().min(visible_right) - 18.0;+ let rect = Rect::from_min_size(pos2(right - galley.size().x, r.center().y - galley.size().y / 2.0), galley.size());+ if label_rect.right() + 6.0 > rect.left() {+ // a long name runs under it: the count gets the row's colour behind it+ ui.painter().rect_filled(rect.expand2(vec2(6.0, 2.0)), 3.0, if selected { t.canvas } else { t.chrome });+ }+ ui.painter().galley(rect.min, galley, t.text_dim);+ register(ui.ctx(), format!("count:{id}"), rect);+ needed += rect.width() + 16.0;}note_width(ui, needed);let _ = app;@@ -129,7 +139,11 @@ pub fn show(app: &mut LightcraftApp, ui: &mut egui::Ui) {let wide = viewport.width().max(content_width(ui.ctx()));ui.set_min_width(wide);ui.set_max_width(wide);- ui.data_mut(|d| d.insert_temp(egui::Id::new("left-content-width-next"), 0.0f32));+ ui.data_mut(|d| {+ d.insert_temp(egui::Id::new("left-content-width-next"), 0.0f32);+ // where the visible part of the content ends (screen x), for what stays at the edge+ d.insert_temp(egui::Id::new("left-visible-right"), ui.cursor().left() + viewport.max.x);+ });let src = app.session.source;for (id, icon, label, count, s) in [("all", Icon::Photos, "All Photos", Some(total), LibrarySource::All),diff --git a/crates/ui-egui/src/tests_panels.rs b/crates/ui-egui/src/tests_panels.rsindex 0396a0f35..a8a65e624 100644--- a/crates/ui-egui/src/tests_panels.rs+++ b/crates/ui-egui/src/tests_panels.rs@@ -235,7 +235,7 @@ fn click(h: &mut Headless, id: &str) {/// Photos imported from two folders: the sidebar's Folders section lists them, choosing one/// fills the grid with its photos, and All Photos shows everything again.#[test]-fn folders_section_lists_where_photos_were_imported_from_and_narrows_the_grid() {+fn folders_section_lists_where_photos_were_imported_from_and_fills_the_grid() {let mut h = folders_app(&["/pics/trip/a.jpg", "/pics/trip/b.jpg", "/pics/home/c.jpg"]);// the disk's row starts open; the folders inside a folder stay folded until it is openedassert!(has(&h, "source:libfolder:/pics"), "the Folders section lists the library's folders");@@ -445,6 +445,11 @@ fn a_deep_chain_keeps_its_nesting_and_the_sidebar_scrolls_sideways() {assert!(xs.len() == 13 && xs.windows(2).all(|w| (w[1] - w[0] - 16.0).abs() < 0.5), "every level steps right by one indent: {xs:?}");let panel = widget(&h, "panel:left_panel");assert!(crate::panels::left::content_width(&h.view.ctx) > panel.width(), "the content is wider than the panel: the bar appears");+ assert!(widget(&h, "source:all").width() > panel.width(), "the rows are as wide as the widest one, so there is something to scroll to");+ // counts stay where you can read them, at the visible edge, however wide the rows are+ for id in ["count:all", "count:picks", "count:recentlyDeleted", "count:libfolder:/a"] {+ assert!(widget(&h, id).right() <= panel.right(), "{id} stays inside the panel");+ }// what a row needs is known before it is drawn off screen, so the plus stays reachableassert!(widget(&h, "icon:albumNew").right() <= panel.right(), "Create Album stays inside the visible panel");// a click in the middle of a deep row chooses it; only the little triangle folds it@@ -457,7 +462,9 @@ fn a_deep_chain_keeps_its_nesting_and_the_sidebar_scrolls_sideways() {fn a_sidebar_that_fits_does_not_scroll_sideways() {let h = folders_app(&["/pics/trip/a.jpg", "/pics/home/b.jpg"]);let panel = widget(&h, "panel:left_panel");- assert!(crate::panels::left::content_width(&h.view.ctx) <= panel.width(), "no horizontal bar for a shallow tree");+ let w = crate::panels::left::content_width(&h.view.ctx);+ assert!(w > 0.0 && w <= panel.width(), "rows were measured and fit: no horizontal bar ({w} vs {})", panel.width());+ assert!((widget(&h, "source:all").width() - (panel.width() - 0.0)).abs() < 24.0, "rows are as wide as the panel");}/// A long folder name is trimmed before it can run under the photo count.diff --git a/docs/parity.md b/docs/parity.mdindex ce312087e..d8b90a3cc 100644--- a/docs/parity.md+++ b/docs/parity.md@@ -718,7 +718,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-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; 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`) || 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`, `crates/catalog/src/folders.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/<host>`), NFS (`/Network/Servers/<host>`), 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: 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 stays at the visible edge); the grid title is cut with the full name on hover; 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. 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…, Show in Finder (on disk, photos relinked, as in Local) and Remove from Library… (asks; moves the folder's photos to Recently Deleted, one undo step, no file touched); a disk row offers 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); creating a folder and moving photos between folders are not here |+| 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`, `crates/catalog/src/folders.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/<host>`), NFS (`/Network/Servers/<host>`), 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: 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); the grid title is cut with the full name on hover; 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…, Show in Finder (on disk, photos relinked, as in Local) and Remove from Library… (asks; moves the folder's photos to Recently Deleted, one undo step, no file touched); a disk row offers 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); creating a folder and moving photos between folders are not here || 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/panels/rules_editor.rs` | rule editor: match all / any / none, nested groups (⌥+ or + Group), 30 fields (rating, flag, label, type, edits, keywords, any text, filename, file path, format, title, caption, camera, lens, location, creator, copyright, copyright status, capture / import / edit date, ISO, aperture, focal length, megapixels, GPS, virtual copy, album) with text / number / date / in-the-last operators; live match count; also usable as a library filter (`ruleSet`) || LRC-LIB-PUBLISH | Publish services | P2 | ⬜ | | |