From f7555d088b529222e8bbabfb1cf8457dca2d5144 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Fri, 20 Nov 2026 15:57:31 -0800 Subject: [PATCH] Links: test Show in Folder with two images selected With two images selected, Link Info shows the first selected one, while the list puts the other (on top) first. The test clicks Show in Folder in that state and checks that only the file of the image Link Info shows is handed to the file manager. --- crates/ui-egui/src/panels/tests_links.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/crates/ui-egui/src/panels/tests_links.rs b/crates/ui-egui/src/panels/tests_links.rs index 1494b75925..47f4dc173a 100644 --- a/crates/ui-egui/src/panels/tests_links.rs +++ b/crates/ui-egui/src/panels/tests_links.rs @@ -611,15 +611,21 @@ fn link_infos_location_row_shows_the_file_in_its_folder() { assert_eq!(click_panel_button(&mut app, "Show in Folder"), Some(true)); app.run("select.set", json!({"ids": [other]})).unwrap(); assert_eq!(click_panel_button(&mut app, "Show in Folder"), Some(true)); - assert_eq!(*revealed.borrow(), [linked_path, other_path.clone()]); + assert_eq!(*revealed.borrow(), [linked_path.clone(), other_path.clone()]); + // Both images selected: Link Info shows the first selected, `linked`, while the list has `other` + // (on top) first. Only the file of the image Link Info shows is handed over. + app.run("select.set", json!({"ids": [linked, other]})).unwrap(); + assert_eq!(click_panel_button(&mut app, "Show in Folder"), Some(true)); + assert_eq!(*revealed.borrow(), [linked_path.clone(), other_path.clone(), linked_path]); // A missing file: the row stays, the button is off. + app.run("select.set", json!({"ids": [other]})).unwrap(); std::fs::remove_file(&other_path).unwrap(); assert_eq!(click_panel_button(&mut app, "Show in Folder"), Some(false)); // Without a file manager (the web): off. app.run("select.set", json!({"ids": [linked]})).unwrap(); app.services.reveal = None; assert_eq!(click_panel_button(&mut app, "Show in Folder"), Some(false)); - assert_eq!(revealed.borrow().len(), 2, "nothing more was shown"); + assert_eq!(revealed.borrow().len(), 3, "nothing more was shown"); } /// #5236: with Preferences › File Handling › Use System Defaults for Edit Original off, Edit