mirror of
https://github.com/storytold/lightcraft.git
synced 2026-12-05 16:31:16 -05:00
KEY-NEXTPREV: ↑ / ↓ step through Survey and Compare instead of leaving one photo selected (#3640)
In Survey and Compare, → / ← go to the next / previous photo on screen, but ↑ / ↓ ran library.down / library.up, which replace the selection with a single photo: one key press took every other photo out of the survey. They now step like → / ←, and survey_up_and_down_step_through_its_photos covers it.
This commit is contained in:
@@ -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::<i64>().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;
|
||||
|
||||
@@ -416,3 +416,19 @@ fn survey_command_click_on_the_active_photo_activates_the_last_one() {
|
||||
let sel: Vec<u64> = 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::<Vec<u64>>();
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user