From 0dc1467e8f1bbac40552cad4511d9df643689449 Mon Sep 17 00:00:00 2001 From: Clyde C Brown Date: Mon, 30 Nov 2026 15:20:07 -0800 Subject: [PATCH 1/5] #1759: Cmd+D (Select None) clears the active photo too Select None kept the active photo selected, so Cmd+D did the same as Select Only Active Photo. It now leaves nothing selected and no active photo, so the arrow keys start again from the view's ends. Manual: reference/shortcuts (no edit: the Deselect All row already describes it) Co-Authored-By: Claude Haiku 5.5 --- crates/engine/src/cmd/library.rs | 8 ++- crates/ui-egui/src/shortcuts.rs | 72 ++++++++++++++++++- crates/ui-egui/src/tests_lrc_menus.rs | 5 +- .../2026-11-30-cmd-d-select-none.md | 2 + 4 files changed, 82 insertions(+), 5 deletions(-) create mode 100644 docs/changelog/unreleased/2026-11-30-cmd-d-select-none.md diff --git a/crates/engine/src/cmd/library.rs b/crates/engine/src/cmd/library.rs index 5513a6e450..f99a0baf3f 100644 --- a/crates/engine/src/cmd/library.rs +++ b/crates/engine/src/cmd/library.rs @@ -1504,8 +1504,12 @@ pub fn specs() -> Vec { select_by ), cmd!("library.selectNone", "Deselect All", ["Edit"], Some("Cmd+Shift+A"), "{}", always, |s, _| { - let a = s.selection.active; - s.selection = Selection { ids: a.into_iter().collect(), active: a }; + // nothing selected and no active photo: the arrows then start again from the view's ends (F-66C0) + s.end_interaction()?; + s.selection = Selection::default(); + s.all_selected = None; + s.active_mask = None; + s.active_spot = None; ok() }), cmd!( diff --git a/crates/ui-egui/src/shortcuts.rs b/crates/ui-egui/src/shortcuts.rs index c80a4aa2d9..d7b9c6f833 100644 --- a/crates/ui-egui/src/shortcuts.rs +++ b/crates/ui-egui/src/shortcuts.rs @@ -1233,7 +1233,7 @@ mod tests { #[test] fn select_only_active_without_active_photo_does_not_change_selection() { let mut h = library(); - // Deselect All keeps the active photo selected, so clear the whole selection state instead. + // a fresh state with no selection and no active photo (Cmd+D leaves the same one) h.app.session.selection = Default::default(); assert!(!crate::menus::ui_enabled(&h.app, "library.selectOnlyActive")); assert!(h.app.run("library.selectOnlyActive", json!({})).is_err()); @@ -1241,6 +1241,76 @@ mod tests { assert!(h.app.session.selection.ids.is_empty()); } + /// Press the Select None chord (Cmd+D, the secondary binding; see `ALIASES`). + fn select_none_chord(h: &mut crate::headless::Headless) { + let r = h.request("ui.key", json!({"key": "D", "cmd": true}), std::time::Duration::from_secs(20)); + assert_eq!(r["ok"], true, "{r}"); + } + + #[test] + fn select_none_clears_every_selected_photo_and_the_active_photo() { + use lcc_catalog::PhotoId; + let mut h = library(); + h.app.session.execute("library.select", &json!({"ids": [1, 2, 3], "active": 2})).unwrap(); + select_none_chord(&mut h); + assert!(h.app.session.selection.ids.is_empty(), "no photo stays selected: {:?}", h.app.session.selection.ids); + assert_eq!(h.app.session.active(), None, "no photo is active afterwards"); + assert!(!h.app.session.selection.contains(PhotoId(2))); + } + + #[test] + fn select_none_with_one_photo_selected_leaves_nothing_selected() { + let mut h = library(); + h.app.session.execute("library.select", &json!({"ids": [3]})).unwrap(); + select_none_chord(&mut h); + assert!(h.app.session.selection.ids.is_empty(), "{:?}", h.app.session.selection); + assert_eq!(h.app.session.active(), None); + } + + #[test] + fn select_none_with_nothing_selected_does_nothing_and_raises_no_error() { + let mut h = library(); + h.app.session.selection = Default::default(); + select_none_chord(&mut h); + assert!(h.app.session.selection.ids.is_empty()); + assert_eq!(h.app.session.active(), None); + } + + #[test] + fn select_only_active_still_keeps_only_the_active_photo() { + use lcc_catalog::PhotoId; + let mut h = library(); + h.app.session.execute("library.select", &json!({"ids": [1, 2, 3], "active": 2})).unwrap(); + select_only_active_chord(&mut h); + assert_eq!(h.app.session.selection.ids, vec![PhotoId(2)]); + assert_eq!(h.app.session.active(), Some(PhotoId(2))); + } + + #[test] + fn select_none_stays_cleared_while_the_view_settles() { + let mut h = library(); + h.app.session.execute("library.select", &json!({"ids": [1, 2], "active": 2})).unwrap(); + select_none_chord(&mut h); + // a few frames later the grid and filmstrip still draw nothing selected + for _ in 0..3 { + h.settle(std::time::Duration::from_secs(5)); + } + assert!(h.app.session.selection.ids.is_empty(), "{:?}", h.app.session.selection); + assert_eq!(h.app.session.active(), None); + } + + #[test] + fn after_select_none_the_down_arrow_takes_the_last_photo_of_the_view() { + let mut h = library(); + h.app.session.execute("library.select", &json!({"ids": [1, 2], "active": 2})).unwrap(); + select_none_chord(&mut h); + let last = *h.app.session.visible_cloned().last().expect("the view has photos"); + let r = h.request("ui.key", json!({"key": "down"}), std::time::Duration::from_secs(20)); + assert_eq!(r["ok"], true, "{r}"); + assert_eq!(h.app.session.active(), Some(last), "↓ after Cmd+D starts from the last photo (F-66C0)"); + assert_eq!(h.app.session.selection.ids, vec![last]); + } + #[test] fn library_rating_labels_flags_and_undo() { use lcc_catalog::{ColorLabel, Flag, PhotoId}; diff --git a/crates/ui-egui/src/tests_lrc_menus.rs b/crates/ui-egui/src/tests_lrc_menus.rs index 7bc850a975..874f04dcfe 100644 --- a/crates/ui-egui/src/tests_lrc_menus.rs +++ b/crates/ui-egui/src/tests_lrc_menus.rs @@ -202,13 +202,14 @@ fn classic_keys_reach_classic_commands() { let mut h = headless(); key(&mut h, "E", json!({"cmd": true, "shift": true})); assert!(h.app.ui.module == ModuleId::Export || h.app.ui.dialog.is_some(), "⇧⌘E opens Export"); - // ⌘D: Select None (the photo on screen stays the active one) + // ⌘D: Select None (nothing stays selected, and no photo is active) let mut h = headless(); let ids: Vec = h.app.session.visible_cloned().iter().take(3).map(|p| p.0).collect(); h.app.run("library.select", json!({"ids": ids, "active": ids[0]})).unwrap(); assert_eq!(h.app.session.selection.ids.len(), 3); key(&mut h, "D", json!({"cmd": true})); - assert_eq!(h.app.session.selection.ids.len(), 1, "⌘D selects none but the active photo"); + assert!(h.app.session.selection.ids.is_empty(), "⌘D selects none"); + assert_eq!(h.app.session.active(), None, "⌘D leaves no active photo"); } // ---- Library / Edit / View / File items that used to be "Coming soon" diff --git a/docs/changelog/unreleased/2026-11-30-cmd-d-select-none.md b/docs/changelog/unreleased/2026-11-30-cmd-d-select-none.md new file mode 100644 index 0000000000..03b99f543d --- /dev/null +++ b/docs/changelog/unreleased/2026-11-30-cmd-d-select-none.md @@ -0,0 +1,2 @@ +## Library +- **Select None (⌘D) deselects every photo:** it used to keep the active photo selected, so it did the same as Select Only Active Photo. Now nothing stays selected and no photo is active; Cmd+Shift+D still keeps only the active photo. From cf1ef806cd187afb430bea4e9afa089f40cb86fa Mon Sep 17 00:00:00 2001 From: Clyde C Brown Date: Mon, 30 Nov 2026 15:32:50 -0800 Subject: [PATCH 2/5] #1759: Select None is listed as Cmd+D in the Classic set The Edit menu's Select None item shows the key that works, Cmd+D, and not the engine's declared Cmd+Shift+A (which only the Alternative set uses). Manual: reference/shortcuts (no edit: the Deselect All row already lists Ctrl+D) Co-Authored-By: Claude Haiku 5.5 --- crates/ui-egui/src/shortcuts.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/crates/ui-egui/src/shortcuts.rs b/crates/ui-egui/src/shortcuts.rs index d7b9c6f833..21eb01fff8 100644 --- a/crates/ui-egui/src/shortcuts.rs +++ b/crates/ui-egui/src/shortcuts.rs @@ -1311,6 +1311,14 @@ mod tests { assert_eq!(h.app.session.selection.ids, vec![last]); } + #[test] + fn select_none_is_listed_as_cmd_d_in_the_classic_set() { + super::set_active(super::KeymapSet::Classic); + let h = library(); + // the Edit menu's "Select None" item shows the key that works: Cmd+D, not the engine's declared Cmd+Shift+A + assert_eq!(super::shortcut_of(&h.app.ui.settings.keymap, "library.selectNone"), Some("Cmd+D")); + } + #[test] fn library_rating_labels_flags_and_undo() { use lcc_catalog::{ColorLabel, Flag, PhotoId}; From f7a82ac1ce243bbfc72d926f88981465e609329a Mon Sep 17 00:00:00 2001 From: Clyde C Brown Date: Mon, 30 Nov 2026 16:20:19 -0800 Subject: [PATCH 3/5] #1759: Deselect Unflagged clears the active photo too; drop Loupedeck DeselectOtherPhotos mapping With no flagged photo in the selection, library.deselectUnflagged now leaves nothing selected and no active photo, as Select None does. The Loupedeck DeselectOtherPhotos action (Select Only Active Photo) no longer maps to library.selectNone, which now clears the active photo. Cold grader: pass, no Must fix. Manual: none, no page describes either command or the Loupedeck action Co-Authored-By: Claude Sonnet 5.5 --- crates/engine/src/cmd/library.rs | 8 +++++--- crates/engine/src/tests_select_menu.rs | 2 +- crates/surface/src/loupedeck.rs | 2 +- crates/ui-egui/src/shortcuts.rs | 2 +- docs/changelog/unreleased/2026-11-30-cmd-d-select-none.md | 2 ++ 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/crates/engine/src/cmd/library.rs b/crates/engine/src/cmd/library.rs index f99a0baf3f..14563e8c8a 100644 --- a/crates/engine/src/cmd/library.rs +++ b/crates/engine/src/cmd/library.rs @@ -1559,15 +1559,17 @@ pub fn specs() -> Vec { "Deselect Unflagged Photos", ["Edit"], None, - "{}: keeps only the flagged (picked) photos of the selection selected; with none flagged it acts as Deselect All (the active photo stays) → {selected}", + "{}: keeps only the flagged (picked) photos of the selection selected; with none flagged it deselects everything, the active photo included → {selected}", always, |s, _| { let keep: Vec = s.selection.ids.iter().copied().filter(|id| s.catalog.photo(*id).is_some_and(|ph| ph.flag == Flag::Pick)).collect(); if keep.is_empty() { - let a = s.selection.active; - s.selection = Selection { ids: a.into_iter().collect(), active: a }; + s.end_interaction()?; + s.selection = Selection::default(); s.all_selected = None; + s.active_mask = None; + s.active_spot = None; return Ok(json!({"selected": s.selection.ids.len()})); } let active = s.selection.active.filter(|a| keep.contains(a)).or(keep.first().copied()); diff --git a/crates/engine/src/tests_select_menu.rs b/crates/engine/src/tests_select_menu.rs index 8069884d66..ea1cc6ea15 100644 --- a/crates/engine/src/tests_select_menu.rs +++ b/crates/engine/src/tests_select_menu.rs @@ -103,7 +103,7 @@ fn deselect_unflagged_with_no_pick_or_no_selection_does_not_panic() { s.execute("photo.flag", &json!({"ids": [vis[0].0, vis[1].0], "flag": "none"})).unwrap(); s.execute("library.select", &json!({"ids": [vis[0].0, vis[1].0], "active": vis[1].0})).unwrap(); s.execute("library.deselectUnflagged", &json!({})).unwrap(); - assert_eq!(s.selection, Selection::single(vis[1]), "acts as Deselect All"); + assert_eq!(s.selection, Selection::default(), "with none flagged, nothing stays selected, the active photo included"); s.selection = Selection::default(); assert!(s.execute("library.deselectUnflagged", &json!({})).is_ok()); assert_eq!(s.selection, Selection::default()); diff --git a/crates/surface/src/loupedeck.rs b/crates/surface/src/loupedeck.rs index 28bb1f295f..066544f271 100644 --- a/crates/surface/src/loupedeck.rs +++ b/crates/surface/src/loupedeck.rs @@ -390,7 +390,7 @@ pub fn map_action(action: &str, preset: &dyn Fn(&str) -> Option) -> Mapp "MoveToNextPhoto" | "SelectRight" | "MoveRight" => c("library.next"), "MoveToPreviousPhoto" | "SelectLeft" | "MoveLeft" => c("library.previous"), "SelectAll" => c("library.selectAll"), - "DeselectOtherPhotos" | "SelectNone" => c("library.selectNone"), + "SelectNone" => c("library.selectNone"), "ToggleZoomView" => c("view.zoomToggle"), "ZoomIn" => c("view.zoomIn"), "ZoomOut" => c("view.zoomOut"), diff --git a/crates/ui-egui/src/shortcuts.rs b/crates/ui-egui/src/shortcuts.rs index 21eb01fff8..fc6772d7ab 100644 --- a/crates/ui-egui/src/shortcuts.rs +++ b/crates/ui-egui/src/shortcuts.rs @@ -1287,7 +1287,7 @@ mod tests { } #[test] - fn select_none_stays_cleared_while_the_view_settles() { + fn select_none_stays_cleared_across_settled_frames() { let mut h = library(); h.app.session.execute("library.select", &json!({"ids": [1, 2], "active": 2})).unwrap(); select_none_chord(&mut h); diff --git a/docs/changelog/unreleased/2026-11-30-cmd-d-select-none.md b/docs/changelog/unreleased/2026-11-30-cmd-d-select-none.md index 03b99f543d..384602313b 100644 --- a/docs/changelog/unreleased/2026-11-30-cmd-d-select-none.md +++ b/docs/changelog/unreleased/2026-11-30-cmd-d-select-none.md @@ -1,2 +1,4 @@ ## Library - **Select None (⌘D) deselects every photo:** it used to keep the active photo selected, so it did the same as Select Only Active Photo. Now nothing stays selected and no photo is active; Cmd+Shift+D still keeps only the active photo. +- **Deselect Unflagged Photos deselects the active photo too:** with no flagged photo in the selection, nothing stays selected. +- **Loupedeck "Select Only Active Photo" is no longer mapped to Select None:** an imported profile that used it now lists that action as dropped. From 46419104b32c4f53d0437444eebe607a6c38bea5 Mon Sep 17 00:00:00 2001 From: Clyde C Brown Date: Mon, 30 Nov 2026 16:56:50 -0800 Subject: [PATCH 4/5] =?UTF-8?q?#1759:=20Test=20that=20=E2=86=91=20after=20?= =?UTF-8?q?Select=20None=20takes=20the=20first=20photo=20of=20the=20view?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Manual: none, test only Co-Authored-By: Claude Sonnet 5.5 --- crates/ui-egui/src/shortcuts.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/crates/ui-egui/src/shortcuts.rs b/crates/ui-egui/src/shortcuts.rs index fc6772d7ab..c89f95d0a0 100644 --- a/crates/ui-egui/src/shortcuts.rs +++ b/crates/ui-egui/src/shortcuts.rs @@ -1311,6 +1311,20 @@ mod tests { assert_eq!(h.app.session.selection.ids, vec![last]); } + #[test] + fn after_select_none_the_up_arrow_takes_the_first_photo_of_the_view() { + let mut h = library(); + // a photo well down the view, so a step up from it (the old behaviour) would not land on the first + let vis = h.app.session.visible_cloned(); + let (first, active) = (vis[0], vis[vis.len() - 1]); + h.app.session.execute("library.select", &json!({"ids": [active.0], "active": active.0})).unwrap(); + select_none_chord(&mut h); + let r = h.request("ui.key", json!({"key": "up"}), std::time::Duration::from_secs(20)); + assert_eq!(r["ok"], true, "{r}"); + assert_eq!(h.app.session.active(), Some(first), "↑ after Cmd+D starts from the first photo (F-66C0)"); + assert_eq!(h.app.session.selection.ids, vec![first]); + } + #[test] fn select_none_is_listed_as_cmd_d_in_the_classic_set() { super::set_active(super::KeymapSet::Classic); From f38df1f5e050e3c85b5532e60b2151860023118b Mon Sep 17 00:00:00 2001 From: Clyde C Brown Date: Mon, 30 Nov 2026 18:06:02 -0800 Subject: [PATCH 5/5] #1759: What's New entry for Select None Manual: none, no page describes these commands Co-Authored-By: Claude Sonnet 5.5 --- docs/whats-new/2026-12-01-cmd-d-select-none.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 docs/whats-new/2026-12-01-cmd-d-select-none.md diff --git a/docs/whats-new/2026-12-01-cmd-d-select-none.md b/docs/whats-new/2026-12-01-cmd-d-select-none.md new file mode 100644 index 0000000000..1d0dec91e3 --- /dev/null +++ b/docs/whats-new/2026-12-01-cmd-d-select-none.md @@ -0,0 +1,3 @@ +### Select None deselects every photo +- Edit ▸ Select None (⌘D) now leaves no photo selected and no photo active; before, it kept the active photo selected (issue #1759). +- Deselect Unflagged Photos also deselects the active photo when it isn't flagged.