diff --git a/crates/ui-egui/src/shortcuts.rs b/crates/ui-egui/src/shortcuts.rs index 07cfe8ba03..64ff537a61 100644 --- a/crates/ui-egui/src/shortcuts.rs +++ b/crates/ui-egui/src/shortcuts.rs @@ -629,8 +629,10 @@ fn fire_grid_key(app: &mut LightcraftApp, f: &str) -> bool { } } else if let Some(step) = f.strip_prefix("grid:extend:") { extend_selection(app, step.parse::().unwrap_or(0)); - } else if compare::culling(app) && (f == "library.next" || f == "library.previous") { - let d = if f == "library.next" { 1 } else { -1 }; + } else if compare::culling(app) && matches!(f, "library.next" | "library.previous" | "library.down" | "library.up") { + // ↑ / ↓ step like → / ←: run as the grid's Photo Below / Above, they would leave one photo + // of the survey (or the pair) selected (issue #3640) + let d = if matches!(f, "library.next" | "library.down") { 1 } else { -1 }; let _ = if app.ui.view == crate::state::ViewMode::Compare { compare::compare_step(app, d) } else { compare::survey_step(app, d) }; } else { return false; diff --git a/crates/ui-egui/src/tests/compare.rs b/crates/ui-egui/src/tests/compare.rs index f570df33a8..3333d55e30 100644 --- a/crates/ui-egui/src/tests/compare.rs +++ b/crates/ui-egui/src/tests/compare.rs @@ -416,3 +416,19 @@ fn survey_command_click_on_the_active_photo_activates_the_last_one() { let sel: Vec = h.app.session.selection.ids.iter().map(|p| p.0).collect(); assert_eq!((sel, h.app.session.selection.active.map(|p| p.0)), (vec![b, c], Some(c))); } + +/// Issue #3640: ↑ / ↓ in Survey step through its photos like → / ←; they used to run the grid's +/// Photo Below / Above, which selected one photo and left the other two out of the survey. +#[test] +fn survey_up_and_down_step_through_its_photos() { + let mut h = demo(); + let [a, b, c] = survey_of_three(&mut h); + let sel = |h: &Headless| h.app.session.selection.ids.iter().map(|p| p.0).collect::>(); + for (key, want) in [("down", c), ("down", c), ("up", b), ("up", a), ("right", b), ("left", a)] { + let r = h.request("ui.key", json!({"key": key}), T); + assert_eq!(r["ok"], true, "{r}"); + h.settle(SETTLE); + assert_eq!((sel(&h), h.app.session.selection.active.map(|p| p.0)), (vec![a, b, c], Some(want)), "after {key}"); + } + assert_eq!(h.app.ui.view, crate::state::ViewMode::Survey); +} diff --git a/docs/whats-new.md b/docs/whats-new.md index 98a0ac7157..2867230513 100644 --- a/docs/whats-new.md +++ b/docs/whats-new.md @@ -2,6 +2,11 @@ ## 2026-10-30 +### ↑ and ↓ keep the Survey together +- In Survey (N) and Compare (C), ↑ and ↓ now step through the photos on screen, as → and ← do. Before, they ran the + grid's Photo Below and Photo Above, which selected a single photo, so the survey shrank to that one photo + (issue #3640). + ### The Flatpak may talk to the accessibility bus - The Flatpak package now has access to the accessibility bus (`org.a11y.Bus`) and no other new permission; its network, Pictures folder and GPU access are unchanged. Without it the sandbox hid the bus, which AccessKit needs to reach a screen reader such as Orca; this has not been tried with Orca yet. The Flatpak build is the only one affected.