LRC-LIB-KEYWORDS: the Keyword List needs no selection

With no photo active the whole right panel said "No photo selected",
so the library's Keyword List disappeared: keywords couldn't be made
or organized before choosing a photo. The Keywords panel now shows the
list without a selection (its tick boxes wait for one), under a note
that selecting photos gives them keywords.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Nathaniel Ledford
2026-10-09 14:56:01 -04:00
co-authored by Claude Opus 5.5
parent 5d4ebe5132
commit 344db72c85
9 changed files with 39 additions and 7 deletions
+2 -1
View File
@@ -1910,5 +1910,6 @@
"Purge Unused Keywords": "Nicht verwendete Stichwörter löschen",
"Delete Keyword…": "Stichwort löschen…",
"Drop here for the top level": "Hier ablegen für die oberste Ebene",
"Their photos and the keywords below them come together under one keyword.": "Ihre Fotos und die Stichwörter darunter kommen unter einem Stichwort zusammen."
"Their photos and the keywords below them come together under one keyword.": "Ihre Fotos und die Stichwörter darunter kommen unter einem Stichwort zusammen.",
"Select photos to give them keywords.": "Wählen Sie Fotos aus, um ihnen Stichwörter zu geben."
}
+2 -1
View File
@@ -1755,5 +1755,6 @@
"Purge Unused Keywords": "Eliminar palabras clave no usadas",
"Delete Keyword…": "Eliminar palabra clave…",
"Drop here for the top level": "Soltar aquí para el nivel superior",
"Their photos and the keywords below them come together under one keyword.": "Sus fotos y las palabras clave que contienen quedan bajo una sola palabra clave."
"Their photos and the keywords below them come together under one keyword.": "Sus fotos y las palabras clave que contienen quedan bajo una sola palabra clave.",
"Select photos to give them keywords.": "Selecciona fotos para darles palabras clave."
}
+2 -1
View File
@@ -1755,5 +1755,6 @@
"Purge Unused Keywords": "使用されていないキーワードを削除",
"Delete Keyword…": "キーワードを削除…",
"Drop here for the top level": "ここにドロップすると最上位に移動",
"Their photos and the keywords below them come together under one keyword.": "写真と下位のキーワードが1つのキーワードにまとめられます。"
"Their photos and the keywords below them come together under one keyword.": "写真と下位のキーワードが1つのキーワードにまとめられます。",
"Select photos to give them keywords.": "写真を選択するとキーワードを付けられます。"
}
+2 -1
View File
@@ -1755,5 +1755,6 @@
"Purge Unused Keywords": "Excluir palavras-chave não usadas",
"Delete Keyword…": "Excluir palavra-chave…",
"Drop here for the top level": "Solte aqui para o nível superior",
"Their photos and the keywords below them come together under one keyword.": "Suas fotos e as palavras-chave abaixo delas ficam sob uma só palavra-chave."
"Their photos and the keywords below them come together under one keyword.": "Suas fotos e as palavras-chave abaixo delas ficam sob uma só palavra-chave.",
"Select photos to give them keywords.": "Selecione fotos para dar palavras-chave a elas."
}
+2 -1
View File
@@ -1428,5 +1428,6 @@
"Purge Unused Keywords": "Удалить неиспользуемые ключевые слова",
"Delete Keyword…": "Удалить ключевое слово…",
"Drop here for the top level": "Отпустите здесь для верхнего уровня",
"Their photos and the keywords below them come together under one keyword.": "Их фото и вложенные ключевые слова объединятся под одним ключевым словом."
"Their photos and the keywords below them come together under one keyword.": "Их фото и вложенные ключевые слова объединятся под одним ключевым словом.",
"Select photos to give them keywords.": "Выберите фото, чтобы назначить им ключевые слова."
}
+2 -1
View File
@@ -1755,5 +1755,6 @@
"Purge Unused Keywords": "清除未使用的关键字",
"Delete Keyword…": "删除关键字…",
"Drop here for the top level": "拖放到此处以移至顶层",
"Their photos and the keywords below them come together under one keyword.": "它们的照片和下级关键字将合并到同一个关键字下。"
"Their photos and the keywords below them come together under one keyword.": "它们的照片和下级关键字将合并到同一个关键字下。",
"Select photos to give them keywords.": "选择照片以为其添加关键字。"
}
+2 -1
View File
@@ -1755,5 +1755,6 @@
"Purge Unused Keywords": "清除未使用的關鍵字",
"Delete Keyword…": "刪除關鍵字…",
"Drop here for the top level": "拖放到此處以移至最上層",
"Their photos and the keywords below them come together under one keyword.": "它們的照片與下層關鍵字將合併到同一個關鍵字下。"
"Their photos and the keywords below them come together under one keyword.": "它們的照片與下層關鍵字將合併到同一個關鍵字下。",
"Select photos to give them keywords.": "選取照片以加入關鍵字。"
}
+12
View File
@@ -19,6 +19,18 @@ pub fn show(app: &mut LightcraftApp, ui: &mut egui::Ui) {
let width = app.ui.right_width;
let resized = super::resizable_side(ui, false, "right_panel", frame, width, crate::state::RIGHT_WIDTH, reserve, |ui| {
let Some(id) = app.session.active() else {
// the Keyword List is the library's, not a photo's: it is there without a selection
if app.ui.right == RightPanel::Keywords {
egui::ScrollArea::vertical().id_salt("right-scroll").auto_shrink([false, false]).show(ui, |ui| {
ui.spacing_mut().item_spacing.y = 0.0;
header(ui, "Keywords");
padded(ui, |ui| {
ui.label(egui::RichText::new(crate::i18n::tr("Select photos to give them keywords.")).color(t.text_dim));
});
super::keyword_list::show(app, ui);
});
return;
}
let r = ui.max_rect();
super::empty_message(ui, r, "No photo selected", "Select a photo to edit");
return;
+13
View File
@@ -293,3 +293,16 @@ fn drops_land_only_on_what_is_shown() {
ask(&mut h, "ui.dragWidget", json!({"id": "keywordRow:aaa|zz", "toX": hidden.x, "toY": hidden.y, "steps": 12}));
assert_eq!(keywords_of(&h, ids[0]), ["aaa|zz"], "not moved to the top level");
}
/// With no photo selected the Keyword List is still there, to create and organize keywords; its
/// tick boxes wait for a selection.
#[test]
fn the_keyword_list_needs_no_selection() {
let (mut h, _) = keywords_panel();
run(&mut h, "library.select", json!({"ids": []}));
assert!(has(&h, "keywordList:topLevel") && has(&h, "keywordList:create"), "the list is shown");
ask(&mut h, "ui.clickWidget", json!({"id": "keywordList:create"}));
ask(&mut h, "ui.text", json!({"text": "Weddings"}));
ask(&mut h, "ui.key", json!({"key": "Enter"}));
assert!(h.app.session.catalog.has_keyword("Weddings"), "and creates keywords");
}