LightCraft: An open-source non-destructive photo editor written by scratch in pure Rust
LRC-LIB-KEYWORDS: what two independent reviews found in the Keywords panel
Nathaniel Ledfordc2c85f5d9789
diff --git a/crates/ui-egui/locales/de.json b/crates/ui-egui/locales/de.jsonindex 25c411ce0..63b377da0 100644--- a/crates/ui-egui/locales/de.json+++ b/crates/ui-egui/locales/de.json@@ -1975,6 +1975,15 @@"Keyword List": "Stichwortliste","Filter Keywords": "Stichwörter filtern","No keywords yet": "Noch keine Stichwörter",+ "Show fewer": "Weniger anzeigen",+ "Whole names": "Ganze Namen",+ "Grouped by parent": "Nach übergeordnetem Stichwort gruppiert",+ "Keywords of the selection": "Stichwörter der Auswahl",+ "Grouped: keywords inside the same keyword share a line naming it, and long lists and the suggestions are shortened.": "Gruppiert: Stichwörter im selben Stichwort teilen sich eine Zeile mit dessen Namen; lange Listen und die Vorschläge werden gekürzt.",+ "Show every keyword of the selected photos": "Alle Stichwörter der ausgewählten Fotos anzeigen",+ "new keyword": "neues Stichwort",+ "Return creates this keyword and gives it to the selected photos": "Die Eingabetaste erstellt dieses Stichwort und weist es den ausgewählten Fotos zu",+ "Separate several keywords with commas. Return gives them to the selected photos.": "Mehrere Stichwörter durch Kommas trennen. Die Eingabetaste weist sie den ausgewählten Fotos zu.","No keywords match": "Keine passenden Stichwörter","Keyword Name": "Stichwortname","Synonyms": "Synonyme",diff --git a/crates/ui-egui/locales/es.json b/crates/ui-egui/locales/es.jsonindex ba3e1e331..b3104fd85 100644--- a/crates/ui-egui/locales/es.json+++ b/crates/ui-egui/locales/es.json@@ -1855,6 +1855,15 @@"Keyword List": "Lista de palabras clave","Filter Keywords": "Filtrar palabras clave","No keywords yet": "Aún no hay palabras clave",+ "Show fewer": "Mostrar menos",+ "Whole names": "Nombres completos",+ "Grouped by parent": "Agrupadas por palabra clave superior",+ "Keywords of the selection": "Palabras clave de la selección",+ "Grouped: keywords inside the same keyword share a line naming it, and long lists and the suggestions are shortened.": "Agrupadas: las palabras clave dentro de la misma palabra clave comparten una línea con su nombre; las listas largas y las sugerencias se acortan.",+ "Show every keyword of the selected photos": "Mostrar todas las palabras clave de las fotos seleccionadas",+ "new keyword": "palabra clave nueva",+ "Return creates this keyword and gives it to the selected photos": "Intro crea esta palabra clave y la asigna a las fotos seleccionadas",+ "Separate several keywords with commas. Return gives them to the selected photos.": "Separa varias palabras clave con comas. Intro las asigna a las fotos seleccionadas.","No keywords match": "Ninguna palabra clave coincide","Keyword Name": "Nombre de la palabra clave","Synonyms": "Sinónimos",diff --git a/crates/ui-egui/locales/fr.json b/crates/ui-egui/locales/fr.jsonindex b0becb154..cc0a47cb3 100644--- a/crates/ui-egui/locales/fr.json+++ b/crates/ui-egui/locales/fr.json@@ -1809,6 +1809,15 @@"Keyword List": "Liste des mots-clés","Filter Keywords": "Filtrer les mots-clés","No keywords yet": "Aucun mot-clé pour l'instant",+ "Show fewer": "Afficher moins",+ "Whole names": "Noms complets",+ "Grouped by parent": "Groupés par mot-clé parent",+ "Keywords of the selection": "Mots-clés de la sélection",+ "Grouped: keywords inside the same keyword share a line naming it, and long lists and the suggestions are shortened.": "Groupés : les mots-clés contenus dans un même mot-clé partagent une ligne qui le nomme ; les longues listes et les suggestions sont raccourcies.",+ "Show every keyword of the selected photos": "Afficher tous les mots-clés des photos sélectionnées",+ "new keyword": "nouveau mot-clé",+ "Return creates this keyword and gives it to the selected photos": "Entrée crée ce mot-clé et l'attribue aux photos sélectionnées",+ "Separate several keywords with commas. Return gives them to the selected photos.": "Séparez plusieurs mots-clés par des virgules. Entrée les attribue aux photos sélectionnées.","No keywords match": "Aucun mot-clé ne correspond","Keyword Name": "Nom du mot-clé","Synonyms": "Synonymes",diff --git a/crates/ui-egui/locales/ja.json b/crates/ui-egui/locales/ja.jsonindex 7a282e676..2b71d047e 100644--- a/crates/ui-egui/locales/ja.json+++ b/crates/ui-egui/locales/ja.json@@ -1821,6 +1821,15 @@"Keyword List": "キーワードリスト","Filter Keywords": "キーワードを絞り込む","No keywords yet": "キーワードはまだありません",+ "Show fewer": "表示を減らす",+ "Whole names": "完全な名前",+ "Grouped by parent": "親キーワードでグループ化",+ "Keywords of the selection": "選択した写真のキーワード",+ "Grouped: keywords inside the same keyword share a line naming it, and long lists and the suggestions are shortened.": "グループ化:同じキーワードの中にあるキーワードは、その名前を示す行にまとめられ、長いリストと候補は短く表示されます。",+ "Show every keyword of the selected photos": "選択した写真のキーワードをすべて表示",+ "new keyword": "新しいキーワード",+ "Return creates this keyword and gives it to the selected photos": "Return キーでこのキーワードを作成し、選択した写真に付けます",+ "Separate several keywords with commas. Return gives them to the selected photos.": "複数のキーワードはカンマで区切ります。Return キーで選択した写真に付けます。","No keywords match": "一致するキーワードはありません","Keyword Name": "キーワード名","Synonyms": "同義語",diff --git a/crates/ui-egui/locales/pt-br.json b/crates/ui-egui/locales/pt-br.jsonindex f8e4753e5..9f84de5c8 100644--- a/crates/ui-egui/locales/pt-br.json+++ b/crates/ui-egui/locales/pt-br.json@@ -1819,6 +1819,15 @@"Keyword List": "Lista de palavras-chave","Filter Keywords": "Filtrar palavras-chave","No keywords yet": "Ainda não há palavras-chave",+ "Show fewer": "Mostrar menos",+ "Whole names": "Nomes completos",+ "Grouped by parent": "Agrupadas pela palavra-chave superior",+ "Keywords of the selection": "Palavras-chave da seleção",+ "Grouped: keywords inside the same keyword share a line naming it, and long lists and the suggestions are shortened.": "Agrupadas: as palavras-chave dentro da mesma palavra-chave compartilham uma linha com o nome dela; listas longas e as sugestões são encurtadas.",+ "Show every keyword of the selected photos": "Mostrar todas as palavras-chave das fotos selecionadas",+ "new keyword": "nova palavra-chave",+ "Return creates this keyword and gives it to the selected photos": "Enter cria esta palavra-chave e a atribui às fotos selecionadas",+ "Separate several keywords with commas. Return gives them to the selected photos.": "Separe várias palavras-chave com vírgulas. Enter as atribui às fotos selecionadas.","No keywords match": "Nenhuma palavra-chave corresponde","Keyword Name": "Nome da palavra-chave","Synonyms": "Sinônimos",diff --git a/crates/ui-egui/locales/ru.json b/crates/ui-egui/locales/ru.jsonindex c840218a0..a3cd09849 100644--- a/crates/ui-egui/locales/ru.json+++ b/crates/ui-egui/locales/ru.json@@ -1528,6 +1528,15 @@"Keyword List": "Список ключевых слов","Filter Keywords": "Фильтровать ключевые слова","No keywords yet": "Ключевых слов пока нет",+ "Show fewer": "Показать меньше",+ "Whole names": "Полные имена",+ "Grouped by parent": "Сгруппированы по родительскому слову",+ "Keywords of the selection": "Ключевые слова выбранных фото",+ "Grouped: keywords inside the same keyword share a line naming it, and long lists and the suggestions are shortened.": "Сгруппированы: ключевые слова внутри одного ключевого слова стоят под строкой с его именем; длинные списки и подсказки сокращаются.",+ "Show every keyword of the selected photos": "Показать все ключевые слова выбранных фото",+ "new keyword": "новое ключевое слово",+ "Return creates this keyword and gives it to the selected photos": "Клавиша Enter создаст это ключевое слово и добавит его выбранным фото",+ "Separate several keywords with commas. Return gives them to the selected photos.": "Несколько ключевых слов разделяйте запятыми. Клавиша Enter добавит их выбранным фото.","No keywords match": "Подходящих ключевых слов нет","Keyword Name": "Название ключевого слова","Synonyms": "Синонимы",diff --git a/crates/ui-egui/locales/uk.json b/crates/ui-egui/locales/uk.jsonindex 85a838098..1407c8259 100644--- a/crates/ui-egui/locales/uk.json+++ b/crates/ui-egui/locales/uk.json@@ -2003,6 +2003,15 @@"Keyword List": "Список ключових слів","Filter Keywords": "Фільтрувати ключові слова","No keywords yet": "Ключових слів ще немає",+ "Show fewer": "Показати менше",+ "Whole names": "Повні назви",+ "Grouped by parent": "Згруповано за батьківським словом",+ "Keywords of the selection": "Ключові слова вибраних фото",+ "Grouped: keywords inside the same keyword share a line naming it, and long lists and the suggestions are shortened.": "Згруповано: ключові слова всередині одного ключового слова стоять під рядком із його назвою; довгі списки та підказки скорочуються.",+ "Show every keyword of the selected photos": "Показати всі ключові слова вибраних фото",+ "new keyword": "нове ключове слово",+ "Return creates this keyword and gives it to the selected photos": "Клавіша Enter створить це ключове слово й додасть його вибраним фото",+ "Separate several keywords with commas. Return gives them to the selected photos.": "Кілька ключових слів розділяйте комами. Клавіша Enter додасть їх вибраним фото.","No keywords match": "Немає відповідних ключових слів","Keyword Name": "Назва ключового слова","Synonyms": "Синоніми",diff --git a/crates/ui-egui/locales/zh-hans.json b/crates/ui-egui/locales/zh-hans.jsonindex ad379f1ef..2ffe4fd05 100644--- a/crates/ui-egui/locales/zh-hans.json+++ b/crates/ui-egui/locales/zh-hans.json@@ -1819,6 +1819,15 @@"Keyword List": "关键字列表","Filter Keywords": "过滤关键字","No keywords yet": "还没有关键字",+ "Show fewer": "显示较少",+ "Whole names": "完整名称",+ "Grouped by parent": "按上级关键字分组",+ "Keywords of the selection": "所选照片的关键字",+ "Grouped: keywords inside the same keyword share a line naming it, and long lists and the suggestions are shortened.": "分组:同一关键字内的关键字共用一行并标出该关键字的名称;较长的列表和建议会被缩短。",+ "Show every keyword of the selected photos": "显示所选照片的全部关键字",+ "new keyword": "新关键字",+ "Return creates this keyword and gives it to the selected photos": "按回车键创建此关键字并添加到所选照片",+ "Separate several keywords with commas. Return gives them to the selected photos.": "用逗号分隔多个关键字。按回车键将它们添加到所选照片。","No keywords match": "没有匹配的关键字","Keyword Name": "关键字名称","Synonyms": "同义词",diff --git a/crates/ui-egui/locales/zh-hant.json b/crates/ui-egui/locales/zh-hant.jsonindex 647d153d0..0d4f6d076 100644--- a/crates/ui-egui/locales/zh-hant.json+++ b/crates/ui-egui/locales/zh-hant.json@@ -1819,6 +1819,15 @@"Keyword List": "關鍵字清單","Filter Keywords": "篩選關鍵字","No keywords yet": "尚無關鍵字",+ "Show fewer": "顯示較少",+ "Whole names": "完整名稱",+ "Grouped by parent": "依上層關鍵字分組",+ "Keywords of the selection": "選取照片的關鍵字",+ "Grouped: keywords inside the same keyword share a line naming it, and long lists and the suggestions are shortened.": "分組:同一關鍵字內的關鍵字共用一行並標出該關鍵字的名稱;較長的清單和建議會縮短。",+ "Show every keyword of the selected photos": "顯示選取照片的全部關鍵字",+ "new keyword": "新關鍵字",+ "Return creates this keyword and gives it to the selected photos": "按 Return 鍵建立此關鍵字並加到選取的照片",+ "Separate several keywords with commas. Return gives them to the selected photos.": "以逗號分隔多個關鍵字。按 Return 鍵將它們加到選取的照片。","No keywords match": "沒有符合的關鍵字","Keyword Name": "關鍵字名稱","Synonyms": "同義詞",diff --git a/crates/ui-egui/src/panels/keywording.rs b/crates/ui-egui/src/panels/keywording.rsindex f9b05e238..6e66aafbf 100644--- a/crates/ui-egui/src/panels/keywording.rs+++ b/crates/ui-egui/src/panels/keywording.rs@@ -169,9 +169,8 @@ fn menu(app: &mut LightcraftApp, ui: &mut egui::Ui, chip: &Chip) {/// With several photos selected, how many the box's keywords are of (`keywordScope`): what a ×/// or a keyword typed here acts on.-pub fn scope(app: &mut LightcraftApp, ui: &mut egui::Ui) {- let selection = app.session.targets(&serde_json::Value::Null);- let photos = app.caches.selected_photos(&app.session.catalog, &selection);+pub fn scope(app: &mut LightcraftApp, ui: &mut egui::Ui, selection: &[PhotoId]) {+ let photos = app.caches.selected_photos(&app.session.catalog, selection);if photos < 2 {return;}@@ -185,9 +184,8 @@ pub fn scope(app: &mut LightcraftApp, ui: &mut egui::Ui) {/// The selection's keywords as chips: the name (right-click for its menu), and × to take it off/// every selected photo. One only some of them have is marked with an asterisk. Whole names, or/// grouped by the keyword they are inside (Settings ▸ Interface).-pub fn chip_row(app: &mut LightcraftApp, ui: &mut egui::Ui) {- let selection = app.session.targets(&serde_json::Value::Null);- let chips = app.caches.keyword_chips(&app.session.catalog, &selection);+pub fn chip_row(app: &mut LightcraftApp, ui: &mut egui::Ui, selection: &[PhotoId]) {+ let chips = app.caches.keyword_chips(&app.session.catalog, selection);if chips.is_empty() {let t = Tokens::get(ui.ctx());let r = ui.label(egui::RichText::new(crate::i18n::tr("No keywords yet")).color(t.text_dim));@@ -195,8 +193,8 @@ pub fn chip_row(app: &mut LightcraftApp, ui: &mut egui::Ui) {return;}if app.ui.settings.keyword_chips == crate::state::KeywordChips::Grouped {- let groups = app.caches.keyword_groups(&app.session.catalog, &selection);- chip_groups(app, ui, &groups);+ let groups = app.caches.keyword_groups(&app.session.catalog, selection);+ chip_groups(app, ui, &groups, crate::key_of(selection));return;}ui.horizontal_wrapped(|ui| {@@ -230,17 +228,25 @@ fn chip_acts(app: &mut LightcraftApp, ui: &egui::Ui, c: &Chip, body: egui::Respobody.context_menu(|ui| menu(app, ui, &c));}-/// When a list is shortened, only this many chips are measured for it: more than fit the lines-/// shown, however narrow they are.-const MEASURED: usize = 128;+/// When a list is shortened, only this many chips are measured for it: more than the lines it+/// can show hold in rows `avail` wide, however short their names are. The others are planned a+/// line each, past the lines shown.+pub(crate) fn measured(avail: f32) -> usize {+ // the narrowest chip: its edges and a letter+ let narrowest = chip_edges(true) + 4.0;+ let row = if avail.is_finite() && avail > narrowest { ((avail / narrowest) as usize).min(4096) } else { 1 };+ row.saturating_add(1).saturating_mul(LINES + SLACK + 1)+}/// The grouped box: each group's parent on a line of its own, its chips under it side by side,/// and "+N more" where a long list stops.-fn chip_groups(app: &mut LightcraftApp, ui: &mut egui::Ui, groups: &[Group]) {+fn chip_groups(app: &mut LightcraftApp, ui: &mut egui::Ui, groups: &[Group], selection: u64) {use egui::{Align2, Sense, vec2};let t = Tokens::get(ui.ctx());let avail = ui.available_width();- let all = app.ui.keyword_chips_all;+ // the whole list only for the selection it was asked of+ let all = app.ui.keyword_chips_all == Some(selection);+ let limit = measured(avail);// the widths the lines are planned with (past what a shortened list can show: a line each)let mut measured = 0_usize;let sizes: Vec<(bool, Vec<f32>)> = groups@@ -251,7 +257,7 @@ fn chip_groups(app: &mut LightcraftApp, ui: &mut egui::Ui, groups: &[Group]) {.iter().map(|(name, c)| {measured = measured.saturating_add(1);- if all || measured <= MEASURED { chip_size(ui, name, !c.on_all(), true, avail).1 } else { avail }+ if all || measured <= limit { chip_size(ui, name, !c.on_all(), true, avail).1 } else { avail }}).collect();(!g.parent.is_empty(), widths)@@ -268,7 +274,11 @@ fn chip_groups(app: &mut LightcraftApp, ui: &mut egui::Ui, groups: &[Group]) {let shown = chip_label(&group.parent, false, avail, measure);let full = group.parent.replace('|', " › ");resp.widget_info(|| egui::WidgetInfo::labeled(egui::WidgetType::Label, true, &full));- ui.painter().text(r.left_center(), Align2::LEFT_CENTER, shown, small.clone(), t.text_label);+ ui.painter().text(r.left_center(), Align2::LEFT_CENTER, &shown, small.clone(), t.text_label);+ // (cut short, it says its whole name on hover, as a chip does)+ if shown != full {+ resp.on_hover_text(&full);+ }register(ui.ctx(), format!("keywordGroup:{}", group.parent), r);}Line::Chips(g, row) => {@@ -288,7 +298,7 @@ fn chip_groups(app: &mut LightcraftApp, ui: &mut egui::Ui, groups: &[Group]) {let r = ui.add(egui::Button::new(egui::RichText::new(label).color(t.text_label)).corner_radius(10.0));register(ui.ctx(), "keywordChipsMore", r.rect);if r.on_hover_text(crate::i18n::tr("Show every keyword of the selected photos")).clicked() {- app.ui.keyword_chips_all = true;+ app.ui.keyword_chips_all = Some(selection);}}Line::Fewer => {@@ -296,7 +306,7 @@ fn chip_groups(app: &mut LightcraftApp, ui: &mut egui::Ui, groups: &[Group]) {let r = ui.add(egui::Button::new(egui::RichText::new(crate::i18n::tr("Show fewer")).color(t.text_label)).corner_radius(10.0));register(ui.ctx(), "keywordChipsFewer", r.rect);if r.clicked() {- app.ui.keyword_chips_all = false;+ app.ui.keyword_chips_all = None;}}}@@ -369,12 +379,21 @@ pub(crate) fn typed_before(catalog: &Catalog, text: &str) -> Vec<String> {/// What the box offers for `typed`, for photos that all have the `current` keywords.pub(crate) fn offers(catalog: &Catalog, current: &[String], typed: &str) -> Offers {- let name = lightcraft_catalog::keywords::clean(typed);+ use lightcraft_catalog::keywords::{SEP, clean};+ let name = clean(typed);if name.is_empty() {return Offers::default();}- let keywords = catalog.keyword_suggestions(current, typed, OFFERS);- let create = (!catalog.has_keyword(&name)).then(|| catalog.typed_keyword(typed));+ // (a keyword two photos spell differently is one offer, the first spelling)+ let mut seen = std::collections::HashSet::new();+ let mut keywords = catalog.keyword_suggestions(current, typed, OFFERS);+ keywords.retain(|k| seen.insert(k.to_lowercase()));+ // where Return would put a name the library lacks, as `Catalog::typed_keyword` does, without+ // looking through the library a second time+ let create = (!catalog.has_keyword(&name)).then(|| match catalog.default_keyword_parent() {+ Some(parent) if !name.contains(SEP) => format!("{parent}{SEP}{name}"),+ _ => name,+ });Offers { keywords, create }}@@ -390,17 +409,25 @@ pub(crate) enum Picked {/// The offers under the Add keyword box (`below` is the box): the library's keywords matching/// what is typed, each by its own name with the keyword it is inside after it, the one at `at`/// highlighted (↑ / ↓); then, for a name the library doesn't have, the keyword Return creates.-/// Returns the offer clicked and where the offers were drawn.-pub(crate) fn offers_below(ui: &egui::Ui, below: egui::Rect, offers: &Offers, at: Option<usize>) -> (Option<Picked>, egui::Rect) {+/// They go above the box where the window has no room for them under it. Returns the offer+/// clicked and where the offers were drawn.+pub(crate) fn offers_below(ui: &egui::Ui, below: egui::Rect, offers: &Offers, at: Option<&str>) -> (Option<Picked>, egui::Rect) {use egui::{Align2, Sense, pos2, vec2};use lightcraft_catalog::keywords::SEP;let t = Tokens::get(ui.ctx());let mut picked = None;let width = (below.width() - 10.0).max(60.0);- let area = egui::Area::new(egui::Id::new("keyword-offers"))- .order(egui::Order::Foreground)- .fixed_pos(below.left_bottom() + vec2(0.0, 2.0))- .constrain(true);+ // as tall as its lines: under the box, or over it where that is the only side with room+ let lines = offers.keywords.len().saturating_add(usize::from(offers.create.is_some()));+ let height = lines as f32 * 24.0 + if offers.create.is_some() && !offers.keywords.is_empty() { 17.0 } else { 10.0 };+ let window = ui.ctx().content_rect();+ let over = below.bottom() + 2.0 + height > window.bottom() && below.top() - window.top() > window.bottom() - below.bottom();+ let area = egui::Area::new(egui::Id::new("keyword-offers")).order(egui::Order::Foreground).constrain(true);+ let area = if over {+ area.pivot(Align2::LEFT_BOTTOM).fixed_pos(below.left_top() - vec2(0.0, 2.0))+ } else {+ area.fixed_pos(below.left_bottom() + vec2(0.0, 2.0))+ };let shown = area.show(ui.ctx(), |ui| {egui::Frame::popup(ui.style()).inner_margin(4.0).show(ui, |ui| {ui.set_width(width);@@ -426,10 +453,10 @@ pub(crate) fn offers_below(ui: &egui::Ui, below: egui::Rect, offers: &Offers, at}resp};- for (i, k) in offers.keywords.iter().enumerate() {+ for k in &offers.keywords {let (place, name) = k.rsplit_once(SEP).unwrap_or(("", k));let whole = k.replace(SEP, " › ");- let lit = at == Some(i);+ let lit = at == Some(k.as_str());let r = line(ui, egui::Id::new(("keyword-offer", k.to_lowercase())), name, place, &whole, lit);register(ui.ctx(), format!("kwComplete:{k}"), r.rect);if lit {@@ -462,7 +489,13 @@ pub(crate) fn offers_below(ui: &egui::Ui, below: egui::Rect, offers: &Offers, atlet small = t.font(11.5);ui.painter().text(pos2(r.rect.right() - 8.0, r.rect.center().y), Align2::RIGHT_CENTER, place, small, t.text_label);register(ui.ctx(), "kwCompleteCreate", r.rect);- if r.on_hover_text(crate::i18n::tr("Return creates this keyword and gives it to the selected photos")).clicked() {+ // (Return gives the highlighted offer instead, while there is one)+ let r = if at.is_none() {+ r.on_hover_text(crate::i18n::tr("Return creates this keyword and gives it to the selected photos"))+ } else {+ r+ };+ if r.clicked() {picked = Some(Picked::Typed);}}@@ -505,7 +538,9 @@ pub(crate) fn grouped(chips: &[Chip]) -> Vec<Group> {let shared = |depth: &usize| inside.get(&head(&levels, *depth).to_lowercase()).is_some_and(|n| *n > 1);let depth = (1..levels.len()).rev().find(shared).unwrap_or(0);let parent = head(&levels, depth);- groups.entry(parent.to_lowercase()).or_insert_with(|| Group { parent, chips: Vec::new() }).chips.push((tail(&levels, depth), c.clone()));+ // (ordered level by level: "Port › Docks" follows "Port", before "Portugal")+ let key = parent.to_lowercase().replace(SEP, "\u{1}");+ groups.entry(key).or_insert_with(|| Group { parent, chips: Vec::new() }).chips.push((tail(&levels, depth), c.clone()));}groups.into_values().collect()}@@ -892,6 +927,45 @@ mod tests {assert!(offers(&c, &[], "p").keywords.len() <= OFFERS);}+ /// A keyword two photos spell differently is offered once.+ #[test]+ fn a_keyword_spelled_two_ways_is_one_offer() {+ let (c, _) = library(&[&["Lisbon"], &["lisbon"], &["LISBON", "Lisboa"]]);+ let got = offers(&c, &[], "lis").keywords;+ assert_eq!(got.len(), 2, "{got:?}");+ assert!(got.iter().any(|k| k.eq_ignore_ascii_case("lisbon")) && got.contains(&"Lisboa".to_string()));+ }++ /// Groups follow the tree: a keyword's groups come right after it, before a keyword whose name+ /// merely starts the same.+ #[test]+ fn groups_are_in_the_trees_order() {+ let parents: Vec<String> =+ groups_of(&["Portugal|a", "Portugal|b", "Port|Docks|j", "Port|Docks|k", "Port|x", "Port|y"]).into_iter().map(|(p, _)| p).collect();+ assert_eq!(parents, ["Port", "Port|Docks", "Portugal"]);+ }++ /// However wide the box, more chips are measured than a shortened list can show: the lines+ /// shown are planned with their real widths.+ #[test]+ fn enough_chips_are_measured_for_the_lines_shown() {+ for avail in [0.0, 60.0, 224.0, 474.0, 1500.0, 6000.0, f32::NAN, f32::INFINITY, -5.0] {+ let limit = measured(avail);+ assert!(limit > LINES + SLACK, "{avail}: {limit}");+ if avail.is_finite() && avail > 0.0 {+ // the narrowest chips there can be, a gap apart: those of the lines shown+ let narrowest = chip_edges(true) + 4.0;+ let fit = (LINES + SLACK + 1) * ((avail / (narrowest + GAP)) as usize + 1);+ assert!(limit >= fit, "{avail}: {limit} < {fit}");+ }+ }+ // a wide box: the lines shown are full rows, not one chip each past the 128th+ let widths = vec![40.0; 300];+ let limit = measured(1500.0);+ let planned: Vec<f32> = widths.iter().enumerate().map(|(i, w)| if i < limit { *w } else { 1500.0 }).collect();+ assert_eq!(lines(&[(false, planned)], 1500.0, GAP, false), lines(&[(false, widths)], 1500.0, GAP, false));+ }+/// What is typed is what follows the last comma; what came before it goes along when an offer/// is taken.#[test]diff --git a/crates/ui-egui/src/panels/right.rs b/crates/ui-egui/src/panels/right.rsindex ecebd010f..23dadfb9e 100644--- a/crates/ui-egui/src/panels/right.rs+++ b/crates/ui-egui/src/panels/right.rs@@ -871,49 +871,75 @@ fn keywording(app: &mut LightcraftApp, ui: &mut egui::Ui) {let field = crate::text_field::id("field:keyword");let oid = egui::Id::new("kw-offers");let pass = ui.ctx().cumulative_pass_nr();- let (typed_then, at_then, drawn, drawn_pass): (String, Option<usize>, Rect, u64) =- ui.data(|d| d.get_temp(oid)).unwrap_or((String::new(), None, Rect::NOTHING, 0));- let clicking = drawn_pass.checked_add(1) == Some(pass)+ // (remembered from the last frame: the text the highlight was for and the keyword it was+ // on, where the offers were drawn, and whether the box was in sight)+ let (typed_then, at_then, drawn, drawn_pass, hidden): (String, Option<String>, Rect, u64, bool) =+ ui.data(|d| d.get_temp(oid)).unwrap_or((String::new(), None, Rect::NOTHING, 0, false));+ let last_frame = drawn_pass.checked_add(1) == Some(pass);+ let clicking = last_frame&& ui.input(|i| (i.pointer.any_down() || i.pointer.any_released()) && i.pointer.interact_pos().is_some_and(|p| drawn.contains(p)));let typed = super::keywording::typing(&text).to_string();- let offers = (ui.memory(|m| m.has_focus(field)) || clicking)+ // (none while the box is scrolled out of the panel: they would float over what is there)+ let offers = ((ui.memory(|m| m.has_focus(field)) || clicking) && !(last_frame && hidden)).then(|| app.caches.completions(&app.session.catalog, &have, &typed)).filter(|o| !o.keywords.is_empty() || o.create.is_some());// ↓ / ↑ move through the offers (none is highlighted at first, and ↑ from the first goes// back to none: Return then gives what was typed, as without offers); Return gives the- // highlighted one- let mut at = at_then.filter(|_| typed_then == typed).filter(|a| offers.as_ref().is_some_and(|o| *a < o.keywords.len()));+ // highlighted one. The highlight is on a keyword, not a line: it stays with it when the+ // library changes under it, and goes when the keyword does. With Shift or Alt the keys+ // are the text's own.+ let mut at = at_then.filter(|k| typed_then == typed && offers.as_ref().is_some_and(|o| o.keywords.contains(k)));let mut picked = None;if let Some(o) = offers.as_ref().filter(|o| !o.keywords.is_empty()) {- let pressed = |ui: &mut egui::Ui, key| ui.input_mut(|i| i.consume_key(egui::Modifiers::NONE, key));+ let pressed = |ui: &mut egui::Ui, key: egui::Key| {+ ui.input_mut(|i| {+ let plain =+ |e: &egui::Event| matches!(e, egui::Event::Key { key: k, pressed: true, modifiers, .. } if *k == key && modifiers.is_none());+ let found = i.events.iter().any(plain);+ i.events.retain(|e| !plain(e));+ found+ })+ };+ let line = at.as_ref().and_then(|k| o.keywords.iter().position(|x| x == k));if pressed(ui, egui::Key::ArrowDown) {- at = Some(at.map_or(0, |a| a.saturating_add(1)).min(o.keywords.len().saturating_sub(1)));+ let next = line.map_or(0, |a| a.saturating_add(1)).min(o.keywords.len().saturating_sub(1));+ at = o.keywords.get(next).cloned();+ } else if pressed(ui, egui::Key::ArrowUp) {+ at = line.and_then(|a| a.checked_sub(1)).and_then(|a| o.keywords.get(a).cloned());}- if pressed(ui, egui::Key::ArrowUp) {- at = at.and_then(|a| a.checked_sub(1));- }- if let Some(k) = at.and_then(|a| o.keywords.get(a))+ if let Some(k) = &at&& pressed(ui, egui::Key::Enter){picked = Some(super::keywording::Picked::Keyword(k.clone()));}}- let r =- crate::text_field::TextField::singleline("field:keyword", &mut text).hint(crate::i18n::tr("Add keyword")).width(f32::INFINITY).show(ui);+ // (after an offer was taken the box starts a new edit, empty: Esc has nothing to bring back)+ let bid = egui::Id::new("kw-begin");+ let begin = ui.data_mut(|d| d.remove_temp::<bool>(bid)).unwrap_or(false);+ let r = crate::text_field::TextField::singleline("field:keyword", &mut text)+ .hint(crate::i18n::tr("Add keyword"))+ .width(f32::INFINITY)+ .begin_edit(begin)+ .show(ui);+ let in_sight = ui.clip_rect().contains(r.response.rect.center());let mut drawn = Rect::NOTHING;if offers.is_none() {// (not over the offers)r.response.clone().on_hover_text(crate::i18n::tr("Separate several keywords with commas. Return gives them to the selected photos."));}- if let Some(o) = &offers {- let (clicked, rect) = super::keywording::offers_below(ui, r.response.rect, o, at);+ if let Some(o) = offers.as_ref().filter(|_| in_sight) {+ let (clicked, rect) = super::keywording::offers_below(ui, r.response.rect, o, at.as_deref());drawn = rect;picked = picked.or(clicked);}- ui.data_mut(|d| d.insert_temp(oid, (typed.clone(), at, drawn, pass)));+ ui.data_mut(|d| d.insert_temp(oid, (typed.clone(), at, drawn, pass, !in_sight)));// Return gives the keywords to the selected photos; Esc gives back what was there before// this edit (the shared field does)let returned = r.ending == Some(crate::text_field::Ending::Return) && !text.trim().is_empty();+ // a new name goes inside the default parent (Put New Keywords Inside This Keyword)+ let as_typed = |app: &LightcraftApp, text: &str| -> Vec<String> {+ text.split(',').map(|s| app.session.catalog.typed_keyword(s)).filter(|s| !s.is_empty()).collect()+ };let adding: Option<Vec<String>> = match picked {// an offer: it, and the keywords typed before the last commaSome(super::keywording::Picked::Keyword(k)) => {@@ -921,28 +947,30 @@ fn keywording(app: &mut LightcraftApp, ui: &mut egui::Ui) {kws.push(k);Some(kws)}- // a new name goes inside the default parent (Put New Keywords Inside This Keyword)- Some(super::keywording::Picked::Typed) => {- Some(text.split(',').map(|s| app.session.catalog.typed_keyword(s)).filter(|s| !s.is_empty()).collect())- }- None if returned => Some(text.split(',').map(|s| app.session.catalog.typed_keyword(s)).filter(|s| !s.is_empty()).collect()),+ Some(super::keywording::Picked::Typed) => Some(as_typed(app, &text)),+ None if returned => Some(as_typed(app, &text)),None => None,};if let Some(kws) = adding {- let _ = app.run("photo.setMeta", json!({"addKeywords": kws}));- text.clear();- // an offer taken leaves the cursor in the box, for the next keyword- if !returned {- ui.memory_mut(|m| m.request_focus(field));+ // (refused, the text stays to be put right, and the refusal is said)+ match app.run("photo.setMeta", json!({"addKeywords": kws})) {+ Ok(_) => {+ text.clear();+ // an offer taken leaves the cursor in the box, for the next keyword+ if !returned {+ ui.data_mut(|d| d.insert_temp(bid, true));+ }+ }+ Err(e) => app.toast_error(ui.ctx(), e),}}ui.data_mut(|d| d.insert_temp(kid, text));ui.add_space(8.0);super::keywording::view_switch(app, ui);ui.add_space(4.0);- super::keywording::scope(app, ui);+ super::keywording::scope(app, ui, &selection);if app.ui.keywording_view == crate::state::KeywordingView::Keywords {- super::keywording::chip_row(app, ui);+ super::keywording::chip_row(app, ui, &selection);} else {super::keywording::names_row(app, ui);}diff --git a/crates/ui-egui/src/state.rs b/crates/ui-egui/src/state.rsindex f3b40a95e..0112ac4d9 100644--- a/crates/ui-egui/src/state.rs+++ b/crates/ui-egui/src/state.rs@@ -284,6 +284,7 @@ pub struct AppSettings {/// the display is treated as sRGB).pub display_profile: String,/// The Keywording box: whole keyword paths, or grouped by the keyword they are inside.+ #[serde(deserialize_with = "lenient")]pub keyword_chips: KeywordChips,}@@ -726,12 +727,13 @@ pub struct UiState {pub keyword_painter: Option<String>,/// What the Keywording box shows (Lightroom Classic's Keyword Tags views).pub keywording_view: KeywordingView,- /// The Keywording box, grouped: every keyword is shown, however many lines that takes ("+N- /// more" was clicked).+ /// The Keywording box, grouped: every keyword of this selection (its hash) is shown, however+ /// many lines that takes ("+N more" was clicked). Another selection's list is short again.#[serde(skip)]- pub keyword_chips_all: bool,+ pub keyword_chips_all: Option<u64>,/// Sections of the right panel folded shut by a click on their title (`keywording`,/// `keywordList`); the others are open.+ #[serde(deserialize_with = "lenient_ids")]pub folded_sections: Vec<String>,/// The Keyword List's open levels (lower-case paths).pub keyword_list_open: Vec<String>,@@ -1163,7 +1165,7 @@ impl Default for UiState {second_window: false,keyword_painter: None,keywording_view: KeywordingView::default(),- keyword_chips_all: false,+ keyword_chips_all: None,folded_sections: Vec::new(),keyword_list_open: Vec::new(),keyword_list_selected: None,@@ -1266,6 +1268,19 @@ impl UiState {}}+/// A setting read leniently: a value that isn't one of its own (a hand-edited file, a newer+/// build's choice) is the default, and the rest of the settings file is still read.+fn lenient<'de, D: serde::Deserializer<'de>, T: Default + serde::de::DeserializeOwned>(d: D) -> Result<T, D::Error> {+ let value = serde_json::Value::deserialize(d)?;+ Ok(serde_json::from_value(value).unwrap_or_default())+}++/// A list of ids read leniently: what isn't a list is none, and what isn't text in it is left out.+fn lenient_ids<'de, D: serde::Deserializer<'de>>(d: D) -> Result<Vec<String>, D::Error> {+ let value = serde_json::Value::deserialize(d)?;+ Ok(value.as_array().into_iter().flatten().filter_map(|v| v.as_str().map(str::to_string)).collect())+}+fn deserialize_favorite_themes<'de, D: serde::Deserializer<'de>>(d: D) -> Result<Vec<String>, D::Error> {let values = Vec::<String>::deserialize(d)?;let mut seen = std::collections::BTreeSet::new();diff --git a/crates/ui-egui/src/tests_keywording.rs b/crates/ui-egui/src/tests_keywording.rsindex 839760af3..ece0ffc6c 100644--- a/crates/ui-egui/src/tests_keywording.rs+++ b/crates/ui-egui/src/tests_keywording.rs@@ -578,8 +578,145 @@ fn any_name_fits_the_panel() {assert!(r.width() > 0.0 && r.height() < 30.0);}}- // and typing them offers them without trouble+ // and typing them offers them without trouble: the photos here all have them, so another+ // photo's emoji keyword is what is offered+ let next = others(&mut h);+ ask(&mut h, "engine.execute", json!({"command": "photo.setMeta", "params": {"ids": [next[0]], "keywords": ["🙂|العربية|سلام"]}}));typed(&mut h, &"x".repeat(300));+ ask(&mut h, "ui.key", json!({"key": "Escape"}));typed(&mut h, "🙂");- assert!(count(&h, "kwComplete") >= 1);+ assert!(has(&h, "kwComplete:🙂|العربية|سلام"), "{:?}", h.app.widgets.iter().filter(|(w, _)| w.starts_with("kwComplete")).collect::<Vec<_>>());+}++fn lit(h: &Headless) -> Vec<String> {+ h.app.widgets.iter().filter_map(|(w, _)| w.strip_prefix("kwCompleteAt:").map(str::to_string)).collect()+}++/// Ids of the library's photos after the two selected ones.+fn others(h: &mut Headless) -> Vec<u64> {+ h.app.session.visible_cloned().iter().skip(2).take(4).map(|p| p.0).collect()+}++// Given a long grouped list shown whole after "+N more",+// when other photos with a long list are selected,+// then theirs is short again: asking for more was for the photos it was asked of.+#[test]+fn asking_for_more_is_for_the_selection_it_was_asked_of() {+ let (mut h, ids) = two_selected();+ h.app.ui.settings.keyword_chips = crate::state::KeywordChips::Grouped;+ give(&mut h, &ids, &sixteen());+ let next = others(&mut h);+ give(&mut h, &next, &sixteen());+ ask(&mut h, "ui.clickWidget", json!({"id": "keywordChipsMore"}));+ assert_eq!(count(&h, "keywordChip:"), 16);+ // taking a keyword off keeps the list whole: it is still theirs+ ask(&mut h, "engine.execute", json!({"command": "photo.setMeta", "params": {"ids": ids, "removeKeywords": [sixteen()[15]]}}));+ assert_eq!(count(&h, "keywordChip:"), 15);+ ask(&mut h, "engine.execute", json!({"command": "library.select", "params": {"ids": next}}));+ assert_eq!(count(&h, "keywordChip:"), 7, "short again");+ assert!(has(&h, "keywordChipsMore") && !has(&h, "keywordChipsFewer"));+}++// Given a keyword two photos spell differently (Lisbon, lisbon),+// when it is typed,+// then it is offered once, and a click gives it.+#[test]+fn a_keyword_spelled_two_ways_is_offered_once() {+ let (mut h, ids) = two_selected();+ let next = others(&mut h);+ ask(&mut h, "engine.execute", json!({"command": "photo.setMeta", "params": {"ids": [next[0]], "keywords": ["Lisbon"]}}));+ ask(&mut h, "engine.execute", json!({"command": "photo.setMeta", "params": {"ids": [next[1]], "keywords": ["lisbon"]}}));+ typed(&mut h, "lis");+ let offered: Vec<String> = h.app.widgets.iter().filter(|(w, _)| w.starts_with("kwComplete:")).map(|(w, _)| w.clone()).collect();+ assert_eq!(offered.len(), 1, "{offered:?}");+ ask(&mut h, "ui.clickWidget", json!({"id": offered[0]}));+ assert!(ids.iter().all(|id| keywords_of(&h, *id).iter().any(|k| k.eq_ignore_ascii_case("lisbon"))));+}++// Given a highlighted offer,+// when the library changes under it and the offers come in another order,+// then the highlight is still on that keyword (it used to stay on the line, and Return gave+// whatever keyword had moved there).+#[test]+fn the_highlight_stays_with_its_keyword() {+ let (mut h, ids) = with_places();+ typed(&mut h, "por");+ ask(&mut h, "ui.key", json!({"key": "ArrowDown"}));+ let before = lit(&h);+ assert_eq!(before.len(), 1);+ let next = others(&mut h);+ ask(&mut h, "engine.execute", json!({"command": "photo.setMeta", "params": {"ids": next, "addKeywords": ["Portraits"]}}));+ assert!(has(&h, "kwComplete:Portraits"), "the offers changed");+ assert_eq!(lit(&h), before, "the highlight did not move to another keyword");+ ask(&mut h, "ui.key", json!({"key": "Enter"}));+ assert!(all_have(&h, &ids, &before[0]) && none_has(&h, &ids, "Portraits"));+}++// Given an offer taken with ↓ and Return, Esc afterwards does not bring back the keywords that+// were just added: the box stays empty.+#[test]+fn escape_after_an_offer_keeps_the_box_empty() {+ let (mut h, ids) = with_places();+ typed(&mut h, "sea");+ ask(&mut h, "ui.key", json!({"key": "Tab"}));+ ask(&mut h, "ui.clickWidget", json!({"id": "field:keyword"}));+ ask(&mut h, "ui.key", json!({"key": "End"}));+ ask(&mut h, "ui.text", json!({"text": ", lis"}));+ ask(&mut h, "ui.key", json!({"key": "ArrowDown"}));+ ask(&mut h, "ui.key", json!({"key": "Enter"}));+ assert!(all_have(&h, &ids, "sea") && all_have(&h, &ids, "Places|Portugal|Lisbon"));+ ask(&mut h, "ui.key", json!({"key": "Escape"}));+ ask(&mut h, "ui.clickWidget", json!({"id": "field:keyword"}));+ ask(&mut h, "ui.key", json!({"key": "End"}));+ ask(&mut h, "ui.text", json!({"text": "x"}));+ ask(&mut h, "ui.key", json!({"key": "Enter"}));+ assert!(all_have(&h, &ids, "x") && none_has(&h, &ids, "seax"), "{:?}", keywords_of(&h, ids[0]));+}++// ↓ / ↑ / Return with Shift or Alt held are the text box's own (select to the start of the text):+// they leave the offers alone.+#[test]+fn modified_arrows_are_the_text_boxs() {+ let (mut h, ids) = with_places();+ typed(&mut h, "por");+ ask(&mut h, "ui.key", json!({"key": "ArrowDown", "shift": true}));+ assert!(lit(&h).is_empty(), "Shift+↓ highlights nothing: {:?}", lit(&h));+ ask(&mut h, "ui.key", json!({"key": "ArrowDown"}));+ ask(&mut h, "ui.key", json!({"key": "ArrowDown"}));+ let before = lit(&h);+ ask(&mut h, "ui.key", json!({"key": "ArrowUp", "shift": true}));+ assert_eq!(lit(&h), before);+ let _ = ids;+}++// Given the box scrolled out of the panel with the cursor still in it, its offers are not drawn+// (they used to float over the top bar, where Return still took one).+#[test]+fn offers_go_when_the_box_scrolls_out_of_sight() {+ let (mut h, ids) = with_places();+ give(&mut h, &ids, &sixteen());+ typed(&mut h, "lis");+ assert!(has(&h, "kwComplete:Places|Portugal|Lisbon"));+ let panel = rect(&h, "panel:right_panel");+ ask(&mut h, "ui.move", json!({"x": panel.center().x, "y": panel.center().y}));+ for _ in 0..8 {+ ask(&mut h, "ui.scroll", json!({"dy": -400.0}));+ }+ assert!(rect(&h, "field:keyword").bottom() < panel.top(), "scrolled out: {:?}", rect(&h, "field:keyword"));+ assert_eq!(count(&h, "kwComplete"), 0);+}++// Settings files with something else under the two new keys keep every other setting (and these+// two at their defaults): a wrong value used to discard the whole file.+#[test]+fn wrong_values_for_the_new_settings_keep_the_rest() {+ let ui: crate::UiState = serde_json::from_str(r#"{"foldedSections": "oops", "rightWidth": 300.0}"#).unwrap();+ assert!(!ui.section_folded("keywording") && ui.right_width == 300.0);+ let ui: crate::UiState =+ serde_json::from_str(r#"{"foldedSections": [1, "keywordList", null], "settings": {"keywordChips": "bogus", "filmNames": false}}"#).unwrap();+ assert!(ui.section_folded("keywordList") && !ui.section_folded("keywording"));+ assert_eq!(ui.settings.keyword_chips, crate::state::KeywordChips::Paths);+ assert!(!ui.settings.film_names, "the other settings are read");+ let ui: crate::UiState = serde_json::from_str(r#"{"settings": {"keywordChips": "grouped"}}"#).unwrap();+ assert_eq!(ui.settings.keyword_chips, crate::state::KeywordChips::Grouped);}diff --git a/docs/parity-checklist.md b/docs/parity-checklist.mdindex 11a4170ea..639894aed 100644--- a/docs/parity-checklist.md+++ b/docs/parity-checklist.md@@ -704,7 +704,7 @@ From `08-lightroom-classic-extras.md` (Classic-only features) and part 2 of `06-| LRC-LIB-STACKS | Stacks (full) | P1 | ✅ | `crates/catalog/src/stacks.rs`, `cmd:stack.group`, `cmd:stack.split`, `cmd:stack.moveUp`, `cmd:stack.moveDown` | group / ungroup / toggle / set top / remove / auto by time / split / move up and down || LRC-LIB-VC | Virtual copies | P1 | ✅ | `cmd:photo.virtualCopy` | ⌘' || LRC-LIB-LABELS | Colour-label sets | P1 | ✅ | `cmd:label.sets`, `cmd:label.applySet`, `cmd:label.saveSet`, `cmd:label.deleteSet`, `cmd:label.setNames`, `crates/engine/src/cmd/manage.rs` | built-in Colors / Review sets + user sets (Photo ▸ Set Color Label, Edit Label Names… dialog); names written to and read from `xmp:Label` |-| LRC-LIB-KEYWORDS | Hierarchical keywords, sets, painter, Keyword List | P1 | ✅ | `crates/catalog/src/keywords.rs`, `crates/ui-egui/src/panels/keyword_list.rs`, `cmd:keyword.list`, `cmd:keyword.create`, `cmd:keyword.edit`, `cmd:keyword.move`, `cmd:keyword.info`, `cmd:keyword.purgeUnused`, `cmd:keyword.setDefaultParent`, `cmd:keyword.sets`, `cmd:keyword.toggleFromSet`, `cmd:keyword.saveSet`, `cmd:tool.keywordPainter` | hierarchical `a\|b\|c` keywords (tree, parent filters include children, rename moves children); keyword sets + Recent Keywords (⌥1–⌥9); keyword painter (Keywords panel ▸ Paint: click photos in the grid to toggle a keyword, Esc stops). Keyword List (Keywords panel): every keyword, those without photos too (a keyword list in the catalog, format version 4), with counts, a filter box, a tri-state tick box for the selection and an arrow to show its photos; + / Create Keyword Tag (name, synonyms, put inside, add to selected photos), double-click / Edit Keyword Tag, − / Delete with confirmation, context menu (create inside, Put New Keywords Inside This Keyword, purge unused keywords); drag a keyword onto another to nest it or onto the list's title for the top level (a merge asks first), drag photos onto a keyword to tag them. The list is there without a selection too; Put New Keywords Inside This Keyword (kept with the keyword in the library, undoable) also places new keywords typed in the Keywords panel. Keyword tag options include on export, export containing keywords and export synonyms shape exported files (names in `dc:subject`, paths in `lr:hierarchicalSubject`), and files' `lr:hierarchicalSubject` paths come back as keywords on import and from sidecars; Person is stored only. Keywording box (`crates/ui-egui/src/panels/keywording.rs`): the selection's keywords as chips (one only some selected photos have marked with an asterisk; × only removes, from every selected photo; with no selection, the active photo's), a Keywords / & Containing / Will Export switch (Lightroom Classic's Keyword Tags views: the keywords to edit, them with their parents, what exported files carry), keyword-set buttons and suggestions that follow the selection, shared text fields for typing and painting. Settings ▸ Interface ▸ Keywords of the selection ▸ Grouped by parent (`keywordChips: grouped` in the app settings; Whole names stays the default): keywords inside the same keyword share a line naming it (`keywordGroup:<parent>`: the deepest keyword a chip shares with another) and their chips say only what is below it, side by side; a list of more than ten lines stops after eight with “+N more” (`keywordChipsMore`, then `keywordChipsFewer`), and the suggestions say the keyword's own name (its whole path when two share a name, and in the tooltip). The titles of Keywords and of the Keyword List fold their sections shut (`section:keywording`, `section:keywordList`; kept in the UI state as `foldedSections`), and a selection without keywords says “No keywords yet”. The Add keyword box offers the library's keywords for what is being typed (after the last comma) right under itself (`kwComplete:<keyword>`, at most eight, those every selected photo has left out): ↓ / ↑ move through them (`kwCompleteAt:<keyword>`), Return or a click gives the highlighted one with the keywords typed before it and leaves the cursor in the box; with none highlighted Return gives what was typed, as before. A name the library doesn't have is announced as a new keyword, with the keyword it would go inside (`kwCompleteCreate`). The suggestions below no longer change while typing. With several photos selected the box says how many its keywords are of (`keywordScope`); a chip's × is a target as tall as the chip and 22 pt wide that lights up on its own, and taking a keyword off several photos (× or the chip's menu) says which keyword, from how many photos, and that Edit ▸ Undo puts it back; a refused removal says why. Chips and their × show the keyboard focus. Edit Keyword Set (Keyword Set ▸ Edit Set…): a set's name and nine slots typed in place, empty slots kept so each keyword stays on its ⌥ key, a set renamed in place (`cmd:keyword.saveSet` `replace`) or saved as a new set (`new`, a taken name refused). File ▸ Import Keywords… / Export Keywords… (`cmd:keyword.import`, `cmd:keyword.export`): keyword list files in Lightroom Classic's format (tab-indented, `{synonym}`, `[left out of export]`), which Capture One, darktable, Bridge and Photo Supreme (its Formatted Vocabulary File) read and write too; import adds what is missing in one undo step, export names the keywords Capture One refuses (; , < >). Not yet: synonyms in search, person keywords tied to faces, Keyword Shortcut, IPTC keywords in exported files (Piwigo, RawTherapee), hierarchy from digiKam / ACDSee / Microsoft XMP fields |+| LRC-LIB-KEYWORDS | Hierarchical keywords, sets, painter, Keyword List | P1 | ✅ | `crates/catalog/src/keywords.rs`, `crates/ui-egui/src/panels/keyword_list.rs`, `cmd:keyword.list`, `cmd:keyword.create`, `cmd:keyword.edit`, `cmd:keyword.move`, `cmd:keyword.info`, `cmd:keyword.purgeUnused`, `cmd:keyword.setDefaultParent`, `cmd:keyword.sets`, `cmd:keyword.toggleFromSet`, `cmd:keyword.saveSet`, `cmd:tool.keywordPainter` | hierarchical `a\|b\|c` keywords (tree, parent filters include children, rename moves children); keyword sets + Recent Keywords (⌥1–⌥9); keyword painter (Keywords panel ▸ Paint: click photos in the grid to toggle a keyword, Esc stops). Keyword List (Keywords panel): every keyword, those without photos too (a keyword list in the catalog, format version 4), with counts, a filter box, a tri-state tick box for the selection and an arrow to show its photos; + / Create Keyword Tag (name, synonyms, put inside, add to selected photos), double-click / Edit Keyword Tag, − / Delete with confirmation, context menu (create inside, Put New Keywords Inside This Keyword, purge unused keywords); drag a keyword onto another to nest it or onto the list's title for the top level (a merge asks first), drag photos onto a keyword to tag them. The list is there without a selection too; Put New Keywords Inside This Keyword (kept with the keyword in the library, undoable) also places new keywords typed in the Keywords panel. Keyword tag options include on export, export containing keywords and export synonyms shape exported files (names in `dc:subject`, paths in `lr:hierarchicalSubject`), and files' `lr:hierarchicalSubject` paths come back as keywords on import and from sidecars; Person is stored only. Keywording box (`crates/ui-egui/src/panels/keywording.rs`): the selection's keywords as chips (one only some selected photos have marked with an asterisk; × only removes, from every selected photo; with no selection, the active photo's), a Keywords / & Containing / Will Export switch (Lightroom Classic's Keyword Tags views: the keywords to edit, them with their parents, what exported files carry), keyword-set buttons and suggestions that follow the selection, shared text fields for typing and painting. Settings ▸ Interface ▸ Keywords of the selection ▸ Grouped by parent (`keywordChips: grouped` in the app settings; Whole names stays the default): keywords inside the same keyword share a line naming it (`keywordGroup:<parent>`: the deepest keyword a chip shares with another) and their chips say only what is below it, side by side; a list of more than ten lines stops after eight with “+N more” (`keywordChipsMore`, then `keywordChipsFewer`); the whole list is for the selection it was asked of, another selection's is short again, and the suggestions say the keyword's own name (its whole path when two share a name, and in the tooltip). The titles of Keywords and of the Keyword List fold their sections shut (`section:keywording`, `section:keywordList`; kept in the UI state as `foldedSections`), and a selection without keywords says “No keywords yet”. The Add keyword box offers the library's keywords for what is being typed (after the last comma) right under itself (`kwComplete:<keyword>`, at most eight, those every selected photo has left out, a keyword spelled two ways once; above the box where the window has no room under it, and not at all while the box is scrolled out of the panel): ↓ / ↑ without Shift or Alt move through them (`kwCompleteAt:<keyword>`; the highlight stays with its keyword when the library changes), Return or a click gives the highlighted one with the keywords typed before it and leaves the cursor in the box; with none highlighted Return gives what was typed, as before. A name the library doesn't have is announced as a new keyword, with the keyword it would go inside (`kwCompleteCreate`). The suggestions below no longer change while typing. A refused add says why and keeps the text. With several photos selected the box says how many its keywords are of (`keywordScope`); a chip's × is a target as tall as the chip and 22 pt wide that lights up on its own, and taking a keyword off several photos (× or the chip's menu) says which keyword, from how many photos, and that Edit ▸ Undo puts it back; a refused removal says why. Chips and their × show the keyboard focus. Edit Keyword Set (Keyword Set ▸ Edit Set…): a set's name and nine slots typed in place, empty slots kept so each keyword stays on its ⌥ key, a set renamed in place (`cmd:keyword.saveSet` `replace`) or saved as a new set (`new`, a taken name refused). File ▸ Import Keywords… / Export Keywords… (`cmd:keyword.import`, `cmd:keyword.export`): keyword list files in Lightroom Classic's format (tab-indented, `{synonym}`, `[left out of export]`), which Capture One, darktable, Bridge and Photo Supreme (its Formatted Vocabulary File) read and write too; import adds what is missing in one undo step, export names the keywords Capture One refuses (; , < >). Not yet: synonyms in search, person keywords tied to faces, Keyword Shortcut, IPTC keywords in exported files (Piwigo, RawTherapee), hierarchy from digiKam / ACDSee / Microsoft XMP fields || LRC-LIB-METADATA | Metadata panel & presets | P1 | ✅ | `cmd:photo.setMeta`, `cmd:metadata.savePreset`, `cmd:metadata.applyPreset`, `cmd:metadata.presets`, `cmd:metadata.deletePreset`, `cmd:dialog.captureTime` | IPTC core, accessibility, place, capture-time edit; copyright status (unknown / copyrighted / public domain), rights usage terms and copyright info URL (`photo.setMeta` `copyrightStatus`, `usageTerms`, `copyrightUrl`; XMP Rights Management fields, kept by "copyright only" exports, a smart-album rule); metadata presets (Photo → Metadata Preset, Save Metadata Preset… from the active photo; applied on import from Settings) || LRC-LIB-QUICKDEV | Quick develop | P2 | ✅ | `cmd:develop.quickAdjust`, `crates/ui-egui/src/panels/edit.rs` (`quick_develop`) | grid with several photos selected: Edit panel ▸ Quick Develop steps (exposure ⅓ / 1 stop, contrast, highlights, shadows, whites, blacks, clarity, vibrance, temperature) added to each photo's own value, one undo step || LRC-LIB-PEOPLE | People view | P2 | 🟡 | `cmd:view.people`, `cmd:view.person`, `cmd:faces.person`, `cmd:faces.unnamed`, `cmd:faces.nameFaces`, `crates/ui-egui/src/panels/people.rs`, `crates/ui-egui/src/panels/person.rs`, `crates/ui-egui/src/panels/unnamed.rs`, `crates/engine/src/face_tiles.rs` | Named People cards (face close-up, the photo count on the picture, name) for the photos the active filters let through, with the filter chips shown above them, sized by the thumbnail slider. Below them the **Unnamed faces**: every face nobody has named as a cropped picture, look-alikes next to each other once recognition has looked at them, a suggested name on a face the named ones recognise; click or Shift-click to select, type a name, Enter names the whole group in one undo step. A click on a person opens their page: only cropped faces, then **More** (unnamed faces that look like them, best first; click to confirm, × to hide). Every face is shown by the detector's box where the scan has one, so faces are equally close. Until recognition is set up a line at the top offers the next step (Settings ▸ Faces, or Turn on), as does the loupe's name box. Face pictures of unedited raws are cut from the largest embedded preview (planned read: header and JPEG only, never the sensor data) when it holds at least ¾ of the tile's pixels across the face, else developed as before; all are kept in the thumbnail disk cache at 16 px size steps, so a later launch shows them without reading the originals (#1440, `docs/faces.md`). No clusters with separators between groups, no persistent reject, no merge of two people