From 939464801c44a656a3e21bfd9cfb7842cefc6700 Mon Sep 17 00:00:00 2001 From: Nathaniel Ledford Date: Fri, 23 Oct 2026 19:30:31 -0400 Subject: [PATCH 1/2] LR-BEHAV-DRAGDROP: a Folders row dragged onto another moves that folder on disk, after a question --- crates/ui-egui/locales/cs-formats.json | 6 +- crates/ui-egui/locales/cs.json | 6 +- crates/ui-egui/locales/de-formats.json | 6 +- crates/ui-egui/locales/de.json | 6 +- crates/ui-egui/locales/es-formats.json | 6 +- crates/ui-egui/locales/es.json | 6 +- crates/ui-egui/locales/fi-formats.json | 6 +- crates/ui-egui/locales/fi.json | 6 +- crates/ui-egui/locales/fr-formats.json | 6 +- crates/ui-egui/locales/fr.json | 6 +- crates/ui-egui/locales/id-formats.json | 6 +- crates/ui-egui/locales/id.json | 6 +- crates/ui-egui/locales/it-formats.json | 6 +- crates/ui-egui/locales/it.json | 6 +- crates/ui-egui/locales/ja-formats.json | 6 +- crates/ui-egui/locales/ja.json | 6 +- crates/ui-egui/locales/ka-formats.json | 6 +- crates/ui-egui/locales/ka.json | 6 +- crates/ui-egui/locales/pl-formats.json | 6 +- crates/ui-egui/locales/pl.json | 6 +- crates/ui-egui/locales/pt-br-formats.json | 6 +- crates/ui-egui/locales/pt-br.json | 6 +- crates/ui-egui/locales/ru-formats.json | 6 +- crates/ui-egui/locales/ru.json | 6 +- crates/ui-egui/locales/sv-formats.json | 6 +- crates/ui-egui/locales/sv.json | 6 +- crates/ui-egui/locales/uk-formats.json | 6 +- crates/ui-egui/locales/uk.json | 6 +- crates/ui-egui/locales/vi-formats.json | 6 +- crates/ui-egui/locales/vi.json | 6 +- crates/ui-egui/locales/zh-hans-formats.json | 6 +- crates/ui-egui/locales/zh-hans.json | 6 +- crates/ui-egui/locales/zh-hant-formats.json | 6 +- crates/ui-egui/locales/zh-hant.json | 6 +- crates/ui-egui/src/app/frame.rs | 1 + crates/ui-egui/src/dialogs.rs | 24 +- crates/ui-egui/src/dialogs/confirm.rs | 13 + crates/ui-egui/src/panels/left.rs | 5 +- crates/ui-egui/src/panels/left/albums.rs | 2 +- crates/ui-egui/src/panels/left/folders.rs | 157 ++++++++- crates/ui-egui/src/state.rs | 9 + crates/ui-egui/src/state/dialog.rs | 14 + crates/ui-egui/src/tests.rs | 1 + crates/ui-egui/src/tests/folder_drag.rs | 371 ++++++++++++++++++++ crates/ui-egui/src/tests/folder_drop.rs | 24 +- docs/parity-checklist.md | 5 +- docs/whats-new.md | 10 + 47 files changed, 786 insertions(+), 54 deletions(-) create mode 100644 crates/ui-egui/src/tests/folder_drag.rs diff --git a/crates/ui-egui/locales/cs-formats.json b/crates/ui-egui/locales/cs-formats.json index 1eb882f09d4..66dec83d1f4 100644 --- a/crates/ui-egui/locales/cs-formats.json +++ b/crates/ui-egui/locales/cs-formats.json @@ -305,5 +305,9 @@ "Could not read {name}: {e}": "Soubor {name} se nepodařilo přečíst: {e}", "Added {n} photo{}": "Přidáno fotografií: {n}{:.0}", "Where should the Lightroom catalog “{catalog}” go?": "Kam má jít katalog Lightroomu „{catalog}“?", - "Merge into the open library “{library}” ({count} photo{})": "Sloučit s otevřenou knihovnou „{library}“ (fotografie: {count}{:.0})" + "Merge into the open library “{library}” ({count} photo{})": "Sloučit s otevřenou knihovnou „{library}“ (fotografie: {count}{:.0})", + "Move “{name}” into “{into}”": "Přesunout „{name}“ do „{into}“", + "Move “{name}” into “{into}”?": "Přesunout „{name}“ do „{into}“?", + "Photos in it and in the folders inside it: {count}": "Fotografie v ní a ve složkách v ní: {count}", + "“{name}” is no longer there: nothing was moved": "„{name}“ už neexistuje: nic nebylo přesunuto" } diff --git a/crates/ui-egui/locales/cs.json b/crates/ui-egui/locales/cs.json index 52ca94a524d..2b7ccd09108 100644 --- a/crates/ui-egui/locales/cs.json +++ b/crates/ui-egui/locales/cs.json @@ -2408,5 +2408,9 @@ "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", + "The library's own folder can't be moved": "Složku knihovny nelze přesunout", + "A folder can't move into itself or a folder inside it": "Složku nelze přesunout do sebe samé ani do složky v ní", + "The folder, its files and XMP sidecars move on disk. Edit → Undo moves it back.": "Složka, její soubory a přidružené soubory XMP se přesunou na disku. Úpravy → Zpět ji přesune zpět.", + "Another library was opened since the folder was dropped: nothing was moved": "Od přetažení složky byla otevřena jiná knihovna: nic nebylo přesunuto" } diff --git a/crates/ui-egui/locales/de-formats.json b/crates/ui-egui/locales/de-formats.json index 79390f13647..3e8f334474e 100644 --- a/crates/ui-egui/locales/de-formats.json +++ b/crates/ui-egui/locales/de-formats.json @@ -305,5 +305,9 @@ "Could not read {name}: {e}": "{name} konnte nicht gelesen werden: {e}", "Added {n} photo{}": "{n} Foto{} hinzugefügt", "Where should the Lightroom catalog “{catalog}” go?": "Wohin soll der Lightroom-Katalog „{catalog}“?", - "Merge into the open library “{library}” ({count} photo{})": "Mit der geöffneten Bibliothek „{library}“ zusammenführen ({count} Foto{})" + "Merge into the open library “{library}” ({count} photo{})": "Mit der geöffneten Bibliothek „{library}“ zusammenführen ({count} Foto{})", + "Move “{name}” into “{into}”": "„{name}“ nach „{into}“ verschieben", + "Move “{name}” into “{into}”?": "„{name}“ nach „{into}“ verschieben?", + "Photos in it and in the folders inside it: {count}": "Fotos darin und in den Ordnern darin: {count}", + "“{name}” is no longer there: nothing was moved": "„{name}“ ist nicht mehr vorhanden: Es wurde nichts verschoben" } diff --git a/crates/ui-egui/locales/de.json b/crates/ui-egui/locales/de.json index e2205db782f..8c5819fdbb0 100644 --- a/crates/ui-egui/locales/de.json +++ b/crates/ui-egui/locales/de.json @@ -3440,5 +3440,9 @@ "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", + "The library's own folder can't be moved": "Der Ordner der Bibliothek selbst kann nicht verschoben werden", + "A folder can't move into itself or a folder inside it": "Ein Ordner kann nicht in sich selbst oder in einen Ordner darin verschoben werden", + "The folder, its files and XMP sidecars move on disk. Edit → Undo moves it back.": "Der Ordner, seine Dateien und XMP-Filialdateien werden auf dem Datenträger verschoben. Bearbeiten → Rückgängig holt ihn zurück.", + "Another library was opened since the folder was dropped: nothing was moved": "Seit dem Ablegen des Ordners wurde eine andere Bibliothek geöffnet: Es wurde nichts verschoben" } diff --git a/crates/ui-egui/locales/es-formats.json b/crates/ui-egui/locales/es-formats.json index 33e5f52fc6e..339be00bdb5 100644 --- a/crates/ui-egui/locales/es-formats.json +++ b/crates/ui-egui/locales/es-formats.json @@ -305,5 +305,9 @@ "Could not read {name}: {e}": "No se pudo leer {name}: {e}", "Added {n} photo{}": "{n} foto{0} añadida{0}", "Where should the Lightroom catalog “{catalog}” go?": "¿Dónde debe ir el catálogo de Lightroom “{catalog}”?", - "Merge into the open library “{library}” ({count} photo{})": "Combinar con la biblioteca abierta “{library}” ({count} foto{})" + "Merge into the open library “{library}” ({count} photo{})": "Combinar con la biblioteca abierta “{library}” ({count} foto{})", + "Move “{name}” into “{into}”": "Mover “{name}” a “{into}”", + "Move “{name}” into “{into}”?": "¿Mover “{name}” a “{into}”?", + "Photos in it and in the folders inside it: {count}": "Fotos en ella y en las carpetas que contiene: {count}", + "“{name}” is no longer there: nothing was moved": "“{name}” ya no está: no se movió nada" } diff --git a/crates/ui-egui/locales/es.json b/crates/ui-egui/locales/es.json index 888af077ff2..022a9cc8215 100644 --- a/crates/ui-egui/locales/es.json +++ b/crates/ui-egui/locales/es.json @@ -2358,5 +2358,9 @@ "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", + "The library's own folder can't be moved": "La carpeta de la propia biblioteca no se puede mover", + "A folder can't move into itself or a folder inside it": "Una carpeta no se puede mover dentro de sí misma ni de una carpeta que contiene", + "The folder, its files and XMP sidecars move on disk. Edit → Undo moves it back.": "La carpeta, sus archivos y archivos XMP auxiliares se mueven en el disco. Editar → Deshacer la devuelve.", + "Another library was opened since the folder was dropped: nothing was moved": "Se abrió otra biblioteca después de soltar la carpeta: no se movió nada" } diff --git a/crates/ui-egui/locales/fi-formats.json b/crates/ui-egui/locales/fi-formats.json index 1daab3dab9f..86724d3b24e 100644 --- a/crates/ui-egui/locales/fi-formats.json +++ b/crates/ui-egui/locales/fi-formats.json @@ -305,5 +305,9 @@ "Drop to import {n} preset{}": "Pudota tuodaksesi esiasetuksia: {n}{:.0}", "Drop to review {n} item{} for import": "Pudota tarkistaaksesi ennen tuontia (kohteita: {n}){:.0}", "Where should the Lightroom catalog “{catalog}” go?": "Minne Lightroom-luettelo ”{catalog}” tuodaan?", - "Merge into the open library “{library}” ({count} photo{})": "Yhdistä avoimeen kirjastoon ”{library}” (kuvia: {count}{:.0})" + "Merge into the open library “{library}” ({count} photo{})": "Yhdistä avoimeen kirjastoon ”{library}” (kuvia: {count}{:.0})", + "Move “{name}” into “{into}”": "Siirrä ”{name}” kohteeseen ”{into}”", + "Move “{name}” into “{into}”?": "Siirretäänkö ”{name}” kohteeseen ”{into}”?", + "Photos in it and in the folders inside it: {count}": "Kuvia siinä ja sen sisällä olevissa kansioissa: {count}", + "“{name}” is no longer there: nothing was moved": "”{name}” ei ole enää siellä: mitään ei siirretty" } diff --git a/crates/ui-egui/locales/fi.json b/crates/ui-egui/locales/fi.json index e0a8c622a36..c0024a2fe6f 100644 --- a/crates/ui-egui/locales/fi.json +++ b/crates/ui-egui/locales/fi.json @@ -2327,5 +2327,9 @@ "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", + "The library's own folder can't be moved": "Kirjaston omaa kansiota ei voi siirtää", + "A folder can't move into itself or a folder inside it": "Kansiota ei voi siirtää itseensä tai sen sisällä olevaan kansioon", + "The folder, its files and XMP sidecars move on disk. Edit → Undo moves it back.": "Kansio, sen tiedostot ja XMP-sivutiedostot siirtyvät levyllä. Muokkaa → Kumoa siirtää sen takaisin.", + "Another library was opened since the folder was dropped: nothing was moved": "Toinen kirjasto avattiin kansion pudottamisen jälkeen: mitään ei siirretty" } diff --git a/crates/ui-egui/locales/fr-formats.json b/crates/ui-egui/locales/fr-formats.json index 294273781e0..88e002b20c6 100644 --- a/crates/ui-egui/locales/fr-formats.json +++ b/crates/ui-egui/locales/fr-formats.json @@ -305,5 +305,9 @@ "Could not read {name}: {e}": "Impossible de lire {name} : {e}", "Added {n} photo{}": "{n} photo{} ajoutée(s)", "Where should the Lightroom catalog “{catalog}” go?": "Où importer le catalogue Lightroom « {catalog} » ?", - "Merge into the open library “{library}” ({count} photo{})": "Fusionner avec la bibliothèque ouverte « {library} » ({count} photo{})" + "Merge into the open library “{library}” ({count} photo{})": "Fusionner avec la bibliothèque ouverte « {library} » ({count} photo{})", + "Move “{name}” into “{into}”": "Déplacer « {name} » dans « {into} »", + "Move “{name}” into “{into}”?": "Déplacer « {name} » dans « {into} » ?", + "Photos in it and in the folders inside it: {count}": "Photos qu'il contient et dans les dossiers à l'intérieur : {count}", + "“{name}” is no longer there: nothing was moved": "« {name} » est introuvable : rien n’a été déplacé" } diff --git a/crates/ui-egui/locales/fr.json b/crates/ui-egui/locales/fr.json index 3278d6ccda6..f0665fc5a69 100644 --- a/crates/ui-egui/locales/fr.json +++ b/crates/ui-egui/locales/fr.json @@ -2390,5 +2390,9 @@ "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 :", + "The library's own folder can't be moved": "Le dossier de la bibliothèque elle-même ne peut pas être déplacé", + "A folder can't move into itself or a folder inside it": "Un dossier ne peut pas être déplacé dans lui-même ni dans un dossier qu'il contient", + "The folder, its files and XMP sidecars move on disk. Edit → Undo moves it back.": "Le dossier, ses fichiers et fichiers annexes XMP sont déplacés sur le disque. Modifier → Annuler le remet en place.", + "Another library was opened since the folder was dropped: nothing was moved": "Une autre bibliothèque a été ouverte depuis le dépôt du dossier : rien n’a été déplacé" } diff --git a/crates/ui-egui/locales/id-formats.json b/crates/ui-egui/locales/id-formats.json index 7fc3255221e..9e016635c3a 100644 --- a/crates/ui-egui/locales/id-formats.json +++ b/crates/ui-egui/locales/id-formats.json @@ -305,5 +305,9 @@ "Drop to review {n} item{} for import": "Jatuhkan untuk meninjau {n} item sebelum impor{:.0}", "Inside: {names}": "Di dalam: {names}", "Where should the Lightroom catalog “{catalog}” go?": "Ke mana katalog Lightroom “{catalog}” diimpor?", - "Merge into the open library “{library}” ({count} photo{})": "Gabungkan ke pustaka yang terbuka “{library}” ({count} foto{:.0})" + "Merge into the open library “{library}” ({count} photo{})": "Gabungkan ke pustaka yang terbuka “{library}” ({count} foto{:.0})", + "Move “{name}” into “{into}”": "Pindahkan “{name}” ke “{into}”", + "Move “{name}” into “{into}”?": "Pindahkan “{name}” ke “{into}”?", + "Photos in it and in the folders inside it: {count}": "Foto di dalamnya dan di folder di dalamnya: {count}", + "“{name}” is no longer there: nothing was moved": "“{name}” tidak ditemukan lagi: tidak ada yang dipindahkan" } diff --git a/crates/ui-egui/locales/id.json b/crates/ui-egui/locales/id.json index 0d6da9b8fb8..7b2ea7daba1 100644 --- a/crates/ui-egui/locales/id.json +++ b/crates/ui-egui/locales/id.json @@ -2339,5 +2339,9 @@ "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", + "The library's own folder can't be moved": "Folder pustaka itu sendiri tidak dapat dipindahkan", + "A folder can't move into itself or a folder inside it": "Folder tidak dapat dipindahkan ke dalam dirinya sendiri atau folder di dalamnya", + "The folder, its files and XMP sidecars move on disk. Edit → Undo moves it back.": "Folder, file, dan sidecar XMP-nya ikut dipindahkan di disk. Edit → Urungkan akan memindahkannya kembali.", + "Another library was opened since the folder was dropped: nothing was moved": "Pustaka lain telah dibuka setelah folder diletakkan: tidak ada yang dipindahkan" } diff --git a/crates/ui-egui/locales/it-formats.json b/crates/ui-egui/locales/it-formats.json index 7efae90e945..c97087241bc 100644 --- a/crates/ui-egui/locales/it-formats.json +++ b/crates/ui-egui/locales/it-formats.json @@ -305,5 +305,9 @@ "Could not read {name}: {e}": "Impossibile leggere {name}: {e}", "Added {n} photo{}": "Foto aggiunte: {n}{:.0}", "Where should the Lightroom catalog “{catalog}” go?": "Dove importare il catalogo Lightroom “{catalog}”?", - "Merge into the open library “{library}” ({count} photo{})": "Unisci alla libreria aperta “{library}” (foto: {count}{:.0})" + "Merge into the open library “{library}” ({count} photo{})": "Unisci alla libreria aperta “{library}” (foto: {count}{:.0})", + "Move “{name}” into “{into}”": "Sposta “{name}” in “{into}”", + "Move “{name}” into “{into}”?": "Spostare “{name}” in “{into}”?", + "Photos in it and in the folders inside it: {count}": "Foto al suo interno e nelle cartelle al suo interno: {count}", + "“{name}” is no longer there: nothing was moved": "“{name}” non c'è più: non è stato spostato nulla" } diff --git a/crates/ui-egui/locales/it.json b/crates/ui-egui/locales/it.json index e159fd47d15..fa22ec16011 100644 --- a/crates/ui-egui/locales/it.json +++ b/crates/ui-egui/locales/it.json @@ -2361,5 +2361,9 @@ "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", + "The library's own folder can't be moved": "La cartella della libreria stessa non può essere spostata", + "A folder can't move into itself or a folder inside it": "Una cartella non può essere spostata in se stessa o in una cartella al suo interno", + "The folder, its files and XMP sidecars move on disk. Edit → Undo moves it back.": "La cartella, i suoi file e i file XMP collegati vengono spostati sul disco. Modifica → Annulla la riporta indietro.", + "Another library was opened since the folder was dropped: nothing was moved": "Dopo il trascinamento della cartella è stata aperta un'altra libreria: non è stato spostato nulla" } diff --git a/crates/ui-egui/locales/ja-formats.json b/crates/ui-egui/locales/ja-formats.json index 99c14bf16dc..2c7d8ad1f6d 100644 --- a/crates/ui-egui/locales/ja-formats.json +++ b/crates/ui-egui/locales/ja-formats.json @@ -305,5 +305,9 @@ "Could not read {name}: {e}": "{name} を読み取れませんでした: {e}", "Added {n} photo{}": "{n}枚を追加しました{:.0}", "Where should the Lightroom catalog “{catalog}” go?": "Lightroom カタログ「{catalog}」をどこに読み込みますか?", - "Merge into the open library “{library}” ({count} photo{})": "開いているライブラリ「{library}」に統合(写真{count}枚){:.0}" + "Merge into the open library “{library}” ({count} photo{})": "開いているライブラリ「{library}」に統合(写真{count}枚){:.0}", + "Move “{name}” into “{into}”": "「{name}」を「{into}」に移動", + "Move “{name}” into “{into}”?": "「{name}」を「{into}」に移動しますか?", + "Photos in it and in the folders inside it: {count}": "その中およびその中のフォルダ内の写真:{count}", + "“{name}” is no longer there: nothing was moved": "「{name}」が見つかりません。何も移動していません" } diff --git a/crates/ui-egui/locales/ja.json b/crates/ui-egui/locales/ja.json index e1834555bd7..d5bf5de5980 100644 --- a/crates/ui-egui/locales/ja.json +++ b/crates/ui-egui/locales/ja.json @@ -2356,5 +2356,9 @@ "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 カタログの読み込みを完了してください", + "The library's own folder can't be moved": "ライブラリ自体のフォルダは移動できません", + "A folder can't move into itself or a folder inside it": "フォルダを自身またはその中のフォルダに移動することはできません", + "The folder, its files and XMP sidecars move on disk. Edit → Undo moves it back.": "フォルダ、そのファイル、XMP サイドカーがディスク上で移動します。編集 → 取り消す で元に戻せます。", + "Another library was opened since the folder was dropped: nothing was moved": "フォルダをドロップした後に別のライブラリが開かれました。何も移動していません" } diff --git a/crates/ui-egui/locales/ka-formats.json b/crates/ui-egui/locales/ka-formats.json index 46036826186..d68e38d849c 100644 --- a/crates/ui-egui/locales/ka-formats.json +++ b/crates/ui-egui/locales/ka-formats.json @@ -305,5 +305,9 @@ "Could not read {name}: {e}": "ვერ წაიკითხა {name}: {e}", "Added {n} photo{}": "დაემატა ფოტო: {n}{:.0}", "Where should the Lightroom catalog “{catalog}” go?": "სად გადავიტანოთ Lightroom-ის კატალოგი „{catalog}“?", - "Merge into the open library “{library}” ({count} photo{})": "გაერთიანება ღია ბიბლიოთეკასთან „{library}“ (ფოტოები: {count}){:.0}" + "Merge into the open library “{library}” ({count} photo{})": "გაერთიანება ღია ბიბლიოთეკასთან „{library}“ (ფოტოები: {count}){:.0}", + "Move “{name}” into “{into}”": "„{name}“-ის გადატანა „{into}“-ში", + "Move “{name}” into “{into}”?": "გადავიტანოთ „{name}“ „{into}“-ში?", + "Photos in it and in the folders inside it: {count}": "ფოტო მასში და მის შიგნით არსებულ საქაღალდეებში: {count}", + "“{name}” is no longer there: nothing was moved": "„{name}“ აქ აღარ არის: არაფერი გადატანილა" } diff --git a/crates/ui-egui/locales/ka.json b/crates/ui-egui/locales/ka.json index 32c40770018..522b28a60a8 100644 --- a/crates/ui-egui/locales/ka.json +++ b/crates/ui-egui/locales/ka.json @@ -2734,5 +2734,9 @@ "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-ის კატალოგის იმპორტი", + "The library's own folder can't be moved": "ბიბლიოთეკის საკუთარი საქაღალდის გადატანა შეუძლებელია", + "A folder can't move into itself or a folder inside it": "საქაღალდის საკუთარ თავში ან მის შიგნით არსებულ საქაღალდეში გადატანა შეუძლებელია", + "The folder, its files and XMP sidecars move on disk. Edit → Undo moves it back.": "საქაღალდე, მისი ფაილები და XMP თანმხლები ფაილები დისკზე გადაადგილდება. რედაქტირება → დაბრუნება მას უკან დააბრუნებს.", + "Another library was opened since the folder was dropped: nothing was moved": "საქაღალდის ჩაგდების შემდეგ სხვა ბიბლიოთეკა გაიხსნა: არაფერი გადატანილა" } diff --git a/crates/ui-egui/locales/pl-formats.json b/crates/ui-egui/locales/pl-formats.json index 20c7f840d6e..9c9964a14c7 100644 --- a/crates/ui-egui/locales/pl-formats.json +++ b/crates/ui-egui/locales/pl-formats.json @@ -305,5 +305,9 @@ "Added {n} photo{}": "Dodano zdjęcia: {n}{:.0}", "Inside: {names}": "Wewnątrz: {names}", "Where should the Lightroom catalog “{catalog}” go?": "Dokąd zaimportować katalog Lightroom „{catalog}”?", - "Merge into the open library “{library}” ({count} photo{})": "Scal z otwartą biblioteką „{library}” (zdjęcia: {count}){:.0}" + "Merge into the open library “{library}” ({count} photo{})": "Scal z otwartą biblioteką „{library}” (zdjęcia: {count}){:.0}", + "Move “{name}” into “{into}”": "Przenieś „{name}” do „{into}”", + "Move “{name}” into “{into}”?": "Przenieść „{name}” do „{into}”?", + "Photos in it and in the folders inside it: {count}": "Zdjęcia w nim i w folderach w nim zawartych: {count}", + "“{name}” is no longer there: nothing was moved": "„{name}” już nie istnieje: nic nie zostało przeniesione" } diff --git a/crates/ui-egui/locales/pl.json b/crates/ui-egui/locales/pl.json index adac22e62ad..fa3897fd311 100644 --- a/crates/ui-egui/locales/pl.json +++ b/crates/ui-egui/locales/pl.json @@ -2283,5 +2283,9 @@ "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", + "The library's own folder can't be moved": "Nie można przenieść folderu samej biblioteki", + "A folder can't move into itself or a folder inside it": "Folderu nie można przenieść do samego siebie ani do folderu w nim zawartego", + "The folder, its files and XMP sidecars move on disk. Edit → Undo moves it back.": "Folder, jego pliki i pliki XMP zostaną przeniesione na dysku. Edycja → Cofnij przenosi go z powrotem.", + "Another library was opened since the folder was dropped: nothing was moved": "Po upuszczeniu folderu otwarto inną bibliotekę: nic nie zostało przeniesione" } diff --git a/crates/ui-egui/locales/pt-br-formats.json b/crates/ui-egui/locales/pt-br-formats.json index f17f2c0fd4b..b06417bfd92 100644 --- a/crates/ui-egui/locales/pt-br-formats.json +++ b/crates/ui-egui/locales/pt-br-formats.json @@ -305,5 +305,9 @@ "Could not read {name}: {e}": "Não foi possível ler {name}: {e}", "Added {n} photo{}": "{n} foto{0} adicionada{0}", "Where should the Lightroom catalog “{catalog}” go?": "Para onde vai o catálogo do Lightroom “{catalog}”?", - "Merge into the open library “{library}” ({count} photo{})": "Mesclar na biblioteca aberta “{library}” ({count} foto{})" + "Merge into the open library “{library}” ({count} photo{})": "Mesclar na biblioteca aberta “{library}” ({count} foto{})", + "Move “{name}” into “{into}”": "Mover “{name}” para “{into}”", + "Move “{name}” into “{into}”?": "Mover “{name}” para “{into}”?", + "Photos in it and in the folders inside it: {count}": "Fotos nela e nas pastas dentro dela: {count}", + "“{name}” is no longer there: nothing was moved": "“{name}” não está mais lá: nada foi movido" } diff --git a/crates/ui-egui/locales/pt-br.json b/crates/ui-egui/locales/pt-br.json index e84fb7615b7..60e1693eec0 100644 --- a/crates/ui-egui/locales/pt-br.json +++ b/crates/ui-egui/locales/pt-br.json @@ -2202,5 +2202,9 @@ "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", + "The library's own folder can't be moved": "A pasta da própria biblioteca não pode ser movida", + "A folder can't move into itself or a folder inside it": "Uma pasta não pode ser movida para dentro de si mesma ou de uma pasta dentro dela", + "The folder, its files and XMP sidecars move on disk. Edit → Undo moves it back.": "A pasta, seus arquivos e os arquivos XMP auxiliares são movidos no disco. Editar → Desfazer a traz de volta.", + "Another library was opened since the folder was dropped: nothing was moved": "Outra biblioteca foi aberta depois que a pasta foi solta: nada foi movido" } diff --git a/crates/ui-egui/locales/ru-formats.json b/crates/ui-egui/locales/ru-formats.json index 76b7af42764..92ff2b90bc8 100644 --- a/crates/ui-egui/locales/ru-formats.json +++ b/crates/ui-egui/locales/ru-formats.json @@ -305,5 +305,9 @@ "Could not read {name}: {e}": "Не удалось прочитать {name}: {e}", "Added {n} photo{}": "Добавлено фото: {n}{:.0}", "Where should the Lightroom catalog “{catalog}” go?": "Куда импортировать каталог Lightroom «{catalog}»?", - "Merge into the open library “{library}” ({count} photo{})": "Объединить с открытой библиотекой «{library}» (фото: {count}){:.0}" + "Merge into the open library “{library}” ({count} photo{})": "Объединить с открытой библиотекой «{library}» (фото: {count}){:.0}", + "Move “{name}” into “{into}”": "Переместить «{name}» в «{into}»", + "Move “{name}” into “{into}”?": "Переместить «{name}» в «{into}»?", + "Photos in it and in the folders inside it: {count}": "Фото в ней и в папках внутри неё: {count}", + "“{name}” is no longer there: nothing was moved": "«{name}» больше нет: ничего не перемещено" } diff --git a/crates/ui-egui/locales/ru.json b/crates/ui-egui/locales/ru.json index 306804df045..268bb4d801c 100644 --- a/crates/ui-egui/locales/ru.json +++ b/crates/ui-egui/locales/ru.json @@ -2349,5 +2349,9 @@ "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, прежде чем добавлять фото", + "The library's own folder can't be moved": "Папку самой библиотеки нельзя переместить", + "A folder can't move into itself or a folder inside it": "Папку нельзя переместить в саму себя или в папку внутри неё", + "The folder, its files and XMP sidecars move on disk. Edit → Undo moves it back.": "Папка, её файлы и XMP-файлы перемещаются на диске. Правка → Отменить вернёт её.", + "Another library was opened since the folder was dropped: nothing was moved": "После перетаскивания папки была открыта другая библиотека: ничего не перемещено" } diff --git a/crates/ui-egui/locales/sv-formats.json b/crates/ui-egui/locales/sv-formats.json index 9a71a0288c4..2b065b799fb 100644 --- a/crates/ui-egui/locales/sv-formats.json +++ b/crates/ui-egui/locales/sv-formats.json @@ -305,5 +305,9 @@ "Drop to review {n} item{} for import": "Släpp för att granska {n} objekt före import{:.0}", "Inside: {names}": "Inuti: {names}", "Where should the Lightroom catalog “{catalog}” go?": "Vart ska Lightroom-katalogen ”{catalog}” importeras?", - "Merge into the open library “{library}” ({count} photo{})": "Slå samman med det öppna biblioteket ”{library}” ({count} foto{:.0})" + "Merge into the open library “{library}” ({count} photo{})": "Slå samman med det öppna biblioteket ”{library}” ({count} foto{:.0})", + "Move “{name}” into “{into}”": "Flytta ”{name}” till ”{into}”", + "Move “{name}” into “{into}”?": "Flytta ”{name}” till ”{into}”?", + "Photos in it and in the folders inside it: {count}": "Foton i den och i mapparna i den: {count}", + "“{name}” is no longer there: nothing was moved": "”{name}” finns inte längre: inget flyttades" } diff --git a/crates/ui-egui/locales/sv.json b/crates/ui-egui/locales/sv.json index 66e69b7ba5d..3ef229f4ad1 100644 --- a/crates/ui-egui/locales/sv.json +++ b/crates/ui-egui/locales/sv.json @@ -2429,5 +2429,9 @@ "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", + "The library's own folder can't be moved": "Bibliotekets egen mapp kan inte flyttas", + "A folder can't move into itself or a folder inside it": "En mapp kan inte flyttas till sig själv eller till en mapp i den", + "The folder, its files and XMP sidecars move on disk. Edit → Undo moves it back.": "Mappen, dess filer och XMP-sidofiler flyttas på disken. Redigera → Ångra flyttar tillbaka den.", + "Another library was opened since the folder was dropped: nothing was moved": "Ett annat bibliotek öppnades efter att mappen släpptes: inget flyttades" } diff --git a/crates/ui-egui/locales/uk-formats.json b/crates/ui-egui/locales/uk-formats.json index 36022ac1a25..80fb0574d50 100644 --- a/crates/ui-egui/locales/uk-formats.json +++ b/crates/ui-egui/locales/uk-formats.json @@ -305,5 +305,9 @@ "Could not read {name}: {e}": "Не вдалося прочитати {name}: {e}", "Added {n} photo{}": "Додано фото: {n}{:.0}", "Where should the Lightroom catalog “{catalog}” go?": "Куди імпортувати каталог Lightroom «{catalog}»?", - "Merge into the open library “{library}” ({count} photo{})": "Об’єднати з відкритою бібліотекою «{library}» (фото: {count}){:.0}" + "Merge into the open library “{library}” ({count} photo{})": "Об’єднати з відкритою бібліотекою «{library}» (фото: {count}){:.0}", + "Move “{name}” into “{into}”": "Перемістити «{name}» до «{into}»", + "Move “{name}” into “{into}”?": "Перемістити «{name}» до «{into}»?", + "Photos in it and in the folders inside it: {count}": "Фото в ній і в теках усередині неї: {count}", + "“{name}” is no longer there: nothing was moved": "«{name}» більше немає: нічого не переміщено" } diff --git a/crates/ui-egui/locales/uk.json b/crates/ui-egui/locales/uk.json index ee694ed4fe0..53b97defa9a 100644 --- a/crates/ui-egui/locales/uk.json +++ b/crates/ui-egui/locales/uk.json @@ -2354,5 +2354,9 @@ "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, перш ніж додавати фото", + "The library's own folder can't be moved": "Теку самої бібліотеки не можна перемістити", + "A folder can't move into itself or a folder inside it": "Теку не можна перемістити в саму себе або в теку всередині неї", + "The folder, its files and XMP sidecars move on disk. Edit → Undo moves it back.": "Тека, її файли та XMP-файли переміщуються на диску. Редагування → Скасувати поверне її.", + "Another library was opened since the folder was dropped: nothing was moved": "Після перетягування теки було відкрито іншу бібліотеку: нічого не переміщено" } diff --git a/crates/ui-egui/locales/vi-formats.json b/crates/ui-egui/locales/vi-formats.json index d5e28bff060..0188ea07876 100644 --- a/crates/ui-egui/locales/vi-formats.json +++ b/crates/ui-egui/locales/vi-formats.json @@ -305,5 +305,9 @@ "Drop to import {n} preset{}": "Thả để nhập {n} thiết lập sẵn{:.0}", "Drop to review {n} item{} for import": "Thả để xem lại {n} mục trước khi nhập{:.0}", "Where should the Lightroom catalog “{catalog}” go?": "Nhập danh mục Lightroom «{catalog}» vào đâu?", - "Merge into the open library “{library}” ({count} photo{})": "Gộp vào thư viện đang mở «{library}» ({count} ảnh{:.0})" + "Merge into the open library “{library}” ({count} photo{})": "Gộp vào thư viện đang mở «{library}» ({count} ảnh{:.0})", + "Move “{name}” into “{into}”": "Di chuyển «{name}» vào «{into}»", + "Move “{name}” into “{into}”?": "Di chuyển «{name}» vào «{into}»?", + "Photos in it and in the folders inside it: {count}": "Ảnh trong đó và trong các thư mục bên trong: {count}", + "“{name}” is no longer there: nothing was moved": "«{name}» không còn nữa: không có gì được di chuyển" } diff --git a/crates/ui-egui/locales/vi.json b/crates/ui-egui/locales/vi.json index e4fb8feb81c..ae49ee7c2ab 100644 --- a/crates/ui-egui/locales/vi.json +++ b/crates/ui-egui/locales/vi.json @@ -2235,5 +2235,9 @@ "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", + "The library's own folder can't be moved": "Không thể di chuyển thư mục của chính thư viện", + "A folder can't move into itself or a folder inside it": "Không thể di chuyển thư mục vào chính nó hoặc vào thư mục bên trong nó", + "The folder, its files and XMP sidecars move on disk. Edit → Undo moves it back.": "Thư mục, các tệp và sidecar XMP của nó được di chuyển trên đĩa. Chỉnh sửa → Hoàn tác sẽ di chuyển lại.", + "Another library was opened since the folder was dropped: nothing was moved": "Một thư viện khác đã được mở sau khi thả thư mục: không có gì được di chuyển" } diff --git a/crates/ui-egui/locales/zh-hans-formats.json b/crates/ui-egui/locales/zh-hans-formats.json index 7406c39b866..f81c3e84cbc 100644 --- a/crates/ui-egui/locales/zh-hans-formats.json +++ b/crates/ui-egui/locales/zh-hans-formats.json @@ -305,5 +305,9 @@ "Could not read {name}: {e}": "无法读取 {name}:{e}", "Added {n} photo{}": "已添加 {n} 张照片{:.0}", "Where should the Lightroom catalog “{catalog}” go?": "Lightroom 目录“{catalog}”要导入到哪里?", - "Merge into the open library “{library}” ({count} photo{})": "合并到当前打开的图库“{library}”({count} 张照片){:.0}" + "Merge into the open library “{library}” ({count} photo{})": "合并到当前打开的图库“{library}”({count} 张照片){:.0}", + "Move “{name}” into “{into}”": "将“{name}”移到“{into}”", + "Move “{name}” into “{into}”?": "将“{name}”移到“{into}”?", + "Photos in it and in the folders inside it: {count}": "其中及其子文件夹中的照片:{count}", + "“{name}” is no longer there: nothing was moved": "“{name}”已不存在:未移动任何内容" } diff --git a/crates/ui-egui/locales/zh-hans.json b/crates/ui-egui/locales/zh-hans.json index 270af8a6251..bcde7c413cc 100644 --- a/crates/ui-egui/locales/zh-hans.json +++ b/crates/ui-egui/locales/zh-hans.json @@ -2200,5 +2200,9 @@ "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 目录的导入", + "The library's own folder can't be moved": "无法移动图库自身的文件夹", + "A folder can't move into itself or a folder inside it": "文件夹不能移到自身或其内部的文件夹中", + "The folder, its files and XMP sidecars move on disk. Edit → Undo moves it back.": "该文件夹、其文件和 XMP 附属文件会在磁盘上移动。编辑 → 撤销 可移回。", + "Another library was opened since the folder was dropped: nothing was moved": "拖放文件夹后打开了另一个图库:未移动任何内容" } diff --git a/crates/ui-egui/locales/zh-hant-formats.json b/crates/ui-egui/locales/zh-hant-formats.json index d5c4eb279a2..abf5c9fa90e 100644 --- a/crates/ui-egui/locales/zh-hant-formats.json +++ b/crates/ui-egui/locales/zh-hant-formats.json @@ -305,5 +305,9 @@ "Could not read {name}: {e}": "無法讀取 {name}:{e}", "Added {n} photo{}": "已加入 {n} 張照片{:.0}", "Where should the Lightroom catalog “{catalog}” go?": "Lightroom 目錄「{catalog}」要匯入到哪裡?", - "Merge into the open library “{library}” ({count} photo{})": "合併到目前開啟的照片庫「{library}」({count} 張照片){:.0}" + "Merge into the open library “{library}” ({count} photo{})": "合併到目前開啟的照片庫「{library}」({count} 張照片){:.0}", + "Move “{name}” into “{into}”": "將「{name}」移到「{into}」", + "Move “{name}” into “{into}”?": "將「{name}」移到「{into}」?", + "Photos in it and in the folders inside it: {count}": "其中及其子資料夾中的照片:{count}", + "“{name}” is no longer there: nothing was moved": "「{name}」已不存在:未移動任何內容" } diff --git a/crates/ui-egui/locales/zh-hant.json b/crates/ui-egui/locales/zh-hant.json index 0408e23ec87..a19a885c716 100644 --- a/crates/ui-egui/locales/zh-hant.json +++ b/crates/ui-egui/locales/zh-hant.json @@ -2157,5 +2157,9 @@ "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 目錄的匯入", + "The library's own folder can't be moved": "無法移動照片庫本身的資料夾", + "A folder can't move into itself or a folder inside it": "資料夾不能移到自身或其內部的資料夾中", + "The folder, its files and XMP sidecars move on disk. Edit → Undo moves it back.": "該資料夾、其檔案和 XMP 附屬檔案會在磁碟上移動。編輯 → 復原 可移回。", + "Another library was opened since the folder was dropped: nothing was moved": "拖放資料夾後開啟了另一個照片庫:未移動任何內容" } diff --git a/crates/ui-egui/src/app/frame.rs b/crates/ui-egui/src/app/frame.rs index 6e92091c780..b355c1a30c3 100644 --- a/crates/ui-egui/src/app/frame.rs +++ b/crates/ui-egui/src/app/frame.rs @@ -430,6 +430,7 @@ impl LightcraftApp { pick::poll(self, &ctx); panels::grid::drag_feedback(self, &ctx); panels::left::album_drag_feedback(self, &ctx); + panels::left::folder_drag_feedback(self, &ctx); panels::left::section_drag_feedback(self, &ctx); panels::keyword_list::drag_feedback(self, &ctx); panels::toast(self, &ctx); diff --git a/crates/ui-egui/src/dialogs.rs b/crates/ui-egui/src/dialogs.rs index 64628822031..0eb157f399d 100644 --- a/crates/ui-egui/src/dialogs.rs +++ b/crates/ui-egui/src/dialogs.rs @@ -270,6 +270,7 @@ fn dialog_title(app: &LightcraftApp, dlg: &Dialog) -> String { Dialog::Settings { .. } => "Settings", Dialog::ConfirmDelete { .. } => "Delete Photos", Dialog::MovePhotos { .. } => "Move Photos", + Dialog::MoveFolder { .. } => "Move Folder", Dialog::LightroomCatalog { .. } => "Lightroom Classic Catalog", Dialog::LightroomDestination { .. } => "Import Lightroom Catalog", Dialog::SaveEffect { .. } => "New Effect Preset", @@ -346,7 +347,7 @@ fn ok_label(app: &LightcraftApp, dlg: &Dialog, informational: bool, sam: &SamSta Dialog::FaceModel { .. } if !informational => "Install", Dialog::ConfirmDelete { .. } | Dialog::DeleteKeyword { .. } | Dialog::DeleteEffects { .. } => "Delete", Dialog::SaveEffect { .. } => "Create", - Dialog::MovePhotos { .. } => "Move", + Dialog::MovePhotos { .. } | Dialog::MoveFolder { .. } => "Move", // (not "Merge": that is photo merging, HDR / panorama, in some languages) Dialog::MoveKeyword { .. } => "Merge Keywords", Dialog::KeywordSet { .. } => "Save", @@ -483,10 +484,14 @@ fn confirmed(app: &mut LightcraftApp, ctx: &egui::Context, dlg: &mut Dialog) -> } closed = true; } - Err(e) if matches!(dlg, Dialog::MovePhotos { .. }) => { + Err(e) if matches!(dlg, Dialog::MovePhotos { .. } | Dialog::MoveFolder { .. }) => { app.toast(ctx, e); closed = true; } + Ok(r) if matches!(dlg, Dialog::MoveFolder { .. }) => { + crate::panels::left::toast_folder_moved(app, ctx, &r); + closed = true; + } // photos whose capture time doesn't read are left as they were: say so Ok(r) if matches!(dlg, Dialog::CaptureTime { .. }) && r["unreadable"].as_u64().is_some_and(|n| n > 0) => { app.toast(ctx, crate::i18n::tr("Photos whose capture time can't be read were left as they were")); @@ -1676,6 +1681,20 @@ fn move_photos_body(ui: &mut egui::Ui, t: &Tokens, dlg: &mut Dialog) { c.on_hover_text(crate::i18n::tr("Settings → Confirm before moving photos to another folder on disk turns it back on")); } +/// The body of the MoveFolder dialog. +fn move_folder_body(ui: &mut egui::Ui, t: &Tokens, dlg: &mut Dialog) { + let Dialog::MoveFolder { name, into_name, count, dont_ask, .. } = dlg else { return }; + ui.label(crate::i18n::tr_format!("Move “{name}” into “{into}”?", name = name, into = into_name)); + ui.label(egui::RichText::new(crate::i18n::tr_format!("Photos in it and in the folders inside it: {count}", count = count)).color(t.text_dim)); + ui.label( + egui::RichText::new(crate::i18n::tr("The folder, its files and XMP sidecars move on disk. Edit → Undo moves it back.")).color(t.text_dim), + ); + ui.add_space(4.0); + let c = ui.checkbox(dont_ask, crate::i18n::tr("Don't ask again")); + crate::widgets::register(ui, "check:moveDontAsk", c.rect); + c.on_hover_text(crate::i18n::tr("Settings → Confirm before moving photos to another folder on disk turns it back on")); +} + /// The body of the LightroomCatalog dialog. fn lightroom_catalog_body(app: &mut LightcraftApp, ui: &mut egui::Ui, t: &Tokens, dlg: &mut Dialog) { let Dialog::LightroomCatalog { folder, catalog } = dlg else { return }; @@ -1834,6 +1853,7 @@ fn dialog_content(app: &mut LightcraftApp, ui: &mut egui::Ui, t: &Tokens, body_m ui.label(egui::RichText::new(crate::i18n::tr("They can be restored from Recently Deleted until it is emptied.")).color(t.text_dim)); } Dialog::MovePhotos { .. } => move_photos_body(ui, t, dlg), + Dialog::MoveFolder { .. } => move_folder_body(ui, t, dlg), d @ Dialog::SynchronizeFolder { .. } => crate::sync::body(app, ui, d), Dialog::LightroomCatalog { .. } => lightroom_catalog_body(app, ui, t, dlg), d @ Dialog::LightroomDestination { .. } => crate::lightroom_destination::body(app, ui, d), diff --git a/crates/ui-egui/src/dialogs/confirm.rs b/crates/ui-egui/src/dialogs/confirm.rs index 6b8998c33c8..f8ad35c1f8d 100644 --- a/crates/ui-egui/src/dialogs/confirm.rs +++ b/crates/ui-egui/src/dialogs/confirm.rs @@ -206,6 +206,19 @@ pub fn confirm_dialog(app: &mut LightcraftApp, dlg: &Dialog) -> Result crate::merge::start_final(app, opts), Dialog::Import { opts } => crate::import::start(app, opts), Dialog::ConfirmDelete { .. } => app.run("photo.delete", json!({})), + Dialog::MoveFolder { path, into, dont_ask, library, .. } => { + // another library opened meanwhile (from the menu bar, an agent): the folder's photos + // in this one aren't the ones the question counted + if *library != app.session.library_generation() { + return Err(crate::i18n::tr("Another library was opened since the folder was dropped: nothing was moved").to_string()); + } + // only a move that happened turns the question off: the next one still asks after a refusal + let moved = crate::panels::left::run_folder_move(app, path, into)?; + if *dont_ask { + app.ui.settings.ask_before_move = false; + } + Ok(moved) + } Dialog::MovePhotos { ids, folder, dont_ask, library, .. } => { // another library opened meanwhile (from the menu bar, an agent): these numbers are // other photos there diff --git a/crates/ui-egui/src/panels/left.rs b/crates/ui-egui/src/panels/left.rs index 27b86aa0d58..37ce138c9c3 100644 --- a/crates/ui-egui/src/panels/left.rs +++ b/crates/ui-egui/src/panels/left.rs @@ -23,7 +23,10 @@ pub use albums::{album_drag_feedback, auto_scroll_speed}; use albums::{albums_rows, drag_auto_scroll}; pub(crate) use dates::browse_all_photos; use dates::date_rows; -pub(crate) use folders::{folder_row_of, move_photos, moved_text}; +pub use folders::folder_drag_feedback; +#[cfg(test)] +pub(crate) use folders::folder_drop_refusal; +pub(crate) use folders::{folder_row_of, move_photos, moved_text, run_folder_move, toast_folder_moved}; use folders::{folder_rows, reveal_chosen}; use keywords::keyword_rows; pub(crate) use local::{fs_cached, fs_cached_running, same_folder}; diff --git a/crates/ui-egui/src/panels/left/albums.rs b/crates/ui-egui/src/panels/left/albums.rs index 92498eb0233..d608def3ac3 100644 --- a/crates/ui-egui/src/panels/left/albums.rs +++ b/crates/ui-egui/src/panels/left/albums.rs @@ -150,7 +150,7 @@ pub fn auto_scroll_speed(y: f32, top: f32, bottom: f32) -> f32 { /// pointer is near its top or bottom edge, so rows beyond the visible part can be reached. Call /// inside the scroll area. pub(super) fn drag_auto_scroll(app: &LightcraftApp, ui: &egui::Ui) { - if app.ui.dragging_album.is_none() && app.ui.dragging_photos.is_none() && app.ui.dragging_section.is_none() { + if app.ui.dragging_album.is_none() && app.ui.dragging_photos.is_none() && app.ui.dragging_folder.is_none() && app.ui.dragging_section.is_none() { return; } let view = ui.clip_rect(); diff --git a/crates/ui-egui/src/panels/left/folders.rs b/crates/ui-egui/src/panels/left/folders.rs index 20c1bbce130..f4f01024ff2 100644 --- a/crates/ui-egui/src/panels/left/folders.rs +++ b/crates/ui-egui/src/panels/left/folders.rs @@ -1,7 +1,7 @@ use super::albums::pointer_over_row; use super::local::{same_folder, subfolders}; use super::rows::{INDENT_STEP, LIBFOLDER_REVEALED, Row, out_of_sight, set_tree_open, tree_open, tree_toggle}; -use super::{Album, FolderNode, Icon, LibrarySource, LightcraftApp, Tokens, json, register, vec2}; +use super::{Album, FolderNode, Icon, LibrarySource, LightcraftApp, Sense, Tokens, json, register, vec2}; /// A folder on disk with a disclosure triangle: click browses it, the triangle lists its /// subfolders. In the tree that holds the folder being browsed (`reveal`), the folders on the @@ -341,8 +341,22 @@ fn folder_row(app: &mut LightcraftApp, ui: &mut egui::Ui, n: &FolderNode, id: &s None => name.to_string(), }; let mark = n.label.map(crate::theme::label_color); - let resp = Row::new(id, Icon::Folder, name).spoken(&spoken).count(Some(n.count)).selected(sel).indent(indent).mark(mark).show(app, ui); + let resp = Row::new(id, Icon::Folder, name) + .spoken(&spoken) + .count(Some(n.count)) + .selected(sel) + .indent(indent) + .sense(Sense::click_and_drag()) + .mark(mark) + .show(app, ui); + // a folder inside a disk can be picked up (egui starts the drag after a few points of + // movement, so a click still chooses the row); a disk, or a row covering several, can't be moved + if resp.drag_started_by(egui::PointerButton::Primary) && n.selectable && !n.volume { + app.ui.dragging_folder = Some(n.path.clone()); + app.ui.dragging_folder_library = app.session.library_generation(); + } folder_drop_target(app, ui, &resp, n, open_id, open); + folder_drag_target(app, ui, &resp, n, open_id, open); let mut toggled = false; if !n.children.is_empty() { let tr = tree_toggle(ui, &resp, indent, open_id, open, format!("libraryFolderToggle:{}", n.path)); @@ -431,6 +445,145 @@ fn folder_drop_target(app: &mut LightcraftApp, ui: &mut egui::Ui, resp: &egui::R } } +/// Why the Folders row `target` can't take the folder `from` dragged onto it, from what the +/// sidebar knows (no disk is read: the move's own refusals, such as a disk that isn't connected or +/// a name already taken, come back from `folder.move` when the drop runs). `Ok` when a drop +/// there asks to move it. +pub(crate) fn folder_drop_refusal(app: &LightcraftApp, from: &str, target: &FolderNode) -> Result<(), String> { + let src = std::path::Path::new(from); + if app.session.library.as_ref().is_some_and(|l| l.dir.starts_with(src) || src.starts_with(&l.dir)) { + return Err(crate::i18n::tr("The library's own folder can't be moved").to_string()); + } + if !target.selectable { + return Err(crate::i18n::tr("This row covers more than one disk: drop on a folder inside it").to_string()); + } + if lightcraft_catalog::query::folder_within(&target.path, from) { + return Err(crate::i18n::tr("A folder can't move into itself or a folder inside it").to_string()); + } + let parent = src.parent().map(|p| p.to_string_lossy().to_string()); + if parent.as_deref().is_some_and(|p| same_folder(p, &target.path)) { + return Err(crate::i18n::tr_format!("Already in “{}”", folder_name(&target.path, &target.name))); + } + Ok(()) +} + +/// The Folders row being dragged. A drag doesn't outlive the library it was picked up in: when +/// another one opens meanwhile it is given up. +fn dragged_folder(app: &mut LightcraftApp) -> Option { + if app.ui.dragging_folder.is_some() && app.ui.dragging_folder_library != app.session.library_generation() { + app.ui.dragging_folder = None; + } + app.ui.dragging_folder.clone() +} + +/// A folder's own name (`fallback` when the path has none). +fn folder_name(path: &str, fallback: &str) -> String { + std::path::Path::new(path).file_name().map_or_else(|| fallback.to_string(), |f| f.to_string_lossy().to_string()) +} + +/// A Folders row while another Folders row is dragged: a drop moves that folder into this one on +/// disk (`folder.move`, one undo step), asked first unless the person said not to. The row lights +/// up and the dragged label says where the folder will go; a row that can't take it shows the +/// not-allowed cursor with the reason in the label, and a release says it too. Held over a +/// closed row, it opens, so a folder inside it can be reached. +fn folder_drag_target(app: &mut LightcraftApp, ui: &mut egui::Ui, resp: &egui::Response, n: &FolderNode, open_id: egui::Id, open: &mut bool) { + let Some(from) = dragged_folder(app) else { return }; + // only where the row can be seen: not scrolled out of the sidebar or beneath the pinned header + if !pointer_over_row(ui, resp.rect) { + return; + } + // not under the folder's own drag: rows opening there would shift away from the pointer + if !lightcraft_catalog::query::folder_within(&n.path, &from) { + spring_open(ui, n, open_id, open); + } + let released = ui.input(|i| i.pointer.primary_released()); + let name = folder_name(&from, &from); + if let Err(why) = folder_drop_refusal(app, &from, n) { + crate::panels::grid::drag_hint(ui.ctx(), why.clone()); + ui.ctx().set_cursor_icon(egui::CursorIcon::NotAllowed); + if released { + // letting go over the row it was picked up on (a slow click, a wobble) is no request + // to move it anywhere: it says nothing + if !same_folder(&from, &n.path) { + app.toast(ui.ctx(), why); + } + app.ui.dragging_folder = None; + } + return; + } + let into_name = folder_name(&n.path, &n.name); + crate::panels::grid::drag_hint(ui.ctx(), crate::i18n::tr_format!("Move “{name}” into “{into}”", name = name, into = into_name)); + let t = Tokens::get(ui.ctx()); + ui.painter().rect_stroke(resp.rect.shrink2(vec2(8.0, 1.0)), 4.0, egui::Stroke::new(1.5, t.accent), egui::StrokeKind::Inside); + if !released { + return; + } + app.ui.dragging_folder = None; + if app.ui.settings.ask_before_move { + let tree = app.caches.folder_tree(&app.session.catalog); + let count = folder_row_of(&tree, &from).map_or(0, |f| f.count); + app.ui.dialog = Some(crate::state::Dialog::MoveFolder { + name: lightcraft_catalog::folders::folder_label(&from), + into_name: lightcraft_catalog::folders::folder_label(&n.path), + path: from, + into: n.path.clone(), + count, + dont_ask: false, + library: app.session.library_generation(), + }); + } else { + match run_folder_move(app, &from, &n.path) { + Ok(r) => toast_folder_moved(app, ui.ctx(), &r), + Err(e) => app.toast(ui.ctx(), e), + } + } +} + +/// `folder.move` of `from` into `into`, unless `into` isn't a folder any more (renamed or deleted +/// meanwhile, its disk gone): the move would make it again and go in. Nothing is moved then. +pub(crate) fn run_folder_move(app: &mut LightcraftApp, from: &str, into: &str) -> Result { + if !std::path::Path::new(into).is_dir() { + return Err(crate::i18n::tr_format!("“{name}” is no longer there: nothing was moved", name = folder_name(into, into))); + } + app.run("folder.move", json!({"path": from, "into": into})) +} + +/// What a finished folder move (`folder.move`'s result `r`) says. +pub(crate) fn toast_folder_moved(app: &mut LightcraftApp, ctx: &egui::Context, r: &serde_json::Value) { + app.toast(ctx, crate::i18n::tr_format!("Moved; {} photo(s) relinked", r["relinked"])); +} + +/// While a Folders row is dragged: its name at the pointer, or what the row under it says (where +/// the folder would go, or why it can't). The drag ends when the button is up (the drop targets +/// act on the release frame, before this runs) and Esc gives it up. +pub fn folder_drag_feedback(app: &mut LightcraftApp, ctx: &egui::Context) { + let Some(from) = dragged_folder(app) else { return }; + let (released, down, pos, esc) = + ctx.input(|i| (i.pointer.primary_released(), i.pointer.primary_down(), i.pointer.latest_pos(), i.key_pressed(egui::Key::Escape))); + if released || !down || esc { + app.ui.dragging_folder = None; + return; + } + let Some(pos) = pos else { return }; + let frame = ctx.cumulative_frame_nr(); + let hint = ctx.data(|d| d.get_temp::<(u64, String)>(egui::Id::unique("drag-photos-hint"))).filter(|(f, _)| *f == frame).map(|(_, text)| text); + let text = hint.unwrap_or_else(|| folder_name(&from, &from)); + let t = Tokens::get(ctx); + // (a row that can't take the folder asked for the not-allowed cursor while it was drawn) + if ctx.output(|o| o.cursor_icon) != egui::CursorIcon::NotAllowed { + ctx.set_cursor_icon(egui::CursorIcon::Grabbing); + } + egui::Area::new(egui::Id::unique("drag-folder")).order(egui::Order::Tooltip).interactable(false).fixed_pos(pos + vec2(14.0, 10.0)).show( + ctx, + |ui| { + egui::Frame::NONE.fill(t.accent).corner_radius(10.0).inner_margin(egui::Margin::symmetric(9, 3)).show(ui, |ui| { + let label = ui.add(egui::Label::new(egui::RichText::new(text).color(egui::Color32::WHITE).font(t.semibold(12.0))).extend()); + crate::widgets::register(ui, "dragFolder", label.rect); + }); + }, + ); +} + /// Photos dragged over the closed row `n` for [`SPRING_OPEN_SECONDS`] open it (a row with folders /// inside it). Restarts on each row the pointer comes to, and when it comes back to one after /// leaving it (or after another drag). diff --git a/crates/ui-egui/src/state.rs b/crates/ui-egui/src/state.rs index 38b50902c50..0a2d44e4cf2 100644 --- a/crates/ui-egui/src/state.rs +++ b/crates/ui-egui/src/state.rs @@ -223,6 +223,13 @@ pub struct UiState { /// An album or folder row being dragged in the sidebar (dropped on a folder to move it there). #[serde(skip)] pub dragging_album: Option, + /// A Folders row being dragged in the sidebar (its path; dropped on another row to move the + /// folder there on disk). + #[serde(skip)] + pub dragging_folder: Option, + /// The library `dragging_folder` was picked up in (`Session::library_generation`). + #[serde(skip)] + pub dragging_folder_library: u64, /// A sidebar section being dragged by its header (dropped between sections to move it there). #[serde(skip)] pub dragging_section: Option, @@ -438,6 +445,8 @@ impl Default for UiState { reveal_keyword: None, reveal_folder: None, dragging_album: None, + dragging_folder: None, + dragging_folder_library: 0, dragging_section: None, curve_channel: "parametric".into(), mixer_mode: "hue".into(), diff --git a/crates/ui-egui/src/state/dialog.rs b/crates/ui-egui/src/state/dialog.rs index 7f9226b6e49..17911689583 100644 --- a/crates/ui-egui/src/state/dialog.rs +++ b/crates/ui-egui/src/state/dialog.rs @@ -313,6 +313,20 @@ pub enum Dialog { /// numbered per library, so in another one they name other photos. library: u64, }, + /// Confirm moving a Folders row dropped on another row: the folder `path` goes into `into` on + /// disk (`folder.move`). `name` and `into_name` are as the question says them; `count` is + /// the library photos in the folder and the folders inside it. + MoveFolder { + path: String, + into: String, + name: String, + into_name: String, + count: usize, + dont_ask: bool, + /// The library the row was dragged in (`Session::library_generation`): the question's + /// folder and photo count belong to it. + library: u64, + }, /// Confirm taking a folder's photos out of the library (`library.removeFolder`). RemoveFolder { path: String, diff --git a/crates/ui-egui/src/tests.rs b/crates/ui-egui/src/tests.rs index 3a102a29a90..ed931bf3594 100644 --- a/crates/ui-egui/src/tests.rs +++ b/crates/ui-egui/src/tests.rs @@ -26,6 +26,7 @@ mod empty_library; mod error_kinds; mod filmstrip; mod focus_point; +mod folder_drag; mod folder_drop; mod grading; mod grid; diff --git a/crates/ui-egui/src/tests/folder_drag.rs b/crates/ui-egui/src/tests/folder_drag.rs new file mode 100644 index 00000000000..0ffc83759ae --- /dev/null +++ b/crates/ui-egui/src/tests/folder_drag.rs @@ -0,0 +1,371 @@ +//! A Folders row dragged onto another Folders row moves that folder there on disk: a click still +//! chooses the row, a drag lights up the rows that can take it and says why the others can't, a +//! drop asks first (unless the person said not to), then moves it (one undo step). Esc gives the +//! drag up. + +use std::path::{Path, PathBuf}; + +use egui::Pos2; +use serde_json::json; + +use crate::headless::Headless; +use crate::tests::folder_drop::{app, click, folder_key, folder_row, glide, hint, id_of, press, release, toast}; + +/// `root` with the folders `trip` (a photo, and `trip/sub` with one), `home` and `archive` (one +/// photo each), each opened in the sidebar. +fn tree(tag: &str) -> (Headless, PathBuf) { + let (root, trip, home) = crate::tests::folder_drop::folders(&format!("drag-{tag}")); + let archive = root.join("archive"); + let sub = trip.join("sub"); + for dir in [&archive, &sub] { + std::fs::create_dir_all(dir).unwrap(); + } + std::fs::copy(home.join("garden.png"), archive.join("vault.png")).unwrap(); + std::fs::copy(home.join("garden.png"), sub.join("deep.png")).unwrap(); + let mut h = + app(&[(trip.join("beach.png"), false), (sub.join("deep.png"), false), (home.join("garden.png"), false), (archive.join("vault.png"), false)]); + click(&mut h, &format!("libraryFolderToggle:{}", folder_key(&root))); + // (opened as a reveal does: the drag tests are about what comes after, not the triangle) + let key = lightcraft_catalog::query::folder_key(&folder_key(&trip)); + h.view.ctx.data_mut(|d| d.insert_temp(egui::Id::unique(("libfolder-open", key)), true)); + for _ in 0..3 { + h.step(); + } + assert!(folder_row(&h, &trip.join("sub")).is_some(), "the folder is opened to show the one inside it"); + (h, root) +} + +fn centre(h: &Headless, dir: &Path) -> Pos2 { + folder_row(h, dir) + .unwrap_or_else(|| { + panic!( + "no row for {}: {:?}", + dir.display(), + h.app.widgets.iter().filter(|(w, _)| w.starts_with("source:libfolder")).map(|(w, _)| w).collect::>() + ) + }) + .center() +} + +/// Pick up the row of `from` and bring the pointer, still pressed, over the row of `to`. +fn drag_over(h: &mut Headless, from: &Path, to: &Path) { + // picked up beside the middle, so a drag onto the row it started on moves the pointer too + let (a, b) = (centre(h, from) + egui::vec2(24.0, 0.0), centre(h, to)); + press(h, a); + glide(h, a, b); +} + +#[test] +fn a_click_chooses_the_row_and_a_drag_picks_it_up() { + let (mut h, root) = tree("start"); + let (trip, home) = (root.join("trip"), root.join("home")); + // a click on a row is still a click + let at = centre(&h, &home); + press(&mut h, at); + assert_eq!(h.app.ui.dragging_folder, None, "pressed, not moved"); + release(&mut h, at); + assert_eq!(h.app.ui.dragging_folder, None); + assert_eq!(h.app.session.library_folder.as_deref().map(|f| folder_key(Path::new(f))), Some(folder_key(&home)), "chosen"); + // a few points of movement are still a click; further, the folder is picked up + let at = centre(&h, &trip); + press(&mut h, at); + h.app.synthetic.push(egui::Event::PointerMoved(at + egui::vec2(2.0, 0.0))); + h.step(); + assert_eq!(h.app.ui.dragging_folder, None, "below the drag threshold"); + glide(&mut h, at, at + egui::vec2(0.0, 60.0)); + assert_eq!(h.app.ui.dragging_folder.as_deref().map(|f| folder_key(Path::new(f))), Some(folder_key(&trip))); + release(&mut h, at + egui::vec2(0.0, 60.0)); + assert_eq!(h.app.ui.dragging_folder, None, "the drag ended with the button"); + let _ = std::fs::remove_dir_all(&root); +} + +#[test] +fn a_folder_dropped_on_another_asks_then_moves_and_undo_brings_it_back() { + let (mut h, root) = tree("move"); + let (trip, archive) = (root.join("trip"), root.join("archive")); + drag_over(&mut h, &trip, &archive); + assert_eq!(hint(&h).as_deref(), Some("Move “trip” into “archive”")); + let at = centre(&h, &archive); + release(&mut h, at); + // it asks first, naming both folders and the photos that go with it + let Some(crate::state::Dialog::MoveFolder { name, into_name, count, .. }) = h.app.ui.dialog.clone() else { panic!("{:?}", h.app.ui.dialog) }; + assert_eq!( + (name.as_str(), into_name.as_str(), count), + ( + &format!("{}/trip", root.file_name().unwrap().to_string_lossy())[..], + &format!("{}/archive", root.file_name().unwrap().to_string_lossy())[..], + 2 + ) + ); + assert!(trip.join("beach.png").is_file(), "not before Move"); + h.step(); + click(&mut h, "button:dialogOk"); + assert!(archive.join("trip").join("beach.png").is_file() && !trip.exists(), "moved on disk"); + let beach = id_of(&h, "beach.png"); + let photo = h.app.session.catalog.photo(lightcraft_catalog::PhotoId(beach)).unwrap(); + assert!(matches!(&photo.source, lightcraft_catalog::Source::File { path } if Path::new(path) == archive.join("trip").join("beach.png"))); + assert_eq!(toast(&h), "Moved; 2 photo(s) relinked"); + // one Undo moves it back + h.app.run("edit.undo", json!({})).unwrap(); + assert!(trip.join("beach.png").is_file() && !archive.join("trip").exists(), "back where it was"); + let _ = std::fs::remove_dir_all(&root); +} + +#[test] +fn cancelling_the_question_moves_nothing() { + let (mut h, root) = tree("cancel"); + let (trip, archive) = (root.join("trip"), root.join("archive")); + drag_over(&mut h, &trip, &archive); + let at = centre(&h, &archive); + release(&mut h, at); + assert!(matches!(h.app.ui.dialog, Some(crate::state::Dialog::MoveFolder { .. }))); + let undo = h.app.session.undo.len(); + h.step(); + click(&mut h, "button:dialogCancel"); + assert!(h.app.ui.dialog.is_none()); + assert!(trip.is_dir() && !archive.join("trip").exists()); + assert_eq!(h.app.session.undo.len(), undo); + let _ = std::fs::remove_dir_all(&root); +} + +#[test] +fn a_row_that_cannot_take_the_folder_says_why_and_a_drop_changes_nothing() { + let (mut h, root) = tree("refuse"); + let (trip, sub) = (root.join("trip"), root.join("trip").join("sub")); + let undo = h.app.session.undo.len(); + // onto itself, onto a folder inside it, and onto the folder it is in already + assert!(folder_row(&h, &sub).is_some(), "sub is listed to start with"); + for (target, reason) in [ + (&trip, "A folder can't move into itself or a folder inside it".to_string()), + (&sub, "A folder can't move into itself or a folder inside it".to_string()), + (&root, format!("Already in “{}”", root.file_name().unwrap().to_string_lossy())), + ] { + drag_over(&mut h, &trip, target); + assert_eq!(hint(&h), Some(reason.clone()), "over {}", target.display()); + assert_eq!(h.last_cursor, egui::CursorIcon::NotAllowed, "the pointer says so too"); + let at = centre(&h, target); + release(&mut h, at); + // (letting go over the row it was picked up on is a slow click: it says nothing) + assert_eq!(toast(&h), if target == &trip { String::new() } else { reason }, "over {}", target.display()); + assert!(h.app.ui.dialog.is_none(), "no question for what can't be done"); + assert!(trip.join("beach.png").is_file() && sub.join("deep.png").is_file(), "nothing moved"); + assert_eq!(h.app.session.undo.len(), undo); + assert_eq!(h.app.ui.dragging_folder, None); + } + let _ = std::fs::remove_dir_all(&root); +} + +#[test] +fn the_librarys_own_folder_is_refused_as_what_is_dragged() { + let (mut h, root) = tree("library"); + let lib = root.join("home").join("mylib"); + std::fs::create_dir_all(&lib).unwrap(); + h.app.session.open_library(&lib, false).unwrap(); + // home holds the library: dragging it anywhere is refused + let node = |dir: &Path| lightcraft_catalog::FolderNode { + name: dir.file_name().unwrap().to_string_lossy().to_string(), + path: folder_key(dir), + count: 1, + own: 1, + volume: false, + selectable: true, + label: None, + children: Vec::new(), + }; + let refusal = crate::panels::left::folder_drop_refusal(&h.app, &folder_key(&root.join("home")), &node(&root.join("archive"))); + assert_eq!(refusal, Err("The library's own folder can't be moved".to_string())); + // a folder elsewhere may still go into any other row + assert_eq!(crate::panels::left::folder_drop_refusal(&h.app, &folder_key(&root.join("archive")), &node(&root.join("trip"))), Ok(())); + let _ = std::fs::remove_dir_all(&root); +} + +#[test] +fn escape_gives_the_drag_up() { + let (mut h, root) = tree("escape"); + let (trip, archive) = (root.join("trip"), root.join("archive")); + drag_over(&mut h, &trip, &archive); + assert!(h.app.ui.dragging_folder.is_some()); + h.events.push(egui::Event::Key { key: egui::Key::Escape, physical_key: None, pressed: true, repeat: false, modifiers: egui::Modifiers::NONE }); + h.step(); + assert_eq!(h.app.ui.dragging_folder, None, "given up"); + let at = centre(&h, &archive); + release(&mut h, at); + assert!(h.app.ui.dialog.is_none(), "a release after Esc asks nothing"); + assert!(trip.is_dir() && !archive.join("trip").exists()); + let _ = std::fs::remove_dir_all(&root); +} + +#[test] +fn with_the_question_turned_off_the_drop_moves_at_once() { + let (mut h, root) = tree("noask"); + let (trip, archive) = (root.join("trip"), root.join("archive")); + h.app.ui.settings.ask_before_move = false; + drag_over(&mut h, &trip, &archive); + let at = centre(&h, &archive); + release(&mut h, at); + assert!(h.app.ui.dialog.is_none(), "not asked"); + assert!(archive.join("trip").join("beach.png").is_file() && !trip.exists(), "moved at once"); + assert_eq!(toast(&h), "Moved; 2 photo(s) relinked"); + h.app.run("edit.undo", json!({})).unwrap(); + assert!(trip.join("beach.png").is_file(), "one Undo"); + let _ = std::fs::remove_dir_all(&root); +} + +#[test] +fn a_move_the_disk_refuses_says_why_in_the_message() { + let (mut h, root) = tree("taken"); + let (trip, archive) = (root.join("trip"), root.join("archive")); + // a folder of that name is already there: the move's own refusal reaches the person + std::fs::create_dir_all(archive.join("trip")).unwrap(); + h.app.ui.settings.ask_before_move = false; + drag_over(&mut h, &trip, &archive); + let at = centre(&h, &archive); + release(&mut h, at); + assert!(toast(&h).contains("already exists"), "{}", toast(&h)); + assert!(trip.join("beach.png").is_file(), "nothing moved"); + let _ = std::fs::remove_dir_all(&root); +} + +#[test] +fn only_the_primary_button_picks_a_row_up() { + let (mut h, root) = tree("secondary"); + let at = centre(&h, &root.join("trip")); + h.app.synthetic.push(egui::Event::PointerMoved(at)); + h.app.synthetic.push(egui::Event::PointerButton { + pos: at, + button: egui::PointerButton::Secondary, + pressed: true, + modifiers: egui::Modifiers::NONE, + }); + h.step(); + glide(&mut h, at, at + egui::vec2(0.0, 80.0)); + assert_eq!(h.app.ui.dragging_folder, None, "the context menu's button doesn't move folders"); + let _ = std::fs::remove_dir_all(&root); +} + +#[test] +fn a_question_left_open_while_another_library_opens_moves_nothing() { + let (mut h, root) = tree("other-library"); + let (trip, archive) = (root.join("trip"), root.join("archive")); + drag_over(&mut h, &trip, &archive); + let at = centre(&h, &archive); + release(&mut h, at); + assert!(matches!(h.app.ui.dialog, Some(crate::state::Dialog::MoveFolder { .. }))); + // the menu bar or an agent opens another library behind the question + let lib = root.join("home").join("mylib"); + std::fs::create_dir_all(&lib).unwrap(); + h.app.session.open_library(&lib, false).unwrap(); + h.step(); + click(&mut h, "button:dialogOk"); + assert!(trip.join("beach.png").is_file() && !archive.join("trip").exists(), "nothing moved"); + assert!(toast(&h).starts_with("Another library was opened"), "{}", toast(&h)); + let _ = std::fs::remove_dir_all(&root); +} + +#[test] +fn a_destination_that_went_away_meanwhile_is_not_made_again() { + let (mut h, root) = tree("gone"); + let (trip, archive) = (root.join("trip"), root.join("archive")); + drag_over(&mut h, &trip, &archive); + let at = centre(&h, &archive); + release(&mut h, at); + assert!(matches!(h.app.ui.dialog, Some(crate::state::Dialog::MoveFolder { .. }))); + // renamed in the file manager while the question is up + std::fs::rename(&archive, root.join("archive-old")).unwrap(); + h.step(); + click(&mut h, "button:dialogOk"); + assert!(toast(&h).contains("no longer there"), "{}", toast(&h)); + assert!(trip.join("beach.png").is_file(), "nothing moved"); + assert!(!archive.exists(), "and the destination was not made again"); + // the same with no question + std::fs::rename(root.join("archive-old"), &archive).unwrap(); + h.step(); + h.app.ui.settings.ask_before_move = false; + h.app.ui.toast = None; + drag_over(&mut h, &trip, &archive); + std::fs::rename(&archive, root.join("archive-old")).unwrap(); + let at = centre(&h, &archive); + release(&mut h, at); + assert!(toast(&h).contains("no longer there"), "{}", toast(&h)); + assert!(trip.join("beach.png").is_file() && !archive.exists()); + let _ = std::fs::remove_dir_all(&root); +} + +#[test] +fn dont_ask_again_is_kept_only_by_a_move_that_happened() { + let (mut h, root) = tree("dont-ask-fails"); + let (trip, archive) = (root.join("trip"), root.join("archive")); + drag_over(&mut h, &trip, &archive); + let at = centre(&h, &archive); + release(&mut h, at); + let Some(crate::state::Dialog::MoveFolder { dont_ask, .. }) = &mut h.app.ui.dialog else { panic!("{:?}", h.app.ui.dialog) }; + *dont_ask = true; + // the destination goes away while the question is up, so the move fails + std::fs::rename(&archive, root.join("archive-old")).unwrap(); + h.step(); + click(&mut h, "button:dialogOk"); + assert!(toast(&h).contains("no longer there"), "{}", toast(&h)); + assert!(h.app.ui.settings.ask_before_move, "a move that did not happen does not turn the question off"); + let _ = std::fs::remove_dir_all(&root); +} + +#[test] +fn a_release_of_another_button_in_the_middle_of_a_drag_is_not_a_drop() { + let (mut h, root) = tree("secondary-release"); + let (trip, archive) = (root.join("trip"), root.join("archive")); + h.app.ui.settings.ask_before_move = false; + drag_over(&mut h, &trip, &archive); + let at = centre(&h, &archive); + for pressed in [true, false] { + h.app.synthetic.push(egui::Event::PointerButton { + pos: at, + button: egui::PointerButton::Secondary, + pressed, + modifiers: egui::Modifiers::NONE, + }); + h.step(); + } + assert!(h.app.ui.dragging_folder.is_some(), "still dragging"); + assert!(trip.join("beach.png").is_file(), "nothing moved"); + let _ = std::fs::remove_dir_all(&root); +} + +#[test] +fn a_closed_folder_does_not_open_under_its_own_drag() { + let (mut h, root) = tree("own-spring"); + let trip = root.join("trip"); + let key = lightcraft_catalog::query::folder_key(&folder_key(&trip)); + h.view.ctx.data_mut(|d| d.insert_temp(egui::Id::unique(("libfolder-open", key)), false)); + h.step(); + h.step(); + assert!(folder_row(&h, &trip.join("sub")).is_none(), "closed"); + let a = centre(&h, &trip) + egui::vec2(24.0, 0.0); + press(&mut h, a); + glide(&mut h, a, a + egui::vec2(0.0, 2.0)); + let b = centre(&h, &trip); + glide(&mut h, a, b); + for _ in 0..60 { + h.step(); + } + assert!(folder_row(&h, &trip.join("sub")).is_none(), "still closed after waiting over its own row"); + let _ = std::fs::remove_dir_all(&root); +} + +#[test] +fn a_drag_does_not_outlive_the_library_it_started_in() { + let (mut h, root) = tree("drag-library"); + let (trip, archive) = (root.join("trip"), root.join("archive")); + h.app.ui.settings.ask_before_move = false; + drag_over(&mut h, &trip, &archive); + assert!(h.app.ui.dragging_folder.is_some()); + let at = centre(&h, &archive); + // another library opens (the menu bar, an agent) while the button is still down + let lib = root.join("home").join("mylib"); + std::fs::create_dir_all(&lib).unwrap(); + h.app.session.open_library(&lib, false).unwrap(); + h.step(); + assert_eq!(h.app.ui.dragging_folder, None, "given up"); + release(&mut h, at); + assert!(trip.join("beach.png").is_file() && !archive.join("trip").exists(), "nothing moved"); + let _ = std::fs::remove_dir_all(&root); +} diff --git a/crates/ui-egui/src/tests/folder_drop.rs b/crates/ui-egui/src/tests/folder_drop.rs index b7a51513174..c3abe97f412 100644 --- a/crates/ui-egui/src/tests/folder_drop.rs +++ b/crates/ui-egui/src/tests/folder_drop.rs @@ -12,7 +12,7 @@ use crate::headless::Headless; use crate::{LightcraftApp, Services}; /// Folders `trip` and `home` in a fresh temporary folder, with a photo file in each. -fn folders(tag: &str) -> (PathBuf, PathBuf, PathBuf) { +pub(crate) fn folders(tag: &str) -> (PathBuf, PathBuf, PathBuf) { let root = std::env::temp_dir().join(format!("lc-folder-drop-{tag}-{}", std::process::id())); let _ = std::fs::remove_dir_all(&root); let (trip, home) = (root.join("trip"), root.join("home")); @@ -27,7 +27,7 @@ fn folders(tag: &str) -> (PathBuf, PathBuf, PathBuf) { /// The photos at `paths` in the catalog (`local`: browsed, not in the library), in the grid with /// the sidebar out, tall enough for the Folders section. -fn app(paths: &[(PathBuf, bool)]) -> Headless { +pub(crate) fn app(paths: &[(PathBuf, bool)]) -> Headless { use lightcraft_catalog::{Op, Photo, Source}; let mut session = lightcraft_engine::Session::new().with_fs(); for (path, local) in paths { @@ -46,24 +46,24 @@ fn app(paths: &[(PathBuf, bool)]) -> Headless { h } -fn widget(h: &Headless, id: &str) -> Option { +pub(crate) fn widget(h: &Headless, id: &str) -> Option { h.app.widgets.iter().find(|(w, _)| w == id).map(|(_, r)| *r) } /// How the Folders section names `dir` in widget ids: with `/` separators, on Windows too. -fn folder_key(dir: &Path) -> String { +pub(crate) fn folder_key(dir: &Path) -> String { dir.to_string_lossy().replace('\\', "/") } -fn folder_row(h: &Headless, dir: &Path) -> Option { +pub(crate) fn folder_row(h: &Headless, dir: &Path) -> Option { widget(h, &format!("source:libfolder:{}", folder_key(dir))) } -fn id_of(h: &Headless, file: &str) -> u64 { +pub(crate) fn id_of(h: &Headless, file: &str) -> u64 { h.app.session.catalog.photos().find(|p| p.file_name == file).map(|p| p.id.0).unwrap() } -fn press(h: &mut Headless, at: Pos2) { +pub(crate) fn press(h: &mut Headless, at: Pos2) { h.app.synthetic.push(egui::Event::PointerMoved(at)); h.app.synthetic.push(egui::Event::PointerButton { pos: at, @@ -75,14 +75,14 @@ fn press(h: &mut Headless, at: Pos2) { } /// Move the pointer, pressed, from `from` to `to` over a few frames. -fn glide(h: &mut Headless, from: Pos2, to: Pos2) { +pub(crate) fn glide(h: &mut Headless, from: Pos2, to: Pos2) { for i in 1..=8 { h.app.synthetic.push(egui::Event::PointerMoved(from + (to - from) * (i as f32 / 8.0))); h.step(); } } -fn release(h: &mut Headless, at: Pos2) { +pub(crate) fn release(h: &mut Headless, at: Pos2) { h.app.synthetic.push(egui::Event::PointerButton { pos: at, button: egui::PointerButton::Primary, @@ -94,18 +94,18 @@ fn release(h: &mut Headless, at: Pos2) { } /// What the dragged label says this frame instead of the count, if a drop target set it. -fn hint(h: &Headless) -> Option { +pub(crate) fn hint(h: &Headless) -> Option { h.view.ctx.data(|d| d.get_temp::<(u64, String)>(egui::Id::unique("drag-photos-hint"))).map(|(_, text)| text) } /// Click a widget the way a person does (press and release on it). -fn click(h: &mut Headless, id: &str) { +pub(crate) fn click(h: &mut Headless, id: &str) { let at = widget(h, id).unwrap_or_else(|| panic!("no {id}")).center(); press(h, at); release(h, at); } -fn toast(h: &Headless) -> String { +pub(crate) fn toast(h: &Headless) -> String { h.app.ui.toast.as_ref().map(|(t, _, _)| t.clone()).unwrap_or_default() } diff --git a/docs/parity-checklist.md b/docs/parity-checklist.md index 90cfc248f60..cab056f68af 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-25 · **Change:** minor (LR-BEHAV-DRAGDROP: a Folders row dragged onto another moves the folder on disk; 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 @@ -466,7 +466,7 @@ differences and missing bindings are in [ui-parity.md](ui-parity.md#shortcuts). | LR-BEHAV-WEB-SAFETY | Library safety in the browser build | P1 | 🟡 | `cmd:file.backupLibrary`, `cmd:file.restoreLibrary`, `apps/lightcraft-web/src/safety.rs`, `apps/lightcraft-web/src/backup.rs`, `apps/lightcraft-web/src/files.rs` | web only (experimental): Back Up Library (zip of the catalog and every stored original) and a non-destructive Restore; failed saves show as unsaved and are retried; a photo that can't be stored isn't added; one tab per library (Web Locks); notices for storage that isn't persistent and for a library that can't open; `?reset` asks first; a panic shows a message. Missing: `?safe` start, deleting originals of removed photos, zip64 (backups > 4 GB) | | LR-BEHAV-GPU | GPU acceleration | P0 | ✅ | `crates/gpu/src/render.rs`, `cmd:app.gpu`, `docs/gpu-pipeline.md`, `crates/ui-egui/src/panels/notices.rs` | CPU fallback per render on device limits, out of memory, device errors / loss, incomplete or black results (`perf.gpuReason`, `perf.gpuFallback`; each render reports its own reason — `lightcraft_gpu::try_render`, `gpuFallback` per exported file — issue #675); short submissions for slow iGPUs; backend choice (DX12 only on Windows, `LIGHTCRAFT_GPU_BACKEND` / `WGPU_BACKEND`), device created after the window opens, crash sentinel (issue #136); a GPU lost while LightCraft runs (driver reset) stops it with that message and turns GPU rendering off for the next start, which says why (issue #1337; the window's renderer can't survive the lost device); quitting waits (up to 2 s) for renders in flight and starts no new GPU work, so none is inside the driver when the process exits (`crates/gpu/src/exit.rs`, issue #620; seen crashing only on Linux + NVIDIA, other drivers unverified); with GPU rendering on and no adapter found at all (e.g. no Vulkan loader on NixOS outside `nix develop`), the desktop app says once per session that it renders on the CPU and points to Help ▸ System Info (`gpu_notice`; not when the GPU is turned off or only a software adapter exists); no tiling beyond the buffer limit (CPU) | | LR-BEHAV-RENDER-FIDELITY | Rendering matches Lightroom | P1 | 🟡 | `crates/pipeline/src/lib.rs`, `crates/pipeline/src/tone.rs` | every slider exists and works, but the character of the result (tone curve shape, highlight recovery, texture / clarity / dehaze, noise reduction, sharpening, default look) is tuned by eye; there is no systematic side-by-side comparison against Lightroom on the same CC0 raws. Needs a fidelity suite: Lightroom reference renders kept only in the local `plan/` (never committed), compared per slider and preset with a perceptual metric. Tuning that changes how existing settings render ships as a new process version (LRC-DEV-PROCESS, `docs/process-versions.md`) | -| LR-BEHAV-DRAGDROP | Drag and drop | P1 | ✅ | `crates/ui-egui/src/lib.rs`, `crates/ui-egui/src/panels/grid.rs` (`drag_feedback`), `crates/ui-egui/src/panels/left.rs` (`drop_target`, `album_drag_over`, `top_level_drop_target`, `drag_auto_scroll`) | files → app (a drop-target card while they hover, then the import review); grid photos → an album row (adds the selection, with a count badge while dragging); sidebar album / folder rows → a folder (moves it; its name follows the pointer); a drag of albums or grid photos near the top or bottom edge of the sidebar scrolls it (faster nearer the edge, only while the pointer is over the sidebar) | +| LR-BEHAV-DRAGDROP | Drag and drop | P1 | ✅ | `crates/ui-egui/src/lib.rs`, `crates/ui-egui/src/panels/grid.rs` (`drag_feedback`), `crates/ui-egui/src/panels/left.rs` (`drop_target`, `album_drag_over`, `top_level_drop_target`, `drag_auto_scroll`, `folder_drag_target`), `crates/ui-egui/src/tests/folder_drag.rs` | files → app (a drop-target card while they hover, then the import review); grid photos → an album row (adds the selection, with a count badge while dragging); sidebar album / folder rows → a folder (moves it; its name follows the pointer); a Folders row → another Folders row (moves the folder on disk with its photos, after a question that Don't ask again turns off; a row that can't take it says why in the label; Esc gives the drag up); a drag of albums or grid photos near the top or bottom edge of the sidebar scrolls it (faster nearer the edge, only while the pointer is over the sidebar) | | LR-BEHAV-TOAST | Toast notifications | P1 | ✅ | `crates/ui-egui/src/panels.rs` | | | LR-BEHAV-DIALOGS | Dialogs fit the window | P1 | ✅ | `crates/ui-egui/src/dialogs.rs` (`dialog_body`, `list_height`), `crates/ui-egui/src/tests/dialog_fit.rs`, `crates/ui-egui/src/tests/dialogs.rs` (`a_click_outside_closes_the_dialog_when_settings_allow_it`) | a dialog taller than the window (Export on a 1366×768 screen, issue #781) never runs off it: its options scroll while the title bar and the Cancel / OK row stay on screen; lists that scroll on their own (What's New, All Metadata, shortcuts, smart-album rules, credits) get shorter first; dialogs that fit look as before; Import keeps its own resizable, scrolling window; Settings → Dialogs → Close a dialog by clicking outside it (off by default, so a stray click never throws away a dialog's choices): a click pressed and released on the dimmed backdrop closes the dialog like Esc and doesn't reach the panels below, while a drag that ends outside (a slider pulled past the edge) or a click that closes a dropdown keeps it; the import review never closes this way (`clicked_backdrop`) | | LR-BEHAV-SIDEBAR-COLLAPSE | Collapsible left-sidebar sections | P2 | ✅ | `crates/ui-egui/src/panels/left.rs` (`section`, `section_header`), `crates/ui-egui/src/sidebar.rs` (`SidebarLayout`), `crates/ui-egui/src/tests/panels.rs` | click the Albums, Local, By Date, Folders or Keywords header (or drive `ui.clickWidget` `sidebarSection:`) to fold or unfold the section; a chevron before the title shows the state; the choice is kept across restarts (`sidebar` in the UI state; the `collapsedSidebar` list of older settings files is still read). the click itself is UI-only, like the By Date / Keywords disclosure triangles, and `cmd:view.sidebarSection` `{section, collapsed}` folds and unfolds for agents; photos dropped on a folded Albums section have no target | @@ -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-23 | minor | LR-BEHAV-DRAGDROP: a Folders row can be dragged onto another Folders row to move that folder on disk (`folder.move`, one undo step): the row under the pointer lights up and opens after 0.7 s, the dragged label says where the folder will go or why it can't (itself, a folder inside it, the folder it is in, a row covering several disks, the library's own folder), a drop asks first unless Don't ask again was ticked, and Esc gives the drag up; status unchanged (✅) | diff --git a/docs/whats-new.md b/docs/whats-new.md index c6c25920034..30e475701a5 100644 --- a/docs/whats-new.md +++ b/docs/whats-new.md @@ -82,6 +82,16 @@ library you open and are imported into it, as files given on the command line are; presets dropped then are refused with a note, since they belong to a library. +### Drag a Folders row onto another to move that folder +- A folder in the sidebar's Folders section can be dragged onto another Folders row to move it there on disk, with + its photos, as the row's Move Folder To… menu item does. The row under the pointer lights up (a closed one opens after a + moment, so a folder inside it can be reached) and the dragged label says "Move “trip” into “archive”". A row that + can't take the folder (the folder itself, one inside it, the folder it is in already, a row that covers several + disks, the library's own folder) shows the not-allowed cursor and says why in the label. A drop asks first, naming + both folders and how many photos go along; "Don't ask again" (Settings → Confirm before moving photos to another + folder on disk) moves it at once. Esc gives the drag up, and Edit ▸ Undo moves the folder back. A click on a row + still chooses it. + ## 2026-10-22 ### Reliability From 2e8f7f2d5b43269a91c9e8984208da540040b62f Mon Sep 17 00:00:00 2001 From: Nathaniel Ledford Date: Thu, 29 Oct 2026 09:15:13 -0400 Subject: [PATCH 2/2] LR-BEHAV-DRAGDROP: Esc in the frame of the release gives the folder drag up instead of dropping it A folder row processed the release before the drag feedback saw Esc, so with the question off the folder moved despite the cancel. Esc is now read where the dragged folder is looked up, ahead of every row's drop handling. --- crates/ui-egui/src/panels/left/folders.rs | 19 ++++++++++--------- crates/ui-egui/src/tests/folder_drag.rs | 19 +++++++++++++++++++ 2 files changed, 29 insertions(+), 9 deletions(-) diff --git a/crates/ui-egui/src/panels/left/folders.rs b/crates/ui-egui/src/panels/left/folders.rs index f4f01024ff2..6f2b2400409 100644 --- a/crates/ui-egui/src/panels/left/folders.rs +++ b/crates/ui-egui/src/panels/left/folders.rs @@ -468,9 +468,11 @@ pub(crate) fn folder_drop_refusal(app: &LightcraftApp, from: &str, target: &Fold } /// The Folders row being dragged. A drag doesn't outlive the library it was picked up in: when -/// another one opens meanwhile it is given up. -fn dragged_folder(app: &mut LightcraftApp) -> Option { - if app.ui.dragging_folder.is_some() && app.ui.dragging_folder_library != app.session.library_generation() { +/// another one opens meanwhile it is given up. Esc gives it up too, before any row acts on a release +/// that came in the same frame. +fn dragged_folder(app: &mut LightcraftApp, ctx: &egui::Context) -> Option { + let other_library = app.ui.dragging_folder_library != app.session.library_generation(); + if app.ui.dragging_folder.is_some() && (other_library || ctx.input(|i| i.key_pressed(egui::Key::Escape))) { app.ui.dragging_folder = None; } app.ui.dragging_folder.clone() @@ -487,7 +489,7 @@ fn folder_name(path: &str, fallback: &str) -> String { /// not-allowed cursor with the reason in the label, and a release says it too. Held over a /// closed row, it opens, so a folder inside it can be reached. fn folder_drag_target(app: &mut LightcraftApp, ui: &mut egui::Ui, resp: &egui::Response, n: &FolderNode, open_id: egui::Id, open: &mut bool) { - let Some(from) = dragged_folder(app) else { return }; + let Some(from) = dragged_folder(app, ui.ctx()) else { return }; // only where the row can be seen: not scrolled out of the sidebar or beneath the pinned header if !pointer_over_row(ui, resp.rect) { return; @@ -555,12 +557,11 @@ pub(crate) fn toast_folder_moved(app: &mut LightcraftApp, ctx: &egui::Context, r /// While a Folders row is dragged: its name at the pointer, or what the row under it says (where /// the folder would go, or why it can't). The drag ends when the button is up (the drop targets -/// act on the release frame, before this runs) and Esc gives it up. +/// act on the release frame, before this runs); Esc gives it up (see [`dragged_folder`]). pub fn folder_drag_feedback(app: &mut LightcraftApp, ctx: &egui::Context) { - let Some(from) = dragged_folder(app) else { return }; - let (released, down, pos, esc) = - ctx.input(|i| (i.pointer.primary_released(), i.pointer.primary_down(), i.pointer.latest_pos(), i.key_pressed(egui::Key::Escape))); - if released || !down || esc { + let Some(from) = dragged_folder(app, ctx) else { return }; + let (released, down, pos) = ctx.input(|i| (i.pointer.primary_released(), i.pointer.primary_down(), i.pointer.latest_pos())); + if released || !down { app.ui.dragging_folder = None; return; } diff --git a/crates/ui-egui/src/tests/folder_drag.rs b/crates/ui-egui/src/tests/folder_drag.rs index 0ffc83759ae..f9977ae4cb7 100644 --- a/crates/ui-egui/src/tests/folder_drag.rs +++ b/crates/ui-egui/src/tests/folder_drag.rs @@ -195,6 +195,25 @@ fn escape_gives_the_drag_up() { let _ = std::fs::remove_dir_all(&root); } +#[test] +fn escape_in_the_frame_of_the_release_cancels_the_drop() { + let (mut h, root) = tree("escape-release"); + let (trip, archive) = (root.join("trip"), root.join("archive")); + // with the question off, a drop that got through would move the folder at once + h.app.ui.settings.ask_before_move = false; + drag_over(&mut h, &trip, &archive); + let at = centre(&h, &archive); + // (both go to egui in one frame: the synthetic queue would deliver the release a frame apart from the key) + h.events.push(egui::Event::Key { key: egui::Key::Escape, physical_key: None, pressed: true, repeat: false, modifiers: egui::Modifiers::NONE }); + h.events.push(egui::Event::PointerButton { pos: at, button: egui::PointerButton::Primary, pressed: false, modifiers: egui::Modifiers::NONE }); + h.step(); + h.step(); + assert_eq!(h.app.ui.dragging_folder, None, "given up"); + assert!(h.app.ui.dialog.is_none(), "a drop that Esc cancelled asks nothing"); + assert!(trip.join("beach.png").is_file() && !archive.join("trip").exists(), "nothing moved"); + let _ = std::fs::remove_dir_all(&root); +} + #[test] fn with_the_question_turned_off_the_drop_moves_at_once() { let (mut h, root) = tree("noask");