From 70b620b85ecf59bf83b65ea3ee16e389cd5b3d71 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sat, 31 Oct 2026 02:57:16 -0700 Subject: [PATCH] LRC-LIB-KEYWORDS: the Keywording panel's Enter Keywords view edits keywords as text The Keywording box gets an Enter Keywords view (keywordView:enter) next to Keywords, & Containing and Will Export. It shows the selected photos' keywords as text, with commas between them and an asterisk after a keyword only some of the photos have. Return or leaving the box applies the edit to the photos selected when it began, as one photo.setMeta call and one undo step: a keyword left out comes off every one of them, a name typed goes to all of them, a marked keyword stays on the photos that have it, and without its asterisk it goes to all of them. Esc gives the edit up, and so does another selection. An asterisk after any other name is refused, and the text is kept. Containing keywords and synonyms stay out of the text. How mixed keywords are handled and when an edit applies are LightCraft's own rules; the help pages describe the view without saying either. --- crates/ui-egui/locales/cs-formats.json | 1 + crates/ui-egui/locales/cs.json | 3 + crates/ui-egui/locales/de-formats.json | 1 + crates/ui-egui/locales/de.json | 3 + crates/ui-egui/locales/es-formats.json | 1 + crates/ui-egui/locales/es.json | 3 + crates/ui-egui/locales/fi-formats.json | 1 + crates/ui-egui/locales/fi.json | 3 + crates/ui-egui/locales/fr-formats.json | 1 + crates/ui-egui/locales/fr.json | 3 + crates/ui-egui/locales/id-formats.json | 1 + crates/ui-egui/locales/id.json | 3 + crates/ui-egui/locales/it-formats.json | 1 + crates/ui-egui/locales/it.json | 3 + crates/ui-egui/locales/ja-formats.json | 1 + crates/ui-egui/locales/ja.json | 3 + crates/ui-egui/locales/ka-formats.json | 1 + crates/ui-egui/locales/ka.json | 3 + crates/ui-egui/locales/pl-formats.json | 1 + crates/ui-egui/locales/pl.json | 3 + crates/ui-egui/locales/pt-br-formats.json | 1 + crates/ui-egui/locales/pt-br.json | 3 + crates/ui-egui/locales/ru-formats.json | 1 + crates/ui-egui/locales/ru.json | 3 + crates/ui-egui/locales/sv-formats.json | 1 + crates/ui-egui/locales/sv.json | 3 + crates/ui-egui/locales/uk-formats.json | 1 + crates/ui-egui/locales/uk.json | 3 + crates/ui-egui/locales/vi-formats.json | 1 + crates/ui-egui/locales/vi.json | 3 + crates/ui-egui/locales/zh-hans-formats.json | 1 + crates/ui-egui/locales/zh-hans.json | 3 + crates/ui-egui/locales/zh-hant-formats.json | 1 + crates/ui-egui/locales/zh-hant.json | 3 + crates/ui-egui/src/panels/keywording.rs | 138 +++++++++++++++++++- crates/ui-egui/src/panels/right/keywords.rs | 105 ++++++++++++++- crates/ui-egui/src/state/view.rs | 6 +- crates/ui-egui/src/tests/keywording.rs | 94 +++++++++++++ docs/parity-checklist.md | 2 +- 39 files changed, 400 insertions(+), 13 deletions(-) diff --git a/crates/ui-egui/locales/cs-formats.json b/crates/ui-egui/locales/cs-formats.json index e0ec9f1baa..f012f37466 100644 --- a/crates/ui-egui/locales/cs-formats.json +++ b/crates/ui-egui/locales/cs-formats.json @@ -114,6 +114,7 @@ "New Folder in “{name}”": "Nová složka v „{name}“", "Created folder “{name}” in “{parent}”": "Vytvořena složka „{name}“ v „{parent}“", "On {have} of {of} selected photos": "Na {have} z {of} vybraných fotografií", + "A keyword name can't end with an asterisk: “{name}”": "Název klíčového slova nemůže končit hvězdičkou: „{name}“", "Painting “{k}”: click photos to add or remove it · Esc stops": "Nanášení „{k}“: kliknutím na fotografie přidáte nebo odeberete slovo · Esc ukončí režim", "Paste into {n} photo{} — only settings that were copied are pasted": "Vložit do fotografií: {n}{:.0} — vloží se pouze zkopírovaná nastavení", "Preset: {name}": "Přednastavení: {name}", diff --git a/crates/ui-egui/locales/cs.json b/crates/ui-egui/locales/cs.json index 6a056bbfb9..e0eaf629a8 100644 --- a/crates/ui-egui/locales/cs.json +++ b/crates/ui-egui/locales/cs.json @@ -5,6 +5,9 @@ " · in a burst": " · v sérii", "% of all commits": "% všech commitů", "& Containing": "& Obsahující", + "Enter Keywords": "Zadat klíčová slova", + "Keywords, separated by commas": "Klíčová slova oddělená čárkami", + "Return applies the edit to the selected photos; Esc gives it up. An asterisk marks a keyword only some of them have.": "Klávesou Return úpravu použijete na vybrané fotografie, klávesou Esc ji zrušíte. Hvězdička označuje klíčové slovo, které má jen část z nich.", "+ Group": "+ Skupina", "+ Rule": "+ Pravidlo", ", picked": ", vybráno", diff --git a/crates/ui-egui/locales/de-formats.json b/crates/ui-egui/locales/de-formats.json index 782886be84..ba5dc85ae8 100644 --- a/crates/ui-egui/locales/de-formats.json +++ b/crates/ui-egui/locales/de-formats.json @@ -232,6 +232,7 @@ "Added “{keyword}” to {n} photo{}": "„{keyword}“ zu {n} Foto{} hinzugefügt", "Add Keyword “{keywords}”": "Stichwort „{keywords}“ hinzufügen", "On {have} of {of} selected photos": "Bei {have} von {of} ausgewählten Fotos", + "A keyword name can't end with an asterisk: “{name}”": "Ein Stichwortname darf nicht mit einem Sternchen enden: „{name}“", "Remove “{name}”": "„{name}“ entfernen", "There is a keyword set “{name}” already": "Es gibt bereits einen Stichwortsatz „{name}“", "Added {n} keyword{}": "Stichwörter hinzugefügt: {n}{:.0}", diff --git a/crates/ui-egui/locales/de.json b/crates/ui-egui/locales/de.json index 405c54a464..6b77f4726a 100644 --- a/crates/ui-egui/locales/de.json +++ b/crates/ui-egui/locales/de.json @@ -2059,6 +2059,9 @@ "Will Export": "Wird exportiert", "No keywords are exported": "Es werden keine Stichwörter exportiert", "& Containing": "& Übergeordnete", + "Enter Keywords": "Stichwörter eingeben", + "Keywords, separated by commas": "Stichwörter, durch Kommas getrennt", + "Return applies the edit to the selected photos; Esc gives it up. An asterisk marks a keyword only some of them have.": "Die Eingabetaste wendet die Änderung auf die ausgewählten Fotos an, Esc verwirft sie. Ein Sternchen kennzeichnet ein Stichwort, das nur einige von ihnen haben.", "Edit Set…": "Satz bearbeiten…", "Edit Keyword Set": "Stichwortsatz bearbeiten", "Edit Keywords": "Stichwörter bearbeiten", diff --git a/crates/ui-egui/locales/es-formats.json b/crates/ui-egui/locales/es-formats.json index 41ae09d66e..f85c0c913f 100644 --- a/crates/ui-egui/locales/es-formats.json +++ b/crates/ui-egui/locales/es-formats.json @@ -233,6 +233,7 @@ "Added “{keyword}” to {n} photo{}": "Se añadió “{keyword}” a {n} foto{}", "Add Keyword “{keywords}”": "Añadir palabra clave “{keywords}”", "On {have} of {of} selected photos": "En {have} de {of} fotos seleccionadas", + "A keyword name can't end with an asterisk: “{name}”": "El nombre de una palabra clave no puede terminar en asterisco: «{name}»", "Remove “{name}”": "Quitar “{name}”", "There is a keyword set “{name}” already": "Ya hay un conjunto de palabras clave “{name}”", "Added {n} keyword{}": "Palabras clave añadidas: {n}{:.0}", diff --git a/crates/ui-egui/locales/es.json b/crates/ui-egui/locales/es.json index e43ae8c49b..178584c309 100644 --- a/crates/ui-egui/locales/es.json +++ b/crates/ui-egui/locales/es.json @@ -2088,6 +2088,9 @@ "Will Export": "Se exportará", "No keywords are exported": "No se exporta ninguna palabra clave", "& Containing": "y contenedoras", + "Enter Keywords": "Introducir palabras clave", + "Keywords, separated by commas": "Palabras clave separadas por comas", + "Return applies the edit to the selected photos; Esc gives it up. An asterisk marks a keyword only some of them have.": "Intro aplica el cambio a las fotos seleccionadas; Esc lo descarta. Un asterisco marca una palabra clave que solo tienen algunas de ellas.", "Edit Set…": "Editar conjunto…", "Edit Keyword Set": "Editar conjunto de palabras clave", "Edit Keywords": "Editar palabras clave", diff --git a/crates/ui-egui/locales/fi-formats.json b/crates/ui-egui/locales/fi-formats.json index 720519a1cc..de04034e74 100644 --- a/crates/ui-egui/locales/fi-formats.json +++ b/crates/ui-egui/locales/fi-formats.json @@ -140,6 +140,7 @@ "New Folder in “{name}”": "Uusi kansio kohteessa ”{name}”", "Created folder “{name}” in “{parent}”": "Kansio ”{name}” luotu kohteeseen ”{parent}”", "On {have} of {of} selected photos": "{have} / {of} valitulla kuvalla", + "A keyword name can't end with an asterisk: “{name}”": "Avainsanan nimi ei voi päättyä tähteen: ”{name}”", "Painting “{k}”: click photos to add or remove it · Esc stops": "Maalataan ”{k}”: napsauta kuvia lisätäksesi tai poistaaksesi sen · Esc lopettaa", "Paste into {n} photo{} — only settings that were copied are pasted": "Liitä kuviin: {n}{:.0} — vain kopioidut asetukset liitetään", "Preset: {name}": "Esiasetus: {name}", diff --git a/crates/ui-egui/locales/fi.json b/crates/ui-egui/locales/fi.json index ff7e03c066..d52eec6f93 100644 --- a/crates/ui-egui/locales/fi.json +++ b/crates/ui-egui/locales/fi.json @@ -5,6 +5,9 @@ " · in a burst": " · osa sarjaa", "% of all commits": "% kaikista commiteista", "& Containing": "& sisältää", + "Enter Keywords": "Kirjoita avainsanat", + "Keywords, separated by commas": "Avainsanat pilkuilla erotettuina", + "Return applies the edit to the selected photos; Esc gives it up. An asterisk marks a keyword only some of them have.": "Return tekee muutoksen valituille kuville, Esc peruu sen. Tähti merkitsee avainsanaa, joka on vain osalla niistä.", "(not in the library)": "(ei kirjastossa)", "+ Group": "+ Ryhmä", "+ Rule": "+ Sääntö", diff --git a/crates/ui-egui/locales/fr-formats.json b/crates/ui-egui/locales/fr-formats.json index fc46d653c6..517e62fe48 100644 --- a/crates/ui-egui/locales/fr-formats.json +++ b/crates/ui-egui/locales/fr-formats.json @@ -233,6 +233,7 @@ "Added “{keyword}” to {n} photo{}": "« {keyword} » ajouté à {n} photo{}", "Add Keyword “{keywords}”": "Ajouter le mot-clé « {keywords} »", "On {have} of {of} selected photos": "Sur {have} des {of} photos sélectionnées", + "A keyword name can't end with an asterisk: “{name}”": "Un nom de mot-clé ne peut pas se terminer par un astérisque : « {name} »", "Remove “{name}”": "Retirer « {name} »", "There is a keyword set “{name}” already": "Un jeu de mots-clés « {name} » existe déjà", "Added {n} keyword{}": "Mots-clés ajoutés : {n}{:.0}", diff --git a/crates/ui-egui/locales/fr.json b/crates/ui-egui/locales/fr.json index e032cf52f3..75d4bff648 100644 --- a/crates/ui-egui/locales/fr.json +++ b/crates/ui-egui/locales/fr.json @@ -1895,6 +1895,9 @@ "Will Export": "Sera exporté", "No keywords are exported": "Aucun mot-clé n'est exporté", "& Containing": "et parents", + "Enter Keywords": "Saisir des mots-clés", + "Keywords, separated by commas": "Mots-clés séparés par des virgules", + "Return applies the edit to the selected photos; Esc gives it up. An asterisk marks a keyword only some of them have.": "Entrée applique la modification aux photos sélectionnées, Échap l'annule. Un astérisque marque un mot-clé que seules certaines d'entre elles ont.", "Edit Set…": "Modifier le jeu…", "Edit Keyword Set": "Modifier le jeu de mots-clés", "Edit Keywords": "Modifier les mots-clés", diff --git a/crates/ui-egui/locales/id-formats.json b/crates/ui-egui/locales/id-formats.json index 22eb2d49e3..62c20dfadf 100644 --- a/crates/ui-egui/locales/id-formats.json +++ b/crates/ui-egui/locales/id-formats.json @@ -236,6 +236,7 @@ "Added “{keyword}” to {n} photo{}": "“{keyword}” ditambahkan ke {n} foto{:.0}", "Add Keyword “{keywords}”": "Tambahkan kata kunci “{keywords}”", "On {have} of {of} selected photos": "Pada {have} dari {of} foto yang dipilih", + "A keyword name can't end with an asterisk: “{name}”": "Nama kata kunci tidak boleh diakhiri tanda bintang: “{name}”", "Remove “{name}”": "Hapus “{name}”", "There is a keyword set “{name}” already": "Set kata kunci “{name}” sudah ada", "Added {n} keyword{}": "{n} kata kunci ditambahkan{:.0}", diff --git a/crates/ui-egui/locales/id.json b/crates/ui-egui/locales/id.json index 1c70f26344..c8e964d592 100644 --- a/crates/ui-egui/locales/id.json +++ b/crates/ui-egui/locales/id.json @@ -6,6 +6,9 @@ "#106): a DNG is checked against the raw data, written to a temp file, synced and read back before it gets its": "#106): DNG dicocokkan dengan data raw, ditulis ke file sementara, disinkronkan, lalu dibaca ulang sebelum diberi", "% of all commits": "% dari semua commit", "& Containing": "& kata kunci induk", + "Enter Keywords": "Masukkan kata kunci", + "Keywords, separated by commas": "Kata kunci, dipisahkan dengan koma", + "Return applies the edit to the selected photos; Esc gives it up. An asterisk marks a keyword only some of them have.": "Tekan Return untuk menerapkan perubahan ke foto yang dipilih, Esc untuk membatalkannya. Tanda bintang menandai kata kunci yang hanya dimiliki sebagian foto.", "(not in the library)": "(tidak ada di pustaka)", "+ Group": "+ Grup", "+ Rule": "+ Aturan", diff --git a/crates/ui-egui/locales/it-formats.json b/crates/ui-egui/locales/it-formats.json index 4437aa644d..5c91284e32 100644 --- a/crates/ui-egui/locales/it-formats.json +++ b/crates/ui-egui/locales/it-formats.json @@ -229,6 +229,7 @@ "Added “{keyword}” to {n} photo{}": "Aggiunta “{keyword}” a {n} foto{:.0}", "Add Keyword “{keywords}”": "Aggiungi parola chiave “{keywords}”", "On {have} of {of} selected photos": "Su {have} di {of} foto selezionate", + "A keyword name can't end with an asterisk: “{name}”": "Il nome di una parola chiave non può terminare con un asterisco: “{name}”", "Remove “{name}”": "Rimuovi “{name}”", "There is a keyword set “{name}” already": "Esiste già un set di parole chiave “{name}”", "Added {n} keyword{}": "Parole chiave aggiunte: {n}{:.0}", diff --git a/crates/ui-egui/locales/it.json b/crates/ui-egui/locales/it.json index a0d39d0610..f638439b6a 100644 --- a/crates/ui-egui/locales/it.json +++ b/crates/ui-egui/locales/it.json @@ -2014,6 +2014,9 @@ "Will Export": "Verrà esportata", "No keywords are exported": "Nessuna parola chiave viene esportata", "& Containing": "e contenenti", + "Enter Keywords": "Inserisci parole chiave", + "Keywords, separated by commas": "Parole chiave separate da virgole", + "Return applies the edit to the selected photos; Esc gives it up. An asterisk marks a keyword only some of them have.": "Invio applica la modifica alle foto selezionate, Esc la annulla. Un asterisco indica una parola chiave che hanno solo alcune di esse.", "Edit Set…": "Modifica set…", "Edit Keyword Set": "Modifica set di parole chiave", "Edit Keywords": "Modifica parole chiave", diff --git a/crates/ui-egui/locales/ja-formats.json b/crates/ui-egui/locales/ja-formats.json index 2fb625ff6a..b07df2d55f 100644 --- a/crates/ui-egui/locales/ja-formats.json +++ b/crates/ui-egui/locales/ja-formats.json @@ -237,6 +237,7 @@ "Added “{keyword}” to {n} photo{}": "写真{n}枚に「{keyword}」を追加しました{:.0}", "Add Keyword “{keywords}”": "キーワード「{keywords}」を追加", "On {have} of {of} selected photos": "選択した写真{of}枚のうち{have}枚", + "A keyword name can't end with an asterisk: “{name}”": "キーワード名の末尾にアスタリスクは使えません:「{name}」", "Remove “{name}”": "「{name}」を削除", "There is a keyword set “{name}” already": "キーワードセット「{name}」はすでにあります", "Added {n} keyword{}": "{n}件のキーワードを追加しました{:.0}", diff --git a/crates/ui-egui/locales/ja.json b/crates/ui-egui/locales/ja.json index 5f80d7896b..0fa1998178 100644 --- a/crates/ui-egui/locales/ja.json +++ b/crates/ui-egui/locales/ja.json @@ -1908,6 +1908,9 @@ "Will Export": "書き出されるキーワード", "No keywords are exported": "書き出されるキーワードはありません", "& Containing": "と親キーワード", + "Enter Keywords": "キーワードを入力", + "Keywords, separated by commas": "キーワード (カンマ区切り)", + "Return applies the edit to the selected photos; Esc gives it up. An asterisk marks a keyword only some of them have.": "Return キーで選択した写真に変更を適用し、Esc キーで取り消します。アスタリスクは一部の写真だけにあるキーワードを示します。", "Edit Set…": "セットを編集…", "Edit Keyword Set": "キーワードセットを編集", "Edit Keywords": "キーワードを編集", diff --git a/crates/ui-egui/locales/ka-formats.json b/crates/ui-egui/locales/ka-formats.json index 329662ac1b..b76c111863 100644 --- a/crates/ui-egui/locales/ka-formats.json +++ b/crates/ui-egui/locales/ka-formats.json @@ -115,6 +115,7 @@ "New Folder in “{name}”": "ახალი საქაღალდე „{name}“-ში", "Created folder “{name}” in “{parent}”": "საქაღალდე „{name}“ შეიქმნა „{parent}“-ში", "On {have} of {of} selected photos": "{of} მონიშნული ფოტოდან {have}-ზე", + "A keyword name can't end with an asterisk: “{name}”": "საკვანძო სიტყვის სახელი ვარსკვლავით ვერ დასრულდება: „{name}“", "Painting “{k}”: click photos to add or remove it · Esc stops": "„{k}“-ის მინიჭება: დაწკაპეთ ფოტოებზე მის დასამატებლად ან მოსახსნელად · Esc ასრულებს", "Paste into {n} photo{} — only settings that were copied are pasted": "ჩასმა ფოტოებში: {n}{:.0} — ჩაისმება მხოლოდ კოპირებული პარამეტრები", "Preset: {name}": "პრესეტი: {name}", diff --git a/crates/ui-egui/locales/ka.json b/crates/ui-egui/locales/ka.json index 0ea7d3d805..8c8a98af87 100644 --- a/crates/ui-egui/locales/ka.json +++ b/crates/ui-egui/locales/ka.json @@ -11,6 +11,9 @@ "#106): a DNG is checked against the raw data, written to a temp file, synced and read back before it gets its": "#106): DNG მოწმდება RAW მონაცემებთან, იწერება დროებით ფაილში, სინქრონიზდება და ხელახლა იკითხება, სანამ მიიღებს", "% of all commits": "ყველა კომიტის %", "& Containing": "და შემცველი", + "Enter Keywords": "საკვანძო სიტყვების შეყვანა", + "Keywords, separated by commas": "საკვანძო სიტყვები, მძიმეებით გამოყოფილი", + "Return applies the edit to the selected photos; Esc gives it up. An asterisk marks a keyword only some of them have.": "Return ცვლილებას მონიშნულ ფოტოებს ანიჭებს, Esc კი აუქმებს. ვარსკვლავი აღნიშნავს საკვანძო სიტყვას, რომელიც მხოლოდ ზოგიერთ მათგანს აქვს.", "(\"Failed to associate portal window with parent window\" in the portal's log): tiling compositors put it beside the": "(„Failed to associate portal window with parent window“ პორტალის ჟურნალში): ფილისებრი კომპოზიტორები მას", "(Esc keeps the old angle; a decimal comma works too), or click the Straighten value; hovering any slider's value now says it can be typed.": "(Esc ძველ კუთხეს ტოვებს; ათწილადი მძიმეც მუშაობს), ან დაწკაპეთ გასწორების მნიშვნელობაზე; ნებისმიერი სლაიდერის მნიშვნელობაზე მიტანისას ახლა ჩანს, რომ მისი აკრეფა შეიძლება.", "(Space, G, X, ⌫) and ⌘ shortcuts were not affected.": "(Space, G, X, ⌫) და ⌘ მალსახმობებზე ეს გავლენას არ ახდენდა.", diff --git a/crates/ui-egui/locales/pl-formats.json b/crates/ui-egui/locales/pl-formats.json index 3f0fd43a22..570f8e47db 100644 --- a/crates/ui-egui/locales/pl-formats.json +++ b/crates/ui-egui/locales/pl-formats.json @@ -220,6 +220,7 @@ "Added “{keyword}” to {n} photo{}": "Dodano „{keyword}” do zdjęć: {n}{:.0}", "Add Keyword “{keywords}”": "Dodaj słowo kluczowe „{keywords}”", "On {have} of {of} selected photos": "Na {have} z {of} zaznaczonych zdjęć", + "A keyword name can't end with an asterisk: “{name}”": "Nazwa słowa kluczowego nie może kończyć się gwiazdką: „{name}”", "Remove “{name}”": "Usuń „{name}”", "There is a keyword set “{name}” already": "Istnieje już zestaw słów kluczowych „{name}”", "Added {n} keyword{}": "Dodane słowa kluczowe: {n}{:.0}", diff --git a/crates/ui-egui/locales/pl.json b/crates/ui-egui/locales/pl.json index bb3729a5b6..6533701b00 100644 --- a/crates/ui-egui/locales/pl.json +++ b/crates/ui-egui/locales/pl.json @@ -1847,6 +1847,9 @@ "Will Export": "Zostanie wyeksportowane", "No keywords are exported": "Nie zostaną wyeksportowane żadne słowa kluczowe", "& Containing": "i nadrzędne", + "Enter Keywords": "Wprowadź słowa kluczowe", + "Keywords, separated by commas": "Słowa kluczowe oddzielone przecinkami", + "Return applies the edit to the selected photos; Esc gives it up. An asterisk marks a keyword only some of them have.": "Return stosuje zmianę do zaznaczonych zdjęć, Esc ją odrzuca. Gwiazdka oznacza słowo kluczowe, które ma tylko część z nich.", "Edit Set…": "Edytuj zestaw…", "Edit Keyword Set": "Edytuj zestaw słów kluczowych", "Edit Keywords": "Edytuj słowa kluczowe", diff --git a/crates/ui-egui/locales/pt-br-formats.json b/crates/ui-egui/locales/pt-br-formats.json index c26b2e281e..073aa982f7 100644 --- a/crates/ui-egui/locales/pt-br-formats.json +++ b/crates/ui-egui/locales/pt-br-formats.json @@ -237,6 +237,7 @@ "Added “{keyword}” to {n} photo{}": "“{keyword}” adicionada a {n} foto{}", "Add Keyword “{keywords}”": "Adicionar palavra-chave “{keywords}”", "On {have} of {of} selected photos": "Em {have} de {of} fotos selecionadas", + "A keyword name can't end with an asterisk: “{name}”": "O nome de uma palavra-chave não pode terminar com asterisco: “{name}”", "Remove “{name}”": "Remover “{name}”", "There is a keyword set “{name}” already": "Já existe um conjunto de palavras-chave “{name}”", "Added {n} keyword{}": "Palavras-chave adicionadas: {n}{:.0}", diff --git a/crates/ui-egui/locales/pt-br.json b/crates/ui-egui/locales/pt-br.json index a0884dc56a..1cd2c17859 100644 --- a/crates/ui-egui/locales/pt-br.json +++ b/crates/ui-egui/locales/pt-br.json @@ -1906,6 +1906,9 @@ "Will Export": "Será exportado", "No keywords are exported": "Nenhuma palavra-chave é exportada", "& Containing": "e as que as contêm", + "Enter Keywords": "Inserir palavras-chave", + "Keywords, separated by commas": "Palavras-chave separadas por vírgulas", + "Return applies the edit to the selected photos; Esc gives it up. An asterisk marks a keyword only some of them have.": "Enter aplica a alteração às fotos selecionadas; Esc a descarta. Um asterisco marca uma palavra-chave que só algumas delas têm.", "Edit Set…": "Editar conjunto…", "Edit Keyword Set": "Editar conjunto de palavras-chave", "Edit Keywords": "Editar palavras-chave", diff --git a/crates/ui-egui/locales/ru-formats.json b/crates/ui-egui/locales/ru-formats.json index 4be240ec5b..c14902a200 100644 --- a/crates/ui-egui/locales/ru-formats.json +++ b/crates/ui-egui/locales/ru-formats.json @@ -233,6 +233,7 @@ "Added “{keyword}” to {n} photo{}": "«{keyword}» добавлено к фото ({n}){:.0}", "Add Keyword “{keywords}”": "Добавить ключевое слово «{keywords}»", "On {have} of {of} selected photos": "На {have} из {of} выбранных фото", + "A keyword name can't end with an asterisk: “{name}”": "Имя ключевого слова не может заканчиваться звёздочкой: «{name}»", "Remove “{name}”": "Убрать «{name}»", "There is a keyword set “{name}” already": "Набор ключевых слов «{name}» уже есть", "Added {n} keyword{}": "Добавлено ключевых слов: {n}{:.0}", diff --git a/crates/ui-egui/locales/ru.json b/crates/ui-egui/locales/ru.json index 598893c3bc..ffe4906beb 100644 --- a/crates/ui-egui/locales/ru.json +++ b/crates/ui-egui/locales/ru.json @@ -1832,6 +1832,9 @@ "Will Export": "Будет экспортировано", "No keywords are exported": "Ключевые слова не экспортируются", "& Containing": "и родительские", + "Enter Keywords": "Ввод ключевых слов", + "Keywords, separated by commas": "Ключевые слова через запятую", + "Return applies the edit to the selected photos; Esc gives it up. An asterisk marks a keyword only some of them have.": "Клавиша Enter применяет изменение к выбранным фото, Esc отменяет его. Звёздочка отмечает ключевое слово, которое есть только у некоторых из них.", "Edit Set…": "Изменить набор…", "Edit Keyword Set": "Изменить набор ключевых слов", "Edit Keywords": "Изменить ключевые слова", diff --git a/crates/ui-egui/locales/sv-formats.json b/crates/ui-egui/locales/sv-formats.json index 7d40388d1b..f3c6b4869a 100644 --- a/crates/ui-egui/locales/sv-formats.json +++ b/crates/ui-egui/locales/sv-formats.json @@ -136,6 +136,7 @@ "none (CPU rendering): {why}": "ingen (CPU-rendering): {why}", "not added to Apple Photos: {e}": "inte tillagt i Apple Photos: {e}", "On {have} of {of} selected photos": "På {have} av {of} markerade foton", + "A keyword name can't end with an asterisk: “{name}”": "Ett nyckelordsnamn kan inte sluta med en asterisk: ”{name}”", "Painting “{k}”: click photos to add or remove it · Esc stops": "Målar ”{k}”: klicka på foton för att lägga till eller ta bort det · Esc avslutar", "Paste into {n} photo{} — only settings that were copied are pasted": "Klistra in i {n} foto{} – endast inställningar som kopierades klistras in", "Preset: {name}": "Förinställning: {name}", diff --git a/crates/ui-egui/locales/sv.json b/crates/ui-egui/locales/sv.json index f229b9547c..4db541291f 100644 --- a/crates/ui-egui/locales/sv.json +++ b/crates/ui-egui/locales/sv.json @@ -7,6 +7,9 @@ "#106): a DNG is checked against the raw data, written to a temp file, synced and read back before it gets its": "#106): en DNG kontrolleras mot rådata, skrivs till en temporär fil, synkas och läses tillbaka innan den får sitt", "% of all commits": "% av alla commits", "& Containing": "& innehåller", + "Enter Keywords": "Ange nyckelord", + "Keywords, separated by commas": "Nyckelord, åtskilda med kommatecken", + "Return applies the edit to the selected photos; Esc gives it up. An asterisk marks a keyword only some of them have.": "Retur tillämpar ändringen på de markerade fotona, Esc ångrar den. En asterisk markerar ett nyckelord som bara några av dem har.", "(`gpuReason`, `gpuFallback`), Help ▸ System Info and Settings ▸ Performance say why the GPU isn't": "(`gpuReason`, `gpuFallback`), Hjälp → Systeminfo och Inställningar → Prestanda anger varför GPU:n inte", "(e.g. D750, D780, D850, D7500, Z 50) no longer render nearly black or with crushed shadows: their black level was": "(t.ex. D750, D780, D850, D7500, Z 50) renderas inte längre nästan svarta eller med klippta skuggor: deras svartnivå var", "(issue #94): an HTTP request from a web page can no longer carry a command in its body. Lines are capped at": "(ärende #94): en HTTP-begäran från en webbsida kan inte längre bära ett kommando i sin brödtext. Rader begränsas till", diff --git a/crates/ui-egui/locales/uk-formats.json b/crates/ui-egui/locales/uk-formats.json index e87bd03749..f60eecc06d 100644 --- a/crates/ui-egui/locales/uk-formats.json +++ b/crates/ui-egui/locales/uk-formats.json @@ -233,6 +233,7 @@ "Added “{keyword}” to {n} photo{}": "«{keyword}» додано до фото: {n}{:.0}", "Add Keyword “{keywords}”": "Додати ключове слово «{keywords}»", "On {have} of {of} selected photos": "На {have} з {of} вибраних фото", + "A keyword name can't end with an asterisk: “{name}”": "Назва ключового слова не може закінчуватися зірочкою: «{name}»", "Remove “{name}”": "Вилучити «{name}»", "There is a keyword set “{name}” already": "Набір ключових слів «{name}» уже існує", "Added {n} keyword{}": "Додано ключових слів: {n}{:.0}", diff --git a/crates/ui-egui/locales/uk.json b/crates/ui-egui/locales/uk.json index a4efe34a60..333cbff27c 100644 --- a/crates/ui-egui/locales/uk.json +++ b/crates/ui-egui/locales/uk.json @@ -2090,6 +2090,9 @@ "Will Export": "Буде експортовано", "No keywords are exported": "Ключові слова не експортуються", "& Containing": "і батьківські", + "Enter Keywords": "Введення ключових слів", + "Keywords, separated by commas": "Ключові слова через кому", + "Return applies the edit to the selected photos; Esc gives it up. An asterisk marks a keyword only some of them have.": "Клавіша Enter застосовує зміну до вибраних фото, Esc скасовує її. Зірочка позначає ключове слово, яке є лише в деяких із них.", "Edit Set…": "Редагувати набір…", "Edit Keyword Set": "Редагувати набір ключових слів", "Edit Keywords": "Редагувати ключові слова", diff --git a/crates/ui-egui/locales/vi-formats.json b/crates/ui-egui/locales/vi-formats.json index dbf1d28db5..bf04d55e00 100644 --- a/crates/ui-egui/locales/vi-formats.json +++ b/crates/ui-egui/locales/vi-formats.json @@ -140,6 +140,7 @@ "New Folder in “{name}”": "Thư mục mới trong «{name}»", "Created folder “{name}” in “{parent}”": "Đã tạo thư mục «{name}» trong «{parent}»", "On {have} of {of} selected photos": "Trên {have} / {of} ảnh đã chọn", + "A keyword name can't end with an asterisk: “{name}”": "Tên từ khóa không thể kết thúc bằng dấu sao: «{name}»", "Painting “{k}”: click photos to add or remove it · Esc stops": "Gán «{k}»: nhấp ảnh để thêm hoặc gỡ · Esc dừng", "Paste into {n} photo{} — only settings that were copied are pasted": "Dán vào {n} ảnh{:.0} — chỉ dán các thiết lập đã sao chép", "Preset: {name}": "Thiết lập sẵn: {name}", diff --git a/crates/ui-egui/locales/vi.json b/crates/ui-egui/locales/vi.json index c1610e428f..8b45b1edbf 100644 --- a/crates/ui-egui/locales/vi.json +++ b/crates/ui-egui/locales/vi.json @@ -7,6 +7,9 @@ "#106): a DNG is checked against the raw data, written to a temp file, synced and read back before it gets its": "#106): một DNG được đối chiếu với dữ liệu raw, ghi vào tệp tạm, đồng bộ và đọc lại trước khi nhận", "% of all commits": "% tất cả commit", "& Containing": "& Chứa", + "Enter Keywords": "Nhập từ khóa", + "Keywords, separated by commas": "Từ khóa, cách nhau bằng dấu phẩy", + "Return applies the edit to the selected photos; Esc gives it up. An asterisk marks a keyword only some of them have.": "Nhấn Return để áp dụng thay đổi cho các ảnh đã chọn, Esc để bỏ. Dấu sao đánh dấu từ khóa chỉ một số ảnh có.", "(`gpuReason`, `gpuFallback`), Help ▸ System Info and Settings ▸ Performance say why the GPU isn't": "(`gpuReason`, `gpuFallback`), Trợ giúp → Thông tin hệ thống và Cài đặt → Hiệu năng giải thích vì sao GPU không", "(e.g. D750, D780, D850, D7500, Z 50) no longer render nearly black or with crushed shadows: their black level was": "(ví dụ D750, D780, D850, D7500, Z 50) không còn hiển thị gần như đen hoặc vùng tối bị nén: mức đen của chúng đã được", "(issue #94): an HTTP request from a web page can no longer carry a command in its body. Lines are capped at": "(issue #94): yêu cầu HTTP từ trang web không còn mang lệnh trong phần thân. Số dòng được giới hạn ở", diff --git a/crates/ui-egui/locales/zh-hans-formats.json b/crates/ui-egui/locales/zh-hans-formats.json index 0a8b94115f..3b063058d1 100644 --- a/crates/ui-egui/locales/zh-hans-formats.json +++ b/crates/ui-egui/locales/zh-hans-formats.json @@ -237,6 +237,7 @@ "Added “{keyword}” to {n} photo{}": "已将“{keyword}”添加到 {n} 张照片{:.0}", "Add Keyword “{keywords}”": "添加关键字“{keywords}”", "On {have} of {of} selected photos": "所选 {of} 张照片中的 {have} 张", + "A keyword name can't end with an asterisk: “{name}”": "关键字名称不能以星号结尾:“{name}”", "Remove “{name}”": "移除“{name}”", "There is a keyword set “{name}” already": "已有关键字集“{name}”", "Added {n} keyword{}": "已添加 {n} 个关键字{:.0}", diff --git a/crates/ui-egui/locales/zh-hans.json b/crates/ui-egui/locales/zh-hans.json index ea867f35e6..26b54d945f 100644 --- a/crates/ui-egui/locales/zh-hans.json +++ b/crates/ui-egui/locales/zh-hans.json @@ -1900,6 +1900,9 @@ "Will Export": "将导出", "No keywords are exported": "没有要导出的关键字", "& Containing": "及上级", + "Enter Keywords": "输入关键字", + "Keywords, separated by commas": "关键字,用逗号分隔", + "Return applies the edit to the selected photos; Esc gives it up. An asterisk marks a keyword only some of them have.": "按回车键将修改应用到所选照片,按 Esc 键放弃。星号表示只有部分照片带有的关键字。", "Edit Set…": "编辑关键字集…", "Edit Keyword Set": "编辑关键字集", "Edit Keywords": "编辑关键字", diff --git a/crates/ui-egui/locales/zh-hant-formats.json b/crates/ui-egui/locales/zh-hant-formats.json index 178cd55a03..ffbad3d8be 100644 --- a/crates/ui-egui/locales/zh-hant-formats.json +++ b/crates/ui-egui/locales/zh-hant-formats.json @@ -237,6 +237,7 @@ "Added “{keyword}” to {n} photo{}": "已將「{keyword}」加入 {n} 張照片{:.0}", "Add Keyword “{keywords}”": "加入關鍵字「{keywords}」", "On {have} of {of} selected photos": "選取的 {of} 張照片中的 {have} 張", + "A keyword name can't end with an asterisk: “{name}”": "關鍵字名稱不能以星號結尾:「{name}」", "Remove “{name}”": "移除「{name}」", "There is a keyword set “{name}” already": "已有關鍵字集「{name}」", "Added {n} keyword{}": "已加入 {n} 個關鍵字{:.0}", diff --git a/crates/ui-egui/locales/zh-hant.json b/crates/ui-egui/locales/zh-hant.json index 90b3670ec3..d57149ce41 100644 --- a/crates/ui-egui/locales/zh-hant.json +++ b/crates/ui-egui/locales/zh-hant.json @@ -1906,6 +1906,9 @@ "Will Export": "將匯出", "No keywords are exported": "沒有要匯出的關鍵字", "& Containing": "及上層", + "Enter Keywords": "輸入關鍵字", + "Keywords, separated by commas": "關鍵字,以逗號分隔", + "Return applies the edit to the selected photos; Esc gives it up. An asterisk marks a keyword only some of them have.": "按 Return 鍵將修改套用到選取的照片,按 Esc 鍵放棄。星號表示只有部分照片帶有的關鍵字。", "Edit Set…": "編輯關鍵字集…", "Edit Keyword Set": "編輯關鍵字集", "Edit Keywords": "編輯關鍵字", diff --git a/crates/ui-egui/src/panels/keywording.rs b/crates/ui-egui/src/panels/keywording.rs index 4861d4c6fa..b77c2a6763 100644 --- a/crates/ui-egui/src/panels/keywording.rs +++ b/crates/ui-egui/src/panels/keywording.rs @@ -9,14 +9,17 @@ use crate::LightcraftApp; use crate::theme::Tokens; use crate::widgets::register; -/// The Keywording box's view: the keywords (chips), them with the keywords containing them, or -/// what exported files will carry. +/// The Keywording box's view: the keywords as text (Enter Keywords), the keywords (chips), them +/// with the keywords containing them, or what exported files will carry. pub fn view_switch(app: &mut LightcraftApp, ui: &mut egui::Ui) { use crate::state::KeywordingView as V; ui.horizontal_wrapped(|ui| { - for (view, id, label) in - [(V::Keywords, "keywords", "Keywords"), (V::Containing, "containing", "& Containing"), (V::WillExport, "willExport", "Will Export")] - { + for (view, id, label) in [ + (V::Enter, "enter", "Enter Keywords"), + (V::Keywords, "keywords", "Keywords"), + (V::Containing, "containing", "& Containing"), + (V::WillExport, "willExport", "Will Export"), + ] { let r = ui.selectable_label(app.ui.keywording_view == view, crate::i18n::tr(label)); register(ui, format!("keywordView:{id}"), r.rect); if r.clicked() { @@ -708,6 +711,62 @@ pub(crate) fn chips(catalog: &Catalog, photos: &[PhotoId]) -> Vec { have.into_values().map(|(k, n)| Chip { path: catalog.listed_path(&k).map(str::to_string).unwrap_or(k), have: n, of: photos.len() }).collect() } +/// The Enter Keywords text of the selection's keywords `chips`: each keyword's path, with commas +/// between them and an asterisk after a keyword only some of the selected photos have. +pub(crate) fn entered_text(chips: &[Chip]) -> String { + chips.iter().map(|c| if c.on_all() { c.path.clone() } else { format!("{}*", c.path) }).collect::>().join(", ") +} + +/// What an edit of the Enter Keywords text gives to and takes off the selected photos. +#[derive(Clone, Debug, Default, PartialEq, Eq)] +pub(crate) struct Entered { + /// Keywords for every selected photo. + pub add: Vec, + /// Keywords taken off every selected photo. + pub remove: Vec, +} + +impl Entered { + /// The edit changes no photo. + pub fn is_empty(&self) -> bool { + self.add.is_empty() && self.remove.is_empty() + } +} + +/// Reads the Enter Keywords `text` against `start`, the selection's keywords when the edit began. +/// Keywords are separated by commas or new lines. A keyword of `start` left out of the text is +/// taken off every selected photo. A name without an asterisk goes to every selected photo (a +/// keyword of `start` keeps its spelling, and a new name goes where `Catalog::typed_keyword` puts +/// it). A keyword only some photos have, still marked with its asterisk, stays on those photos +/// only. An asterisk after any other name is refused: the error is the name as typed. +pub(crate) fn entered(catalog: &Catalog, start: &[Chip], text: &str) -> Result { + use lightcraft_catalog::keywords::{clean, same}; + let mut kept: Vec = Vec::new(); + let mut add: Vec = Vec::new(); + for token in text.split([',', '\n']).map(str::trim).filter(|t| !t.is_empty()) { + if let Some(marked) = token.strip_suffix('*') { + let name = clean(marked); + let partial = start.iter().find(|c| !c.on_all() && same(&c.path, &name)).ok_or_else(|| token.to_string())?; + kept.push(partial.path.clone()); + continue; + } + let typed = clean(token); + let (name, on_all) = match start.iter().find(|c| same(&c.path, &typed)) { + Some(c) => (c.path.clone(), c.on_all()), + None => (catalog.typed_keyword(token), false), + }; + if name.is_empty() { + continue; + } + if !on_all && !add.iter().any(|a| same(a, &name)) { + add.push(name.clone()); + } + kept.push(name); + } + let remove = start.iter().filter(|c| !kept.iter().any(|k| same(k, &c.path))).map(|c| c.path.clone()).collect(); + Ok(Entered { add, remove }) +} + #[cfg(test)] mod tests { use lightcraft_catalog::{Op, Photo, Source}; @@ -1007,4 +1066,73 @@ mod tests { let (c, ids) = library(&[&["travel|Italy|Rome", "travel|Spain"], &["travel|Italy"]]); assert_eq!(shown(&with_containing(&c, &ids)), [("Italy", 2, 2), ("Rome", 1, 2), ("Spain", 1, 2), ("travel", 2, 2)]); } + + fn edit(add: &[&str], remove: &[&str]) -> Entered { + Entered { add: add.iter().map(|s| s.to_string()).collect(), remove: remove.iter().map(|s| s.to_string()).collect() } + } + + /// The Enter Keywords text is the selection's keywords with their paths, commas between them, and + /// an asterisk after one only some of the selected photos have; left as it is, it changes nothing. + #[test] + fn the_entered_text_is_the_selections_keywords() { + let (c, ids) = library(&[&["Places|Lisbon", "beach"], &["beach"]]); + let start = chips(&c, &ids); + let text = entered_text(&start); + assert_eq!(text, "beach, Places|Lisbon*"); + assert_eq!(entered(&c, &start, &text), Ok(Entered::default())); + assert_eq!(entered(&c, &start, " beach ,\nPlaces | Lisbon * "), Ok(Entered::default()), "spaces and new lines"); + assert_eq!(entered(&c, &start, "BEACH, places|lisbon*"), Ok(Entered::default()), "another case is the same keyword"); + assert_eq!(entered_text(&[]), ""); + } + + /// A keyword left out of the text is taken off every selected photo; a name typed goes to every + /// one of them; a partial keyword without its asterisk goes to all of them. + #[test] + fn an_edit_adds_and_removes_for_every_selected_photo() { + let (c, ids) = library(&[&["Places|Lisbon", "beach"], &["beach", "sea"]]); + let start = chips(&c, &ids); + assert_eq!(entered(&c, &start, "Places|Lisbon*, sea*"), Ok(edit(&[], &["beach"]))); + assert_eq!(entered(&c, &start, "beach, Places|Lisbon*, sea*, harbour, Places|Porto"), Ok(edit(&["harbour", "Places|Porto"], &[]))); + assert_eq!(entered(&c, &start, "beach, Places|Lisbon, sea*"), Ok(edit(&["Places|Lisbon"], &[])), "made common"); + assert_eq!(entered(&c, &start, "beach, harbour, HARBOUR"), Ok(edit(&["harbour"], &["Places|Lisbon", "sea"])), "named once"); + assert_eq!(entered(&c, &start, ""), Ok(edit(&[], &["beach", "Places|Lisbon", "sea"])), "an empty box clears them"); + assert_eq!(entered(&c, &start, " , | ,"), Ok(edit(&[], &["beach", "Places|Lisbon", "sea"])), "nothing but separators"); + } + + /// Containing keywords and synonyms are not part of the text: they stay derived, and an edit + /// never assigns them. + #[test] + fn containing_keywords_and_synonyms_stay_out_of_the_text() { + use lightcraft_catalog::keywords::KeywordInfo; + let (mut c, ids) = library(&[&["Places|Lisbon"]]); + c.apply(Op::SetKeyword { + path: "Places|Lisbon".into(), + info: Some(KeywordInfo { synonyms: vec!["Lisboa".into()], ..KeywordInfo::default() }), + }) + .unwrap(); + let start = chips(&c, &ids); + assert_eq!(entered_text(&start), "Places|Lisbon"); + assert_eq!(entered(&c, &start, &entered_text(&start)), Ok(Entered::default())); + } + + /// An asterisk marks a keyword only some photos have; after any other name it is refused, and the + /// error names what was typed. + #[test] + fn an_asterisk_after_another_name_is_refused() { + let (c, ids) = library(&[&["beach", "sea"], &["beach"]]); + let start = chips(&c, &ids); + assert_eq!(entered(&c, &start, "beach*, sea*"), Err("beach*".to_string()), "every photo has beach"); + assert_eq!(entered(&c, &start, "beach, sea*, harbour*"), Err("harbour*".to_string()), "a new name"); + assert_eq!(entered(&c, &start, "beach, *"), Err("*".to_string())); + } + + /// A new name goes inside the default parent, as one typed in the Add keyword box does. + #[test] + fn a_new_name_goes_inside_the_default_parent() { + use lightcraft_catalog::keywords::KeywordInfo; + let (mut c, ids) = library(&[&["beach"]]); + c.apply(Op::SetKeyword { path: "Inbox".into(), info: Some(KeywordInfo { new_keywords_inside: true, ..KeywordInfo::default() }) }).unwrap(); + let start = chips(&c, &ids); + assert_eq!(entered(&c, &start, "beach, harbour"), Ok(edit(&["Inbox|harbour"], &[]))); + } } diff --git a/crates/ui-egui/src/panels/right/keywords.rs b/crates/ui-egui/src/panels/right/keywords.rs index d202557c12..1b092f06ee 100644 --- a/crates/ui-egui/src/panels/right/keywords.rs +++ b/crates/ui-egui/src/panels/right/keywords.rs @@ -138,10 +138,10 @@ fn keywording(app: &mut LightcraftApp, ui: &mut egui::Ui) { crate::panels::keywording::view_switch(app, ui); ui.add_space(4.0); crate::panels::keywording::scope(app, ui, &selection); - if app.ui.keywording_view == crate::state::KeywordingView::Keywords { - crate::panels::keywording::chip_row(app, ui, &selection); - } else { - crate::panels::keywording::names_row(app, ui); + match app.ui.keywording_view { + crate::state::KeywordingView::Enter => enter_keywords(app, ui, &selection), + crate::state::KeywordingView::Keywords => crate::panels::keywording::chip_row(app, ui, &selection), + _ => crate::panels::keywording::names_row(app, ui), } ui.add_space(10.0); keyword_set(app, ui); @@ -198,6 +198,101 @@ fn keywording(app: &mut LightcraftApp, ui: &mut egui::Ui) { }); } +/// An edit of the Enter Keywords box: its text, and the selection it was started on. +#[derive(Clone)] +struct EnterEdit { + text: String, + /// The selection's keywords when the edit started. + start: Vec, + /// The photos the edit is for (`photo.setMeta` `ids`). + ids: Vec, + /// The selection the edit was started on (`key_of`). + selection: u64, + /// The last try to apply it was refused: the text stays to be put right. + refused: bool, +} + +impl EnterEdit { + fn new(chips: &[crate::panels::keywording::Chip], selection: &[PhotoId], key: u64) -> Self { + let mut seen = std::collections::HashSet::new(); + EnterEdit { + text: crate::panels::keywording::entered_text(chips), + start: chips.to_vec(), + ids: selection.iter().filter(|id| seen.insert(**id)).map(|id| id.0).collect(), + selection: key, + refused: false, + } + } +} + +/// Enter Keywords: the selection's keywords as text, separated by commas, one only some of the +/// photos have marked with an asterisk. Return or leaving the box applies the edit to the photos +/// selected when it started, as one undo step; Esc gives it up. Another selection while the box is +/// being edited gives the edit up too. A refused edit keeps its text and says why. +fn enter_keywords(app: &mut LightcraftApp, ui: &mut egui::Ui, selection: &[PhotoId]) { + const FIELD: &str = "field:enterKeywords"; + let id = egui::Id::unique("kw-enter"); + let key = crate::key_of(selection); + let chips = app.caches.keyword_chips(&app.session.catalog, selection); + let fid = crate::text_field::id(FIELD); + let focused = ui.memory(|m| m.has_focus(fid)); + let kept: Option = ui.data(|d| d.get_temp(id)); + // (an edit of another selection is given up, never applied to this one) + if kept.as_ref().is_some_and(|e| e.selection != key) && focused { + ui.memory_mut(|m| m.surrender_focus(fid)); + } + let mut edit = kept.filter(|e| e.selection == key).unwrap_or_else(|| EnterEdit::new(&chips, selection, key)); + // Return applies the edit (Shift+Return or a pasted line break separates keywords as a comma does) + let returned = focused + && ui.input_mut(|i| { + let plain = + |e: &egui::Event| matches!(e, egui::Event::Key { key: egui::Key::Enter, pressed: true, modifiers, .. } if modifiers.is_none()); + let found = i.events.iter().any(plain); + i.events.retain(|e| !plain(e)); + found + }); + let r = crate::text_field::TextField::multiline(FIELD, &mut edit.text) + .hint(crate::i18n::tr("Keywords, separated by commas")) + .label(crate::i18n::tr("Enter Keywords")) + .rows(2) + .width(f32::INFINITY) + .show(ui); + r.response.clone().on_hover_text(crate::i18n::tr( + "Return applies the edit to the selected photos; Esc gives it up. An asterisk marks a keyword only some of them have.", + )); + if r.cancelled() { + ui.data_mut(|d| d.remove::(id)); + return; + } + let mut done = false; + if returned || r.committed() { + let applied = match crate::panels::keywording::entered(&app.session.catalog, &edit.start, &edit.text) { + Ok(change) if change.is_empty() => true, + Ok(change) => match app.run("photo.setMeta", json!({"ids": edit.ids, "addKeywords": change.add, "removeKeywords": change.remove})) { + Ok(_) => true, + Err(e) => { + app.toast_error(ui.ctx(), e); + false + } + }, + Err(name) => { + app.toast_error(ui.ctx(), crate::i18n::tr_format!("A keyword name can't end with an asterisk: “{name}”", name = name)); + false + } + }; + edit.refused = !applied; + done = applied; + if applied && returned { + ui.memory_mut(|m| m.surrender_focus(fid)); + } + } + if !done && (r.editing || returned || edit.refused) { + ui.data_mut(|d| d.insert_temp(id, edit)); + } else { + ui.data_mut(|d| d.remove::(id)); + } +} + /// Keeps the Keyword List where it is on screen when the Keywords box above it (starting at /// `top`) grows or shrinks: a keyword ticked or unticked in the list, another selection. Without it /// a long tree slides away from under the pointer by a row of chips each time. It holds only while @@ -218,7 +313,7 @@ fn hold_list_in_place(ui: &mut egui::Ui, top: f32) { // (only the part of it in sight: the pointer on the top bar above a half-hidden box isn't on it) let old_box = Rect::from_x_y_ranges(ui.max_rect().x_range(), top..=top + before).intersect(ui.clip_rect()); let on_box = ui.input(|i| i.pointer.latest_pos()).is_some_and(|p| old_box.contains(p)); - let typing = ui.memory(|m| m.has_focus(crate::text_field::id("field:keyword"))); + let typing = ui.memory(|m| ["field:keyword", "field:enterKeywords"].iter().any(|f| m.has_focus(crate::text_field::id(f)))); if on_box || typing { return; } diff --git a/crates/ui-egui/src/state/view.rs b/crates/ui-egui/src/state/view.rs index 6110026475..a1fdb3b7ce 100644 --- a/crates/ui-egui/src/state/view.rs +++ b/crates/ui-egui/src/state/view.rs @@ -367,11 +367,13 @@ pub const RIGHT_WIDTH: PanelWidth = PanelWidth { min: 250.0, default: 270.0, max /// The photo area the side panels always leave free (as far as their minimum widths allow). pub const MIN_PHOTO_WIDTH: f32 = 360.0; -/// What the Keywording box shows: the keywords (chips to edit), them with the keywords containing -/// them, or what exported files will carry (read only). +/// What the Keywording box shows: the keywords as text to edit (Enter Keywords), the keywords +/// (chips to edit), them with the keywords containing them, or what exported files will carry +/// (read only). #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub enum KeywordingView { + Enter, #[default] Keywords, Containing, diff --git a/crates/ui-egui/src/tests/keywording.rs b/crates/ui-egui/src/tests/keywording.rs index 4e2908d10f..130af6ee3d 100644 --- a/crates/ui-egui/src/tests/keywording.rs +++ b/crates/ui-egui/src/tests/keywording.rs @@ -949,3 +949,97 @@ fn open_dialogs_count_once_per_library_change() { } assert_eq!(h.app.caches.dialog_count_scans, before + 3, "another dialog counts its own photos, once"); } + +/// Enter Keywords, with everything in its box replaced by `text`. +fn enter(h: &mut Headless, text: &str) { + ask(h, "ui.clickWidget", json!({"id": "keywordView:enter"})); + ask(h, "ui.clickWidget", json!({"id": "field:enterKeywords"})); + ask(h, "ui.key", json!({"key": "A", "cmd": true})); + ask(h, "ui.key", json!({"key": "Backspace"})); + if !text.is_empty() { + ask(h, "ui.text", json!({"text": text})); + } +} + +fn enter_focused(h: &Headless) -> bool { + h.view.ctx.memory(|m| m.has_focus(crate::text_field::id("field:enterKeywords"))) +} + +/// Given two selected photos, when Enter Keywords is chosen, then the box shows their keywords as +/// text in place of the chips; Return applies an edit to both photos as one undo step, and gives up +/// the cursor. +#[test] +fn enter_keywords_edits_the_selections_keywords_as_text() { + let (mut h, ids) = two_selected(); + ask(&mut h, "ui.clickWidget", json!({"id": "keywordView:enter"})); + assert!(has(&h, "field:enterKeywords") && !has(&h, "keywordChip:beach"), "the text gives the chips way"); + enter(&mut h, "beach, Weddings*, harbour"); + ask(&mut h, "ui.key", json!({"key": "Enter"})); + assert_eq!(keywords_of(&h, ids[0]), ["beach", "Weddings", "harbour"]); + assert_eq!(keywords_of(&h, ids[1]), ["beach", "harbour"], "Weddings stays on the photo that had it"); + assert!(!enter_focused(&h), "Return gave up the cursor"); + ask(&mut h, "engine.execute", json!({"command": "edit.undo", "params": {}})); + assert_eq!(keywords_of(&h, ids[0]), ["beach", "Weddings"], "one undo takes the edit back"); + assert_eq!(keywords_of(&h, ids[1]), ["beach"]); + ask(&mut h, "ui.clickWidget", json!({"id": "keywordView:keywords"})); + assert!(has(&h, "keywordChip:beach") && !has(&h, "field:enterKeywords"), "Keywords brings the chips back"); +} + +/// A keyword left out of the text is taken off every selected photo, a partial one keeps its photos +/// while its asterisk stays, and without its asterisk it goes to all of them. +#[test] +fn enter_keywords_removes_and_makes_a_partial_keyword_common() { + let (mut h, ids) = two_selected(); + enter(&mut h, "Weddings*"); + ask(&mut h, "ui.key", json!({"key": "Enter"})); + assert_eq!(keywords_of(&h, ids[0]), ["Weddings"]); + assert!(keywords_of(&h, ids[1]).is_empty(), "beach went from both"); + enter(&mut h, "Weddings"); + ask(&mut h, "ui.key", json!({"key": "Enter"})); + assert_eq!(keywords_of(&h, ids[1]), ["Weddings"], "without its asterisk it goes to both"); + enter(&mut h, ""); + ask(&mut h, "ui.key", json!({"key": "Enter"})); + assert!(ids.iter().all(|id| keywords_of(&h, *id).is_empty()), "an empty box takes every keyword off"); +} + +/// Esc gives the edit up; leaving the box applies it, as Return does. +#[test] +fn enter_keywords_escape_gives_up_and_leaving_applies() { + let (mut h, ids) = two_selected(); + enter(&mut h, "sea"); + ask(&mut h, "ui.key", json!({"key": "Escape"})); + assert_eq!(keywords_of(&h, ids[0]), ["beach", "Weddings"], "Esc changed nothing"); + assert_eq!(keywords_of(&h, ids[1]), ["beach"]); + enter(&mut h, "beach, Weddings*, sea"); + ask(&mut h, "ui.key", json!({"key": "Tab"})); + assert!(all_have(&h, &ids, "sea"), "leaving the box applied it"); +} + +/// An asterisk after a name that is not a keyword only some photos have is refused: the photos keep +/// their keywords, the box keeps the cursor and its text, and the refusal is said. +#[test] +fn enter_keywords_refuses_a_name_ending_in_an_asterisk() { + let (mut h, ids) = two_selected(); + enter(&mut h, "beach, Weddings*, sea*"); + ask(&mut h, "ui.key", json!({"key": "Enter"})); + assert_eq!(keywords_of(&h, ids[0]), ["beach", "Weddings"]); + assert_eq!(keywords_of(&h, ids[1]), ["beach"]); + assert!(enter_focused(&h), "the box keeps the cursor to put it right"); + assert!(h.app.ui.toast.as_ref().is_some_and(|(t, ..)| t.contains("asterisk") && t.contains("sea*")), "{:?}", h.app.ui.toast); + ask(&mut h, "ui.key", json!({"key": "Backspace"})); + ask(&mut h, "ui.key", json!({"key": "Enter"})); + assert!(all_have(&h, &ids, "sea"), "the text was kept and put right"); +} + +/// Another selection while the box is being edited gives the edit up: what was typed goes neither to +/// the photos it was typed for nor to the new selection. +#[test] +fn enter_keywords_gives_up_an_edit_when_the_selection_changes() { + let (mut h, ids) = two_selected(); + enter(&mut h, "beach, Weddings*, harbour"); + ask(&mut h, "engine.execute", json!({"command": "library.select", "params": {"ids": [ids[1]]}})); + ask(&mut h, "ui.key", json!({"key": "Enter"})); + let every: Vec = h.app.session.visible_cloned().iter().map(|p| p.0).collect(); + assert!(every.iter().all(|id| !keywords_of(&h, *id).contains(&"harbour".to_string())), "nobody got harbour"); + assert_eq!(keywords_of(&h, ids[0]), ["beach", "Weddings"]); +} diff --git a/docs/parity-checklist.md b/docs/parity-checklist.md index a9dd725236..ed019f08bf 100644 --- a/docs/parity-checklist.md +++ b/docs/parity-checklist.md @@ -711,7 +711,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:keyword.nextSet`, `cmd:keyword.previousSet`, `cmd:tool.keywordPainter`, `cmd:tool.enablePainting` | hierarchical `a\|b\|c` keywords (tree, parent filters include children, rename moves children); keyword sets + Recent Keywords (⌥1–⌥9; ⌥0 / ⌥⇧0 go to the next / previous set and wrap around at either end); keyword painter (Keywords panel ▸ Paint: click photos in the grid to toggle a keyword, Esc stops; Photo ▸ Enable Painting, ⌘⌥K / Ctrl+Alt+K, paints the painter box's keyword, stops painting when pressed again, and with the box empty opens the Keywords panel). 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:`: 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:`, 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:`; 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 (; , < >). The keyword shortcut (Set Keyword Shortcut, Use This as Keyword Shortcut, a + in the Keyword List, ⇧K) is under KEYC-METADATA. Not yet: synonyms in search, person keywords tied to faces, IPTC keywords in exported files (Piwigo, RawTherapee), hierarchy from digiKam / ACDSee / Microsoft XMP fields. In the Keyword List a keyword's empty box carries a dot when the selected photos have a keyword inside it (its tooltip names them), so a folded keyword shows that something in it is applied | +| 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:keyword.nextSet`, `cmd:keyword.previousSet`, `cmd:tool.keywordPainter`, `cmd:tool.enablePainting` | hierarchical `a\|b\|c` keywords (tree, parent filters include children, rename moves children); keyword sets + Recent Keywords (⌥1–⌥9; ⌥0 / ⌥⇧0 go to the next / previous set and wrap around at either end); keyword painter (Keywords panel ▸ Paint: click photos in the grid to toggle a keyword, Esc stops; Photo ▸ Enable Painting, ⌘⌥K / Ctrl+Alt+K, paints the painter box's keyword, stops painting when pressed again, and with the box empty opens the Keywords panel). 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); Enter Keywords (`keywordView:enter`, `field:enterKeywords`) shows the selection's keywords as text, commas between them and an asterisk after one only some selected photos have: Return or leaving the box applies the edit to the photos selected when it began as one undo step (a keyword left out comes off every one of them, a name typed goes to all of them, a marked keyword stays on the photos that have it and without its asterisk goes to all), Esc gives the edit up, another selection gives it up too, an asterisk after any other name is refused with the text kept, and containing keywords and synonyms stay out of the text (the rules for mixed keywords and for when an edit applies are LightCraft's own), 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:`: 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:`, 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:`; 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 (; , < >). The keyword shortcut (Set Keyword Shortcut, Use This as Keyword Shortcut, a + in the Keyword List, ⇧K) is under KEYC-METADATA. Not yet: synonyms in search, person keywords tied to faces, IPTC keywords in exported files (Piwigo, RawTherapee), hierarchy from digiKam / ACDSee / Microsoft XMP fields. In the Keyword List a keyword's empty box carries a dot when the selected photos have a keyword inside it (its tooltip names them), so a folded keyword shows that something in it is applied | | 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 one, × to hide for the session, or ↑ / hovered-or-focused A key to confirm all currently shown non-hidden suggestions at or above that face's score, including ties, in one undo step). 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