From 8fca8eb4f582197b7233541af5188e182976be65 Mon Sep 17 00:00:00 2001 From: Nathaniel Ledford Date: Wed, 28 Oct 2026 12:13:00 -0400 Subject: [PATCH 1/7] LRC-LIB-FOLDERS: Local's built-in places offer no Rename or Move MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Home, Pictures, Desktop and Downloads rows carry a translated label. Rename Folder… started its prompt with that label, so confirming it in German renamed ~/Pictures to ~/Bilder on disk, and Home was offered for rename at all. Local now lists no Rename Folder… or Move Folder To… on a built-in place; a folder kept with Browse Folder… still renames from its real name. --- crates/ui-egui/src/panels/left/folders.rs | 38 +++++---- crates/ui-egui/src/panels/left/local.rs | 60 ++++++++++++-- crates/ui-egui/tests/it/local_places.rs | 97 +++++++++++++++++++++++ crates/ui-egui/tests/it/main.rs | 1 + docs/parity-checklist.md | 5 +- docs/whats-new.md | 8 ++ 6 files changed, 185 insertions(+), 24 deletions(-) create mode 100644 crates/ui-egui/tests/it/local_places.rs diff --git a/crates/ui-egui/src/panels/left/folders.rs b/crates/ui-egui/src/panels/left/folders.rs index 20c1bbce1..15502d2f7 100644 --- a/crates/ui-egui/src/panels/left/folders.rs +++ b/crates/ui-egui/src/panels/left/folders.rs @@ -1,5 +1,5 @@ use super::albums::pointer_over_row; -use super::local::{same_folder, subfolders}; +use super::local::{is_builtin_place, same_folder, subfolders}; use super::rows::{INDENT_STEP, LIBFOLDER_REVEALED, Row, out_of_sight, set_tree_open, tree_open, tree_toggle}; use super::{Album, FolderNode, Icon, LibrarySource, LightcraftApp, Tokens, json, register, vec2}; @@ -69,22 +69,26 @@ pub(super) fn folder_tree( let _ = app.run("local.hide", json!({"path": path})); ui.close(); } - if ui.button(crate::i18n::tr("Rename Folder…")).clicked() { - app.ui.dialog = Some(crate::state::Dialog::TextPrompt { - title: crate::i18n::tr_format!("Rename “{name}”", name = name), - hint: "Folder name (renamed on disk; its photos follow)".into(), - value: name.to_string(), - command: "folder.rename".into(), - params: json!({"path": path}), - key: "name".into(), - }); - } - if app.services.pick_folder.is_some() && ui.button(crate::i18n::tr("Move Folder To…")).clicked() { - let into = app.services.pick_folder.as_mut().and_then(|f| f()); - if let Some(into) = into { - match app.run("folder.move", json!({"path": path, "into": into})) { - Ok(r) => app.toast(ui.ctx(), crate::i18n::tr_format!("Moved; {} photo(s) relinked", r["relinked"])), - Err(e) => app.toast(ui.ctx(), e), + // a built-in place is one of the computer's own folders under a translated label (Home is + // the user's whole home): Local offers no Rename or Move for it (the other items stay) + if !(indent == 0.0 && is_builtin_place(app, path)) { + if ui.button(crate::i18n::tr("Rename Folder…")).clicked() { + app.ui.dialog = Some(crate::state::Dialog::TextPrompt { + title: crate::i18n::tr_format!("Rename “{name}”", name = name), + hint: "Folder name (renamed on disk; its photos follow)".into(), + value: name.to_string(), + command: "folder.rename".into(), + params: json!({"path": path}), + key: "name".into(), + }); + } + if app.services.pick_folder.is_some() && ui.button(crate::i18n::tr("Move Folder To…")).clicked() { + let into = app.services.pick_folder.as_mut().and_then(|f| f()); + if let Some(into) = into { + match app.run("folder.move", json!({"path": path, "into": into})) { + Ok(r) => app.toast(ui.ctx(), crate::i18n::tr_format!("Moved; {} photo(s) relinked", r["relinked"])), + Err(e) => app.toast(ui.ctx(), e), + } } } } diff --git a/crates/ui-egui/src/panels/left/local.rs b/crates/ui-egui/src/panels/left/local.rs index 1308059c8..3963fe0ee 100644 --- a/crates/ui-egui/src/panels/left/local.rs +++ b/crates/ui-egui/src/panels/left/local.rs @@ -18,12 +18,10 @@ pub(super) fn local_now(app: &mut LightcraftApp, ui: &egui::Ui) -> Option Option