LightCraft: An open-source non-destructive photo editor written by scratch in pure Rust
LR-LIB-LABEL: colour-label menus, Info swatches, grid label dots and editable label names
Brandon Thomasf471b7780093
diff --git a/crates/catalog/src/lib.rs b/crates/catalog/src/lib.rsindex 9eb55beab..a32568486 100644--- a/crates/catalog/src/lib.rs+++ b/crates/catalog/src/lib.rs@@ -149,6 +149,11 @@ pub enum Op {file_name: String,source: Source,},+ /// The name shown for a colour label (`None` = its colour's name).+ SetLabelName {+ label: ColorLabel,+ name: Option<String>,+ },/// Several ops as one step (undo applies the inverses in reverse).Batch {ops: Vec<Op>,@@ -165,6 +170,9 @@ pub struct Catalog {stacks: BTreeMap<StackId, Stack>,#[serde(default)]next_stack: u64,+ /// Custom colour label names.+ #[serde(default, skip_serializing_if = "BTreeMap::is_empty")]+ label_names: BTreeMap<ColorLabel, String>,/// Increments on every applied op.#[serde(skip)]pub revision: u64,@@ -260,6 +268,15 @@ impl Catalog {Ok(())}+ /// The name of a colour label: its custom name, else the colour (`Red`).+ pub fn label_name(&self, l: ColorLabel) -> String {+ self.label_names.get(&l).cloned().unwrap_or_else(|| format!("{l:?}"))+ }+ /// The custom name of a colour label, if any.+ pub fn custom_label_name(&self, l: ColorLabel) -> Option<&str> {+ self.label_names.get(&l).map(String::as_str)+ }+// ---- writesfn photo_mut(&mut self, id: PhotoId) -> Result<&mut Photo> {@@ -450,6 +467,14 @@ impl Catalog {let old_name = std::mem::replace(&mut p.file_name, file_name);Op::SetFile { id, file_name: old_name, source: std::mem::replace(&mut p.source, source) }}+ Op::SetLabelName { label, name } => {+ let name = name.map(|n| n.trim().to_string()).filter(|n| !n.is_empty());+ let old = match name {+ Some(n) => self.label_names.insert(label, n),+ None => self.label_names.remove(&label),+ };+ Op::SetLabelName { label, name: old }+ }Op::Batch { ops } => {let mut inverses = Vec::with_capacity(ops.len());for op in ops {diff --git a/crates/catalog/src/model.rs b/crates/catalog/src/model.rsindex 5d4f46d9c..f437ba4d5 100644--- a/crates/catalog/src/model.rs+++ b/crates/catalog/src/model.rs@@ -66,7 +66,7 @@ impl Flag {}}-#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]+#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)]#[serde(rename_all = "lowercase")]pub enum ColorLabel {Red,diff --git a/crates/catalog/src/tests_journal.rs b/crates/catalog/src/tests_journal.rsindex 3c6f1ef71..5fa4ecf42 100644--- a/crates/catalog/src/tests_journal.rs+++ b/crates/catalog/src/tests_journal.rs@@ -67,6 +67,7 @@ fn op_for(c: &mut Catalog, kind: u8, a: u8, b: u8) -> Op {}13 => Op::Batch { ops: c.remove_from_stacks_ops(&[pid]) },14 => c.set_top_ops(pid).unwrap_or(Op::Batch { ops: vec![] }),+ 9 if b.is_multiple_of(5) => Op::SetLabelName { label: ColorLabel::ALL[a as usize % 5], name: (a % 3 != 1).then(|| format!("Label {b}")) },9 if b.is_multiple_of(2) => {Op::SetFile { id: pid, file_name: format!("Renamed_{b}.jpg"), source: Source::File { path: format!("/p/Renamed_{b}.jpg") } }}diff --git a/crates/engine/src/cmd/manage.rs b/crates/engine/src/cmd/manage.rsindex ab5809358..7603fca6e 100644--- a/crates/engine/src/cmd/manage.rs+++ b/crates/engine/src/cmd/manage.rs@@ -2,9 +2,9 @@use serde_json::{Value, json};-use lightcraft_catalog::Op;+use lightcraft_catalog::{ColorLabel, Op};-use super::{CommandSpec, bad, bool_or, cmd, f64_or, has_selection, str_param};+use super::{CommandSpec, always, bad, bool_or, cmd, f64_or, has_selection, str_param};use crate::Result;fn rename_args(s: &crate::Session, p: &Value, c: &str) -> Result<(Vec<lightcraft_catalog::PhotoId>, String, usize)> {@@ -81,5 +81,36 @@ pub fn specs() -> Vec<CommandSpec> {Ok(json!({"changed": n, "captured": out}))}),+ cmd!(query "label.names", "Color Label Names", [], None, "{} → [{label, name, custom}]", always, |s, _| {+ Ok(json!(ColorLabel::ALL+ .iter()+ .map(|l| json!({"label": format!("{l:?}").to_lowercase(), "name": s.catalog.label_name(*l), "custom": s.catalog.custom_label_name(*l)}))+ .collect::<Vec<_>>()))+ }),+ cmd!(+ "label.setNames",+ "Edit Color Label Names",+ [],+ None,+ "{names: {red?: name|null, yellow?, green?, blue?, purple?}} — null or empty restores the colour's name",+ always,+ |s, p| {+ let names = p.get("names").and_then(Value::as_object).ok_or_else(|| bad("label.setNames", "missing `names`"))?;+ let mut ops = Vec::new();+ for (k, v) in names {+ let label = ColorLabel::parse(k).ok_or_else(|| bad("label.setNames", format!("unknown label `{k}`")))?;+ let name =+ v.as_str().map(str::trim).filter(|n| !n.is_empty() && !n.eq_ignore_ascii_case(&format!("{label:?}"))).map(str::to_string);+ if s.catalog.custom_label_name(label) != name.as_deref() {+ ops.push(Op::SetLabelName { label, name });+ }+ }+ let n = ops.len();+ if n > 0 {+ s.commit("Edit Label Names", Op::Batch { ops })?;+ }+ Ok(json!({"changed": n}))+ }+ ),]}diff --git a/crates/engine/src/tests_libops.rs b/crates/engine/src/tests_libops.rsindex 28d1c29e1..4578038aa 100644--- a/crates/engine/src/tests_libops.rs+++ b/crates/engine/src/tests_libops.rs@@ -232,3 +232,29 @@ fn capture_time_set_shift_undo_and_replay() {assert_eq!(s.catalog.to_snapshot(), expect);let _ = std::fs::remove_dir_all(&dir);}++/// Colour label names: one undo step, journaled; a colour's own name or empty resets it.+#[test]+fn label_names_set_undo_and_replay() {+ let dir = temp_dir("labels");+ let mut s = Session::new();+ s.open_library(&dir, true).unwrap();+ let r = s.execute("label.setNames", &json!({"names": {"red": "Reject later", "green": "Approved", "blue": " "}})).unwrap();+ assert_eq!(r["changed"], 2);+ let names = s.execute("label.names", &json!({})).unwrap();+ assert_eq!(names[0], json!({"label": "red", "name": "Reject later", "custom": "Reject later"}));+ assert_eq!(names[3]["name"], "Blue");+ assert_eq!(names[3]["custom"], json!(null));+ s.execute("label.setNames", &json!({"names": {"red": "red"}})).unwrap();+ assert_eq!(s.catalog.label_name(lightcraft_catalog::ColorLabel::Red), "Red", "the colour's own name resets");+ s.execute("edit.undo", &json!({})).unwrap();+ assert_eq!(s.catalog.label_name(lightcraft_catalog::ColorLabel::Red), "Reject later");+ assert!(s.execute("label.setNames", &json!({"names": {"orange": "x"}})).is_err());+ let expect = s.catalog.to_snapshot();+ drop(s);+ let mut s = Session::new();+ s.open_library(&dir, false).unwrap();+ assert_eq!(s.catalog.to_snapshot(), expect);+ assert_eq!(s.catalog.label_name(lightcraft_catalog::ColorLabel::Green), "Approved");+ let _ = std::fs::remove_dir_all(&dir);+}diff --git a/crates/ui-egui/src/headless.rs b/crates/ui-egui/src/headless.rsindex 2ad9daabc..147f3da70 100644--- a/crates/ui-egui/src/headless.rs+++ b/crates/ui-egui/src/headless.rs@@ -482,6 +482,34 @@ mod tests {h.settle(SETTLE);}+ /// Colour labels: Info-panel swatches set/clear the label, the names dialog renames them and+ /// the Photo menu shows the names.+ #[test]+ fn label_swatches_and_names() {+ let mut h = demo([1200.0, 900.0]);+ let t = Duration::from_secs(10);+ let id = h.app.session.visible_cloned()[0];+ h.request("engine.execute", json!({"command": "library.select", "params": {"ids": [id.0]}}), t);+ h.request("ui.set", json!({"view": "detail", "right": "info"}), t);+ let r = h.request("ui.clickWidget", json!({"id": "label:green"}), t);+ assert_eq!(r["ok"], true, "{r}");+ assert_eq!(h.app.session.catalog.photo(id).unwrap().label, Some(lightcraft_catalog::ColorLabel::Green));+ h.request("engine.execute", json!({"command": "dialog.labelNames"}), t);+ if let Some(crate::state::Dialog::LabelNames { names }) = &mut h.app.ui.dialog {+ names[2] = "Approved".into();+ } else {+ panic!("no dialog");+ }+ h.settle(SETTLE);+ let r = h.request("ui.dialog.confirm", json!({}), t);+ assert_eq!(r["ok"], true, "{r}");+ let tree = h.request("ui.menu.tree", json!({}), t).to_string();+ assert!(tree.contains("Approved (Green)"), "menu shows the name");+ h.request("ui.clickWidget", json!({"id": "label:green"}), t);+ assert_eq!(h.app.session.catalog.photo(id).unwrap().label, None, "clicking the current label clears it");+ h.settle(SETTLE);+ }+#[test]fn screenshot_request_is_answered_without_a_window() {let mut h = demo([800.0, 500.0]);diff --git a/crates/ui-egui/src/menubar.rs b/crates/ui-egui/src/menubar.rsindex 7b35effe3..9626c1efb 100644--- a/crates/ui-egui/src/menubar.rs+++ b/crates/ui-egui/src/menubar.rs@@ -260,10 +260,14 @@ fn expanded(app: &LightcraftApp, name: &str) -> Option<Vec<MenuNode>> {.zip([Some("6"), Some("7"), Some("8"), Some("9"), None]).map(|(l, sc)| {let name = format!("{l:?}");+ let label = match app.session.catalog.custom_label_name(*l) {+ Some(custom) => format!("{custom} ({name})"),+ None => name.clone(),+ };item("photo.label",json!({"label": name.to_lowercase()}),- name,+ label,sc,has,Some(active.as_ref().is_some_and(|p| p.label == Some(*l))),@@ -272,6 +276,8 @@ fn expanded(app: &LightcraftApp, name: &str) -> Option<Vec<MenuNode>> {.collect();v.push(MenuNode::Separator);v.push(item("photo.label", json!({"label": "none"}), "None", None, has, Some(active.as_ref().is_some_and(|p| p.label.is_none()))));+ v.push(MenuNode::Separator);+ v.push(item("dialog.labelNames", Value::Null, "Edit Label Names…", None, true, None));v}"Sort" => {diff --git a/crates/ui-egui/src/menus.rs b/crates/ui-egui/src/menus.rsindex 1977c0608..2307a4250 100644--- a/crates/ui-egui/src/menus.rs+++ b/crates/ui-egui/src/menus.rs@@ -77,6 +77,7 @@ pub const UI_COMMANDS: &[UiCommand] = &[("app.export", "Export Now", None, ""),("app.showInFinder", "Show in Finder", Some("Cmd+R"), "Photo"),("dialog.rename", "Rename Photos…", None, "Photo"),+ ("dialog.labelNames", "Edit Color Label Names…", None, ""),("dialog.captureTime", "Edit Capture Time…", None, "Photo"),("app.exportPrevious", "Export with Previous", Some("Cmd+Alt+Shift+E"), "File"),];@@ -338,6 +339,12 @@ pub fn run_ui_command(app: &mut LightcraftApp, id: &str, p: &Value) -> Option<ReSome(Dialog::CaptureTime { mode, time: time.get(..19).unwrap_or(&time).to_string(), days: 0, hours: 0, minutes: 0, zone: 0.0 });Ok(Value::Null)}+ "dialog.labelNames" => {+ let names =+ lightcraft_catalog::ColorLabel::ALL.iter().map(|l| app.session.catalog.custom_label_name(*l).unwrap_or("").to_string()).collect();+ app.ui.dialog = Some(Dialog::LabelNames { names });+ Ok(Value::Null)+ }"dialog.rename" => {let template = p.get("template").and_then(Value::as_str).unwrap_or("{name}").to_string();app.ui.dialog = Some(Dialog::Rename { template, start: p.get("start").and_then(Value::as_u64).unwrap_or(1) as u32 });diff --git a/crates/ui-egui/src/panels/dialogs.rs b/crates/ui-egui/src/panels/dialogs.rsindex f3ac500ee..cd3aaa503 100644--- a/crates/ui-egui/src/panels/dialogs.rs+++ b/crates/ui-egui/src/panels/dialogs.rs@@ -23,6 +23,7 @@ pub fn show(app: &mut LightcraftApp, ctx: &egui::Context) {Dialog::NewAlbum { .. } => "Create Album",Dialog::RenameAlbum { .. } => "Rename Album",Dialog::Rename { .. } => "Rename Photos",+ Dialog::LabelNames { .. } => "Edit Color Label Names",Dialog::CaptureTime { .. } => "Edit Capture Time",Dialog::RenameKeyword { .. } => "Rename Keyword",Dialog::MergeKeywords { .. } => "Merge Keywords",@@ -127,6 +128,19 @@ pub fn show(app: &mut LightcraftApp, ctx: &egui::Context) {ui.label(egui::RichText::new(format!("All {n} selected photos move by the same amount.")).color(t.text_dim));}}+ Dialog::LabelNames { names } => {+ names.resize(5, String::new());+ for (i, l) in lightcraft_catalog::ColorLabel::ALL.iter().enumerate() {+ let colour = format!("{l:?}");+ field(ui, &colour, |ui| {+ let (r, _) = ui.allocate_exact_size(egui::vec2(14.0, 14.0), egui::Sense::hover());+ ui.painter().circle_filled(r.center(), 6.0, crate::panels::grid::label_color(*l));+ let te = ui.add(egui::TextEdit::singleline(&mut names[i]).hint_text(colour.as_str()).desired_width(f32::INFINITY));+ crate::widgets::register(ui.ctx(), format!("field:labelName-{}", colour.to_lowercase()), te.rect);+ });+ }+ ui.label(egui::RichText::new("Names appear in the label menu, the filter bar and the Info panel. Empty = the colour's name.").color(t.text_dim));+ }Dialog::Rename { template, start } => {let n = app.session.targets(&json!({})).len();ui.label(egui::RichText::new(format!("{n} photo{}", if n == 1 { "" } else { "s" })).color(t.text_dim));@@ -420,6 +434,13 @@ pub fn confirm_dialog(app: &mut LightcraftApp, dlg: &Dialog) -> Result<serde_jso_ => json!({"hours": zone}),},),+ Dialog::LabelNames { names } => {+ let mut m = serde_json::Map::new();+ for (l, n) in lightcraft_catalog::ColorLabel::ALL.iter().zip(names) {+ m.insert(format!("{l:?}").to_lowercase(), if n.trim().is_empty() { serde_json::Value::Null } else { json!(n.trim()) });+ }+ app.run("label.setNames", json!({"names": m}))+ }Dialog::Rename { template, start } => app.run("photo.rename", json!({"template": template, "start": start})),Dialog::RenameKeyword { from, to } => app.run("keyword.rename", json!({"from": from, "to": to})),Dialog::MergeKeywords { from, into } => app.run("keyword.merge", json!({"from": from, "into": into})),diff --git a/crates/ui-egui/src/panels/filterbar.rs b/crates/ui-egui/src/panels/filterbar.rsindex 7dcea37b0..ee1ba155e 100644--- a/crates/ui-egui/src/panels/filterbar.rs+++ b/crates/ui-egui/src/panels/filterbar.rs@@ -171,7 +171,8 @@ pub fn show(app: &mut LightcraftApp, ui: &mut egui::Ui) {for l in ColorLabel::ALL {let on = f.label == Some(l);let name = format!("{l:?}").to_lowercase();- let resp = toggle(ui, &format!("label-{name}"), on, &format!("{l:?} label"), |p, r, _| {+ let tip = format!("{} label", app.session.catalog.label_name(l));+ let resp = toggle(ui, &format!("label-{name}"), on, &tip, |p, r, _| {p.circle_filled(r.center(), 5.5, label_color(l));});if resp.clicked() {diff --git a/crates/ui-egui/src/panels/grid.rs b/crates/ui-egui/src/panels/grid.rsindex 2efa08ed5..c500bbf8c 100644--- a/crates/ui-egui/src/panels/grid.rs+++ b/crates/ui-egui/src/panels/grid.rs@@ -3,7 +3,7 @@use std::collections::HashSet;use egui::{Align2, Color32, Rect, Sense, Stroke, StrokeKind, pos2, vec2};-use lightcraft_catalog::{DateRun, Flag, GroupBy, PhotoId};+use lightcraft_catalog::{ColorLabel, DateRun, Flag, GroupBy, PhotoId};use serde_json::json;use crate::LightcraftApp;@@ -312,7 +312,7 @@ fn cell(app: &mut LightcraftApp, ui: &mut egui::Ui, id: PhotoId, r: Rect, squarep.rect_filled(br, 2.0, Color32::from_gray(26));p.galley(br.min + vec2(4.0, 1.5), g, t.text_label);}- let show_badges = resp.hovered() || selected || photo.rating > 0 || photo.flag != Flag::None;+ let show_badges = resp.hovered() || selected || photo.rating > 0 || photo.flag != Flag::None || photo.label.is_some();if show_badges {let bar = Rect::from_min_max(pos2(img_rect.left(), img_rect.bottom() - 24.0), img_rect.right_bottom());if resp.hovered() || selected {@@ -328,8 +328,13 @@ fn cell(app: &mut LightcraftApp, ui: &mut egui::Ui, id: PhotoId, r: Rect, squareFlag::Reject => paint(p, Rect::from_min_size(pos2(x, bar.center().y - 7.0), vec2(14.0, 14.0)), Icon::FlagReject, t.reject),Flag::None => {}}+ let mut right = bar.right();if photo.is_edited() {- paint(p, Rect::from_min_size(pos2(bar.right() - 20.0, bar.center().y - 7.0), vec2(14.0, 14.0)), Icon::Sliders, t.text_label);+ paint(p, Rect::from_min_size(pos2(right - 20.0, bar.center().y - 7.0), vec2(14.0, 14.0)), Icon::Sliders, t.text_label);+ right -= 20.0;+ }+ if let Some(l) = photo.label {+ p.circle(pos2(right - 12.0, bar.center().y), 5.0, label_color(l), Stroke::new(1.0, Color32::from_black_alpha(120)));}}if let Some(name) = &photo.copy_name {@@ -371,6 +376,32 @@ fn cell(app: &mut LightcraftApp, ui: &mut egui::Ui, id: PhotoId, r: Rect, squareresp.context_menu(|ui| context_menu(app, ui, id));}+pub use super::filterbar::label_color;++/// "Set Color Label" items (coloured dot + the label's name), shared by context menus.+pub fn label_menu(app: &mut LightcraftApp, ui: &mut egui::Ui) {+ let current = app.session.active().and_then(|id| app.session.catalog.photo(id)).and_then(|p| p.label);+ for l in ColorLabel::ALL {+ let name = app.session.catalog.label_name(l);+ let resp = ui.horizontal(|ui| {+ let (r, _) = ui.allocate_exact_size(vec2(12.0, 12.0), Sense::hover());+ ui.painter().circle_filled(r.center(), 5.0, label_color(l));+ ui.selectable_label(current == Some(l), name)+ });+ if resp.inner.clicked() {+ let _ = app.run("photo.label", json!({"label": format!("{l:?}").to_lowercase()}));+ ui.close();+ }+ }+ if ui.selectable_label(current.is_none(), "None").clicked() {+ let _ = app.run("photo.label", json!({"label": "none"}));+ }+ ui.separator();+ if ui.button("Edit Label Names…").clicked() {+ let _ = app.run("dialog.labelNames", json!({}));+ }+}+/// Stack badge at the cell's top-left: the photo count on a collapsed stack's top, `i/n` on the/// members of an expanded stack. Clicking it expands/collapses the stack.pub fn stack_badge(app: &mut LightcraftApp, ui: &mut egui::Ui, id: PhotoId, sid: lightcraft_catalog::StackId, pos: usize, r: Rect, square: bool) {@@ -423,6 +454,7 @@ pub fn context_menu(app: &mut LightcraftApp, ui: &mut egui::Ui, id: PhotoId) {}}});+ ui.menu_button("Set Color Label", |ui| label_menu(app, ui));ui.menu_button("Add to Album", |ui| {let albums: Vec<_> = app.session.catalog.albums().filter(|a| !a.folder && !a.is_smart()).map(|a| (a.id.0, a.name.clone())).collect();for (aid, name) in albums {diff --git a/crates/ui-egui/src/panels/right.rs b/crates/ui-egui/src/panels/right.rsindex 21e173063..3f3a71e6f 100644--- a/crates/ui-egui/src/panels/right.rs+++ b/crates/ui-egui/src/panels/right.rs@@ -329,6 +329,27 @@ fn info(app: &mut LightcraftApp, ui: &mut egui::Ui, id: PhotoId) {if let Some(r) = ui.horizontal(|ui| crate::widgets::stars(ui, "info", p.rating, 20.0)).inner {let _ = app.run("photo.rate", json!({"rating": r}));}+ ui.add_space(6.0);+ // colour label: one swatch per label (hover shows its name); clicking the current one clears it+ ui.horizontal(|ui| {+ for l in lightcraft_catalog::ColorLabel::ALL {+ let (r, resp) = ui.allocate_exact_size(vec2(22.0, 22.0), Sense::click());+ let key = format!("{l:?}").to_lowercase();+ register(ui.ctx(), format!("label:{key}"), r);+ let on = p.label == Some(l);+ ui.painter().circle_filled(r.center(), if on || resp.hovered() { 8.0 } else { 6.5 }, crate::panels::grid::label_color(l));+ if on {+ ui.painter().circle_stroke(r.center(), 10.0, egui::Stroke::new(1.5, t.text));+ }+ let resp = resp.on_hover_text(app.session.catalog.label_name(l));+ if resp.clicked() {+ let _ = app.run("photo.label", json!({"label": if on { "none".to_string() } else { key }}));+ }+ }+ if let Some(l) = p.label {+ ui.label(egui::RichText::new(app.session.catalog.label_name(l)).color(t.text_label));+ }+ });});divider(ui);let mut title = p.meta.title.clone();diff --git a/crates/ui-egui/src/state.rs b/crates/ui-egui/src/state.rsindex 710224e10..02e20fed1 100644--- a/crates/ui-egui/src/state.rs+++ b/crates/ui-egui/src/state.rs@@ -161,6 +161,10 @@ pub enum Dialog {minutes: i32,zone: f32,},+ /// Edit the colour label names (red, yellow, green, blue, purple; empty = the colour's name).+ LabelNames {+ names: Vec<String>,+ },/// Batch rename the selected photos with a file-name template.Rename {template: String,diff --git a/docs/parity.md b/docs/parity.mdindex c92183528..fc010bd76 100644--- a/docs/parity.md+++ b/docs/parity.md@@ -75,7 +75,6 @@ Ordered by tier, then user value, then (low) effort. Take the first one nobody i12. **LR-IMP-FORMATS** (P0) — CR3, compressed NEF/RAF/ORF, RW2 v4 (preview only today); HEIC/AVIF decode (nopermissive pure-Rust decoder yet). High value, high effort (clean sources needed).13. **LR-VIEW-FULLSCREEN + LR-VIEW-NAVIGATOR + LR-VIEW-INFOOVERLAY** (P1) — view modes. Medium effort.-14. **LR-LIB-LABEL UI** (P1) — label menu/names.15. **LR-EXP-BITDEPTH + LR-EXP-COMPRESSION** (P1) — 16-bit TIFF/PNG and TIFF compression choice.16. **LR-EDIT-OPTICS-PROFILE** (P1) — a lens-profile database of our own (embedded DNG/maker corrections work today).@@ -148,7 +147,7 @@ under the UI command that wraps it (a no-op error); the UI command now wins.| LR-LIB-TARGET | Target album | P2 | ⬜ | | || LR-LIB-RATING | Star ratings | P0 | ✅ | `cmd:photo.rate` (`advance`), `crates/ui-egui/src/shortcuts.rs` | || LR-LIB-FLAG | Pick / reject flags | P0 | ✅ | `cmd:photo.pick`, `cmd:photo.reject`, `cmd:photo.unflag`, `cmd:photo.flag` | pick key is P (see Shortcuts); no flag cycle |-| LR-LIB-LABEL | Colour labels | P1 | 🟡 | `cmd:photo.label`, keys 6–9 in `crates/ui-egui/src/shortcuts.rs` | no label menu/buttons, no purple key, label names not editable |+| LR-LIB-LABEL | Colour labels | P1 | ✅ | `cmd:photo.label`, `cmd:label.setNames`, `cmd:label.names`, `cmd:dialog.labelNames`, keys 6–9 in `crates/ui-egui/src/shortcuts.rs` | Photo menu and grid context menu (coloured, named), Info-panel swatches, label dot in grid cells; editable label names (undoable, journaled); no purple key (as in Lightroom), no custom extra labels || LR-LIB-KEYWORD | Keywords | P0 | ✅ | `cmd:panel.keywords`, `cmd:photo.setMeta` (`addKeywords`/`removeKeywords`), `cmd:keyword.list`, `cmd:keyword.rename`, `cmd:keyword.delete`, `cmd:keyword.merge`, `cmd:keyword.suggest`, `crates/catalog/src/keywords.rs`, `crates/ui-egui/src/panels/left.rs` | left-panel keyword tree with counts (click filters, children included; context menu rename / merge / delete / add / remove); library-wide ops are one undo step and replay from the op log; suggestions (co-occurring / most used / completions) in the Keywords panel; no keyword drag-and-drop || LR-LIB-PEOPLE | People / faces | P2 | ⬜ | | || LR-LIB-STACK | Stacks | P1 | ✅ | `cmd:stack.group`, `cmd:stack.ungroup`, `cmd:stack.toggle`, `cmd:stack.setTop`, `cmd:stack.remove`, `cmd:stack.auto`, `crates/catalog/src/stacks.rs` | grid/filmstrip count badges, expand/collapse, auto-stack by capture time; no visual-similarity auto-stack |@@ -576,7 +575,7 @@ visible menu bar yet: the menu model is only exposed through the control channel| MENU-PHOTO-REMOVEFROMALBUM | Remove from album | P0 | ✅ | `cmd:album.removePhotos` | || MENU-PHOTO-RATE | Rate submenu | P0 | ✅ | `cmd:photo.rate` | || MENU-PHOTO-FLAG | Flag submenu | P0 | ✅ | `cmd:photo.flag` | |-| MENU-PHOTO-LABEL | Colour label submenu | P1 | 🟡 | `cmd:photo.label` | keys only; no menu, no label editing |+| MENU-PHOTO-LABEL | Colour label submenu | P1 | ✅ | `cmd:photo.label`, `cmd:dialog.labelNames` | shows custom names; Edit Label Names… || MENU-PHOTO-ROTATE | Rotate left / right | P0 | ✅ | `cmd:photo.rotateLeft`, `cmd:photo.rotateRight` | || MENU-PHOTO-FLIP | Flip horizontal / vertical | P0 | ✅ | `cmd:photo.flipHorizontal`, `cmd:photo.flipVertical` | || MENU-PHOTO-CREATEVERSION | Create Version… | P1 | ✅ | `cmd:version.create` | no name prompt |