From 409a4955c2e60156d22376b8de1354055b3c9da3 Mon Sep 17 00:00:00 2001 From: Nathaniel Ledford Date: Wed, 28 Oct 2026 19:20:22 -0400 Subject: [PATCH 1/4] MENU-VIEW-SORT: the Sort menus offer only what the view uses Recently Added is always newest import first: its keys, direction and Reshuffle are off, nothing is checked as the order shown, and a dim line says why. Under Random and in Recently Deleted the date groups are off and unchecked. Reshuffle is listed in both menus under its own separator below the keys. The bottom bar's popup and View > Sort read one model (menus/sort_menu.rs). --- crates/engine/src/cmd/library/specs.rs | 4 +- crates/ui-egui/locales/cs.json | 4 +- crates/ui-egui/locales/de.json | 4 +- crates/ui-egui/locales/es.json | 4 +- crates/ui-egui/locales/fi.json | 4 +- crates/ui-egui/locales/fr.json | 4 +- crates/ui-egui/locales/id.json | 4 +- crates/ui-egui/locales/it.json | 4 +- crates/ui-egui/locales/ja.json | 4 +- crates/ui-egui/locales/ka.json | 4 +- crates/ui-egui/locales/pl.json | 4 +- crates/ui-egui/locales/pt-br.json | 4 +- crates/ui-egui/locales/ru.json | 4 +- crates/ui-egui/locales/sv.json | 4 +- crates/ui-egui/locales/uk.json | 4 +- crates/ui-egui/locales/vi.json | 4 +- crates/ui-egui/locales/zh-hans.json | 4 +- crates/ui-egui/locales/zh-hant.json | 4 +- crates/ui-egui/src/menus.rs | 1 + crates/ui-egui/src/menus/menubar.rs | 60 ++++++------ crates/ui-egui/src/menus/menubar/tests.rs | 114 ++++++++++++++++++++++ crates/ui-egui/src/menus/sort_menu.rs | 93 ++++++++++++++++++ crates/ui-egui/src/panels/bottombar.rs | 51 +++++++--- crates/ui-egui/src/tests.rs | 1 + crates/ui-egui/src/tests/sort_menu.rs | 79 +++++++++++++++ docs/parity-checklist.md | 7 +- docs/whats-new.md | 11 +++ 27 files changed, 423 insertions(+), 66 deletions(-) create mode 100644 crates/ui-egui/src/menus/sort_menu.rs create mode 100644 crates/ui-egui/src/tests/sort_menu.rs diff --git a/crates/engine/src/cmd/library/specs.rs b/crates/engine/src/cmd/library/specs.rs index 2e7c1311d0c..9a8ecd7bf62 100644 --- a/crates/engine/src/cmd/library/specs.rs +++ b/crates/engine/src/cmd/library/specs.rs @@ -233,7 +233,7 @@ pub fn specs() -> Vec { "Sort", ["View", "Sort"], None, - "{key?: captureDate|importDate|editDate|fileName|rating|fileSize|random, ascending?: bool, group?: auto|none|day|month|year, seed?: u64 (the shuffle `random` gives)}", + "{key?: captureDate|importDate|editDate|fileName|rating|fileSize|random, ascending?: bool, group?: auto|none|day|month|year, seed?: u64 (the shuffle `random` gives)} — the sort is kept as asked in every view, but Recently Added is always newest import first whatever it says (its menus turn the keys and the direction off; it still groups by import date, at the chosen grouping). Elsewhere only the date keys (captureDate, importDate, editDate) draw date headers, so `group` is kept but unused for the other keys, and Recently Deleted draws none", always, |s, p| { let key: SortKey = match p.get("key") { @@ -297,7 +297,7 @@ pub fn specs() -> Vec { "Reshuffle", ["View", "Sort"], None, - "{seed?: 0..2^53-1} — sort at random; without `seed` a new shuffle each time", + "{seed?: 0..2^53-1} — sort at random; without `seed` a new shuffle each time. Recently Added ignores the sort and stays newest import first, so a reshuffle there only switches the stored sort to Random with a new seed and changes no order on screen (it still ends a held view, like any sort change; the menus keep Reshuffle off in that view)", always, |s, p| { let seed = match seed_param(p, "library.shuffle", s.sort.seed)? { diff --git a/crates/ui-egui/locales/cs.json b/crates/ui-egui/locales/cs.json index 52ca94a524d..5efb9ebef86 100644 --- a/crates/ui-egui/locales/cs.json +++ b/crates/ui-egui/locales/cs.json @@ -2408,5 +2408,7 @@ "Import dropped files without review": "Importovat přetažené soubory bez kontroly", "An import is running": "Import už běží", "An import is running. Drop photos when it has finished": "Import už běží. Fotky přetáhněte, až skončí", - "Finish Lightroom catalog import before adding photos": "Dokončete import katalogu Lightroom, než přidáte fotky" + "Finish Lightroom catalog import before adding photos": "Dokončete import katalogu Lightroom, než přidáte fotky", + "Recently Added always shows the newest imports first.": "Nedávno přidané vždy zobrazuje nejnovější importy jako první.", + "Recently Deleted shows no date groups.": "Nedávno odstraněné nezobrazuje skupiny podle data." } diff --git a/crates/ui-egui/locales/de.json b/crates/ui-egui/locales/de.json index e2205db782f..0ee4d0fd886 100644 --- a/crates/ui-egui/locales/de.json +++ b/crates/ui-egui/locales/de.json @@ -3440,5 +3440,7 @@ "Import dropped files without review": "Abgelegte Dateien ohne Prüfung importieren", "An import is running": "Ein Import läuft", "An import is running. Drop photos when it has finished": "Ein Import läuft. Lege die Fotos ab, wenn er fertig ist", - "Finish Lightroom catalog import before adding photos": "Schließe den Import des Lightroom-Katalogs ab, bevor du Fotos hinzufügst" + "Finish Lightroom catalog import before adding photos": "Schließe den Import des Lightroom-Katalogs ab, bevor du Fotos hinzufügst", + "Recently Added always shows the newest imports first.": "Zuletzt hinzugefügt zeigt immer die neuesten Importe zuerst.", + "Recently Deleted shows no date groups.": "Zuletzt gelöscht zeigt keine Datumsgruppen." } diff --git a/crates/ui-egui/locales/es.json b/crates/ui-egui/locales/es.json index 888af077ff2..aa39d9efa10 100644 --- a/crates/ui-egui/locales/es.json +++ b/crates/ui-egui/locales/es.json @@ -2358,5 +2358,7 @@ "Import dropped files without review": "Importar los archivos soltados sin revisión", "An import is running": "Hay una importación en curso", "An import is running. Drop photos when it has finished": "Hay una importación en curso. Suelta las fotos cuando termine", - "Finish Lightroom catalog import before adding photos": "Termina la importación del catálogo de Lightroom antes de añadir fotos" + "Finish Lightroom catalog import before adding photos": "Termina la importación del catálogo de Lightroom antes de añadir fotos", + "Recently Added always shows the newest imports first.": "Añadidas recientemente siempre muestra primero las importaciones más recientes.", + "Recently Deleted shows no date groups.": "Eliminadas recientemente no muestra grupos por fecha." } diff --git a/crates/ui-egui/locales/fi.json b/crates/ui-egui/locales/fi.json index e0a8c622a36..c18ed79e4b4 100644 --- a/crates/ui-egui/locales/fi.json +++ b/crates/ui-egui/locales/fi.json @@ -2327,5 +2327,7 @@ "Drop to open the face model": "Pudota avataksesi kasvomallin", "Dropped Files": "Pudotetut tiedostot", "Finish Lightroom catalog import before adding photos": "Viimeistele Lightroom-luettelon tuonti ennen kuvien lisäämistä", - "Import dropped files without review": "Tuo pudotetut tiedostot ilman tarkistusta" + "Import dropped files without review": "Tuo pudotetut tiedostot ilman tarkistusta", + "Recently Added always shows the newest imports first.": "Äskettäin lisätyt näyttää aina uusimmat tuonnit ensin.", + "Recently Deleted shows no date groups.": "Äskettäin poistetut ei näytä päivämääräryhmiä." } diff --git a/crates/ui-egui/locales/fr.json b/crates/ui-egui/locales/fr.json index 3278d6ccda6..2ce08ac4485 100644 --- a/crates/ui-egui/locales/fr.json +++ b/crates/ui-egui/locales/fr.json @@ -2390,5 +2390,7 @@ "Checking recent libraries": "Vérification des bibliothèques récentes", "The photos are imported once a library is open": "Les photos seront importées dès qu'une bibliothèque sera ouverte", "Open a library first, then drop the presets again": "Ouvrez d'abord une bibliothèque, puis déposez à nouveau les préréglages", - "This library couldn't be checked:": "Impossible de vérifier cette bibliothèque :" + "This library couldn't be checked:": "Impossible de vérifier cette bibliothèque :", + "Recently Added always shows the newest imports first.": "Ajoutées récemment affiche toujours les importations les plus récentes en premier.", + "Recently Deleted shows no date groups.": "Supprimées récemment n'affiche aucun groupe par date." } diff --git a/crates/ui-egui/locales/id.json b/crates/ui-egui/locales/id.json index 0d6da9b8fb8..ab960d53c8c 100644 --- a/crates/ui-egui/locales/id.json +++ b/crates/ui-egui/locales/id.json @@ -2339,5 +2339,7 @@ "Drop to open the face model": "Jatuhkan untuk membuka model wajah", "Dropped Files": "File yang dijatuhkan", "Finish Lightroom catalog import before adding photos": "Selesaikan impor katalog Lightroom sebelum menambahkan foto", - "Import dropped files without review": "Impor file yang dijatuhkan tanpa tinjauan" + "Import dropped files without review": "Impor file yang dijatuhkan tanpa tinjauan", + "Recently Added always shows the newest imports first.": "Baru ditambahkan selalu menampilkan impor terbaru lebih dulu.", + "Recently Deleted shows no date groups.": "Baru dihapus tidak menampilkan grup tanggal." } diff --git a/crates/ui-egui/locales/it.json b/crates/ui-egui/locales/it.json index e159fd47d15..aa3d5110c9e 100644 --- a/crates/ui-egui/locales/it.json +++ b/crates/ui-egui/locales/it.json @@ -2361,5 +2361,7 @@ "Import dropped files without review": "Importa i file rilasciati senza revisione", "An import is running": "Un'importazione è in corso", "An import is running. Drop photos when it has finished": "Un'importazione è in corso. Trascina le foto quando è finita", - "Finish Lightroom catalog import before adding photos": "Termina l'importazione del catalogo Lightroom prima di aggiungere foto" + "Finish Lightroom catalog import before adding photos": "Termina l'importazione del catalogo Lightroom prima di aggiungere foto", + "Recently Added always shows the newest imports first.": "Aggiunte di recente mostra sempre prima le importazioni più recenti.", + "Recently Deleted shows no date groups.": "Eliminate di recente non mostra raggruppamenti per data." } diff --git a/crates/ui-egui/locales/ja.json b/crates/ui-egui/locales/ja.json index e1834555bd7..9ec64bc2d3d 100644 --- a/crates/ui-egui/locales/ja.json +++ b/crates/ui-egui/locales/ja.json @@ -2356,5 +2356,7 @@ "Import dropped files without review": "ドロップしたファイルを確認せずに読み込む", "An import is running": "読み込み中です", "An import is running. Drop photos when it has finished": "読み込み中です。完了してから写真をドロップしてください", - "Finish Lightroom catalog import before adding photos": "写真を追加する前に Lightroom カタログの読み込みを完了してください" + "Finish Lightroom catalog import before adding photos": "写真を追加する前に Lightroom カタログの読み込みを完了してください", + "Recently Added always shows the newest imports first.": "「最近追加した写真」では、常に読み込みが新しい順に表示されます。", + "Recently Deleted shows no date groups.": "「最近削除した写真」では日付でまとめて表示されません。" } diff --git a/crates/ui-egui/locales/ka.json b/crates/ui-egui/locales/ka.json index 32c40770018..9fcd113cbb5 100644 --- a/crates/ui-egui/locales/ka.json +++ b/crates/ui-egui/locales/ka.json @@ -2734,5 +2734,7 @@ "Import dropped files without review": "ჩაგდებული ფაილების იმპორტი გადახედვის გარეშე", "An import is running": "იმპორტი მიმდინარეობს", "An import is running. Drop photos when it has finished": "იმპორტი მიმდინარეობს. ფოტოები ჩააგდეთ, როცა დასრულდება", - "Finish Lightroom catalog import before adding photos": "ფოტოების დამატებამდე დაასრულეთ Lightroom-ის კატალოგის იმპორტი" + "Finish Lightroom catalog import before adding photos": "ფოტოების დამატებამდე დაასრულეთ Lightroom-ის კატალოგის იმპორტი", + "Recently Added always shows the newest imports first.": "„ბოლოს დამატებული“ ყოველთვის ჯერ უახლეს იმპორტებს აჩვენებს.", + "Recently Deleted shows no date groups.": "„ახლახან წაშლილი“ თარიღის მიხედვით დაჯგუფებას არ აჩვენებს." } diff --git a/crates/ui-egui/locales/pl.json b/crates/ui-egui/locales/pl.json index adac22e62ad..8a216cb4690 100644 --- a/crates/ui-egui/locales/pl.json +++ b/crates/ui-egui/locales/pl.json @@ -2283,5 +2283,7 @@ "Import dropped files without review": "Importuj upuszczone pliki bez przeglądu", "An import is running": "Import jest w toku", "An import is running. Drop photos when it has finished": "Import jest w toku. Upuść zdjęcia, gdy się zakończy", - "Finish Lightroom catalog import before adding photos": "Zakończ import katalogu Lightrooma, zanim dodasz zdjęcia" + "Finish Lightroom catalog import before adding photos": "Zakończ import katalogu Lightrooma, zanim dodasz zdjęcia", + "Recently Added always shows the newest imports first.": "Ostatnio dodane zawsze pokazuje najnowsze importy jako pierwsze.", + "Recently Deleted shows no date groups.": "Ostatnio usunięte nie pokazuje grup według dat." } diff --git a/crates/ui-egui/locales/pt-br.json b/crates/ui-egui/locales/pt-br.json index e84fb7615b7..0a92243a5ca 100644 --- a/crates/ui-egui/locales/pt-br.json +++ b/crates/ui-egui/locales/pt-br.json @@ -2202,5 +2202,7 @@ "Import dropped files without review": "Importar arquivos soltos sem revisão", "An import is running": "Uma importação está em andamento", "An import is running. Drop photos when it has finished": "Uma importação está em andamento. Solte as fotos quando ela terminar", - "Finish Lightroom catalog import before adding photos": "Conclua a importação do catálogo do Lightroom antes de adicionar fotos" + "Finish Lightroom catalog import before adding photos": "Conclua a importação do catálogo do Lightroom antes de adicionar fotos", + "Recently Added always shows the newest imports first.": "Adicionados recentemente sempre mostra as importações mais recentes primeiro.", + "Recently Deleted shows no date groups.": "Excluídos recentemente não mostra grupos de datas." } diff --git a/crates/ui-egui/locales/ru.json b/crates/ui-egui/locales/ru.json index 306804df045..100a6a1cafa 100644 --- a/crates/ui-egui/locales/ru.json +++ b/crates/ui-egui/locales/ru.json @@ -2349,5 +2349,7 @@ "Import dropped files without review": "Импортировать перетащенные файлы без проверки", "An import is running": "Импорт уже выполняется", "An import is running. Drop photos when it has finished": "Импорт уже выполняется. Перетащите фото, когда он закончится", - "Finish Lightroom catalog import before adding photos": "Завершите импорт каталога Lightroom, прежде чем добавлять фото" + "Finish Lightroom catalog import before adding photos": "Завершите импорт каталога Lightroom, прежде чем добавлять фото", + "Recently Added always shows the newest imports first.": "В «Недавно добавленные» сначала всегда показаны самые новые импорты.", + "Recently Deleted shows no date groups.": "В «Недавно удалённые» нет групп по датам." } diff --git a/crates/ui-egui/locales/sv.json b/crates/ui-egui/locales/sv.json index 66e69b7ba5d..0daef9a8a22 100644 --- a/crates/ui-egui/locales/sv.json +++ b/crates/ui-egui/locales/sv.json @@ -2429,5 +2429,7 @@ "Drop to open the face model": "Släpp för att öppna ansiktsmodellen", "Dropped Files": "Släppta filer", "Finish Lightroom catalog import before adding photos": "Slutför importen av Lightroom-katalogen innan du lägger till foton", - "Import dropped files without review": "Importera släppta filer utan granskning" + "Import dropped files without review": "Importera släppta filer utan granskning", + "Recently Added always shows the newest imports first.": "Nyligen tillagda visar alltid de senaste importerna först.", + "Recently Deleted shows no date groups.": "Nyligen raderade visar inga datumgrupper." } diff --git a/crates/ui-egui/locales/uk.json b/crates/ui-egui/locales/uk.json index ee694ed4fe0..0e42b02c801 100644 --- a/crates/ui-egui/locales/uk.json +++ b/crates/ui-egui/locales/uk.json @@ -2354,5 +2354,7 @@ "Import dropped files without review": "Імпортувати перетягнуті файли без перегляду", "An import is running": "Імпорт уже виконується", "An import is running. Drop photos when it has finished": "Імпорт уже виконується. Перетягніть фото, коли він завершиться", - "Finish Lightroom catalog import before adding photos": "Завершіть імпорт каталогу Lightroom, перш ніж додавати фото" + "Finish Lightroom catalog import before adding photos": "Завершіть імпорт каталогу Lightroom, перш ніж додавати фото", + "Recently Added always shows the newest imports first.": "У «Нещодавно додані» завжди спершу показано найновіші імпорти.", + "Recently Deleted shows no date groups.": "У «Нещодавно видалені» немає груп за датою." } diff --git a/crates/ui-egui/locales/vi.json b/crates/ui-egui/locales/vi.json index e4fb8feb81c..9fb1d8ee2dd 100644 --- a/crates/ui-egui/locales/vi.json +++ b/crates/ui-egui/locales/vi.json @@ -2235,5 +2235,7 @@ "Drop to open the face model": "Thả để mở mô hình khuôn mặt", "Dropped Files": "Tệp đã thả", "Finish Lightroom catalog import before adding photos": "Hoàn tất nhập danh mục Lightroom trước khi thêm ảnh", - "Import dropped files without review": "Nhập các tệp đã thả mà không xem lại" + "Import dropped files without review": "Nhập các tệp đã thả mà không xem lại", + "Recently Added always shows the newest imports first.": "Mục Mới thêm luôn hiển thị các lần nhập mới nhất trước.", + "Recently Deleted shows no date groups.": "Mục Đã xóa gần đây không hiển thị nhóm ngày." } diff --git a/crates/ui-egui/locales/zh-hans.json b/crates/ui-egui/locales/zh-hans.json index 270af8a6251..ae0e7306270 100644 --- a/crates/ui-egui/locales/zh-hans.json +++ b/crates/ui-egui/locales/zh-hans.json @@ -2200,5 +2200,7 @@ "Import dropped files without review": "不经检查直接导入拖入的文件", "An import is running": "正在导入", "An import is running. Drop photos when it has finished": "正在导入。导入完成后再拖放照片", - "Finish Lightroom catalog import before adding photos": "添加照片前,请先完成 Lightroom 目录的导入" + "Finish Lightroom catalog import before adding photos": "添加照片前,请先完成 Lightroom 目录的导入", + "Recently Added always shows the newest imports first.": "“最近添加”始终先显示最新导入的照片。", + "Recently Deleted shows no date groups.": "“最近删除”不显示日期分组。" } diff --git a/crates/ui-egui/locales/zh-hant.json b/crates/ui-egui/locales/zh-hant.json index 0408e23ec87..e0a7c745184 100644 --- a/crates/ui-egui/locales/zh-hant.json +++ b/crates/ui-egui/locales/zh-hant.json @@ -2157,5 +2157,7 @@ "Import dropped files without review": "不經檢查直接匯入拖放的檔案", "An import is running": "正在匯入", "An import is running. Drop photos when it has finished": "正在匯入。匯入完成後再拖放照片", - "Finish Lightroom catalog import before adding photos": "新增照片前,請先完成 Lightroom 目錄的匯入" + "Finish Lightroom catalog import before adding photos": "新增照片前,請先完成 Lightroom 目錄的匯入", + "Recently Added always shows the newest imports first.": "「最近加入」一律先顯示最新匯入的相片。", + "Recently Deleted shows no date groups.": "「最近刪除」不顯示日期群組。" } diff --git a/crates/ui-egui/src/menus.rs b/crates/ui-egui/src/menus.rs index b6b6c66c520..e3ff34e47d9 100644 --- a/crates/ui-egui/src/menus.rs +++ b/crates/ui-egui/src/menus.rs @@ -18,6 +18,7 @@ pub use ui_commands::{LANGUAGE_COMMANDS, UI_COMMANDS, language_from_command, ui_ pub mod menu_level; pub mod menubar; +pub mod sort_menu; /// (id, label, shortcut, menu path) pub type UiCommand = (&'static str, &'static str, Option<&'static str>, &'static str); diff --git a/crates/ui-egui/src/menus/menubar.rs b/crates/ui-egui/src/menus/menubar.rs index 5c1bcb9fc1c..492108f090c 100644 --- a/crates/ui-egui/src/menus/menubar.rs +++ b/crates/ui-egui/src/menus/menubar.rs @@ -649,40 +649,32 @@ pub(crate) fn expanded(app: &LightcraftApp, name: &str) -> Option> .map(|(k, label)| item("view.gridInfo", json!({"info": k}), label, None, true, Some(app.ui.grid_info == k))) .collect(), "Sort" => { + use crate::menus::sort_menu::SortMenu; use lightcraft_catalog::SortKey::*; - let cur = app.session.sort; - let mut v: Vec = [ - ("Capture Date", CaptureDate, "captureDate"), - ("Import Date", ImportDate, "importDate"), - ("Modified Date", EditDate, "editDate"), - ("File Name", FileName, "fileName"), - ("Rating", Rating, "rating"), - ("File Size", FileSize, "fileSize"), - ("Random", Random, "random"), - ] - .into_iter() - .map(|(label, key, k)| item("library.sort", json!({"key": k}), label, None, true, Some(cur.key == key))) - .collect(); - v.push(item("library.shuffle", json!({}), "Reshuffle", None, cur.key == Random, None)); + // what is on, checked and why not comes from one model shared with the bottom bar's popup + let m = SortMenu::of(&app.session); + let note = |n: Option| n.map(|n| item("library.sort", Value::Null, n.text(), None, false, None)); + let mut v: Vec = note(m.keys_note()).into_iter().collect(); + v.extend( + [ + ("Capture Date", CaptureDate, "captureDate"), + ("Import Date", ImportDate, "importDate"), + ("Modified Date", EditDate, "editDate"), + ("File Name", FileName, "fileName"), + ("Rating", Rating, "rating"), + ("File Size", FileSize, "fileSize"), + ("Random", Random, "random"), + ] + .into_iter() + .map(|(label, key, k)| item("library.sort", json!({"key": k}), label, None, m.keys_enabled(), Some(m.key_checked(key)))), + ); + v.push(MenuNode::Separator); + v.push(item("library.shuffle", json!({}), "Reshuffle", None, m.reshuffle_enabled(), None)); v.push(MenuNode::Separator); - // a shuffle has no direction worth choosing - v.push(item( - "library.sort", - json!({"ascending": true}), - "Ascending", - None, - cur.key != Random, - (cur.key != Random).then_some(cur.ascending), - )); - v.push(item( - "library.sort", - json!({"ascending": false}), - "Descending", - None, - cur.key != Random, - (cur.key != Random).then_some(!cur.ascending), - )); + v.push(item("library.sort", json!({"ascending": true}), "Ascending", None, m.direction_enabled(), m.direction_checked(true))); + v.push(item("library.sort", json!({"ascending": false}), "Descending", None, m.direction_enabled(), m.direction_checked(false))); v.push(MenuNode::Separator); + v.extend(note(m.groups_note())); use lightcraft_catalog::GroupBy; let groups = [ ("Group by Date: Automatic", GroupBy::Auto, "auto"), @@ -691,7 +683,11 @@ pub(crate) fn expanded(app: &LightcraftApp, name: &str) -> Option> ("Group by Year", GroupBy::Year, "year"), ("No Date Groups", GroupBy::None, "none"), ]; - v.extend(groups.into_iter().map(|(label, g, k)| item("library.sort", json!({"group": k}), label, None, true, Some(cur.group == g)))); + v.extend( + groups + .into_iter() + .map(|(label, g, k)| item("library.sort", json!({"group": k}), label, None, m.groups_enabled(), Some(m.group_checked(g)))), + ); v } "Open Recent Library" => { diff --git a/crates/ui-egui/src/menus/menubar/tests.rs b/crates/ui-egui/src/menus/menubar/tests.rs index 1e2fe388dde..e7be7637973 100644 --- a/crates/ui-egui/src/menus/menubar/tests.rs +++ b/crates/ui-egui/src/menus/menubar/tests.rs @@ -176,6 +176,120 @@ fn sort_menu_lists_reshuffle_once_and_only_enables_it_for_random() { assert!(dir_checked(&sort_children(&menu_bar(&a))).iter().all(Option::is_some), "checks come back for other keys"); } +fn sort_submenu(a: &LightcraftApp) -> Vec { + let bar = menu_bar(a); + let view = &bar.iter().find(|(t, _)| t == "View").expect("View menu").1; + view.iter() + .find_map(|n| match n { + MenuNode::Submenu { label, children } if label == "Sort" => Some(children.clone()), + _ => None, + }) + .expect("Sort submenu") +} + +/// (enabled, checked) of the Sort row with this label. +fn sort_row(kids: &[MenuNode], label: &str) -> (bool, Option) { + kids.iter() + .find_map(|n| match n { + MenuNode::Item { label: l, enabled, checked, .. } if l == label => Some((*enabled, *checked)), + _ => None, + }) + .unwrap_or_else(|| panic!("no {label} row in {kids:?}")) +} + +const SORT_KEYS: [&str; 7] = ["Capture Date", "Import Date", "Modified Date", "File Name", "Rating", "File Size", "Random"]; +const GROUPS: [&str; 5] = ["Group by Date: Automatic", "Group by Day", "Group by Month", "Group by Year", "No Date Groups"]; + +/// Recently Added is always newest import first: the keys, the direction and Reshuffle are off and +/// nothing is checked as the order shown; a dim line says why. Its date groups still apply. +#[test] +fn recently_added_sort_menu_offers_only_what_the_view_uses() { + let mut a = app(); + a.session.execute("library.sort", &json!({"key": "random"})).expect("sort at random"); + a.session.execute("library.source", &json!({"kind": "recentlyAdded"})).expect("Recently Added"); + let kids = sort_submenu(&a); + for label in SORT_KEYS { + assert_eq!(sort_row(&kids, label), (false, Some(false)), "{label}: off, and not checked as the order shown"); + } + for label in ["Ascending", "Descending"] { + assert_eq!(sort_row(&kids, label), (false, None), "{label}"); + } + assert!(!sort_row(&kids, "Reshuffle").0, "a reshuffle changes nothing here"); + let note = "Recently Added always shows the newest imports first."; + assert_eq!(sort_row(&kids, note), (false, None), "a dim line says why"); + // the grid still groups by import date there, whatever the key: the groups stay choosable + for label in GROUPS { + assert!(sort_row(&kids, label).0, "{label}"); + } + assert_eq!(sort_row(&kids, "Group by Date: Automatic").1, Some(true)); + // another source offers the keys again, and no note + a.session.execute("library.source", &json!({"kind": "all"})).expect("All Photos"); + let kids = sort_submenu(&a); + assert_eq!(sort_row(&kids, "Random"), (true, Some(true))); + assert!(!kids.iter().any(|n| matches!(n, MenuNode::Item { label, .. } if label == note))); + // a date sort leaves the direction on, except in Recently Added, which is newest import first whatever it says + a.session.execute("library.sort", &json!({"key": "captureDate"})).expect("sort by date"); + assert!(sort_row(&sort_submenu(&a), "Descending").0); + a.session.execute("library.source", &json!({"kind": "recentlyAdded"})).expect("Recently Added"); + assert_eq!(sort_row(&sort_submenu(&a), "Descending"), (false, None)); +} + +/// Recently Deleted lists photos without date headers whatever the group choice: it says so. +#[test] +fn recently_deleted_sort_menu_turns_the_date_groups_off() { + let mut a = app(); + a.session.execute("library.source", &json!({"kind": "recentlyDeleted"})).expect("Recently Deleted"); + let kids = sort_submenu(&a); + for label in GROUPS { + assert_eq!(sort_row(&kids, label), (false, Some(false)), "{label}"); + } + for label in SORT_KEYS { + assert!(sort_row(&kids, label).0, "the sort still orders Recently Deleted: {label}"); + } + assert_eq!(sort_row(&kids, "Recently Deleted shows no date groups."), (false, None)); +} + +/// A shuffle has no date headers (the grid draws none), so the group choice is off and unchecked, +/// like the direction; the stored choice comes back with the next key. +#[test] +fn random_sort_turns_the_date_groups_off_and_keeps_the_choice() { + let mut a = app(); + a.session.execute("library.sort", &json!({"group": "month"})).expect("group by month"); + a.session.execute("library.sort", &json!({"key": "random"})).expect("sort at random"); + let kids = sort_submenu(&a); + for label in GROUPS { + assert_eq!(sort_row(&kids, label), (false, Some(false)), "{label}"); + } + a.session.execute("library.sort", &json!({"key": "captureDate"})).expect("sort by date"); + assert_eq!(sort_row(&sort_submenu(&a), "Group by Month"), (true, Some(true)), "kept for when Random is left"); +} + +/// File Name, Rating and File Size draw no date headers either (only the date keys do): the group rows are off +/// there too, and on for each date key. +#[test] +fn only_the_date_keys_offer_date_groups() { + let mut a = app(); + for (key, on) in [("fileName", false), ("rating", false), ("fileSize", false), ("captureDate", true), ("importDate", true), ("editDate", true)] { + a.session.execute("library.sort", &json!({"key": key})).expect("sort"); + let kids = sort_submenu(&a); + for label in GROUPS { + assert_eq!(sort_row(&kids, label).0, on, "{label} under {key}"); + } + } +} + +/// Reshuffle sits below its own separator, under the key list, not inside it; it is always listed. +#[test] +fn reshuffle_follows_a_separator_below_the_sort_keys() { + let a = app(); + let kids = sort_submenu(&a); + let at = kids.iter().position(|n| matches!(n, MenuNode::Item { id, .. } if id == "library.shuffle")).expect("Reshuffle is always listed"); + let random = kids.iter().position(|n| matches!(n, MenuNode::Item { label, .. } if label == "Random")).expect("Random"); + assert_eq!(kids[random + 1], MenuNode::Separator, "the key list ends at Random"); + assert_eq!(kids[at - 1], MenuNode::Separator, "Reshuffle starts its own section"); + assert!(at > random); +} + /// File opens with the import entry points, worded as importing (not as adding a sidebar /// folder): Import Photos… (⇧⌘I), Import from Folder…, Import from Device ▸. #[test] diff --git a/crates/ui-egui/src/menus/sort_menu.rs b/crates/ui-egui/src/menus/sort_menu.rs new file mode 100644 index 00000000000..e68d637d62a --- /dev/null +++ b/crates/ui-egui/src/menus/sort_menu.rs @@ -0,0 +1,93 @@ +//! What the Sort menus offer for the view being shown. The bottom bar's popup and View ▸ Sort (the +//! native menu bar, the in-window one and the control channel) both ask this one model, so they can +//! never disagree about what is on, what is checked and why something is off. +//! +//! The grid decides what a sort means: Recently Added is always newest import first, a shuffle has +//! no date headers, and Recently Deleted draws none whatever the grouping (`panels::grid`). + +use lightcraft_catalog::{GroupBy, Sort, SortKey}; +use lightcraft_engine::{LibrarySource, Session}; + +/// Why part of the menu is off, as a dim line in the menu. +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub enum SortNote { + /// Shown above the keys: they have no say in this view. + RecentlyAdded, + /// Shown above the date groups: this view has no headers. + RecentlyDeleted, +} + +impl SortNote { + /// The message key (and the English text). + pub fn text(self) -> &'static str { + match self { + SortNote::RecentlyAdded => "Recently Added always shows the newest imports first.", + SortNote::RecentlyDeleted => "Recently Deleted shows no date groups.", + } + } +} + +#[derive(Clone, Copy, Debug)] +pub struct SortMenu { + sort: Sort, + source: LibrarySource, +} + +impl SortMenu { + pub fn of(session: &Session) -> Self { + SortMenu { sort: session.sort, source: session.source } + } + + /// Recently Added orders by import date whatever the sort says. + fn fixed_order(&self) -> bool { + self.source == LibrarySource::RecentlyAdded + } + + /// The sort keys, the direction and Reshuffle all have a say only when the sort orders the view. + pub fn keys_enabled(&self) -> bool { + !self.fixed_order() + } + + /// A key is checked only while it is the order shown. + pub fn key_checked(&self, key: SortKey) -> bool { + self.keys_enabled() && self.sort.key == key + } + + /// A shuffle has no direction worth choosing. + pub fn direction_enabled(&self) -> bool { + self.keys_enabled() && self.sort.key != SortKey::Random + } + + /// `None` where no direction is in force (a shuffle, Recently Added), so no row claims one. + pub fn direction_checked(&self, ascending: bool) -> Option { + self.direction_enabled().then_some(self.sort.ascending == ascending) + } + + /// Reshuffle means something only under Random (and where the sort is used at all). + pub fn reshuffle_enabled(&self) -> bool { + self.keys_enabled() && self.sort.key == SortKey::Random + } + + /// Date headers: only the date keys draw them (not a shuffle, File Name, Rating or File Size), and not + /// Recently Deleted. Recently Added orders by import date, so it groups by import date whatever the key. + pub fn groups_enabled(&self) -> bool { + match self.source { + LibrarySource::RecentlyDeleted => false, + LibrarySource::RecentlyAdded => true, + _ => matches!(self.sort.key, SortKey::CaptureDate | SortKey::ImportDate | SortKey::EditDate), + } + } + + /// The stored choice stays while the groups are off, and is not shown as in force. + pub fn group_checked(&self, group: GroupBy) -> bool { + self.groups_enabled() && self.sort.group == group + } + + pub fn keys_note(&self) -> Option { + self.fixed_order().then_some(SortNote::RecentlyAdded) + } + + pub fn groups_note(&self) -> Option { + (self.source == LibrarySource::RecentlyDeleted).then_some(SortNote::RecentlyDeleted) + } +} diff --git a/crates/ui-egui/src/panels/bottombar.rs b/crates/ui-egui/src/panels/bottombar.rs index 0b48d1e34a0..82bdcb1b235 100644 --- a/crates/ui-egui/src/panels/bottombar.rs +++ b/crates/ui-egui/src/panels/bottombar.rs @@ -6,6 +6,7 @@ use serde_json::json; use crate::LightcraftApp; use crate::icons::{Icon, paint}; +use crate::menus::sort_menu::{SortMenu, SortNote}; use crate::state::{ViewMode, Zoom}; use crate::theme::Tokens; use crate::widgets::{icon_button, register}; @@ -268,11 +269,38 @@ fn click_zoom_menu(app: &mut LightcraftApp, ui: &mut egui::Ui) { } } +/// One row of the Sort popup, registered as `sortMenu:{id}`: a check row where `checked` is `Some`, a plain +/// button where it is `None`; a row that is off can't be clicked. +fn sort_row(ui: &mut egui::Ui, id: &str, label: &str, enabled: bool, checked: Option) -> bool { + let r = ui + .add_enabled_ui(enabled, |ui| match checked { + Some(on) => ui.selectable_label(on, crate::i18n::tr(label)), + None => ui.button(crate::i18n::tr(label)), + }) + .inner; + register(ui, format!("sortMenu:{id}"), r.rect); + r.clicked() +} + +/// The dim line saying why part of the menu is off. +fn sort_note(ui: &mut egui::Ui, note: Option) { + let Some(note) = note else { return }; + let r = ui + .scope(|ui| { + ui.set_max_width(200.0); + ui.add(egui::Label::new(egui::RichText::new(crate::i18n::tr(note.text())).weak().small()).wrap()) + }) + .inner; + register(ui, "sortMenu:note", r.rect); +} + fn sort_menu(app: &mut LightcraftApp, ui: &mut egui::Ui) { use lightcraft_catalog::GroupBy; use lightcraft_catalog::SortKey::*; - let cur = app.session.sort; + // what is on, checked and why not comes from one model shared with View ▸ Sort + let m = SortMenu::of(&app.session); ui.label(egui::RichText::new(crate::i18n::tr("Sort by")).weak()); + sort_note(ui, m.keys_note()); for (label, key, k) in [ ("Capture Date", CaptureDate, "captureDate"), ("Import Date", ImportDate, "importDate"), @@ -282,11 +310,12 @@ fn sort_menu(app: &mut LightcraftApp, ui: &mut egui::Ui) { ("File Size", FileSize, "fileSize"), ("Random", Random, "random"), ] { - if ui.selectable_label(cur.key == key, crate::i18n::tr(label)).clicked() { + if sort_row(ui, &format!("key:{k}"), label, m.keys_enabled(), Some(m.key_checked(key))) { let _ = app.run("library.sort", json!({"key": k})); } } - if cur.key == Random && ui.button(crate::i18n::tr("Reshuffle")).clicked() { + ui.separator(); + if sort_row(ui, "reshuffle", "Reshuffle", m.reshuffle_enabled(), None) { let _ = app.run("library.shuffle", json!({})); } // a view that holds its photos shows what matches now when asked to @@ -298,17 +327,15 @@ fn sort_menu(app: &mut LightcraftApp, ui: &mut egui::Ui) { } } ui.separator(); - // a shuffle has no direction worth choosing - ui.add_enabled_ui(cur.key != Random, |ui| { - if ui.selectable_label(cur.key != Random && cur.ascending, crate::i18n::tr("Ascending")).clicked() { - let _ = app.run("library.sort", json!({"ascending": true})); - } - if ui.selectable_label(cur.key != Random && !cur.ascending, crate::i18n::tr("Descending")).clicked() { - let _ = app.run("library.sort", json!({"ascending": false})); + for (label, id, ascending) in [("Ascending", "ascending", true), ("Descending", "descending", false)] { + let checked = m.direction_checked(ascending).unwrap_or(false); + if sort_row(ui, id, label, m.direction_enabled(), Some(checked)) { + let _ = app.run("library.sort", json!({"ascending": ascending})); } - }); + } ui.separator(); ui.label(egui::RichText::new(crate::i18n::tr("Group by date")).weak()); + sort_note(ui, m.groups_note()); for (label, g, k) in [ ("Automatic", GroupBy::Auto, "auto"), ("Day", GroupBy::Day, "day"), @@ -316,7 +343,7 @@ fn sort_menu(app: &mut LightcraftApp, ui: &mut egui::Ui) { ("Year", GroupBy::Year, "year"), ("None", GroupBy::None, "none"), ] { - if ui.selectable_label(cur.group == g, crate::i18n::tr(label)).clicked() { + if sort_row(ui, &format!("group:{k}"), label, m.groups_enabled(), Some(m.group_checked(g))) { let _ = app.run("library.sort", json!({"group": k})); } } diff --git a/crates/ui-egui/src/tests.rs b/crates/ui-egui/src/tests.rs index 3a102a29a90..284af5a743c 100644 --- a/crates/ui-egui/src/tests.rs +++ b/crates/ui-egui/src/tests.rs @@ -71,6 +71,7 @@ mod scroll; mod slider_reset; mod slideshow; mod solo_sections; +mod sort_menu; mod switch_library; mod sync; mod tallies; diff --git a/crates/ui-egui/src/tests/sort_menu.rs b/crates/ui-egui/src/tests/sort_menu.rs new file mode 100644 index 00000000000..75ba9cbe960 --- /dev/null +++ b/crates/ui-egui/src/tests/sort_menu.rs @@ -0,0 +1,79 @@ +//! The bottom bar's Sort menu offers only what the view being shown uses: Recently Added is always +//! newest import first, a shuffle has no date headers, Reshuffle only means something under Random. + +use crate::headless::Headless; +use crate::{LightcraftApp, Services}; +use serde_json::json; +use std::time::Duration; + +const T: Duration = Duration::from_secs(20); + +fn demo() -> Headless { + let app = LightcraftApp::new(lightcraft_engine::Session::with_demo(), Services { png: None, ..Default::default() }); + let mut h = Headless::new(app, [1400.0, 900.0], 1.0); + h.settle(Duration::from_secs(120)); + // the first request switches the widget list on, the next frame fills it + h.request("ui.widgets", json!({}), T); + h.step(); + h +} + +fn exec(h: &mut Headless, command: &str, params: serde_json::Value) { + let r = h.request("engine.execute", json!({"command": command, "params": params}), T); + assert_eq!(r["ok"], true, "{command}: {r}"); +} + +/// Open the Sort popup and click `id` in it (the popup closes with the click). +fn click_in_sort_menu(h: &mut Headless, id: &str) { + let r = h.request("ui.clickWidget", json!({"id": "icon:sort"}), T); + assert_eq!(r["ok"], true, "{r}"); + h.step(); + h.step(); + let r = h.request("ui.clickWidget", json!({"id": id}), T); + assert_eq!(r["ok"], true, "{id}: {r}"); + h.step(); + h.step(); +} + +fn row_listed(h: &mut Headless, id: &str) -> bool { + let r = h.request("ui.clickWidget", json!({"id": "icon:sort"}), T); + assert_eq!(r["ok"], true, "{r}"); + h.step(); + h.step(); + let listed = h.request("ui.widgets", json!({"filter": id}), T)["result"].as_array().is_some_and(|a| a.iter().any(|w| w["id"] == id)); + // close it again with Escape + h.events.push(egui::Event::Key { key: egui::Key::Escape, physical_key: None, pressed: true, repeat: false, modifiers: egui::Modifiers::NONE }); + h.step(); + h.step(); + listed +} + +#[test] +fn recently_added_turns_the_keys_the_direction_and_reshuffle_off_and_says_why() { + let mut h = demo(); + exec(&mut h, "library.sort", json!({"key": "random", "seed": 7})); + exec(&mut h, "library.source", json!({"kind": "recentlyAdded"})); + assert!(row_listed(&mut h, "sortMenu:note"), "a dim line says why the keys are off"); + click_in_sort_menu(&mut h, "sortMenu:reshuffle"); + assert_eq!(h.app.session.sort.seed, 7, "a reshuffle changes nothing there"); + click_in_sort_menu(&mut h, "sortMenu:key:fileName"); + assert_eq!(h.app.session.sort.key, lightcraft_catalog::SortKey::Random, "the keys are off"); + click_in_sort_menu(&mut h, "sortMenu:ascending"); + assert!(!h.app.session.sort.ascending, "the direction is off"); + + exec(&mut h, "library.source", json!({"kind": "all"})); + assert!(!row_listed(&mut h, "sortMenu:note"), "no note where the sort applies"); + click_in_sort_menu(&mut h, "sortMenu:reshuffle"); + assert_ne!(h.app.session.sort.seed, 7, "under Random in All Photos Reshuffle works"); +} + +#[test] +fn a_shuffle_turns_the_date_groups_off_and_keeps_the_choice() { + let mut h = demo(); + exec(&mut h, "library.sort", json!({"key": "random", "group": "month"})); + click_in_sort_menu(&mut h, "sortMenu:group:day"); + assert_eq!(h.app.session.sort.group, lightcraft_catalog::GroupBy::Month, "no date headers to group"); + exec(&mut h, "library.sort", json!({"key": "captureDate"})); + click_in_sort_menu(&mut h, "sortMenu:group:day"); + assert_eq!(h.app.session.sort.group, lightcraft_catalog::GroupBy::Day, "groups are choosable for a date sort"); +} diff --git a/docs/parity-checklist.md b/docs/parity-checklist.md index 90cfc248f60..690e99b50b2 100644 --- a/docs/parity-checklist.md +++ b/docs/parity-checklist.md @@ -1,6 +1,6 @@ # Lightroom parity checklist -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-25 · **Change:** minor (LR-BEHAV-TITLEBAR: a double-click follows the system setting, and a panel over the bar keeps the window still; KEYC-METADATA, LRC-LIB-KEYWORDS: ⌥0 / ⌥⇧0 go to the next / previous keyword set; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; KEYC-METADATA: ⌘K / Ctrl+K Add Keywords; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings) · **Target:** Adobe Lightroom Classic 15.5 / Lightroom 9.6 +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-28 · **Change:** minor (MENU-VIEW-SORT, LR-FILT-SORT: the Sort menus (bottom bar and View ▸ Sort) turn off what the view ignores — the keys, the direction and Reshuffle in Recently Added, the date groups wherever the grid draws no date headers (under Random, File Name, Rating and File Size, and in Recently Deleted) — and say why where a whole view is the reason; Reshuffle sits under its own separator; LR-BEHAV-TITLEBAR: a double-click follows the system setting, and a panel over the bar keeps the window still; KEYC-METADATA, LRC-LIB-KEYWORDS: ⌥0 / ⌥⇧0 go to the next / previous keyword set; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; KEYC-METADATA: ⌘K / Ctrl+K Add Keywords; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings) · **Target:** Adobe Lightroom Classic 15.5 / Lightroom 9.6 The measured, row-by-row checklist: one row per Lightroom feature, menu item and shortcut, what we have and what is missing. It answers *does the feature exist?* (feature breadth). Whether it is good @@ -157,7 +157,7 @@ differences and missing bindings are in [ui-parity.md](ui-parity.md#shortcuts). | LR-FILT-LOCATION | Location filter | P2 | ✅ | `cmd:library.filter` (`text`, `ruleSet` field `location`) | free text, or a rule on location / city / state / country (smart albums, `library.filter`) | | LR-FILT-PEOPLE | People filter | P2 | 🟡 | `cmd:library.filter`, `crates/catalog/src/query.rs` | filter by a person's name (case-insensitive, named Face regions only) from the People view, a filter chip, `person:` (`person:"Jane Doe"` for a name of several words) or a plain word in Search Photos (part of the name); no People picker in the filter bar and one person at a time (issue #1449); no unnamed / suggested people | | LR-FILT-CULL | Culling-score filters | P2 | ✅ | `cmd:library.filter` (`ruleSet` fields `sharpness`, `bestOfGroup`) | Focus and Best of Similar Shots in the rule editor / smart albums | -| LR-FILT-SORT | Sort | P0 | ✅ | `cmd:library.sort`, `cmd:library.shuffle`, `crates/ui-egui/src/panels/bottombar.rs` | Random sort (seeded, stable under edits; choosing Random or Reshuffle picks a new seed); the shuffle is part of the saved view state; no effect in Recently Added (always newest import first); no colour-label or custom (manual) order | +| LR-FILT-SORT | Sort | P0 | ✅ | `cmd:library.sort`, `cmd:library.shuffle`, `crates/ui-egui/src/panels/bottombar.rs`, `crates/ui-egui/src/menus/sort_menu.rs` | Random sort (seeded, stable under edits; choosing Random or Reshuffle picks a new seed); the shuffle is part of the saved view state; both Sort menus (bottom bar, View ▸ Sort) offer only what the view uses: in Recently Added (always newest import first, grouped by import date at the chosen grouping) the keys, the direction and Reshuffle are off, nothing is checked as the order shown, and a dim line says why; elsewhere the date groups are on only for the date keys (off under Random, File Name, Rating and File Size), and off in Recently Deleted, which draws no headers, with a dim line there; no colour-label or custom (manual) order | | LR-FILT-SAVED | Filter presets [Classic] | P2 | ✅ | `cmd:filter.savePreset`, `cmd:filter.applyPreset`, `cmd:filter.presets`, `cmd:filter.deletePreset`, `crates/ui-egui/src/panels/filterbar.rs` | filter bar → Presets: apply, save current filter, delete (right-click); saved with the library | ## E. Metadata (META) @@ -548,7 +548,7 @@ visible menu bar yet: the menu model is only exposed through the control channel | MENU-VIEW-CLIPPING | Clipping | P0 | ✅ | `cmd:view.clipping` | | | MENU-VIEW-MASKOVERLAY | Mask overlay / cycle colour | P0 | ✅ | `cmd:view.maskOverlay`, `cmd:view.maskOverlayMode`, `cmd:view.maskOverlayColor` | colour cycles through the panel's swatches (no params) or takes `color` / `opacity` | | MENU-VIEW-INCLUDESUBFOLDERS | Include subfolders | P1 | ✅ | `cmd:library.browse` (`subfolders`) | toggle in the folder header; imports of folders are recursive | -| MENU-VIEW-SORT | Sort submenu | P0 | ✅ | `cmd:library.sort`, `cmd:library.shuffle` | Random + Reshuffle; no colour-label key | +| MENU-VIEW-SORT | Sort submenu | P0 | ✅ | `cmd:library.sort`, `cmd:library.shuffle` | Random + Reshuffle (always listed under its own separator, on only under Random and not in Recently Added); the keys and the direction are off in Recently Added, with a dim line saying why; the date groups stay on in Recently Added (it groups by import date), are on elsewhere only for the date keys, and are off in Recently Deleted (dim line there); no colour-label key | | MENU-VIEW-STACKS | Expand/collapse stacks | P1 | ✅ | `cmd:stack.expandAll`, `cmd:stack.collapseAll` | | | MENU-VIEW-PHOTOCOUNT | Show photo counts | P2 | ✅ | `cmd:view.photoCounts` | View ▸ Photo Counts toggles the left panel's counts | | MENU-VIEW-SIDEBARSECTIONS | Sidebar sections | P2 | ✅ | `cmd:view.sidebarSection`, `cmd:view.sidebarReset` | View ▸ Sidebar Sections ▸ a checkable item per left-sidebar section, then Reset Sidebar Sections (see LR-BEHAV-SIDEBAR-HIDE) | @@ -959,3 +959,4 @@ Latin stays upright. Advanced Japanese composition remains open. Regression cove | 2026-10-23 | patch | LR-BEHAV-ACCESS: the name field of New Album, New Smart Album, Rename and the other one-field dialogs takes the keyboard focus once when the dialog opens instead of every frame, so Tab and Shift+Tab reach the check box, Cancel and OK; status unchanged (🟡) | | 2026-10-22 | minor | LR-CROP-AUTO: Auto straighten turns by at most 10° and only on at least 3 agreeing lines, and says when it finds nothing to level by; measured on 68 photos straightened by hand and 300 left as shot, unwanted turns of more than 1° fell from 79 to 19 of the 300. Downgraded ✅ → 🟡: it still leaves most tilted photos alone | | 2026-10-23 | patch | LRC-LIB-FILTERBAR: showing an album (`library.source`) while the filter holds an album drops the filter's album, as showing a library folder already dropped its folder filter; before, the old album stayed in the filter unseen (the filter bar has no album chip) and narrowed the next source such as All Photos; the row's note says so; status unchanged (✅) | +| 2026-10-28 | minor | MENU-VIEW-SORT, LR-FILT-SORT: the bottom bar's Sort popup and View ▸ Sort read one model (`menus/sort_menu.rs`) and offer only what the view uses: in Recently Added the keys, the direction and Reshuffle are off (nothing is checked as the order shown) with a dim line "Recently Added always shows the newest imports first."; the date groups are off, and unchecked, where the grid draws no headers (under Random, File Name, Rating and File Size, and in Recently Deleted, which says so; the stored choice is kept); Reshuffle is listed in both menus under its own separator below the keys; status unchanged (✅) | diff --git a/docs/whats-new.md b/docs/whats-new.md index c6c25920034..98105d089ab 100644 --- a/docs/whats-new.md +++ b/docs/whats-new.md @@ -1,5 +1,16 @@ # What's new in LightCraft +## 2026-10-28 + +### The Sort menus offer only what the view uses +- In Recently Added, which always shows the newest imports first, the sort keys, Ascending / Descending and Reshuffle in + the bottom bar's Sort popup and in View ▸ Sort are now off and nothing is checked as the order shown; a dim line says + "Recently Added always shows the newest imports first." Before, they checked the saved sort (and, under Random, offered + a Reshuffle that changed nothing). The Group by Date choices are off too where the grid draws no date headers — + under Random, File Name, Rating and File Size, and in Recently Deleted — and your choice is kept for when you pick a + date sort again, as the direction already was for Random. Reshuffle is always listed, in both menus, under its own + separator below the sort keys, and is on only while you sort at random. + ## 2026-10-24 ### Relative-date filters and smart albums follow the clock From f256472e6d495c5ff89c5743214d491455a5cb6d Mon Sep 17 00:00:00 2001 From: Nathaniel Ledford Date: Wed, 28 Oct 2026 21:04:22 -0400 Subject: [PATCH 2/4] MENU-VIEW-SORT: say the date-group wording applies outside Recently Added --- docs/parity-checklist.md | 4 ++-- docs/whats-new.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/parity-checklist.md b/docs/parity-checklist.md index 690e99b50b2..90db2e98831 100644 --- a/docs/parity-checklist.md +++ b/docs/parity-checklist.md @@ -1,6 +1,6 @@ # Lightroom parity checklist -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-28 · **Change:** minor (MENU-VIEW-SORT, LR-FILT-SORT: the Sort menus (bottom bar and View ▸ Sort) turn off what the view ignores — the keys, the direction and Reshuffle in Recently Added, the date groups wherever the grid draws no date headers (under Random, File Name, Rating and File Size, and in Recently Deleted) — and say why where a whole view is the reason; Reshuffle sits under its own separator; LR-BEHAV-TITLEBAR: a double-click follows the system setting, and a panel over the bar keeps the window still; KEYC-METADATA, LRC-LIB-KEYWORDS: ⌥0 / ⌥⇧0 go to the next / previous keyword set; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; KEYC-METADATA: ⌘K / Ctrl+K Add Keywords; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings) · **Target:** Adobe Lightroom Classic 15.5 / Lightroom 9.6 +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-28 · **Change:** minor (MENU-VIEW-SORT, LR-FILT-SORT: the Sort menus (bottom bar and View ▸ Sort) turn off what the view ignores — the keys, the direction and Reshuffle in Recently Added, and outside it the date groups wherever the grid draws no date headers (under Random, File Name, Rating and File Size, and in Recently Deleted) — and say why where a whole view is the reason; Reshuffle sits under its own separator; LR-BEHAV-TITLEBAR: a double-click follows the system setting, and a panel over the bar keeps the window still; KEYC-METADATA, LRC-LIB-KEYWORDS: ⌥0 / ⌥⇧0 go to the next / previous keyword set; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; KEYC-METADATA: ⌘K / Ctrl+K Add Keywords; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings) · **Target:** Adobe Lightroom Classic 15.5 / Lightroom 9.6 The measured, row-by-row checklist: one row per Lightroom feature, menu item and shortcut, what we have and what is missing. It answers *does the feature exist?* (feature breadth). Whether it is good @@ -959,4 +959,4 @@ Latin stays upright. Advanced Japanese composition remains open. Regression cove | 2026-10-23 | patch | LR-BEHAV-ACCESS: the name field of New Album, New Smart Album, Rename and the other one-field dialogs takes the keyboard focus once when the dialog opens instead of every frame, so Tab and Shift+Tab reach the check box, Cancel and OK; status unchanged (🟡) | | 2026-10-22 | minor | LR-CROP-AUTO: Auto straighten turns by at most 10° and only on at least 3 agreeing lines, and says when it finds nothing to level by; measured on 68 photos straightened by hand and 300 left as shot, unwanted turns of more than 1° fell from 79 to 19 of the 300. Downgraded ✅ → 🟡: it still leaves most tilted photos alone | | 2026-10-23 | patch | LRC-LIB-FILTERBAR: showing an album (`library.source`) while the filter holds an album drops the filter's album, as showing a library folder already dropped its folder filter; before, the old album stayed in the filter unseen (the filter bar has no album chip) and narrowed the next source such as All Photos; the row's note says so; status unchanged (✅) | -| 2026-10-28 | minor | MENU-VIEW-SORT, LR-FILT-SORT: the bottom bar's Sort popup and View ▸ Sort read one model (`menus/sort_menu.rs`) and offer only what the view uses: in Recently Added the keys, the direction and Reshuffle are off (nothing is checked as the order shown) with a dim line "Recently Added always shows the newest imports first."; the date groups are off, and unchecked, where the grid draws no headers (under Random, File Name, Rating and File Size, and in Recently Deleted, which says so; the stored choice is kept); Reshuffle is listed in both menus under its own separator below the keys; status unchanged (✅) | +| 2026-10-28 | minor | MENU-VIEW-SORT, LR-FILT-SORT: the bottom bar's Sort popup and View ▸ Sort read one model (`menus/sort_menu.rs`) and offer only what the view uses: in Recently Added the keys, the direction and Reshuffle are off (nothing is checked as the order shown) with a dim line "Recently Added always shows the newest imports first."; outside Recently Added the date groups are off, and unchecked, where the grid draws no headers (under Random, File Name, Rating and File Size, and in Recently Deleted, which says so; the stored choice is kept for when you pick a date sort again or leave Recently Deleted); Reshuffle is listed in both menus under its own separator below the keys; status unchanged (✅) | diff --git a/docs/whats-new.md b/docs/whats-new.md index 98105d089ab..d5d509dddf5 100644 --- a/docs/whats-new.md +++ b/docs/whats-new.md @@ -6,9 +6,9 @@ - In Recently Added, which always shows the newest imports first, the sort keys, Ascending / Descending and Reshuffle in the bottom bar's Sort popup and in View ▸ Sort are now off and nothing is checked as the order shown; a dim line says "Recently Added always shows the newest imports first." Before, they checked the saved sort (and, under Random, offered - a Reshuffle that changed nothing). The Group by Date choices are off too where the grid draws no date headers — + a Reshuffle that changed nothing). Outside Recently Added, the Group by Date choices are off too where the grid draws no date headers — under Random, File Name, Rating and File Size, and in Recently Deleted — and your choice is kept for when you pick a - date sort again, as the direction already was for Random. Reshuffle is always listed, in both menus, under its own + date sort again or leave Recently Deleted, as the direction already was for Random. Reshuffle is always listed, in both menus, under its own separator below the sort keys, and is on only while you sort at random. ## 2026-10-24 From 755f858bd9aab3bcd0a632c9384517b9e51db0a4 Mon Sep 17 00:00:00 2001 From: Nathaniel Ledford Date: Wed, 28 Oct 2026 21:06:28 -0400 Subject: [PATCH 3/4] LR-FILT-SORT: Previous Shuffle and a Reshuffle shortcut --- crates/engine/src/cmd/library/specs.rs | 70 ++++++++++++++++-- crates/engine/src/lib.rs | 12 +++ crates/engine/src/library.rs | 2 + crates/engine/src/tests/libops.rs | 90 +++++++++++++++++++++++ crates/ui-egui/locales/cs.json | 3 +- crates/ui-egui/locales/de.json | 3 +- crates/ui-egui/locales/es.json | 3 +- crates/ui-egui/locales/fi.json | 3 +- crates/ui-egui/locales/fr.json | 3 +- crates/ui-egui/locales/id.json | 3 +- crates/ui-egui/locales/it.json | 3 +- crates/ui-egui/locales/ja.json | 3 +- crates/ui-egui/locales/ka.json | 3 +- crates/ui-egui/locales/pl.json | 3 +- crates/ui-egui/locales/pt-br.json | 3 +- crates/ui-egui/locales/ru.json | 3 +- crates/ui-egui/locales/sv.json | 3 +- crates/ui-egui/locales/uk.json | 3 +- crates/ui-egui/locales/vi.json | 3 +- crates/ui-egui/locales/zh-hans.json | 3 +- crates/ui-egui/locales/zh-hant.json | 3 +- crates/ui-egui/src/menus/menubar.rs | 7 +- crates/ui-egui/src/menus/menubar/tests.rs | 27 +++++++ crates/ui-egui/src/menus/sort_menu.rs | 8 +- crates/ui-egui/src/panels/bottombar.rs | 20 +++-- crates/ui-egui/src/shortcuts.rs | 14 ++++ crates/ui-egui/src/tests/keymap.rs | 22 ++++++ crates/ui-egui/src/tests/sort_menu.rs | 12 +++ docs/library-shortcuts.md | 2 + docs/parity-checklist.md | 7 +- docs/whats-new.md | 7 ++ 31 files changed, 314 insertions(+), 37 deletions(-) diff --git a/crates/engine/src/cmd/library/specs.rs b/crates/engine/src/cmd/library/specs.rs index 9a8ecd7bf62..94e6393dbdb 100644 --- a/crates/engine/src/cmd/library/specs.rs +++ b/crates/engine/src/cmd/library/specs.rs @@ -24,11 +24,50 @@ fn seed_param(p: &Value, cmd: &str, default: u64) -> Result { /// The seed after `prev` at time `now`: a mix of `prev` and the clock text, so repeated reshuffles /// within one clock tick still differ (barring a 2^-53 collision). Kept below 2^53 so JSON /// clients that read numbers as doubles (web, MCP agents) get the same seed back. -fn next_seed(prev: u64, now: &str) -> u64 { - let t = now.bytes().fold(0u64, |h, b| lightcraft_catalog::mix64(h ^ u64::from(b))); +fn next_seed(prev: u64, now: &str, count: u64) -> u64 { + let t = now.bytes().fold(count, |h, b| lightcraft_catalog::mix64(h ^ u64::from(b))); (lightcraft_catalog::mix64(prev.wrapping_add(1)) ^ t) & (MAX_SEED - 1) } +/// How many replaced shuffles `library.previousShuffle` can step back through. +const MAX_SHUFFLE_HISTORY: usize = 32; + +/// Change the sort. While shuffling, a different seed replaces the order shown, so the seed it replaces is kept for +/// `library.previousShuffle` (the oldest is dropped past [`MAX_SHUFFLE_HISTORY`]); leaving Random forgets them all, as +/// they would restore an order nobody sees any more. +fn set_sort(s: &mut crate::Session, new: Sort) { + let old = s.sort; + if new.key == SortKey::Random && old.key == SortKey::Random { + if new.seed != old.seed { + if s.shuffle_history.len() >= MAX_SHUFFLE_HISTORY { + s.shuffle_history.remove(0); + } + s.shuffle_history.push(old.seed); + } + } else { + s.shuffle_history.clear(); + } + s.sort = new; +} + +/// `library.previousShuffle` is on while sorting at random with a replaced shuffle to go back to. +fn can_go_back(s: &crate::Session) -> std::result::Result<(), String> { + if s.sort.key != SortKey::Random { + Err("the view is not sorted at random".into()) + } else if s.shuffle_history.is_empty() { + Err("no earlier shuffle".into()) + } else { + Ok(()) + } +} + +/// A new shuffle after `prev`. The clock only ticks in seconds, and Previous Shuffle can return to a seed whose successor +/// was already made, so the count of shuffles made this session goes in too: a Reshuffle is never the order just left. +fn fresh_seed(s: &mut crate::Session, prev: u64) -> u64 { + s.shuffle_count += 1; + next_seed(prev, &(s.clock)(), s.shuffle_count) +} + pub fn specs() -> Vec { vec![ // ---- view source / filter / sort @@ -248,9 +287,10 @@ pub fn specs() -> Vec { let explicit = p.get("seed").is_some_and(|v| !v.is_null()); if key == SortKey::Random && s.sort.key != SortKey::Random && !explicit { // switching to Random is a fresh shuffle, not whatever seed was left behind - seed = next_seed(seed, &(s.clock)()); + seed = fresh_seed(s, seed); } - s.sort = Sort { key, ascending: bool_or(p, "ascending", s.sort.ascending), group, seed }; + let sort = Sort { key, ascending: bool_or(p, "ascending", s.sort.ascending), group, seed }; + set_sort(s, sort); ok() } ), @@ -296,17 +336,31 @@ pub fn specs() -> Vec { "library.shuffle", "Reshuffle", ["View", "Sort"], - None, - "{seed?: 0..2^53-1} — sort at random; without `seed` a new shuffle each time. Recently Added ignores the sort and stays newest import first, so a reshuffle there only switches the stored sort to Random with a new seed and changes no order on screen (it still ends a held view, like any sort change; the menus keep Reshuffle off in that view)", + Some("Cmd+Alt+Shift+R"), + "{seed?: 0..2^53-1} — sort at random; without `seed` a new shuffle each time (the one it replaces can come back with `library.previousShuffle`). Recently Added ignores the sort and stays newest import first, so a reshuffle there only switches the stored sort to Random with a new seed and changes no order on screen (it still ends a held view, like any sort change; the menus keep Reshuffle off in that view)", always, |s, p| { let seed = match seed_param(p, "library.shuffle", s.sort.seed)? { given if p.get("seed").is_some_and(|v| !v.is_null()) => given, // derived from the previous seed and the session clock: reproducible under a test // clock, and no RNG needed - prev => next_seed(prev, &(s.clock)()), + prev => fresh_seed(s, prev), }; - s.sort = Sort { key: SortKey::Random, seed, ..s.sort }; + let sort = Sort { key: SortKey::Random, seed, ..s.sort }; + set_sort(s, sort); + ok() + } + ), + cmd!( + "library.previousShuffle", + "Previous Shuffle", + ["View", "Sort"], + Some("Cmd+Alt+Shift+P"), + "{} — go back to the shuffle a Reshuffle (or a new `seed` given while sorting at random) replaced: the same seed, so the exact earlier order. Steps back through up to 32 of them, newest first; going back is not itself kept, so a Reshuffle after it is a new shuffle. Only while sorting at random with an earlier shuffle; the list lives in the session only (never saved with the view) and is forgotten when the sort leaves Random or another library opens", + can_go_back, + |s, _| { + let seed = s.shuffle_history.pop().ok_or_else(|| bad("library.previousShuffle", "no earlier shuffle"))?; + s.sort = Sort { seed, ..s.sort }; ok() } ), diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index acaa1807009..c2595c70a7f 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -235,6 +235,11 @@ pub struct Session { /// The filter `library.toggleFilters` put aside (Library > Enable Filters off); not persisted. pub(crate) shelved_filter: Option, pub sort: Sort, + /// The seeds Reshuffle replaced during this stay in Random, newest last (`library.previousShuffle`). Session-only: + /// never saved with the view. Empty unless the sort is Random. + pub(crate) shuffle_history: Vec, + /// New shuffles made this session; mixed into each new seed so two in the same clock second differ. + pub(crate) shuffle_count: u64, pub selection: Selection, /// The grid order for the current source/filter/sort (cached by catalog revision). /// Shared, so frontends can hold it across frames without copying ([`Session::visible_shared`]). @@ -453,6 +458,8 @@ impl Session { filter: Filter::default(), shelved_filter: None, sort: Sort::default(), + shuffle_history: Vec::new(), + shuffle_count: 0, selection: Selection::default(), visible: Vec::new().into(), visible_key: None, @@ -1213,6 +1220,11 @@ impl Session { f } + /// Whether `library.previousShuffle` has a replaced shuffle to go back to (only while the sort is Random). + pub fn has_previous_shuffle(&self) -> bool { + self.sort.key == lightcraft_catalog::SortKey::Random && !self.shuffle_history.is_empty() + } + /// Let go of what a held view kept: the view shows what matches now ([`Session::hold_view`]). pub fn refresh_view(&mut self) { self.base = None; diff --git a/crates/engine/src/library.rs b/crates/engine/src/library.rs index a5071b4b358..e7bab63cac0 100644 --- a/crates/engine/src/library.rs +++ b/crates/engine/src/library.rs @@ -488,6 +488,8 @@ impl Session { self.selection = Selection::default(); self.source = LibrarySource::All; self.library_folder = None; + // (the orders of the last library's shuffles don't exist in this one) + self.shuffle_history.clear(); if report.created && seed_demo { crate::demo::load(self); journal.snapshot(&self.catalog)?; diff --git a/crates/engine/src/tests/libops.rs b/crates/engine/src/tests/libops.rs index b35167c1baa..1d393e6dc2b 100644 --- a/crates/engine/src/tests/libops.rs +++ b/crates/engine/src/tests/libops.rs @@ -502,6 +502,96 @@ fn random_sort_is_stable_until_reshuffled() { assert_eq!(s.visible_cloned(), a); } +// ---- Previous Shuffle: Given a reshuffle that replaced a good order, When the user asks for the previous shuffle, Then that exact order is back + +fn previous_shuffle_enabled(s: &Session) -> bool { + crate::cmd::find_command("library.previousShuffle").expect("the command exists").info(s).enabled +} + +#[test] +fn previous_shuffle_restores_the_exact_earlier_order_one_reshuffle_at_a_time() { + let mut s = Session::with_demo(); + s.execute("library.sort", &json!({"key": "random", "seed": 11})).unwrap(); + let first = s.visible_cloned(); + assert!(!previous_shuffle_enabled(&s), "no reshuffle has replaced anything yet"); + s.execute("library.shuffle", &json!({})).unwrap(); + let second = s.visible_cloned(); + s.execute("library.shuffle", &json!({})).unwrap(); + let third = s.visible_cloned(); + assert!(first != second && second != third, "each reshuffle is a new order"); + assert!(previous_shuffle_enabled(&s)); + s.execute("library.previousShuffle", &json!({})).unwrap(); + assert_eq!(s.visible_cloned(), second, "the order the last reshuffle replaced"); + s.execute("library.previousShuffle", &json!({})).unwrap(); + assert_eq!((s.visible_cloned(), s.sort.seed), (first, 11), "and the one before it, by its seed"); + assert!(!previous_shuffle_enabled(&s), "nothing earlier is left"); + assert!(matches!(s.execute("library.previousShuffle", &json!({})), Err(crate::EngineError::Disabled(..)))); + // going back is not a reshuffle: a new reshuffle after it is again a new order, and goes back to the one it replaced + s.execute("library.shuffle", &json!({})).unwrap(); + assert!(previous_shuffle_enabled(&s)); + assert_ne!(s.visible_cloned(), second, "the clock may not have moved, yet it is a new order, not the one just left"); + assert_ne!(s.visible_cloned(), third, "nor the one before that"); + s.execute("library.previousShuffle", &json!({})).unwrap(); + assert_eq!(s.sort.seed, 11); +} + +#[test] +fn opening_a_library_forgets_the_earlier_shuffles() { + let dir = std::env::temp_dir().join(format!("lc-prev-shuffle-{}", std::process::id())); + let _ = std::fs::remove_dir_all(&dir); + std::fs::create_dir_all(&dir).unwrap(); + let mut s = Session::new().with_fs(); + s.open_library(dir.join("one"), false).unwrap(); + s.execute("library.sort", &json!({"key": "random", "seed": 3})).unwrap(); + s.execute("library.shuffle", &json!({})).unwrap(); + assert!(previous_shuffle_enabled(&s)); + s.open_library(dir.join("two"), false).unwrap(); + assert!(!previous_shuffle_enabled(&s), "the other library never showed those orders"); + let _ = std::fs::remove_dir_all(&dir); +} + +#[test] +fn previous_shuffle_keeps_a_bounded_history_of_seeds() { + let mut s = Session::with_demo(); + s.execute("library.sort", &json!({"key": "random", "seed": 100})).unwrap(); + for seed in 1..=40u64 { + s.execute("library.shuffle", &json!({"seed": seed})).unwrap(); + } + // 40 replaced seeds (100, 1 … 39), the oldest 8 forgotten + let mut back = Vec::new(); + for _ in 0..64 { + if !previous_shuffle_enabled(&s) { + break; + } + s.execute("library.previousShuffle", &json!({})).unwrap(); + back.push(s.sort.seed); + } + assert_eq!(back.len(), 32, "a bounded history"); + assert_eq!((back.first(), back.last()), (Some(&39), Some(&8)), "newest first, the oldest dropped"); +} + +#[test] +fn previous_shuffle_is_off_unless_sorting_at_random_with_an_earlier_shuffle() { + let mut s = Session::with_demo(); + assert!(!previous_shuffle_enabled(&s), "a date sort"); + s.execute("library.sort", &json!({"key": "random", "seed": 5})).unwrap(); + s.execute("library.shuffle", &json!({})).unwrap(); + assert!(previous_shuffle_enabled(&s)); + // leaving Random forgets the shuffles of that stay: they would restore an order nobody sees any more + s.execute("library.sort", &json!({"key": "fileName"})).unwrap(); + assert!(!previous_shuffle_enabled(&s)); + s.execute("library.sort", &json!({"key": "random"})).unwrap(); + assert!(!previous_shuffle_enabled(&s), "coming back starts a new shuffle with nothing before it"); + // an explicit seed given while shuffling replaces the order shown, a repeat of the seed in force does not + let seed = s.sort.seed; + s.execute("library.sort", &json!({"seed": seed})).unwrap(); + s.execute("library.shuffle", &json!({"seed": seed})).unwrap(); + assert!(!previous_shuffle_enabled(&s), "the same order again replaced nothing"); + s.execute("library.sort", &json!({"seed": 77})).unwrap(); + s.execute("library.previousShuffle", &json!({})).unwrap(); + assert_eq!(s.sort.seed, seed); +} + #[test] fn random_sort_rejects_bad_params() { let mut s = Session::with_demo(); diff --git a/crates/ui-egui/locales/cs.json b/crates/ui-egui/locales/cs.json index 5efb9ebef86..7c8ada4f4f8 100644 --- a/crates/ui-egui/locales/cs.json +++ b/crates/ui-egui/locales/cs.json @@ -2410,5 +2410,6 @@ "An import is running. Drop photos when it has finished": "Import už běží. Fotky přetáhněte, až skončí", "Finish Lightroom catalog import before adding photos": "Dokončete import katalogu Lightroom, než přidáte fotky", "Recently Added always shows the newest imports first.": "Nedávno přidané vždy zobrazuje nejnovější importy jako první.", - "Recently Deleted shows no date groups.": "Nedávno odstraněné nezobrazuje skupiny podle data." + "Recently Deleted shows no date groups.": "Nedávno odstraněné nezobrazuje skupiny podle data.", + "Previous Shuffle": "Předchozí promíchání" } diff --git a/crates/ui-egui/locales/de.json b/crates/ui-egui/locales/de.json index 0ee4d0fd886..612c821cc86 100644 --- a/crates/ui-egui/locales/de.json +++ b/crates/ui-egui/locales/de.json @@ -3442,5 +3442,6 @@ "An import is running. Drop photos when it has finished": "Ein Import läuft. Lege die Fotos ab, wenn er fertig ist", "Finish Lightroom catalog import before adding photos": "Schließe den Import des Lightroom-Katalogs ab, bevor du Fotos hinzufügst", "Recently Added always shows the newest imports first.": "Zuletzt hinzugefügt zeigt immer die neuesten Importe zuerst.", - "Recently Deleted shows no date groups.": "Zuletzt gelöscht zeigt keine Datumsgruppen." + "Recently Deleted shows no date groups.": "Zuletzt gelöscht zeigt keine Datumsgruppen.", + "Previous Shuffle": "Vorheriges Mischen" } diff --git a/crates/ui-egui/locales/es.json b/crates/ui-egui/locales/es.json index aa39d9efa10..e709e6a688b 100644 --- a/crates/ui-egui/locales/es.json +++ b/crates/ui-egui/locales/es.json @@ -2360,5 +2360,6 @@ "An import is running. Drop photos when it has finished": "Hay una importación en curso. Suelta las fotos cuando termine", "Finish Lightroom catalog import before adding photos": "Termina la importación del catálogo de Lightroom antes de añadir fotos", "Recently Added always shows the newest imports first.": "Añadidas recientemente siempre muestra primero las importaciones más recientes.", - "Recently Deleted shows no date groups.": "Eliminadas recientemente no muestra grupos por fecha." + "Recently Deleted shows no date groups.": "Eliminadas recientemente no muestra grupos por fecha.", + "Previous Shuffle": "Mezcla anterior" } diff --git a/crates/ui-egui/locales/fi.json b/crates/ui-egui/locales/fi.json index c18ed79e4b4..6eefef9d345 100644 --- a/crates/ui-egui/locales/fi.json +++ b/crates/ui-egui/locales/fi.json @@ -2329,5 +2329,6 @@ "Finish Lightroom catalog import before adding photos": "Viimeistele Lightroom-luettelon tuonti ennen kuvien lisäämistä", "Import dropped files without review": "Tuo pudotetut tiedostot ilman tarkistusta", "Recently Added always shows the newest imports first.": "Äskettäin lisätyt näyttää aina uusimmat tuonnit ensin.", - "Recently Deleted shows no date groups.": "Äskettäin poistetut ei näytä päivämääräryhmiä." + "Recently Deleted shows no date groups.": "Äskettäin poistetut ei näytä päivämääräryhmiä.", + "Previous Shuffle": "Edellinen sekoitus" } diff --git a/crates/ui-egui/locales/fr.json b/crates/ui-egui/locales/fr.json index 2ce08ac4485..baf81b7345d 100644 --- a/crates/ui-egui/locales/fr.json +++ b/crates/ui-egui/locales/fr.json @@ -2392,5 +2392,6 @@ "Open a library first, then drop the presets again": "Ouvrez d'abord une bibliothèque, puis déposez à nouveau les préréglages", "This library couldn't be checked:": "Impossible de vérifier cette bibliothèque :", "Recently Added always shows the newest imports first.": "Ajoutées récemment affiche toujours les importations les plus récentes en premier.", - "Recently Deleted shows no date groups.": "Supprimées récemment n'affiche aucun groupe par date." + "Recently Deleted shows no date groups.": "Supprimées récemment n'affiche aucun groupe par date.", + "Previous Shuffle": "Mélange précédent" } diff --git a/crates/ui-egui/locales/id.json b/crates/ui-egui/locales/id.json index ab960d53c8c..d0e693c31f6 100644 --- a/crates/ui-egui/locales/id.json +++ b/crates/ui-egui/locales/id.json @@ -2341,5 +2341,6 @@ "Finish Lightroom catalog import before adding photos": "Selesaikan impor katalog Lightroom sebelum menambahkan foto", "Import dropped files without review": "Impor file yang dijatuhkan tanpa tinjauan", "Recently Added always shows the newest imports first.": "Baru ditambahkan selalu menampilkan impor terbaru lebih dulu.", - "Recently Deleted shows no date groups.": "Baru dihapus tidak menampilkan grup tanggal." + "Recently Deleted shows no date groups.": "Baru dihapus tidak menampilkan grup tanggal.", + "Previous Shuffle": "Acakan sebelumnya" } diff --git a/crates/ui-egui/locales/it.json b/crates/ui-egui/locales/it.json index aa3d5110c9e..0415824986d 100644 --- a/crates/ui-egui/locales/it.json +++ b/crates/ui-egui/locales/it.json @@ -2363,5 +2363,6 @@ "An import is running. Drop photos when it has finished": "Un'importazione è in corso. Trascina le foto quando è finita", "Finish Lightroom catalog import before adding photos": "Termina l'importazione del catalogo Lightroom prima di aggiungere foto", "Recently Added always shows the newest imports first.": "Aggiunte di recente mostra sempre prima le importazioni più recenti.", - "Recently Deleted shows no date groups.": "Eliminate di recente non mostra raggruppamenti per data." + "Recently Deleted shows no date groups.": "Eliminate di recente non mostra raggruppamenti per data.", + "Previous Shuffle": "Rimescolamento precedente" } diff --git a/crates/ui-egui/locales/ja.json b/crates/ui-egui/locales/ja.json index 9ec64bc2d3d..096c34221c3 100644 --- a/crates/ui-egui/locales/ja.json +++ b/crates/ui-egui/locales/ja.json @@ -2358,5 +2358,6 @@ "An import is running. Drop photos when it has finished": "読み込み中です。完了してから写真をドロップしてください", "Finish Lightroom catalog import before adding photos": "写真を追加する前に Lightroom カタログの読み込みを完了してください", "Recently Added always shows the newest imports first.": "「最近追加した写真」では、常に読み込みが新しい順に表示されます。", - "Recently Deleted shows no date groups.": "「最近削除した写真」では日付でまとめて表示されません。" + "Recently Deleted shows no date groups.": "「最近削除した写真」では日付でまとめて表示されません。", + "Previous Shuffle": "前のシャッフル" } diff --git a/crates/ui-egui/locales/ka.json b/crates/ui-egui/locales/ka.json index 9fcd113cbb5..c3d77e3cb53 100644 --- a/crates/ui-egui/locales/ka.json +++ b/crates/ui-egui/locales/ka.json @@ -2736,5 +2736,6 @@ "An import is running. Drop photos when it has finished": "იმპორტი მიმდინარეობს. ფოტოები ჩააგდეთ, როცა დასრულდება", "Finish Lightroom catalog import before adding photos": "ფოტოების დამატებამდე დაასრულეთ Lightroom-ის კატალოგის იმპორტი", "Recently Added always shows the newest imports first.": "„ბოლოს დამატებული“ ყოველთვის ჯერ უახლეს იმპორტებს აჩვენებს.", - "Recently Deleted shows no date groups.": "„ახლახან წაშლილი“ თარიღის მიხედვით დაჯგუფებას არ აჩვენებს." + "Recently Deleted shows no date groups.": "„ახლახან წაშლილი“ თარიღის მიხედვით დაჯგუფებას არ აჩვენებს.", + "Previous Shuffle": "წინა არევა" } diff --git a/crates/ui-egui/locales/pl.json b/crates/ui-egui/locales/pl.json index 8a216cb4690..e4f74039c42 100644 --- a/crates/ui-egui/locales/pl.json +++ b/crates/ui-egui/locales/pl.json @@ -2285,5 +2285,6 @@ "An import is running. Drop photos when it has finished": "Import jest w toku. Upuść zdjęcia, gdy się zakończy", "Finish Lightroom catalog import before adding photos": "Zakończ import katalogu Lightrooma, zanim dodasz zdjęcia", "Recently Added always shows the newest imports first.": "Ostatnio dodane zawsze pokazuje najnowsze importy jako pierwsze.", - "Recently Deleted shows no date groups.": "Ostatnio usunięte nie pokazuje grup według dat." + "Recently Deleted shows no date groups.": "Ostatnio usunięte nie pokazuje grup według dat.", + "Previous Shuffle": "Poprzednie losowanie" } diff --git a/crates/ui-egui/locales/pt-br.json b/crates/ui-egui/locales/pt-br.json index 0a92243a5ca..7fa8ba01f87 100644 --- a/crates/ui-egui/locales/pt-br.json +++ b/crates/ui-egui/locales/pt-br.json @@ -2204,5 +2204,6 @@ "An import is running. Drop photos when it has finished": "Uma importação está em andamento. Solte as fotos quando ela terminar", "Finish Lightroom catalog import before adding photos": "Conclua a importação do catálogo do Lightroom antes de adicionar fotos", "Recently Added always shows the newest imports first.": "Adicionados recentemente sempre mostra as importações mais recentes primeiro.", - "Recently Deleted shows no date groups.": "Excluídos recentemente não mostra grupos de datas." + "Recently Deleted shows no date groups.": "Excluídos recentemente não mostra grupos de datas.", + "Previous Shuffle": "Embaralhamento anterior" } diff --git a/crates/ui-egui/locales/ru.json b/crates/ui-egui/locales/ru.json index 100a6a1cafa..f1629328edb 100644 --- a/crates/ui-egui/locales/ru.json +++ b/crates/ui-egui/locales/ru.json @@ -2351,5 +2351,6 @@ "An import is running. Drop photos when it has finished": "Импорт уже выполняется. Перетащите фото, когда он закончится", "Finish Lightroom catalog import before adding photos": "Завершите импорт каталога Lightroom, прежде чем добавлять фото", "Recently Added always shows the newest imports first.": "В «Недавно добавленные» сначала всегда показаны самые новые импорты.", - "Recently Deleted shows no date groups.": "В «Недавно удалённые» нет групп по датам." + "Recently Deleted shows no date groups.": "В «Недавно удалённые» нет групп по датам.", + "Previous Shuffle": "Предыдущее перемешивание" } diff --git a/crates/ui-egui/locales/sv.json b/crates/ui-egui/locales/sv.json index 0daef9a8a22..0e1a2f12168 100644 --- a/crates/ui-egui/locales/sv.json +++ b/crates/ui-egui/locales/sv.json @@ -2431,5 +2431,6 @@ "Finish Lightroom catalog import before adding photos": "Slutför importen av Lightroom-katalogen innan du lägger till foton", "Import dropped files without review": "Importera släppta filer utan granskning", "Recently Added always shows the newest imports first.": "Nyligen tillagda visar alltid de senaste importerna först.", - "Recently Deleted shows no date groups.": "Nyligen raderade visar inga datumgrupper." + "Recently Deleted shows no date groups.": "Nyligen raderade visar inga datumgrupper.", + "Previous Shuffle": "Föregående blandning" } diff --git a/crates/ui-egui/locales/uk.json b/crates/ui-egui/locales/uk.json index 0e42b02c801..01927e60452 100644 --- a/crates/ui-egui/locales/uk.json +++ b/crates/ui-egui/locales/uk.json @@ -2356,5 +2356,6 @@ "An import is running. Drop photos when it has finished": "Імпорт уже виконується. Перетягніть фото, коли він завершиться", "Finish Lightroom catalog import before adding photos": "Завершіть імпорт каталогу Lightroom, перш ніж додавати фото", "Recently Added always shows the newest imports first.": "У «Нещодавно додані» завжди спершу показано найновіші імпорти.", - "Recently Deleted shows no date groups.": "У «Нещодавно видалені» немає груп за датою." + "Recently Deleted shows no date groups.": "У «Нещодавно видалені» немає груп за датою.", + "Previous Shuffle": "Попереднє перемішування" } diff --git a/crates/ui-egui/locales/vi.json b/crates/ui-egui/locales/vi.json index 9fb1d8ee2dd..75b61080ddf 100644 --- a/crates/ui-egui/locales/vi.json +++ b/crates/ui-egui/locales/vi.json @@ -2237,5 +2237,6 @@ "Finish Lightroom catalog import before adding photos": "Hoàn tất nhập danh mục Lightroom trước khi thêm ảnh", "Import dropped files without review": "Nhập các tệp đã thả mà không xem lại", "Recently Added always shows the newest imports first.": "Mục Mới thêm luôn hiển thị các lần nhập mới nhất trước.", - "Recently Deleted shows no date groups.": "Mục Đã xóa gần đây không hiển thị nhóm ngày." + "Recently Deleted shows no date groups.": "Mục Đã xóa gần đây không hiển thị nhóm ngày.", + "Previous Shuffle": "Lần xáo trộn trước" } diff --git a/crates/ui-egui/locales/zh-hans.json b/crates/ui-egui/locales/zh-hans.json index ae0e7306270..bf66bb8399e 100644 --- a/crates/ui-egui/locales/zh-hans.json +++ b/crates/ui-egui/locales/zh-hans.json @@ -2202,5 +2202,6 @@ "An import is running. Drop photos when it has finished": "正在导入。导入完成后再拖放照片", "Finish Lightroom catalog import before adding photos": "添加照片前,请先完成 Lightroom 目录的导入", "Recently Added always shows the newest imports first.": "“最近添加”始终先显示最新导入的照片。", - "Recently Deleted shows no date groups.": "“最近删除”不显示日期分组。" + "Recently Deleted shows no date groups.": "“最近删除”不显示日期分组。", + "Previous Shuffle": "上一次随机排序" } diff --git a/crates/ui-egui/locales/zh-hant.json b/crates/ui-egui/locales/zh-hant.json index e0a7c745184..3059d0f0a4c 100644 --- a/crates/ui-egui/locales/zh-hant.json +++ b/crates/ui-egui/locales/zh-hant.json @@ -2159,5 +2159,6 @@ "An import is running. Drop photos when it has finished": "正在匯入。匯入完成後再拖放照片", "Finish Lightroom catalog import before adding photos": "新增照片前,請先完成 Lightroom 目錄的匯入", "Recently Added always shows the newest imports first.": "「最近加入」一律先顯示最新匯入的相片。", - "Recently Deleted shows no date groups.": "「最近刪除」不顯示日期群組。" + "Recently Deleted shows no date groups.": "「最近刪除」不顯示日期群組。", + "Previous Shuffle": "上一次隨機排序" } diff --git a/crates/ui-egui/src/menus/menubar.rs b/crates/ui-egui/src/menus/menubar.rs index 492108f090c..f466fd9f9df 100644 --- a/crates/ui-egui/src/menus/menubar.rs +++ b/crates/ui-egui/src/menus/menubar.rs @@ -343,6 +343,7 @@ const HIDDEN: &[&str] = &[ "photo.label", "library.sort", "library.shuffle", + "library.previousShuffle", "album.addPhotos", "album.create", "library.import", @@ -669,7 +670,11 @@ pub(crate) fn expanded(app: &LightcraftApp, name: &str) -> Option> .map(|(label, key, k)| item("library.sort", json!({"key": k}), label, None, m.keys_enabled(), Some(m.key_checked(key)))), ); v.push(MenuNode::Separator); - v.push(item("library.shuffle", json!({}), "Reshuffle", None, m.reshuffle_enabled(), None)); + let keys = &app.ui.settings.keymap; + let shuffle = crate::shortcuts::shortcut_of(keys, "library.shuffle"); + v.push(item("library.shuffle", json!({}), "Reshuffle", shuffle, m.reshuffle_enabled(), None)); + let previous = crate::shortcuts::shortcut_of(keys, "library.previousShuffle"); + v.push(item("library.previousShuffle", Value::Null, "Previous Shuffle", previous, m.previous_enabled(), None)); v.push(MenuNode::Separator); v.push(item("library.sort", json!({"ascending": true}), "Ascending", None, m.direction_enabled(), m.direction_checked(true))); v.push(item("library.sort", json!({"ascending": false}), "Descending", None, m.direction_enabled(), m.direction_checked(false))); diff --git a/crates/ui-egui/src/menus/menubar/tests.rs b/crates/ui-egui/src/menus/menubar/tests.rs index e7be7637973..136794891c6 100644 --- a/crates/ui-egui/src/menus/menubar/tests.rs +++ b/crates/ui-egui/src/menus/menubar/tests.rs @@ -290,6 +290,33 @@ fn reshuffle_follows_a_separator_below_the_sort_keys() { assert!(at > random); } +/// Previous Shuffle sits right under Reshuffle, is on only while a reshuffle has replaced an order under Random (not in +/// Recently Added, where the sort is not used), and both rows show their keys. +#[test] +fn previous_shuffle_follows_reshuffle_and_both_show_their_shortcuts() { + let mut a = app(); + let kids = sort_submenu(&a); + let at = kids.iter().position(|n| matches!(n, MenuNode::Item { id, .. } if id == "library.shuffle")).expect("Reshuffle"); + assert!(matches!(&kids[at + 1], MenuNode::Item { id, label, .. } if id == "library.previousShuffle" && label == "Previous Shuffle")); + let shortcut = |id: &str| match find(&sort_submenu(&a), id) { + Some(MenuNode::Item { shortcut, .. }) => shortcut.clone(), + other => panic!("{id}: {other:?}"), + }; + assert_eq!(shortcut("library.shuffle").as_deref(), Some("Cmd+Alt+Shift+R")); + assert_eq!(shortcut("library.previousShuffle").as_deref(), Some("Cmd+Alt+Shift+P")); + let previous = |a: &LightcraftApp| sort_row(&sort_submenu(a), "Previous Shuffle"); + assert_eq!(previous(&a), (false, None), "a date sort"); + a.session.execute("library.sort", &json!({"key": "random"})).expect("sort at random"); + assert!(!previous(&a).0, "nothing replaced yet"); + run_item(&mut a, "library.shuffle", Value::Null).expect("reshuffle"); + assert!(previous(&a).0, "a reshuffle replaced an order"); + a.session.execute("library.source", &json!({"kind": "recentlyAdded"})).expect("Recently Added"); + assert!(!previous(&a).0, "the sort is not used there"); + a.session.execute("library.source", &json!({"kind": "all"})).expect("All Photos"); + run_item(&mut a, "library.previousShuffle", Value::Null).expect("previous shuffle"); + assert!(!previous(&a).0, "nothing earlier is left"); +} + /// File opens with the import entry points, worded as importing (not as adding a sidebar /// folder): Import Photos… (⇧⌘I), Import from Folder…, Import from Device ▸. #[test] diff --git a/crates/ui-egui/src/menus/sort_menu.rs b/crates/ui-egui/src/menus/sort_menu.rs index e68d637d62a..64a4be9dc32 100644 --- a/crates/ui-egui/src/menus/sort_menu.rs +++ b/crates/ui-egui/src/menus/sort_menu.rs @@ -31,11 +31,12 @@ impl SortNote { pub struct SortMenu { sort: Sort, source: LibrarySource, + has_previous: bool, } impl SortMenu { pub fn of(session: &Session) -> Self { - SortMenu { sort: session.sort, source: session.source } + SortMenu { sort: session.sort, source: session.source, has_previous: session.has_previous_shuffle() } } /// Recently Added orders by import date whatever the sort says. @@ -68,6 +69,11 @@ impl SortMenu { self.keys_enabled() && self.sort.key == SortKey::Random } + /// Previous Shuffle: only where Reshuffle is, and once a reshuffle has replaced an order to go back to. + pub fn previous_enabled(&self) -> bool { + self.reshuffle_enabled() && self.has_previous + } + /// Date headers: only the date keys draw them (not a shuffle, File Name, Rating or File Size), and not /// Recently Deleted. Recently Added orders by import date, so it groups by import date whatever the key. pub fn groups_enabled(&self) -> bool { diff --git a/crates/ui-egui/src/panels/bottombar.rs b/crates/ui-egui/src/panels/bottombar.rs index 82bdcb1b235..6208fc03baa 100644 --- a/crates/ui-egui/src/panels/bottombar.rs +++ b/crates/ui-egui/src/panels/bottombar.rs @@ -270,12 +270,12 @@ fn click_zoom_menu(app: &mut LightcraftApp, ui: &mut egui::Ui) { } /// One row of the Sort popup, registered as `sortMenu:{id}`: a check row where `checked` is `Some`, a plain -/// button where it is `None`; a row that is off can't be clicked. -fn sort_row(ui: &mut egui::Ui, id: &str, label: &str, enabled: bool, checked: Option) -> bool { +/// button (with its key, when it has one) where it is `None`; a row that is off can't be clicked. +fn sort_row(ui: &mut egui::Ui, id: &str, label: &str, enabled: bool, checked: Option, hint: Option) -> bool { let r = ui .add_enabled_ui(enabled, |ui| match checked { Some(on) => ui.selectable_label(on, crate::i18n::tr(label)), - None => ui.button(crate::i18n::tr(label)), + None => ui.add(egui::Button::new(crate::i18n::tr(label)).shortcut_text(hint.unwrap_or_default())), }) .inner; register(ui, format!("sortMenu:{id}"), r.rect); @@ -310,14 +310,20 @@ fn sort_menu(app: &mut LightcraftApp, ui: &mut egui::Ui) { ("File Size", FileSize, "fileSize"), ("Random", Random, "random"), ] { - if sort_row(ui, &format!("key:{k}"), label, m.keys_enabled(), Some(m.key_checked(key))) { + if sort_row(ui, &format!("key:{k}"), label, m.keys_enabled(), Some(m.key_checked(key)), None) { let _ = app.run("library.sort", json!({"key": k})); } } ui.separator(); - if sort_row(ui, "reshuffle", "Reshuffle", m.reshuffle_enabled(), None) { + let mac = ui.ctx().os() == egui::os::OperatingSystem::Mac; + let hint = |id: &str| crate::shortcuts::shortcut_of(&app.ui.settings.keymap, id).map(|sc| crate::menubar::shortcut_text(sc, mac)); + let (shuffle_hint, previous_hint) = (hint("library.shuffle"), hint("library.previousShuffle")); + if sort_row(ui, "reshuffle", "Reshuffle", m.reshuffle_enabled(), None, shuffle_hint) { let _ = app.run("library.shuffle", json!({})); } + if sort_row(ui, "previous", "Previous Shuffle", m.previous_enabled(), None, previous_hint) { + let _ = app.run("library.previousShuffle", json!({})); + } // a view that holds its photos shows what matches now when asked to if app.session.hold_view { let r = ui.button(crate::i18n::tr("Refresh View")); @@ -329,7 +335,7 @@ fn sort_menu(app: &mut LightcraftApp, ui: &mut egui::Ui) { ui.separator(); for (label, id, ascending) in [("Ascending", "ascending", true), ("Descending", "descending", false)] { let checked = m.direction_checked(ascending).unwrap_or(false); - if sort_row(ui, id, label, m.direction_enabled(), Some(checked)) { + if sort_row(ui, id, label, m.direction_enabled(), Some(checked), None) { let _ = app.run("library.sort", json!({"ascending": ascending})); } } @@ -343,7 +349,7 @@ fn sort_menu(app: &mut LightcraftApp, ui: &mut egui::Ui) { ("Year", GroupBy::Year, "year"), ("None", GroupBy::None, "none"), ] { - if sort_row(ui, &format!("group:{k}"), label, m.groups_enabled(), Some(m.group_checked(g))) { + if sort_row(ui, &format!("group:{k}"), label, m.groups_enabled(), Some(m.group_checked(g)), None) { let _ = app.run("library.sort", json!({"group": k})); } } diff --git a/crates/ui-egui/src/shortcuts.rs b/crates/ui-egui/src/shortcuts.rs index 2f0b07d458b..ba55c7a4b36 100644 --- a/crates/ui-egui/src/shortcuts.rs +++ b/crates/ui-egui/src/shortcuts.rs @@ -557,6 +557,10 @@ fn fire_command(app: &mut LightcraftApp, ctx: &egui::Context, f: &str, rotate_fi up_down_key(app, ctx, f); return; } + // the Sort menus' rule for these two rows holds for the keys too (a native menu enforces it for its own keys) + if sort_row_off(app, f) { + return; + } // an export that can't start (e.g. no folder) says why instead of doing nothing if let Err(e) = app.run(f, json!({})) && matches!(f, "app.export" | "app.exportPrevious") @@ -573,6 +577,16 @@ fn fire_command(app: &mut LightcraftApp, ctx: &egui::Context, f: &str, rotate_fi } } +/// Reshuffle and Previous Shuffle where the Sort menus turn them off. +fn sort_row_off(app: &LightcraftApp, f: &str) -> bool { + let menu = crate::menus::sort_menu::SortMenu::of(&app.session); + match f { + "library.shuffle" => !menu.reshuffle_enabled(), + "library.previousShuffle" => !menu.previous_enabled(), + _ => false, + } +} + /// Rating and colour label keys; whether `f` was one. fn fire_rating_key(app: &mut LightcraftApp, ctx: &egui::Context, f: &str) -> bool { if let Some(rest) = f.strip_prefix("rate:") { diff --git a/crates/ui-egui/src/tests/keymap.rs b/crates/ui-egui/src/tests/keymap.rs index 6e784de1a46..8d481cedd19 100644 --- a/crates/ui-egui/src/tests/keymap.rs +++ b/crates/ui-egui/src/tests/keymap.rs @@ -304,6 +304,28 @@ fn opening_numeric_release_keeps_keys_in_the_editor() { } } +/// ⌘⌥⇧R / ⌘⌥⇧P reshuffle and go back, but only where the Sort menus offer those rows: a key press goes straight to the +/// command on Windows and Linux, so it follows the same rule (not under a date sort, not in Recently Added). +#[test] +fn the_shuffle_keys_follow_the_sort_menus_rules() { + let mut h = demo(); + let seed = |h: &Headless| h.app.session.sort.seed; + let chord = |h: &mut Headless, key: &str| press(h, key, &["cmd", "alt", "shift"]); + chord(&mut h, "R"); + assert_ne!(h.app.session.sort.key, lightcraft_catalog::SortKey::Random, "Reshuffle is off under a date sort"); + h.app.run("library.sort", json!({"key": "random", "seed": 9})).unwrap(); + chord(&mut h, "R"); + assert_ne!(seed(&h), 9, "Reshuffle works under Random"); + chord(&mut h, "P"); + assert_eq!(seed(&h), 9, "Previous Shuffle goes back"); + h.app.run("library.shuffle", json!({})).unwrap(); + let now = seed(&h); + h.app.run("library.source", json!({"kind": "recentlyAdded"})).unwrap(); + chord(&mut h, "P"); + chord(&mut h, "R"); + assert_eq!(seed(&h), now, "both are off in Recently Added, where the sort is not used"); +} + /// Press `key` with the named modifiers held (`cmd`, `shift`, `alt`, `ctrl`). fn press(h: &mut Headless, key: &str, mods: &[&str]) { let mut p = json!({ "key": key }); diff --git a/crates/ui-egui/src/tests/sort_menu.rs b/crates/ui-egui/src/tests/sort_menu.rs index 75ba9cbe960..0acc6e3b8a7 100644 --- a/crates/ui-egui/src/tests/sort_menu.rs +++ b/crates/ui-egui/src/tests/sort_menu.rs @@ -77,3 +77,15 @@ fn a_shuffle_turns_the_date_groups_off_and_keeps_the_choice() { click_in_sort_menu(&mut h, "sortMenu:group:day"); assert_eq!(h.app.session.sort.group, lightcraft_catalog::GroupBy::Day, "groups are choosable for a date sort"); } + +#[test] +fn the_popups_previous_shuffle_brings_back_the_order_a_reshuffle_replaced() { + let mut h = demo(); + exec(&mut h, "library.sort", json!({"key": "random", "seed": 7})); + click_in_sort_menu(&mut h, "sortMenu:previous"); + assert_eq!(h.app.session.sort.seed, 7, "off until a reshuffle replaced something"); + click_in_sort_menu(&mut h, "sortMenu:reshuffle"); + assert_ne!(h.app.session.sort.seed, 7); + click_in_sort_menu(&mut h, "sortMenu:previous"); + assert_eq!(h.app.session.sort.seed, 7, "the exact earlier shuffle is back"); +} diff --git a/docs/library-shortcuts.md b/docs/library-shortcuts.md index 98ae0558a9a..e4e6c8f9199 100644 --- a/docs/library-shortcuts.md +++ b/docs/library-shortcuts.md @@ -21,6 +21,8 @@ Select photos in Photo Grid or Square Grid, then use: | ⌘L / Ctrl+L | Enable Filters: switch the filter off and on | | ⌘⌥⇧C / Ctrl+Alt+Shift+C | Copy Metadata: copy the active photo's metadata | | ⌘⌥⇧V / Ctrl+Alt+Shift+V | Paste Metadata: paste the copied metadata on the selected photos | +| ⌘⌥⇧R / Ctrl+Alt+Shift+R | Reshuffle: a new random order (View ▸ Sort ▸ Reshuffle; does nothing unless the menu row is on: only while sorting at random, not in Recently Added) | +| ⌘⌥⇧P / Ctrl+Alt+Shift+P | Previous Shuffle: go back to the random order the last Reshuffle replaced (up to 32 steps back, this session only; on only where the menu row is on) | Enter opens the active photo without changing the selection. Text fields, dialogs and open popups keep the key; a custom Enter binding takes precedence. Enter has no additional action in Detail. diff --git a/docs/parity-checklist.md b/docs/parity-checklist.md index 90db2e98831..9783d2956b9 100644 --- a/docs/parity-checklist.md +++ b/docs/parity-checklist.md @@ -1,6 +1,6 @@ # Lightroom parity checklist -> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-28 · **Change:** minor (MENU-VIEW-SORT, LR-FILT-SORT: the Sort menus (bottom bar and View ▸ Sort) turn off what the view ignores — the keys, the direction and Reshuffle in Recently Added, and outside it the date groups wherever the grid draws no date headers (under Random, File Name, Rating and File Size, and in Recently Deleted) — and say why where a whole view is the reason; Reshuffle sits under its own separator; LR-BEHAV-TITLEBAR: a double-click follows the system setting, and a panel over the bar keeps the window still; KEYC-METADATA, LRC-LIB-KEYWORDS: ⌥0 / ⌥⇧0 go to the next / previous keyword set; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; KEYC-METADATA: ⌘K / Ctrl+K Add Keywords; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings) · **Target:** Adobe Lightroom Classic 15.5 / Lightroom 9.6 +> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-28 · **Change:** minor (LR-FILT-SORT, MENU-VIEW-SORT: Previous Shuffle (⌘⌥⇧P) and a Reshuffle shortcut (⌘⌥⇧R); MENU-VIEW-SORT, LR-FILT-SORT: the Sort menus (bottom bar and View ▸ Sort) turn off what the view ignores — the keys, the direction and Reshuffle in Recently Added, and outside it the date groups wherever the grid draws no date headers (under Random, File Name, Rating and File Size, and in Recently Deleted) — and say why where a whole view is the reason; Reshuffle sits under its own separator; LR-BEHAV-TITLEBAR: a double-click follows the system setting, and a panel over the bar keeps the window still; KEYC-METADATA, LRC-LIB-KEYWORDS: ⌥0 / ⌥⇧0 go to the next / previous keyword set; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; KEYC-METADATA: ⌘K / Ctrl+K Add Keywords; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings) · **Target:** Adobe Lightroom Classic 15.5 / Lightroom 9.6 The measured, row-by-row checklist: one row per Lightroom feature, menu item and shortcut, what we have and what is missing. It answers *does the feature exist?* (feature breadth). Whether it is good @@ -157,7 +157,7 @@ differences and missing bindings are in [ui-parity.md](ui-parity.md#shortcuts). | LR-FILT-LOCATION | Location filter | P2 | ✅ | `cmd:library.filter` (`text`, `ruleSet` field `location`) | free text, or a rule on location / city / state / country (smart albums, `library.filter`) | | LR-FILT-PEOPLE | People filter | P2 | 🟡 | `cmd:library.filter`, `crates/catalog/src/query.rs` | filter by a person's name (case-insensitive, named Face regions only) from the People view, a filter chip, `person:` (`person:"Jane Doe"` for a name of several words) or a plain word in Search Photos (part of the name); no People picker in the filter bar and one person at a time (issue #1449); no unnamed / suggested people | | LR-FILT-CULL | Culling-score filters | P2 | ✅ | `cmd:library.filter` (`ruleSet` fields `sharpness`, `bestOfGroup`) | Focus and Best of Similar Shots in the rule editor / smart albums | -| LR-FILT-SORT | Sort | P0 | ✅ | `cmd:library.sort`, `cmd:library.shuffle`, `crates/ui-egui/src/panels/bottombar.rs`, `crates/ui-egui/src/menus/sort_menu.rs` | Random sort (seeded, stable under edits; choosing Random or Reshuffle picks a new seed); the shuffle is part of the saved view state; both Sort menus (bottom bar, View ▸ Sort) offer only what the view uses: in Recently Added (always newest import first, grouped by import date at the chosen grouping) the keys, the direction and Reshuffle are off, nothing is checked as the order shown, and a dim line says why; elsewhere the date groups are on only for the date keys (off under Random, File Name, Rating and File Size), and off in Recently Deleted, which draws no headers, with a dim line there; no colour-label or custom (manual) order | +| LR-FILT-SORT | Sort | P0 | ✅ | `cmd:library.sort`, `cmd:library.shuffle`, `cmd:library.previousShuffle`, `crates/ui-egui/src/panels/bottombar.rs`, `crates/ui-egui/src/menus/sort_menu.rs` | Random sort (seeded, stable under edits; choosing Random or Reshuffle picks a new seed); Previous Shuffle (⌘⌥⇧P) goes back to the exact order a Reshuffle replaced, up to 32 steps, kept for this session only and forgotten when the sort leaves Random or another library opens; Reshuffle is ⌘⌥⇧R; the shuffle is part of the saved view state; both Sort menus (bottom bar, View ▸ Sort) offer only what the view uses: in Recently Added (always newest import first, grouped by import date at the chosen grouping) the keys, the direction and Reshuffle are off, nothing is checked as the order shown, and a dim line says why; elsewhere the date groups are on only for the date keys (off under Random, File Name, Rating and File Size), and off in Recently Deleted, which draws no headers, with a dim line there; no colour-label or custom (manual) order | | LR-FILT-SAVED | Filter presets [Classic] | P2 | ✅ | `cmd:filter.savePreset`, `cmd:filter.applyPreset`, `cmd:filter.presets`, `cmd:filter.deletePreset`, `crates/ui-egui/src/panels/filterbar.rs` | filter bar → Presets: apply, save current filter, delete (right-click); saved with the library | ## E. Metadata (META) @@ -548,7 +548,7 @@ visible menu bar yet: the menu model is only exposed through the control channel | MENU-VIEW-CLIPPING | Clipping | P0 | ✅ | `cmd:view.clipping` | | | MENU-VIEW-MASKOVERLAY | Mask overlay / cycle colour | P0 | ✅ | `cmd:view.maskOverlay`, `cmd:view.maskOverlayMode`, `cmd:view.maskOverlayColor` | colour cycles through the panel's swatches (no params) or takes `color` / `opacity` | | MENU-VIEW-INCLUDESUBFOLDERS | Include subfolders | P1 | ✅ | `cmd:library.browse` (`subfolders`) | toggle in the folder header; imports of folders are recursive | -| MENU-VIEW-SORT | Sort submenu | P0 | ✅ | `cmd:library.sort`, `cmd:library.shuffle` | Random + Reshuffle (always listed under its own separator, on only under Random and not in Recently Added); the keys and the direction are off in Recently Added, with a dim line saying why; the date groups stay on in Recently Added (it groups by import date), are on elsewhere only for the date keys, and are off in Recently Deleted (dim line there); no colour-label key | +| MENU-VIEW-SORT | Sort submenu | P0 | ✅ | `cmd:library.sort`, `cmd:library.shuffle`, `cmd:library.previousShuffle` | Random + Reshuffle (⌘⌥⇧R) + Previous Shuffle (⌘⌥⇧P) (always listed under its own separator, on only under Random and not in Recently Added; Previous Shuffle only once a Reshuffle replaced an order); the keys and the direction are off in Recently Added, with a dim line saying why; the date groups stay on in Recently Added (it groups by import date), are on elsewhere only for the date keys, and are off in Recently Deleted (dim line there); no colour-label key | | MENU-VIEW-STACKS | Expand/collapse stacks | P1 | ✅ | `cmd:stack.expandAll`, `cmd:stack.collapseAll` | | | MENU-VIEW-PHOTOCOUNT | Show photo counts | P2 | ✅ | `cmd:view.photoCounts` | View ▸ Photo Counts toggles the left panel's counts | | MENU-VIEW-SIDEBARSECTIONS | Sidebar sections | P2 | ✅ | `cmd:view.sidebarSection`, `cmd:view.sidebarReset` | View ▸ Sidebar Sections ▸ a checkable item per left-sidebar section, then Reset Sidebar Sections (see LR-BEHAV-SIDEBAR-HIDE) | @@ -960,3 +960,4 @@ Latin stays upright. Advanced Japanese composition remains open. Regression cove | 2026-10-22 | minor | LR-CROP-AUTO: Auto straighten turns by at most 10° and only on at least 3 agreeing lines, and says when it finds nothing to level by; measured on 68 photos straightened by hand and 300 left as shot, unwanted turns of more than 1° fell from 79 to 19 of the 300. Downgraded ✅ → 🟡: it still leaves most tilted photos alone | | 2026-10-23 | patch | LRC-LIB-FILTERBAR: showing an album (`library.source`) while the filter holds an album drops the filter's album, as showing a library folder already dropped its folder filter; before, the old album stayed in the filter unseen (the filter bar has no album chip) and narrowed the next source such as All Photos; the row's note says so; status unchanged (✅) | | 2026-10-28 | minor | MENU-VIEW-SORT, LR-FILT-SORT: the bottom bar's Sort popup and View ▸ Sort read one model (`menus/sort_menu.rs`) and offer only what the view uses: in Recently Added the keys, the direction and Reshuffle are off (nothing is checked as the order shown) with a dim line "Recently Added always shows the newest imports first."; outside Recently Added the date groups are off, and unchecked, where the grid draws no headers (under Random, File Name, Rating and File Size, and in Recently Deleted, which says so; the stored choice is kept for when you pick a date sort again or leave Recently Deleted); Reshuffle is listed in both menus under its own separator below the keys; status unchanged (✅) | +| 2026-10-28 | minor | LR-FILT-SORT, MENU-VIEW-SORT: `library.previousShuffle` (Previous Shuffle, ⌘⌥⇧P, under Reshuffle in both Sort menus) brings back the exact order a Reshuffle replaced, by its seed; up to 32 steps, session only, forgotten when the sort leaves Random or another library opens; Reshuffle gets ⌘⌥⇧R; status unchanged (✅) | diff --git a/docs/whats-new.md b/docs/whats-new.md index d5d509dddf5..a82f1d627dc 100644 --- a/docs/whats-new.md +++ b/docs/whats-new.md @@ -11,6 +11,13 @@ date sort again or leave Recently Deleted, as the direction already was for Random. Reshuffle is always listed, in both menus, under its own separator below the sort keys, and is on only while you sort at random. +### Previous Shuffle brings back the order a Reshuffle replaced +- Both Sort menus (the bottom bar's popup and View ▸ Sort) have a new Previous Shuffle row under Reshuffle. It goes back to + the exact random order the last Reshuffle replaced, and again for the one before, up to 32 steps in this session. It is + on only while you sort at random and a Reshuffle has replaced something; the steps are forgotten when you leave Random + or open another library, and are never saved with it. Reshuffle is now ⌘⌥⇧R (Ctrl+Alt+Shift+R) and Previous Shuffle ⌘⌥⇧P + (Ctrl+Alt+Shift+P); both rows show their keys. + ## 2026-10-24 ### Relative-date filters and smart albums follow the clock From cc6fe89ed1b670569a2ffed6e387e0a891ea0cba Mon Sep 17 00:00:00 2001 From: Nathaniel Ledford Date: Wed, 28 Oct 2026 21:51:22 -0400 Subject: [PATCH 4/4] LR-FILT-SORT: say next_seed also mixes in the shuffle count --- crates/engine/src/cmd/library/specs.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/engine/src/cmd/library/specs.rs b/crates/engine/src/cmd/library/specs.rs index 94e6393dbdb..0850e181548 100644 --- a/crates/engine/src/cmd/library/specs.rs +++ b/crates/engine/src/cmd/library/specs.rs @@ -21,7 +21,7 @@ fn seed_param(p: &Value, cmd: &str, default: u64) -> Result { } } -/// The seed after `prev` at time `now`: a mix of `prev` and the clock text, so repeated reshuffles +/// The seed after `prev` at time `now`, with `count` shuffles made before: a mix of the three, so repeated reshuffles /// within one clock tick still differ (barring a 2^-53 collision). Kept below 2^53 so JSON /// clients that read numbers as doubles (web, MCP agents) get the same seed back. fn next_seed(prev: u64, now: &str, count: u64) -> u64 {