diff --git a/crates/ui-egui/locales/cs-formats.json b/crates/ui-egui/locales/cs-formats.json index 77c37c84fc2..35d8990da29 100644 --- a/crates/ui-egui/locales/cs-formats.json +++ b/crates/ui-egui/locales/cs-formats.json @@ -155,6 +155,8 @@ "Showing {n} of {}": "Zobrazeno {n} z {}", "Shows the model's terms, then downloads {} from {host}, installs it and starts using it. Nothing else is sent.": "Zobrazí podmínky modelu, poté stáhne {} z {host}, nainstaluje jej a začne používat. Nic dalšího se neodesílá.", "Smart album: {}": "Inteligentní album: {}", + "Sort: {key}": "Řazení: {key}", + "Sort: {key}, {direction}": "Řazení: {key}, {direction}", "Tagged {n} photo{} from the tracklog": "Poloha doplněna ze záznamu trasy u fotografií: {n}{:.0}", "The SAM 3 download failed: {e}": "Stažení SAM 3 selhalo: {e}", "There is a keyword set “{name}” already": "Sada klíčových slov „{name}“ již existuje", diff --git a/crates/ui-egui/locales/cs.json b/crates/ui-egui/locales/cs.json index ea102192177..f84bc27b6ba 100644 --- a/crates/ui-egui/locales/cs.json +++ b/crates/ui-egui/locales/cs.json @@ -55,6 +55,8 @@ "Add to My Photos": "Přidat do mých fotografií", "Can't be moved here": "Sem nelze přesunout", "Import photos with File → Import Photos…, or drop them here": "Importujte fotografie přes Soubor → Importovat fotografie… nebo je přetáhněte sem", + "Shown in a random order. Reshuffle for a new one.": "Zobrazeno v náhodném pořadí. Nové pořadí získáte volbou Znovu promíchat.", + "Shuffled": "Promícháno", "This row covers more than one disk: drop on a folder inside it": "Tento řádek zahrnuje více disků: přetáhněte položky na některou ze složek v něm", "Local photos aren't in the library yet: Add to My Photos first, then move them": "Místní fotografie zatím nejsou v knihovně: nejprve použijte Přidat do mých fotografií a pak je přesuňte", "Add to My Photos First": "Nejprve přidat do mých fotografií", diff --git a/crates/ui-egui/locales/de-formats.json b/crates/ui-egui/locales/de-formats.json index 7e78396a1ca..574606875a1 100644 --- a/crates/ui-egui/locales/de-formats.json +++ b/crates/ui-egui/locales/de-formats.json @@ -66,6 +66,8 @@ "Import failed: {e}": "Import fehlgeschlagen: {e}", "Import photos with File → Import Photos… ({}), or drop them here": "Importiere Fotos über Datei → Fotos importieren… ({}) oder lege sie hier ab", "Import warnings ({n}):\n{warnings}": "Importwarnungen ({n}):\n{warnings}", + "Sort: {key}": "Sortierung: {key}", + "Sort: {key}, {direction}": "Sortierung: {key}, {direction}", "The XMP sidecars of {n} photos couldn't be written (is their folder offline?). LightCraft keeps trying.": "Die XMP-Begleitdateien von {n} Fotos konnten nicht geschrieben werden (ist ihr Ordner offline?). LightCraft versucht es weiter.", "XMP profile \"{profile}\" was not applied for {path}; colors may differ from Lightroom.": "XMP-Profil „{profile}“ wurde für {path} nicht angewendet; Farben können von Lightroom abweichen.", "Lightroom geometry was not preserved for {path}; {mode} will be recalculated.": "Lightroom-Geometrie wurde für {path} nicht beibehalten; {mode} wird neu berechnet.", diff --git a/crates/ui-egui/locales/de.json b/crates/ui-egui/locales/de.json index bc67606eb61..95ca1556bb9 100644 --- a/crates/ui-egui/locales/de.json +++ b/crates/ui-egui/locales/de.json @@ -58,6 +58,8 @@ "Add to My Photos": "Zu „Meine Fotos“ hinzufügen", "Can't be moved here": "Hierher nicht verschiebbar", "Import photos with File → Import Photos…, or drop them here": "Importiere Fotos über Datei → Fotos importieren… oder lege sie hier ab", + "Shown in a random order. Reshuffle for a new one.": "Wird in zufälliger Reihenfolge angezeigt. „Neu mischen“ ergibt eine neue.", + "Shuffled": "Gemischt", "This row covers more than one disk: drop on a folder inside it": "Diese Zeile umfasst mehr als ein Laufwerk: auf einem Ordner darin ablegen", "Local photos aren't in the library yet: Add to My Photos first, then move them": "Lokale Fotos sind noch nicht in der Bibliothek: erst zu „Meine Fotos“ hinzufügen, dann verschieben", "Add to Selected Photos": "Zu ausgewählten Fotos hinzufügen", diff --git a/crates/ui-egui/locales/es-formats.json b/crates/ui-egui/locales/es-formats.json index 77d40f0ec0d..66f272728b7 100644 --- a/crates/ui-egui/locales/es-formats.json +++ b/crates/ui-egui/locales/es-formats.json @@ -66,6 +66,8 @@ "Import failed: {e}": "Error de importación: {e}", "Import photos with File → Import Photos… ({}), or drop them here": "Importar fotos con Archivo → Importar fotos… ({}) o soltarlas aquí", "Import warnings ({n}):\n{warnings}": "Avisos de importación ({n}):\n{warnings}", + "Sort: {key}": "Orden: {key}", + "Sort: {key}, {direction}": "Orden: {key}, {direction}", "The XMP sidecars of {n} photos couldn't be written (is their folder offline?). LightCraft keeps trying.": "No se pudieron escribir los archivos XMP de {n} fotos (¿su carpeta está desconectada?). LightCraft lo sigue intentando.", "XMP profile \"{profile}\" was not applied for {path}; colors may differ from Lightroom.": "El perfil XMP \"{profile}\" no se aplicó a {path}; los colores pueden diferir de Lightroom.", "Lightroom geometry was not preserved for {path}; {mode} will be recalculated.": "La geometría de Lightroom no se conservó para {path}; {mode} se recalculará.", diff --git a/crates/ui-egui/locales/es.json b/crates/ui-egui/locales/es.json index c34057bdfe5..c69ff33a8d7 100644 --- a/crates/ui-egui/locales/es.json +++ b/crates/ui-egui/locales/es.json @@ -43,6 +43,8 @@ "Add to My Photos": "Añadir a Mis fotos", "Can't be moved here": "No se pueden mover aquí", "Import photos with File → Import Photos…, or drop them here": "Importar fotos con Archivo → Importar fotos… o soltarlas aquí", + "Shown in a random order. Reshuffle for a new one.": "Se muestran en orden aleatorio. Volver a mezclar da un orden nuevo.", + "Shuffled": "Mezcladas", "This row covers more than one disk: drop on a folder inside it": "Esta fila abarca más de un disco: suéltalas en una carpeta dentro de ella", "Local photos aren't in the library yet: Add to My Photos first, then move them": "Las fotos locales aún no están en la biblioteca: primero Añadir a Mis fotos y luego muévelas", "Add to Selected Photos": "Añadir a las fotos seleccionadas", diff --git a/crates/ui-egui/locales/fi-formats.json b/crates/ui-egui/locales/fi-formats.json index 31f6c32b5d4..713ad110bb7 100644 --- a/crates/ui-egui/locales/fi-formats.json +++ b/crates/ui-egui/locales/fi-formats.json @@ -186,6 +186,8 @@ "Skipped {problem}": "Ohitettu {problem}", "Slideshow exported: {what}": "Diaesitys viety: {what}", "Smart album: {}": "Älyalbumi: {}", + "Sort: {key}": "Lajittelu: {key}", + "Sort: {key}, {direction}": "Lajittelu: {key}, {direction}", "Tagged {n} photo{} from the tracklog": "Reittilokista merkittyjä kuvia: {n}{:.0}", "Template preview: {name}": "Mallipohjan esikatselu: {name}", "The SAM 3 download failed: {e}": "SAM 3:n lataus epäonnistui: {e}", diff --git a/crates/ui-egui/locales/fi.json b/crates/ui-egui/locales/fi.json index 59cc611cd61..1bef292f3fa 100644 --- a/crates/ui-egui/locales/fi.json +++ b/crates/ui-egui/locales/fi.json @@ -1869,7 +1869,9 @@ "Show this wheel's effect": "Näytä tämän pyörän vaikutus", "Show/Hide Mask": "Näytä/piilota maski", "Show/hide My Photos panel": "Näytä/piilota Omat kuvat -paneeli", + "Shown in a random order. Reshuffle for a new one.": "Näytetään satunnaisessa järjestyksessä. Uuden järjestyksen saat valitsemalla Sekoita uudelleen.", "Shows": "Näyttää", + "Shuffled": "Sekoitettu", "Shutter Speed": "Suljinaika", "Side panels": "Sivupaneelit", "Sidebar Sections": "Sivupalkin osiot", diff --git a/crates/ui-egui/locales/fr-formats.json b/crates/ui-egui/locales/fr-formats.json index ba6bcc7b0f9..229713be269 100644 --- a/crates/ui-egui/locales/fr-formats.json +++ b/crates/ui-egui/locales/fr-formats.json @@ -70,6 +70,8 @@ "Imported {n} preset{}": "{n} préréglage{} importé(s)", "Imported {n} preset{}, {f} file{} not readable": "{n} préréglage{} importé(s), {f} fichier{} illisible(s)", "Imported {profiles} profile{} (Profile browser ▸ their groups)": "{profiles} profil{} importé(s) (Navigateur de profils → leurs groupes)", + "Sort: {key}": "Tri : {key}", + "Sort: {key}, {direction}": "Tri : {key}, {direction}", "The XMP sidecars of {n} photos couldn't be written (is their folder offline?). LightCraft keeps trying.": "Les fichiers annexes XMP de {n} photos n'ont pas pu être écrits (leur dossier est-il hors ligne ?). LightCraft continue d'essayer.", "XMP profile \"{profile}\" was not applied for {path}; colors may differ from Lightroom.": "Le profil XMP « {profile} » n’a pas été appliqué à {path} ; les couleurs peuvent différer de Lightroom.", "Lightroom geometry was not preserved for {path}; {mode} will be recalculated.": "La géométrie Lightroom de {path} n’a pas été conservée ; {mode} sera recalculé.", diff --git a/crates/ui-egui/locales/fr.json b/crates/ui-egui/locales/fr.json index 31e6814b6d5..3c44f4e19b4 100644 --- a/crates/ui-egui/locales/fr.json +++ b/crates/ui-egui/locales/fr.json @@ -43,6 +43,8 @@ "Add to My Photos": "Ajouter à Mes photos", "Can't be moved here": "Impossible de les déplacer ici", "Import photos with File → Import Photos…, or drop them here": "Importez des photos avec Fichier → Importer des photos… ou déposez-les ici", + "Shown in a random order. Reshuffle for a new one.": "Affichées dans un ordre aléatoire. Mélanger à nouveau en donne un autre.", + "Shuffled": "Mélangées", "This row covers more than one disk: drop on a folder inside it": "Cette ligne couvre plusieurs disques : déposez-les sur un dossier qu’elle contient", "Local photos aren't in the library yet: Add to My Photos first, then move them": "Les photos locales ne sont pas encore dans la bibliothèque : Ajouter à Mes photos d’abord, puis déplacez-les", "Add to Selected Photos": "Ajouter aux photos sélectionnées", diff --git a/crates/ui-egui/locales/id-formats.json b/crates/ui-egui/locales/id-formats.json index 7bd027cc352..0d4fbe39550 100644 --- a/crates/ui-egui/locales/id-formats.json +++ b/crates/ui-egui/locales/id-formats.json @@ -74,6 +74,8 @@ "Show {hidden} hidden location{}": "Tampilkan {hidden} lokasi tersembunyi{:.0}", "Showing {n} of {}": "Menampilkan {n} dari {}", "Smart album: {}": "Album pintar: {}", + "Sort: {key}": "Urutan: {key}", + "Sort: {key}, {direction}": "Urutan: {key}, {direction}", "The XMP sidecars of {n} photos couldn't be written (is their folder offline?). LightCraft keeps trying.": "File sidecar XMP untuk {n} foto tidak dapat ditulis (apakah foldernya sedang offline?). LightCraft akan terus mencoba.", "Undo {}": "Urungkan {}", "Version {} — a clean-room, pure-Rust photo library and raw developer.": "Versi {} — pustaka foto dan pengolah raw yang dibuat secara clean-room dengan Rust murni.", diff --git a/crates/ui-egui/locales/id.json b/crates/ui-egui/locales/id.json index 52705328cc7..b0c1b6d94c0 100644 --- a/crates/ui-egui/locales/id.json +++ b/crates/ui-egui/locales/id.json @@ -1864,7 +1864,9 @@ "Show this wheel's effect": "Tampilkan efek roda ini", "Show/Hide Mask": "Tampilkan/Sembunyikan masker", "Show/hide My Photos panel": "Tampilkan/sembunyikan panel Foto saya", + "Shown in a random order. Reshuffle for a new one.": "Ditampilkan dalam urutan acak. Acak ulang untuk urutan baru.", "Shows": "Isi tampilan", + "Shuffled": "Diacak", "Shutter Speed": "Kecepatan rana", "Shutter speed": "Kecepatan rana", "Side panels": "Panel samping", diff --git a/crates/ui-egui/locales/it-formats.json b/crates/ui-egui/locales/it-formats.json index 922bac810df..71e4bdc55ec 100644 --- a/crates/ui-egui/locales/it-formats.json +++ b/crates/ui-egui/locales/it-formats.json @@ -64,6 +64,8 @@ "Import failed: {e}": "Importazione non riuscita: {e}", "Import photos with File → Import Photos… ({}), or drop them here": "Importa le foto con File → Importa foto… ({}), oppure trascinale qui", "Import warnings ({n}):\n{warnings}": "Avvisi di importazione ({n}):\n{warnings}", + "Sort: {key}": "Ordine: {key}", + "Sort: {key}, {direction}": "Ordine: {key}, {direction}", "XMP profile \"{profile}\" was not applied for {path}; colors may differ from Lightroom.": "Il profilo XMP \"{profile}\" non è stato applicato a {path}; i colori possono differire da Lightroom.", "Lightroom geometry was not preserved for {path}; {mode} will be recalculated.": "La geometria di Lightroom non è stata conservata per {path}; {mode} verrà ricalcolato.", "Lightroom geometry for {path} was not preserved; saved transform is ignored because Upright is Off.": "La geometria di Lightroom per {path} non è stata conservata; la trasformazione salvata viene ignorata perché il raddrizzamento è disattivato.", diff --git a/crates/ui-egui/locales/it.json b/crates/ui-egui/locales/it.json index 5b0ccc0cee0..fe7423874a4 100644 --- a/crates/ui-egui/locales/it.json +++ b/crates/ui-egui/locales/it.json @@ -43,6 +43,8 @@ "Add to My Photos": "Aggiungi a Le mie foto", "Can't be moved here": "Non si possono spostare qui", "Import photos with File → Import Photos…, or drop them here": "Importa le foto con File → Importa foto…, oppure trascinale qui", + "Shown in a random order. Reshuffle for a new one.": "Mostrate in ordine casuale. Rimescola per un nuovo ordine.", + "Shuffled": "Rimescolate", "This row covers more than one disk: drop on a folder inside it": "Questa riga comprende più di un disco: rilascia su una cartella al suo interno", "Local photos aren't in the library yet: Add to My Photos first, then move them": "Le foto locali non sono ancora nella libreria: prima Aggiungi a Le mie foto, poi spostale", "Add to Selected Photos": "Aggiungi alle foto selezionate", diff --git a/crates/ui-egui/locales/ja-formats.json b/crates/ui-egui/locales/ja-formats.json index 9f7dd3fe7cc..e716e4ddd80 100644 --- a/crates/ui-egui/locales/ja-formats.json +++ b/crates/ui-egui/locales/ja-formats.json @@ -74,6 +74,8 @@ "Show {hidden} hidden location{}": "非表示の{hidden}か所を表示{:.0}", "Showing {n} of {}": "{}枚中{n}枚を表示", "Smart album: {}": "スマートアルバム:{}", + "Sort: {key}": "並べ替え:{key}", + "Sort: {key}, {direction}": "並べ替え:{key}、{direction}", "The XMP sidecars of {n} photos couldn't be written (is their folder offline?). LightCraft keeps trying.": "{n} 枚の写真の XMP サイドカーを書き込めませんでした(フォルダーがオフラインではありませんか?)。LightCraft は再試行を続けます。", "Undo {}": "取り消す:{}", "Version {} — a clean-room, pure-Rust photo library and raw developer.": "バージョン{} — Rust製の写真管理・RAW現像アプリ", diff --git a/crates/ui-egui/locales/ja.json b/crates/ui-egui/locales/ja.json index 97c15dd0191..0611f148d7e 100644 --- a/crates/ui-egui/locales/ja.json +++ b/crates/ui-egui/locales/ja.json @@ -44,6 +44,8 @@ "Add to My Photos": "マイフォトに追加", "Can't be moved here": "ここには移動できません", "Import photos with File → Import Photos…, or drop them here": "「ファイル → 写真を読み込む…」から読み込むか、ここに写真をドロップしてください", + "Shown in a random order. Reshuffle for a new one.": "ランダムな順序で表示中。シャッフルし直すと別の順序になります。", + "Shuffled": "シャッフル中", "This row covers more than one disk: drop on a folder inside it": "この行は複数のディスクにまたがっています。中のフォルダにドロップしてください", "Local photos aren't in the library yet: Add to My Photos first, then move them": "ローカルの写真はまだライブラリにありません。先に「マイフォトに追加」してから移動してください", "Add to Selected Photos": "選択した写真に追加", diff --git a/crates/ui-egui/locales/ka-formats.json b/crates/ui-egui/locales/ka-formats.json index b13dc07d30d..44eae6d7de8 100644 --- a/crates/ui-egui/locales/ka-formats.json +++ b/crates/ui-egui/locales/ka-formats.json @@ -156,6 +156,8 @@ "Showing {n} of {}": "ნაჩვენებია {n} / {}", "Shows the model's terms, then downloads {} from {host}, installs it and starts using it. Nothing else is sent.": "აჩვენებს მოდელის პირობებს, შემდეგ ჩამოტვირთავს {}-ს {host}-დან, დააყენებს და დაიწყებს მის გამოყენებას. სხვა არაფერი იგზავნება.", "Smart album: {}": "სმარტ-ალბომი: {}", + "Sort: {key}": "სორტირება: {key}", + "Sort: {key}, {direction}": "სორტირება: {key}, {direction}", "Tagged {n} photo{} from the tracklog": "მარშრუტის ჟურნალით მოინიშნა ფოტო: {n}{:.0}", "The SAM 3 download failed: {e}": "SAM 3-ის ჩამოტვირთვა ვერ მოხერხდა: {e}", "There is a keyword set “{name}” already": "საკვანძო სიტყვების ნაკრები „{name}“ უკვე არსებობს", diff --git a/crates/ui-egui/locales/ka.json b/crates/ui-egui/locales/ka.json index 30769b60fa1..cda4a042d2b 100644 --- a/crates/ui-egui/locales/ka.json +++ b/crates/ui-egui/locales/ka.json @@ -1962,6 +1962,8 @@ "Show this wheel's effect": "ამ ბორბლის ეფექტის ჩვენება", "Show/Hide Mask": "ნიღბის ჩვენება/დამალვა", "Show/hide My Photos panel": "„ჩემი ფოტოების“ პანელის ჩვენება/დამალვა", + "Shown in a random order. Reshuffle for a new one.": "ნაჩვენებია შემთხვევითი რიგით. ხელახლა არევა ახალ რიგს აჩვენებს.", + "Shuffled": "არეულია", "Shutter Speed": "ჩამკეტის სიჩქარე", "Shutter speed": "ჩამკეტის სიჩქარე", "Side panels": "გვერდითი პანელები", diff --git a/crates/ui-egui/locales/pl-formats.json b/crates/ui-egui/locales/pl-formats.json index f03219ae1eb..ae93e8399f5 100644 --- a/crates/ui-egui/locales/pl-formats.json +++ b/crates/ui-egui/locales/pl-formats.json @@ -118,6 +118,8 @@ "Show {hidden} hidden location{}": "Pokaż ukryte lokalizacje: {hidden}{:.0}", "Showing {n} of {}": "Wyświetlono {n} z {}", "Smart album: {}": "Album inteligentny: {}", + "Sort: {key}": "Sortowanie: {key}", + "Sort: {key}, {direction}": "Sortowanie: {key}, {direction}", "Tagged {n} photo{} from the tracklog": "Geotagi ze śladu GPS dodane do zdjęć: {n}{:.0}", "The SAM 3 download failed: {e}": "Nie udało się pobrać SAM 3: {e}", "Undo {}": "Cofnij {}", diff --git a/crates/ui-egui/locales/pl.json b/crates/ui-egui/locales/pl.json index dbc29a19417..15980b47eb9 100644 --- a/crates/ui-egui/locales/pl.json +++ b/crates/ui-egui/locales/pl.json @@ -1357,6 +1357,8 @@ "Show the template tags; click one to insert it": "Pokaż znaczniki szablonu; kliknij znacznik, aby go wstawić", "Show/Hide Mask": "Pokaż/ukryj maskę", "Show/hide My Photos panel": "Pokaż/ukryj panel Moje zdjęcia", + "Shown in a random order. Reshuffle for a new one.": "Wyświetlane losowo. Wylosuj ponownie, aby uzyskać nową kolejność.", + "Shuffled": "Wymieszane", "Shutter speed": "Czas naświetlania", "Side panels": "Panele boczne", "Sidecar names": "Nazwy plików pomocniczych", diff --git a/crates/ui-egui/locales/pt-br-formats.json b/crates/ui-egui/locales/pt-br-formats.json index 4227fe328a9..d2db625b20c 100644 --- a/crates/ui-egui/locales/pt-br-formats.json +++ b/crates/ui-egui/locales/pt-br-formats.json @@ -96,6 +96,8 @@ "Show {hidden} hidden location{}": "Mostrar {hidden} local(is) oculto(s){:.0}", "Showing {n} of {}": "Mostrando {n} de {}", "Smart album: {}": "Álbum inteligente: {}", + "Sort: {key}": "Ordem: {key}", + "Sort: {key}, {direction}": "Ordem: {key}, {direction}", "The XMP sidecars of {n} photos couldn't be written (is their folder offline?). LightCraft keeps trying.": "Não foi possível gravar os arquivos XMP de {n} fotos (a pasta está offline?). O LightCraft continua tentando.", "Undo {}": "Desfazer {}", "Updated “{name}”": "“{name}” atualizado", diff --git a/crates/ui-egui/locales/pt-br.json b/crates/ui-egui/locales/pt-br.json index 3aedd829064..4c35422a81f 100644 --- a/crates/ui-egui/locales/pt-br.json +++ b/crates/ui-egui/locales/pt-br.json @@ -45,6 +45,8 @@ "Add to My Photos": "Adicionar às Minhas fotos", "Can't be moved here": "Não podem ser movidas para cá", "Import photos with File → Import Photos…, or drop them here": "Importe fotos com Arquivo → Importar fotos… ou solte-as aqui", + "Shown in a random order. Reshuffle for a new one.": "Exibidas em ordem aleatória. Embaralhar de novo dá uma nova ordem.", + "Shuffled": "Embaralhadas", "This row covers more than one disk: drop on a folder inside it": "Esta linha abrange mais de um disco: solte em uma pasta dentro dela", "Local photos aren't in the library yet: Add to My Photos first, then move them": "As fotos locais ainda não estão na biblioteca: primeiro Adicionar às Minhas fotos, depois mova-as", "Add to Selected Photos": "Adicionar às fotos selecionadas", diff --git a/crates/ui-egui/locales/ru-formats.json b/crates/ui-egui/locales/ru-formats.json index 24134de9440..e7b39b7e3b7 100644 --- a/crates/ui-egui/locales/ru-formats.json +++ b/crates/ui-egui/locales/ru-formats.json @@ -69,6 +69,8 @@ "Import failed: {e}": "Ошибка импорта: {e}", "Import photos with File → Import Photos… ({}), or drop them here": "Импортируйте фото через Файл → Импорт фото… ({}) или перетащите их сюда", "Import warnings ({n}):\n{warnings}": "Предупреждения импорта ({n}):\n{warnings}", + "Sort: {key}": "Сортировка: {key}", + "Sort: {key}, {direction}": "Сортировка: {key}, {direction}", "The XMP sidecars of {n} photos couldn't be written (is their folder offline?). LightCraft keeps trying.": "Не удалось записать XMP-файлы {n} фото (папка недоступна?). LightCraft продолжает попытки.", "XMP profile \"{profile}\" was not applied for {path}; colors may differ from Lightroom.": "Профиль XMP \"{profile}\" не применён к {path}; цвета могут отличаться от Lightroom.", "Lightroom geometry was not preserved for {path}; {mode} will be recalculated.": "Геометрия Lightroom для {path} не сохранена; режим {mode} будет пересчитан.", diff --git a/crates/ui-egui/locales/ru.json b/crates/ui-egui/locales/ru.json index b3df02470e3..8282fe90b3d 100644 --- a/crates/ui-egui/locales/ru.json +++ b/crates/ui-egui/locales/ru.json @@ -219,6 +219,8 @@ "Their photos in the grid": "Их фото в сетке", "This page setup is not valid": "Эти параметры страницы недопустимы", "Import photos with File → Import Photos…, or drop them here": "Импортируйте фото через Файл → Импорт фото… или перетащите их сюда", + "Shown in a random order. Reshuffle for a new one.": "Показано в случайном порядке. «Перемешать» даст новый порядок.", + "Shuffled": "Перемешано", "This row covers more than one disk: drop on a folder inside it": "Эта строка охватывает несколько дисков: перетащите на папку внутри неё", "Local photos aren't in the library yet: Add to My Photos first, then move them": "Локальных фото ещё нет в библиотеке: сначала «Добавить в «Мои фото»», затем перемещайте", "Add to Selected Photos": "Добавить к выбранным фото", diff --git a/crates/ui-egui/locales/sv-formats.json b/crates/ui-egui/locales/sv-formats.json index 124fcb3a182..0a105f2d548 100644 --- a/crates/ui-egui/locales/sv-formats.json +++ b/crates/ui-egui/locales/sv-formats.json @@ -132,6 +132,8 @@ "Named ({named_n})": "Namngivna ({named_n})", "New Folder in “{name}”": "Ny mapp i ”{name}”", "Created folder “{name}” in “{parent}”": "Mappen ”{name}” skapad i ”{parent}”", + "Sort: {key}": "Sortering: {key}", + "Sort: {key}, {direction}": "Sortering: {key}, {direction}", "new, inside {parent}": "ny, inuti {parent}", "none (CPU rendering): {why}": "ingen (CPU-rendering): {why}", "not added to Apple Photos: {e}": "inte tillagt i Apple Photos: {e}", diff --git a/crates/ui-egui/locales/sv.json b/crates/ui-egui/locales/sv.json index 94b9e303338..8da97df3225 100644 --- a/crates/ui-egui/locales/sv.json +++ b/crates/ui-egui/locales/sv.json @@ -26,6 +26,8 @@ "630 drivers): on Windows the window and GPU rendering use DirectX 12 only and never load the Vulkan driver unless": "630-drivrutiner): i Windows använder fönstret och GPU-renderingen endast DirectX 12 och läser aldrig in Vulkan-drivrutinen om inte", "= exactly": "= exakt", "Import photos with File → Import Photos…, or drop them here": "Importera foton med Arkiv → Importera foton… eller släpp dem här", + "Shown in a random order. Reshuffle for a new one.": "Visas i slumpmässig ordning. Blanda om ger en ny.", + "Shuffled": "Blandad ordning", "`img_1-1.JPG`; on case-insensitive volumes the case change still goes through.": "`img_1-1.JPG`; på skiftlägesokänsliga volymer går ändringen av skiftläge ändå igenom.", "`Photos/2026/20260114/20260114_001.jpg`) together with their XMP sidecars; each original leaves the card only after its": "`Photos/2026/20260114/20260114_001.jpg`) tillsammans med sina XMP-sidofiler; varje original lämnar kortet först efter att dess", "A 16:9 frame with black bars above and below, the title in the corner, fades through black and a closing card.": "En 16:9-bild med svarta fält ovanför och nedanför, titeln i hörnet, toningar via svart och ett avslutande kort.", diff --git a/crates/ui-egui/locales/uk-formats.json b/crates/ui-egui/locales/uk-formats.json index d30091f2d2b..019d37b45dc 100644 --- a/crates/ui-egui/locales/uk-formats.json +++ b/crates/ui-egui/locales/uk-formats.json @@ -70,6 +70,8 @@ "Imported {n} preset{}": "Імпортовано наборів налаштувань: {n}{:.0}", "Imported {n} preset{}, {f} file{} not readable": "Імпортовано наборів налаштувань: {n}{:.0}, файлів не читається: {f}{:.0}", "Imported {profiles} profile{} (Profile browser ▸ their groups)": "Імпортовано профілів: {profiles}{:.0} (Оглядач профілів → їхні групи)", + "Sort: {key}": "Сортування: {key}", + "Sort: {key}, {direction}": "Сортування: {key}, {direction}", "The XMP sidecars of {n} photos couldn't be written (is their folder offline?). LightCraft keeps trying.": "Не вдалося записати XMP-файли {n} фото (папка недоступна?). LightCraft продовжує спроби.", "XMP profile \"{profile}\" was not applied for {path}; colors may differ from Lightroom.": "Профіль XMP «{profile}» не застосовано до {path}; кольори можуть відрізнятися від Lightroom.", "Lightroom geometry was not preserved for {path}; {mode} will be recalculated.": "Геометрію Lightroom для {path} не збережено; режим {mode} буде перераховано.", diff --git a/crates/ui-egui/locales/uk.json b/crates/ui-egui/locales/uk.json index 09b78fab1e3..0f9bd27b655 100644 --- a/crates/ui-egui/locales/uk.json +++ b/crates/ui-egui/locales/uk.json @@ -282,6 +282,8 @@ "Show All": "Показати всі", "Show Mask": "Показати маску", "Show Thumbnails": "Показати мініатюри", + "Shown in a random order. Reshuffle for a new one.": "Показано у випадковому порядку. «Перемішати» дасть новий порядок.", + "Shuffled": "Перемішано", "Size": "Розмір", "Sky": "Небо", "Smoothness": "Плавність", diff --git a/crates/ui-egui/locales/vi-formats.json b/crates/ui-egui/locales/vi-formats.json index d6c686c3b54..27bb66c9f85 100644 --- a/crates/ui-egui/locales/vi-formats.json +++ b/crates/ui-egui/locales/vi-formats.json @@ -186,6 +186,8 @@ "Skipped {problem}": "Skipped {problem}", "Slideshow exported: {what}": "Slideshow exported: {what}", "Smart album: {}": "Album thông minh: {}", + "Sort: {key}": "Sắp xếp: {key}", + "Sort: {key}, {direction}": "Sắp xếp: {key}, {direction}", "Tagged {n} photo{} from the tracklog": "Đã gắn thẻ {n} ảnh{:.0} từ nhật ký tuyến", "Template preview: {name}": "Template preview: {name}", "The SAM 3 download failed: {e}": "Tải SAM 3 thất bại: {e}", diff --git a/crates/ui-egui/locales/vi.json b/crates/ui-egui/locales/vi.json index af27e9aa0ab..c620c677368 100644 --- a/crates/ui-egui/locales/vi.json +++ b/crates/ui-egui/locales/vi.json @@ -1713,6 +1713,8 @@ "Show the template tags; click one to insert it": "Hiện thẻ mẫu; nhấp để chèn", "Show/Hide Mask": "Hiện/Ẩn mặt nạ", "Show/hide My Photos panel": "Hiện/ẩn bảng Ảnh của tôi", + "Shown in a random order. Reshuffle for a new one.": "Hiển thị theo thứ tự ngẫu nhiên. Xáo trộn lại để có thứ tự mới.", + "Shuffled": "Đã xáo trộn", "Shutter Speed": "Tốc độ màn trập", "Shutter speed": "Tốc độ màn trập", "Side panels": "Bảng bên", diff --git a/crates/ui-egui/locales/zh-hans-formats.json b/crates/ui-egui/locales/zh-hans-formats.json index 1d5f27c5764..883baa5a4f0 100644 --- a/crates/ui-egui/locales/zh-hans-formats.json +++ b/crates/ui-egui/locales/zh-hans-formats.json @@ -74,6 +74,8 @@ "Show {hidden} hidden location{}": "显示 {hidden} 个隐藏位置{0:.0}", "Showing {n} of {}": "显示 {0} 张中的 {n} 张", "Smart album: {}": "智能相册:{0}", + "Sort: {key}": "排序:{key}", + "Sort: {key}, {direction}": "排序:{key},{direction}", "The XMP sidecars of {n} photos couldn't be written (is their folder offline?). LightCraft keeps trying.": "无法写入 {n} 张照片的 XMP 附属文件(其文件夹是否离线?)。LightCraft 会继续重试。", "Undo {}": "撤销 {0}", "Version {} — a clean-room, pure-Rust photo library and raw developer.": "版本 {0} — 净室实现的纯 Rust 照片图库与 RAW 编辑工具。", diff --git a/crates/ui-egui/locales/zh-hans.json b/crates/ui-egui/locales/zh-hans.json index ca13d782a5e..bfa7bc68e3e 100644 --- a/crates/ui-egui/locales/zh-hans.json +++ b/crates/ui-egui/locales/zh-hans.json @@ -45,6 +45,8 @@ "Add to My Photos": "添加到我的照片", "Can't be moved here": "无法移到这里", "Import photos with File → Import Photos…, or drop them here": "使用“文件 → 导入照片…”导入照片,或将照片拖放到此处", + "Shown in a random order. Reshuffle for a new one.": "按随机顺序显示。重新随机排序可得到新的顺序。", + "Shuffled": "已随机排序", "This row covers more than one disk: drop on a folder inside it": "此行涵盖多个磁盘:请拖放到其中的文件夹", "Local photos aren't in the library yet: Add to My Photos first, then move them": "本地照片尚未在图库中:请先“添加到我的照片”,再移动", "Add to Selected Photos": "添加到所选照片", diff --git a/crates/ui-egui/locales/zh-hant-formats.json b/crates/ui-egui/locales/zh-hant-formats.json index 51fb1109ae4..6560f43b3c2 100644 --- a/crates/ui-egui/locales/zh-hant-formats.json +++ b/crates/ui-egui/locales/zh-hant-formats.json @@ -92,6 +92,8 @@ "Show {hidden} hidden location{}": "顯示 {hidden} 個隱藏的位置{:.0}", "Showing {n} of {}": "顯示 {n}/{} 張", "Smart album: {}": "智慧型相簿:{}", + "Sort: {key}": "排序:{key}", + "Sort: {key}, {direction}": "排序:{key},{direction}", "The XMP sidecars of {n} photos couldn't be written (is their folder offline?). LightCraft keeps trying.": "無法寫入 {n} 張照片的 XMP 附屬檔案(其資料夾是否離線?)。LightCraft 會持續重試。", "Undo {}": "復原 {}", "Updated “{name}”": "已更新「{name}」", diff --git a/crates/ui-egui/locales/zh-hant.json b/crates/ui-egui/locales/zh-hant.json index f3dfc422ec3..f9e4432670c 100644 --- a/crates/ui-egui/locales/zh-hant.json +++ b/crates/ui-egui/locales/zh-hant.json @@ -45,6 +45,8 @@ "Add to My Photos": "加入我的照片", "Can't be moved here": "無法移到這裡", "Import photos with File → Import Photos…, or drop them here": "使用「檔案 → 匯入照片…」,或將照片拖放至此", + "Shown in a random order. Reshuffle for a new one.": "依隨機順序顯示。重新隨機排序可得到新的順序。", + "Shuffled": "已隨機排序", "This row covers more than one disk: drop on a folder inside it": "此列涵蓋多個磁碟:請拖放到其中的資料夾", "Local photos aren't in the library yet: Add to My Photos first, then move them": "本機照片尚未在照片庫中:請先「加入我的照片」,再移動", "Add to Selected Photos": "加入選取的照片", diff --git a/crates/ui-egui/src/panels/bottombar.rs b/crates/ui-egui/src/panels/bottombar.rs index 81ea562ea49..08440ae8d91 100644 --- a/crates/ui-egui/src/panels/bottombar.rs +++ b/crates/ui-egui/src/panels/bottombar.rs @@ -44,7 +44,8 @@ pub fn show(app: &mut LightcraftApp, ui: &mut egui::Ui) { let (sep, _) = ui.allocate_exact_size(vec2(1.0, 22.0), Sense::hover()); ui.painter().rect_filled(sep, 0.0, t.button_border); ui.add_space(10.0); - let sort = icon_button(ui, "sort", Icon::Sort, vec2(30.0, 30.0), false, true, "Sort"); + let name = sort_summary(&app.session.sort); + let sort = icon_button(ui, "sort", Icon::Sort, vec2(30.0, 30.0), false, true, &name); egui::Popup::menu(&sort).show(|ui| sort_menu(app, ui)); } else { let current_icon = VIEW_MODES.iter().find(|(_, _, mode, _)| *mode == app.ui.view).map_or(Icon::More, |(_, icon, _, _)| *icon); @@ -356,6 +357,23 @@ fn sort_menu(app: &mut LightcraftApp, ui: &mut egui::Ui) { } } +/// What the sort button's tooltip and screen-reader name say: "Sort: Capture Date, Descending", or +/// "Sort: Random" (a shuffle has no direction), worded as the Sort menu words them. +fn sort_summary(sort: &lightcraft_catalog::Sort) -> String { + use lightcraft_catalog::SortKey::*; + let key = crate::i18n::tr(match sort.key { + CaptureDate => "Capture Date", + ImportDate => "Import Date", + EditDate => "Modified Date", + FileName => "File Name", + Rating => "Rating", + FileSize => "File Size", + Random => return crate::i18n::tr_format!("Sort: {key}", key = crate::i18n::tr("Random")), + }); + let direction = crate::i18n::tr(if sort.ascending { "Ascending" } else { "Descending" }); + crate::i18n::tr_format!("Sort: {key}, {direction}", key = key, direction = direction) +} + #[cfg(test)] mod visual_regressions { use super::*; diff --git a/crates/ui-egui/src/panels/grid.rs b/crates/ui-egui/src/panels/grid.rs index db4dfa1b83e..3bbb39d6f76 100644 --- a/crates/ui-egui/src/panels/grid.rs +++ b/crates/ui-egui/src/panels/grid.rs @@ -299,27 +299,36 @@ fn show_inner(app: &mut LightcraftApp, ui: &mut egui::Ui) { let total = app.session.source_total(); let counted = super::chips::count_text(ids.len(), total, !chips.is_empty()); let cnt = if sel_n > 1 { crate::i18n::tr_format!("{sel_n} selected · {counted}", counted = counted, sel_n = sel_n) } else { counted }; + // a shuffle of a source that follows the sort says so, with Reshuffle beside it + let shuffled = !ids.is_empty() && source_follows_sort(app.session.source) && app.session.sort.key == SortKey::Random; match app.session.browse.clone().filter(|_| app.session.source == lightcraft_engine::LibrarySource::Folder) { Some(b) => { let local = app.caches.grid.local(&app.session.catalog, &ids, generation); - folder_header(app, ui, &b, &ids, local, &cnt); + folder_header(app, ui, &b, &ids, local, &cnt, shuffled); } None => { let (hr, _) = ui.allocate_exact_size(vec2(ui.available_width(), 44.0), Sense::hover()); ui.painter().rect_filled(hr, 0.0, t.canvas); let full = crate::i18n::source_title(&app.session); let count_w = ui.painter().layout_no_wrap(cnt.clone(), t.font(12.5), t.text_dim).size().x; - // the title gives way to the count: a long album or folder name is trimmed, in full on hover - let room = (hr.width() - 20.0 - count_w - 36.0).max(0.0); + // the title gives way to the count and the chip: a long album or folder name is trimmed, in full on hover + let before_title = 20.0 + count_w + 36.0; + // a long count leaves the title no room beside the chip: the chip gives way, never the count + let chip = if shuffled { chip_plan(ui, hr.width() - before_title, MIN_TITLE_W, CHIP_GAP) } else { None }; + let room = (hr.width() - before_title - chip.map_or(0.0, |(_, w)| w + CHIP_GAP)).max(0.0); let font = t.semibold(17.0); let title = crate::widgets::elide_head(&full, room, |s| ui.painter().layout_no_wrap(s.to_string(), font.clone(), t.text).size().x); let title_rect = ui.painter().text(pos2(hr.left() + 20.0, hr.center().y), Align2::LEFT_CENTER, &title, font, t.text); - let count_rect = ui.painter().text(pos2(hr.right() - 20.0, hr.center().y), Align2::RIGHT_CENTER, cnt, t.font(12.5), t.text_dim); + let count_rect = ui.painter().text(pos2(hr.right() - 20.0, hr.center().y), Align2::RIGHT_CENTER, &cnt, t.font(12.5), t.text_dim); crate::widgets::register(ui, "grid:title", title_rect); crate::widgets::register(ui, "grid:count", count_rect); if title != full { ui.interact(title_rect, ui.scope_id().with("grid-title"), Sense::hover()).on_hover_text(full); } + if let Some((compact, chip_w)) = chip { + let right = hr.right() - 20.0 - count_w - CHIP_GAP; + shuffle_chip(app, ui, Rect::from_min_size(pos2(right - chip_w, hr.center().y - 12.0), vec2(chip_w, 24.0)), compact); + } } } super::chips::show(app, ui, &chips); @@ -1016,9 +1025,81 @@ struct BadgeFlags { hovered: bool, } +/// The gap between a shuffled view's chip and the count. +const CHIP_GAP: f32 = 12.0; + +/// The gap between "Shuffled" and the button: the state and the action read as two things. +const LABEL_GAP: f32 = 8.0; + +/// The least width the title keeps (a few letters and the ellipsis) before the chip gives way. +const MIN_TITLE_W: f32 = 48.0; + +/// The least width a Local folder's breadcrumb keeps (the ellipsis, a chevron and the folder's +/// first letters) before the chip gives way. +const MIN_PATH_W: f32 = 80.0; + +/// Whether the view's order is the sort's at all: Recently Added is always newest import first, +/// whatever the sort says (Recently Deleted is sorted like any other view). +fn source_follows_sort(source: lightcraft_engine::LibrarySource) -> bool { + source != lightcraft_engine::LibrarySource::RecentlyAdded +} + +/// How the chip fits in a header: `free` is the width left for the title (or path) and the chip, +/// the chip keeps `gap` from it, and the title is left at least `min_title`. The button stands +/// alone (`compact`) when the whole chip would leave the title little room, and there is no chip +/// (`None`) when even the button would take the title under `min_title`: the count never moves. +/// Returns whether the chip is compact and how wide it is. +fn chip_plan(ui: &egui::Ui, free: f32, min_title: f32, gap: f32) -> Option<(bool, f32)> { + let whole = chip_width(ui, false); + let compact = free < whole + 200.0; + let w = if compact { chip_width(ui, true) } else { whole }; + (free - w - gap >= min_title).then_some((compact, w)) +} + +fn chip_width(ui: &egui::Ui, compact: bool) -> f32 { + let t = Tokens::get(ui.ctx()); + let button = crate::button::Button::new("Reshuffle").secondary().small().desired_size(ui).x; + if compact { + return button; + } + let word = ui.painter().layout_no_wrap(crate::i18n::tr("Shuffled").to_string(), t.font(12.5), t.text_dim).size().x; + word.ceil() + LABEL_GAP + button +} + +/// The chip in `rect` (as wide as [`chip_width`]): "Shuffled" in the count's quiet voice and the +/// Reshuffle button (bordered at rest, so it reads as an action beside the state), one click for a +/// new shuffle. +fn shuffle_chip(app: &mut LightcraftApp, ui: &mut egui::Ui, rect: Rect, compact: bool) { + let t = Tokens::get(ui.ctx()); + let button_w = crate::button::Button::new("Reshuffle").secondary().small().desired_size(ui).x; + if !compact { + let word = ui.painter().text(pos2(rect.left(), rect.center().y), Align2::LEFT_CENTER, crate::i18n::tr("Shuffled"), t.font(12.5), t.text_dim); + register(ui, "grid:shuffled", word); + } + let at = Rect::from_min_size(pos2(rect.right() - button_w, rect.center().y - 12.0), vec2(button_w, 24.0)); + if crate::button::Button::new("Reshuffle") + .secondary() + .small() + .widget("button:reshuffle") + .tooltip("Shown in a random order. Reshuffle for a new one.") + .show_at(ui, at) + .clicked() + { + let _ = app.run("library.shuffle", json!({})); + } +} + /// The header of a Local folder view: the path as a breadcrumb (each part opens that folder), /// Include subfolders, Add to My Photos. -fn folder_header(app: &mut LightcraftApp, ui: &mut egui::Ui, b: &lightcraft_engine::Browse, ids: &[PhotoId], local_n: usize, cnt: &str) -> Rect { +fn folder_header( + app: &mut LightcraftApp, + ui: &mut egui::Ui, + b: &lightcraft_engine::Browse, + ids: &[PhotoId], + local_n: usize, + cnt: &str, + shuffled: bool, +) -> Rect { let t = Tokens::get(ui.ctx()); // The path/count and actions need independent rows. The frame reserves the actual height, // including any wrapped actions, so the grid below never paints under the header. @@ -1028,10 +1109,15 @@ fn folder_header(app: &mut LightcraftApp, ui: &mut egui::Ui, b: &lightcraft_engi ui.spacing_mut().item_spacing.x = 8.0; let count_w = ui.painter().layout_no_wrap(cnt.to_owned(), t.font(12.5), t.text_dim).size().x.ceil().min((ui.available_width() * 0.45).floor()); - let path_w = (ui.available_width() - count_w - 8.0).max(0.0).floor(); + let chip = if shuffled { chip_plan(ui, ui.available_width() - count_w - 8.0, MIN_PATH_W, 8.0) } else { None }; + let path_w = (ui.available_width() - count_w - 8.0 - chip.map_or(0.0, |(_, w)| w + 8.0)).max(0.0).floor(); ui.allocate_ui_with_layout(vec2(path_w, 24.0), egui::Layout::left_to_right(egui::Align::Center), |ui| { folder_breadcrumbs(app, ui, &b.path); }); + if let Some((compact, chip_w)) = chip { + let (rect, _) = ui.allocate_exact_size(vec2(chip_w, 24.0), Sense::hover()); + shuffle_chip(app, ui, rect, compact); + } let count = ui.add_sized(vec2(count_w, 24.0), egui::Label::new(egui::RichText::new(cnt).size(12.5).color(t.text_dim)).truncate()); register(ui, "grid:count", count.rect); count.on_hover_text(cnt); diff --git a/crates/ui-egui/src/panels/grid/header_tests.rs b/crates/ui-egui/src/panels/grid/header_tests.rs index 463991625e9..a86f69ed8ff 100644 --- a/crates/ui-egui/src/panels/grid/header_tests.rs +++ b/crates/ui-egui/src/panels/grid/header_tests.rs @@ -29,7 +29,7 @@ fn text_bounds(shape: &egui::Shape, out: &mut Vec) { fn local_folder_header_text_and_controls_do_not_overlap() { for locale in [Locale::En, Locale::De, Locale::PtBr] { for width in [136.0, 200.0, 320.0, 590.0, 1100.0] { - for scale in [1.0, 2.0] { + for (scale, shuffled) in [(1.0, false), (2.0, false), (1.0, true), (2.0, true)] { for (path, local_n) in [ ("/Volumes/External drive/Photography archive/Trips and holidays/A very long folder name with many photographs to import", 2408), ("/A very long folder name with many photographs to import", 2408), @@ -50,7 +50,7 @@ fn local_folder_header_text_and_controls_do_not_overlap() { let raw = HeadlessView::raw_input(vec2(width, 300.0), scale, frame as f64 / 60.0, vec![]); let mut out = ctx.run_ui(raw, |ui| { egui::CentralPanel::default().frame(egui::Frame::NONE).show(ui, |ui| { - header = super::folder_header(&mut app, ui, &browse, &[], local_n, &counted); + header = super::folder_header(&mut app, ui, &browse, &[], local_n, &counted, shuffled); let (grid, _) = ui.allocate_exact_size(vec2(ui.available_width(), 100.0), egui::Sense::hover()); assert!(grid.top() >= header.bottom(), "wrapped controls must reserve space above the grid"); }); @@ -67,6 +67,10 @@ fn local_folder_header_text_and_controls_do_not_overlap() { let check = widgets.iter().find(|(id, _)| id == "check:includeSubfolders").unwrap().1; assert!(widgets.iter().any(|(id, _)| id.starts_with("crumb:"))); assert_eq!(widgets.iter().any(|(id, _)| id == "button:addToLibrary"), local_n > 0); + let count = widgets.iter().find(|(id, _)| id == "grid:count").unwrap().1; + if let Some((_, chip)) = widgets.iter().find(|(id, _)| id == "button:reshuffle") { + assert!(shuffled && chip.right() <= count.left() + 0.5, "{locale:?} {width}: Reshuffle {chip:?} before the count {count:?}"); + } for (id, rect) in &widgets { assert!(header.contains_rect(*rect), "{locale:?} {width} {scale}: {id} outside header: {rect:?}"); if id.starts_with("crumb:") { diff --git a/crates/ui-egui/src/tests.rs b/crates/ui-egui/src/tests.rs index f801ee843f2..0e20c990f59 100644 --- a/crates/ui-egui/src/tests.rs +++ b/crates/ui-egui/src/tests.rs @@ -84,6 +84,7 @@ mod rules_editor; mod sam_setup; mod scan_probes; mod scroll; +mod shuffle_chip; mod slider_reset; mod slideshow; mod solo_sections; diff --git a/crates/ui-egui/src/tests/shuffle_chip.rs b/crates/ui-egui/src/tests/shuffle_chip.rs new file mode 100644 index 00000000000..d2be5cd5f5d --- /dev/null +++ b/crates/ui-egui/src/tests/shuffle_chip.rs @@ -0,0 +1,217 @@ +//! A shuffled view says so in the grid header, with Reshuffle beside it (LR-FILT-SORT), and the +//! sort button names which sort is chosen. + +use std::time::Duration; + +use serde_json::{Value, json}; + +use crate::LightcraftApp; +use crate::headless::Headless; + +const T: Duration = Duration::from_secs(10); +const SETTLE: Duration = Duration::from_secs(120); + +fn demo(size: [f32; 2], view: &str) -> Headless { + let services = crate::Services { png: None, ..Default::default() }; + let mut h = Headless::new(LightcraftApp::new(lightcraft_engine::Session::with_demo(), services), size, 1.0); + let r = h.request("ui.set", json!({"view": view, "leftPanel": false, "right": "none"}), T); + assert_eq!(r["ok"], true, "{r}"); + h.settle(SETTLE); + h +} + +fn exec(h: &mut Headless, command: &str, params: Value) { + let r = h.request("engine.execute", json!({"command": command, "params": params}), T); + assert_eq!(r["ok"], true, "{command} {params}: {r}"); + h.settle(SETTLE); +} + +fn widget(h: &Headless, id: &str) -> Option { + h.app.widgets.iter().find(|(w, _)| w == id).map(|(_, r)| *r) +} + +fn tooltip_shown(h: &Headless) -> bool { + h.view.ctx.memory(|m| m.areas().visible_layer_ids().into_iter().any(|l| l.order == egui::Order::Tooltip)) +} + +const RESHUFFLE: &str = "button:reshuffle"; +const SHUFFLED: &str = "grid:shuffled"; + +/// The chip shows for a shuffle of a source that follows the sort, in both grids, and not for any +/// other order. +#[test] +fn the_header_says_shuffled_only_under_random_in_a_source_that_follows_the_sort() { + for view in ["photoGrid", "squareGrid"] { + let mut h = demo([1200.0, 800.0], view); + assert!(widget(&h, RESHUFFLE).is_none() && widget(&h, SHUFFLED).is_none(), "{view}: sorted by date: no chip"); + exec(&mut h, "library.sort", json!({"key": "fileName"})); + assert!(widget(&h, SHUFFLED).is_none(), "{view}: another key: no chip"); + exec(&mut h, "library.sort", json!({"key": "random"})); + let (chip, count) = (widget(&h, SHUFFLED).unwrap_or_else(|| panic!("{view}: no chip")), widget(&h, "grid:count").unwrap()); + let button = widget(&h, RESHUFFLE).unwrap_or_else(|| panic!("{view}: no Reshuffle")); + assert!(h.painted_text().iter().any(|t| t == "Shuffled"), "{view}: the chip reads Shuffled"); + assert!( + chip.right() <= button.left() + 0.5 && button.right() <= count.left(), + "{view}: chip {chip:?}, button {button:?} sit before the count {count:?}" + ); + // Recently Added ignores the sort: it says nothing about it + exec(&mut h, "library.source", json!({"kind": "recentlyAdded"})); + assert!(widget(&h, SHUFFLED).is_none() && widget(&h, RESHUFFLE).is_none(), "{view}: Recently Added ignores the sort: no chip"); + // Recently Deleted is sorted like any other view (and empty it has nothing to shuffle) + exec(&mut h, "library.source", json!({"kind": "recentlyDeleted"})); + assert!(widget(&h, SHUFFLED).is_none(), "{view}: nothing deleted: no chip"); + exec(&mut h, "library.source", json!({"kind": "all"})); + let eight: Vec = h.app.session.visible_cloned().iter().take(8).map(|p| p.0).collect(); + exec(&mut h, "library.select", json!({"ids": eight})); + exec(&mut h, "photo.delete", json!({})); + exec(&mut h, "library.source", json!({"kind": "recentlyDeleted"})); + assert_eq!(h.app.session.visible_cloned().len(), 8); + assert!(widget(&h, SHUFFLED).is_some() && widget(&h, RESHUFFLE).is_some(), "{view}: Recently Deleted is shuffled: chip"); + let seed = h.app.session.sort.seed; + let r = h.request("ui.clickWidget", json!({"id": RESHUFFLE}), T); + assert_eq!(r["ok"], true, "{r}"); + h.settle(SETTLE); + assert_ne!(h.app.session.sort.seed, seed, "{view}: Reshuffle reshuffles Recently Deleted"); + exec(&mut h, "library.source", json!({"kind": "all"})); + assert!(widget(&h, SHUFFLED).is_some(), "{view}: back to All Photos: the chip is back"); + exec(&mut h, "library.sort", json!({"key": "captureDate"})); + assert!(widget(&h, SHUFFLED).is_none() && widget(&h, RESHUFFLE).is_none(), "{view}: sorted again: no chip"); + } +} + +/// "Shuffled" is the state (quiet text) and Reshuffle the action: the button shows its border at +/// rest, in every theme, and keeps a gap from the label, so the two don't read as one phrase. +#[test] +fn reshuffle_reads_as_a_button_beside_the_label() { + for theme in ["charcoal", "midnight", "paper", "silver"] { + let mut h = demo([1200.0, 800.0], "photoGrid"); + exec(&mut h, "view.theme", json!({"theme": theme})); + exec(&mut h, "library.sort", json!({"key": "random"})); + let (word, button) = (widget(&h, SHUFFLED).expect("the label"), widget(&h, RESHUFFLE).expect("the button")); + let outlines = |of: egui::Rect| { + h.view + .painted_shapes() + .iter() + .filter(|s| matches!(s, egui::epaint::Shape::Rect(r) if r.stroke.width > 0.0 && r.rect.expand(0.5).contains_rect(of) && of.expand(0.5).contains_rect(r.rect))) + .count() + }; + assert_eq!(outlines(button), 1, "{theme}: Reshuffle shows its border at rest"); + assert_eq!(outlines(word), 0, "{theme}: the label stays plain text"); + assert!(button.left() - word.right() >= 8.0, "{theme}: a gap between the state and the action: {word:?} {button:?}"); + } +} + +/// One click on the chip's Reshuffle is a new shuffle, and the chip stays. +#[test] +fn reshuffle_in_the_header_gives_a_new_order() { + let mut h = demo([1200.0, 800.0], "photoGrid"); + exec(&mut h, "library.sort", json!({"key": "random"})); + let (seed, order) = (h.app.session.sort.seed, h.app.session.visible_cloned()); + let r = h.request("ui.clickWidget", json!({"id": RESHUFFLE}), T); + assert_eq!(r["ok"], true, "{r}"); + h.settle(SETTLE); + assert_ne!(h.app.session.sort.seed, seed, "a new seed"); + assert_ne!(h.app.session.visible_cloned(), order, "a new order"); + assert_eq!(h.app.session.sort.key, lightcraft_catalog::SortKey::Random, "still a shuffle"); + assert!(widget(&h, RESHUFFLE).is_some(), "the chip stays"); +} + +/// The Local folder header has its own layout: the chip is there too, and its count stays. +#[test] +fn a_shuffled_local_folder_says_so_too() { + let dir = std::env::temp_dir().join(format!("lc-ui-shuffle-chip-{}", std::process::id())); + let _ = std::fs::remove_dir_all(&dir); + std::fs::create_dir_all(&dir).unwrap(); + let o = lightcraft_engine::export::ExportOptions { format: lightcraft_engine::export::ExportFormat::Png, ..Default::default() }; + for i in 0..3u8 { + let img = lightcraft_raster::Rgba8::from_fn(24, 16, |x, y| [(x * 9) as u8, (y * 12) as u8, 40 * i, 255]); + std::fs::write(dir.join(format!("p{i}.png")), lightcraft_engine::export::encode_image(&img, &o).unwrap()).unwrap(); + } + let mut h = demo([1200.0, 800.0], "photoGrid"); + exec(&mut h, "library.browse", json!({"path": dir.to_string_lossy()})); + assert!(widget(&h, RESHUFFLE).is_none(), "sorted: no chip"); + exec(&mut h, "library.sort", json!({"key": "random"})); + let (button, count) = (widget(&h, RESHUFFLE).expect("Reshuffle in the folder header"), widget(&h, "grid:count").unwrap()); + assert!(button.right() <= count.left(), "{button:?} before {count:?}"); + let _ = std::fs::remove_dir_all(&dir); +} + +/// However narrow the window, the count stays on screen, Reshuffle stays reachable and nothing +/// overlaps. +#[test] +fn the_chip_never_pushes_the_count_off_a_narrow_header() { + for width in [520.0f32, 400.0, 340.0] { + let mut h = demo([width, 700.0], "photoGrid"); + exec(&mut h, "library.sort", json!({"key": "random"})); + let (title, count) = (widget(&h, "grid:title").unwrap(), widget(&h, "grid:count").unwrap()); + let button = widget(&h, RESHUFFLE).unwrap_or_else(|| panic!("{width}: no Reshuffle")); + assert!(count.right() <= width && count.left() >= 0.0 && button.left() >= 0.0, "{width}: on screen: {count:?} {button:?}"); + assert!(button.right() <= count.left() + 0.5, "{width}: {button:?} left of {count:?}"); + assert!(title.right() <= button.left() + 0.5, "{width}: title {title:?} left of {button:?}"); + if let Some(chip) = widget(&h, SHUFFLED) { + assert!(title.right() <= chip.left() + 0.5 && chip.right() <= button.left() + 0.5, "{width}: {title:?} {chip:?} {button:?}"); + } + } +} + +/// A long count (a selection) leaves the title no room beside the chip: the chip gives way, and +/// never covers the title or the count. A little wider, the chip is back. +#[test] +fn a_long_count_makes_the_chip_give_way_rather_than_overlap() { + // (a Local folder or the library, the narrowest window that still has the chip, one narrower) + for (folder, shown, dropped) in [(false, 420.0f32, 340.0f32), (true, 440.0, 330.0)] { + for width in [shown, dropped] { + let mut h = demo([width, 700.0], "photoGrid"); + exec(&mut h, "library.sort", json!({"key": "random"})); + if folder { + let dir = std::env::temp_dir().join(format!("lc-ui-shuffle-chip-narrow-{}", std::process::id())); + let _ = std::fs::remove_dir_all(&dir); + std::fs::create_dir_all(&dir).unwrap(); + let o = lightcraft_engine::export::ExportOptions { format: lightcraft_engine::export::ExportFormat::Png, ..Default::default() }; + for i in 0..12u8 { + let img = lightcraft_raster::Rgba8::from_fn(24, 16, |x, y| [(x * 9) as u8, (y * 12) as u8, 20 * i, 255]); + std::fs::write(dir.join(format!("p{i}.png")), lightcraft_engine::export::encode_image(&img, &o).unwrap()).unwrap(); + } + exec(&mut h, "library.browse", json!({"path": dir.to_string_lossy()})); + } + let all: Vec = h.app.session.visible_cloned().iter().map(|p| p.0).collect(); + exec(&mut h, "library.select", json!({"ids": all})); + let count = widget(&h, "grid:count").expect("the count"); + assert!(count.left() >= 0.0 && count.right() <= width, "folder {folder}, {width}: the count stays on screen: {count:?}"); + if width == shown { + let button = widget(&h, RESHUFFLE).unwrap_or_else(|| panic!("folder {folder}, {width}: the chip fits")); + assert!(button.left() >= 0.0 && button.right() <= count.left() + 0.5, "folder {folder}, {width}: {button:?} before {count:?}"); + } else { + assert!( + widget(&h, RESHUFFLE).is_none() && widget(&h, SHUFFLED).is_none(), + "folder {folder}, {width}: no room beside the title: no chip" + ); + } + if folder { + let _ = std::fs::remove_dir_all(std::env::temp_dir().join(format!("lc-ui-shuffle-chip-narrow-{}", std::process::id()))); + } + } + } +} + +/// The sort button's tooltip names the sort setting, as the menu words it. +#[test] +fn the_sort_button_names_the_current_sort() { + let mut h = demo([1200.0, 800.0], "photoGrid"); + for (params, said) in [ + (json!({"key": "captureDate", "ascending": false}), "Sort: Capture Date, Descending"), + (json!({"key": "fileName", "ascending": true}), "Sort: File Name, Ascending"), + (json!({"key": "random"}), "Sort: Random"), + ] { + exec(&mut h, "library.sort", params); + let c = widget(&h, "icon:sort").expect("the sort button").center(); + let r = h.request("ui.move", json!({"x": c.x, "y": c.y}), T); + assert_eq!(r["ok"], true, "{r}"); + assert!(h.step_until(Duration::from_secs(5), tooltip_shown), "{said}: a tooltip appears"); + // (the tooltip fades in over a few frames) + assert!(h.step_until(Duration::from_secs(5), |h| h.painted_text().iter().any(|t| t == said)), "{said}: not in {:?}", h.painted_text()); + let r = h.request("ui.move", json!({"x": 5.0, "y": 5.0}), T); + assert_eq!(r["ok"], true, "{r}"); + h.step(); + } +} diff --git a/docs/parity-checklist.md b/docs/parity-checklist.md index 49bfe4ec9c2..c6bf046b424 100644 --- a/docs/parity-checklist.md +++ b/docs/parity-checklist.md @@ -158,7 +158,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/panels/grid.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); a shuffled grid shows a "Shuffled" chip with a bordered Reshuffle button in its header, and the sort button's tooltip and screen-reader name give the current sort ("Sort: Random", "Sort: Capture Date, Descending"); 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) @@ -1051,3 +1051,4 @@ Latin stays upright. Advanced Japanese composition remains open. Regression cove | 2026-10-17 | minor | LR-EXP-DIALOG: built-in export presets for the issue #2104 delivery targets — Instagram Feed (1080 px, screen sharpening), Instagram Story / Reel (1920 px), Web / Portfolio (2048 px, copyright and creator metadata), Full Resolution Master (full size, Display P3, quality 95); LR-EXP-PREVIOUS drops its stale "no named export presets yet" note; status unchanged (✅) | | 2026-10-20 | patch | LR-EXP-DIALOG: the four built-in export presets are translated in all 17 catalogs (translations pending native-speaker review); Instagram Story / Reel states that it applies no crop to 9:16; status unchanged (✅) | | 2026-10-31 | patch | LRC-LIB-VISUALSEARCH: Find Similar Photos reads the photos on a worker thread under an activity row with ✕ instead of on the UI thread, where a large library left the window not responding (#3468). A stopped search leaves the view as it was and keeps what it read; a control request gets the same `{photos}` when the search ends. | +| 2026-10-29 | patch | LR-FILT-SORT: a view sorted at random (Recently Added keeps its own order) shows a quiet "Shuffled" chip beside the photo count in the grid header, with a Reshuffle button that runs `library.shuffle`, drawn with its border at rest and a little apart from the label so the two read as a state and an action; narrow headers keep the count and show the button alone, or drop the chip when even that leaves the title no room; the sort button's tooltip and screen-reader name read "Sort: Random" or "Sort: Capture Date, Descending" (the key and the direction as the Sort menu words them) instead of "Sort"; status unchanged (✅) | diff --git a/docs/whats-new.md b/docs/whats-new.md index ab0f90c0338..fe82f857f25 100644 --- a/docs/whats-new.md +++ b/docs/whats-new.md @@ -195,6 +195,15 @@ ## 2026-10-28 +### A shuffled grid says so, and Reshuffle is one click away +- When the photos are sorted at random, the grid's header now shows "Shuffled" beside the photo count with a Reshuffle + button (bordered, so it reads as an action beside the state): one click gives a new order, with the Sort menu's + Reshuffle unchanged. Recently Added keeps its own order + (newest import first), so it shows no chip. In a narrow window the button stands alone, and when even it would + leave the title no room (a very narrow window or a very long count) the chip is left out, so the count always stays in view. +- The sort button's tooltip and its name for screen readers now say which sort is chosen ("Sort: Capture + Date, Descending", "Sort: Random") instead of just "Sort". + ### The empty photo grid names Import Photos' shortcut as it is bound - When a view is empty and the way in is File ▸ Import Photos…, the message under "No photos" used a fixed "Cmd+Shift+I" (or a translation's fixed copy of it) whatever the platform or the binding. It now shows the key as the menu bar writes it (on a Mac its glyphs, elsewhere Ctrl+Shift+I) on its own line under the sentence, follows a remapped key, and names no key when Import Photos has none. The sentence now wraps in a narrow window instead of running off its edge.