LR-BEHAV-ACCESS: Reduce motion is a setting, not a View menu item

The command stays (`view.reduceMotion`, for scripts and agents) but leaves
the View menu: it is an interface preference, which lives in Settings ▸
Interface. The progress bar's doc comment is back on the function it
describes, and the docs no longer name the menu item.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Nathaniel LedfordandClaude Opus 5.5 committed 2026-11-02 15:52:31 -05:00
1 parent 0c5a99402f
commit b8d64cf7a9
9 files changed
+49 -51

No files matched your search

-2
View File
@@ -200,7 +200,6 @@ const LAYOUT: &[(&str, &[&str])] = &[
"view.faceBoxes",
"view.focusPoint",
"view.zoomToFocus",
"view.reduceMotion",
"view.filmstrip",
"view.histogram",
"view.navigator",
@@ -409,7 +408,6 @@ pub fn checked(app: &LightcraftApp, id: &str) -> Option<bool> {
"view.faceBoxes" => Some(u.face_boxes),
"view.focusPoint" => Some(u.settings.focus_point),
"view.zoomToFocus" => Some(u.settings.zoom_to_focus),
"view.reduceMotion" => Some(u.settings.reduce_motion),
"view.filmstrip" => Some(u.filmstrip),
"view.frameRate" => Some(u.frame_rate),
"view.histogram" => Some(u.histogram),
+1 -1
View File
@@ -75,7 +75,7 @@ pub const UI_COMMANDS: &[UiCommand] = &[
("view.faceBoxes", "Face Boxes", None, "View"),
("view.focusPoint", "Focus Point", Some("Alt+F"), "View"),
("view.zoomToFocus", "Zoom to Focus Point", None, "View"),
("view.reduceMotion", "Reduce Motion", None, "View"),
("view.reduceMotion", "Reduce Motion", None, ""),
("view.reference", "Reference View", Some("Shift+R"), "View"),
("photo.setReference", "Set as Reference Photo", None, ""),
("compare.swap", "Swap Compare Photos", None, "View"),
+1 -13
View File
@@ -7,7 +7,7 @@
//! [`LightcraftApp::sync_theme`](crate::LightcraftApp::sync_theme) stores the setting in the egui
//! context every frame ([`sync`]), so drawing code needs only the `Context`, not the app.
use egui::{Context, Id, Sense, Ui, vec2};
use egui::{Context, Id};
/// egui's widget easing time when motion is on.
const ANIMATION_TIME: f32 = 0.08;
@@ -42,15 +42,3 @@ pub fn animation_time(reduced: bool) -> f32 {
pub fn zoom_tween_seconds(ctx: &Context) -> f32 {
if reduced(ctx) { 0.0 } else { ZOOM_TWEEN_SECONDS }
}
/// A "working" indicator: egui's turning spinner, or with reduced motion a still dot of the same size
/// (so the layout doesn't move).
pub fn spinner(ui: &mut Ui) {
if !reduced(ui.ctx()) {
ui.spinner();
return;
}
let side = ui.spacing().interact_size.y;
let (rect, _) = ui.allocate_exact_size(vec2(side, side), Sense::hover());
ui.painter().circle_filled(rect.center(), side * 0.18, ui.visuals().text_color());
}
+1 -14
View File
@@ -147,23 +147,10 @@ fn row(ui: &mut egui::Ui, t: &Tokens, task: &TaskInfo, width: f32) -> bool {
}
/// The progress bar, named after its task for screen readers; while the amount of work isn't
/// known, a segment sweeps across.
/// known, a segment sweeps across (it stands still with Reduce motion on).
pub(crate) fn bar(ui: &mut egui::Ui, task: &TaskInfo, width: f32) -> egui::Response {
let fraction = (task.total > 0).then(|| (task.done as f64 / task.total as f64) as f32);
let response = crate::progress::Progress::new(fraction).width(width).dimmed(task.cancelling).show(ui);
crate::widgets::screen_reader_name(ui.ctx(), response.id, tr(&task.label));
response
}
/// The progress bar; while the amount of work isn't known, a segment sweeps across.
/// The sweeping segment of an indeterminate bar, as offsets from the bar's left edge. Reduced motion
/// leaves a still segment (a quarter of the bar, at its left end) that says "working" without moving.
pub(crate) fn indeterminate_span(width: f32, time: f64, reduced: bool) -> (f32, f32) {
if reduced {
return (0.0, width * 0.25);
}
let phase = (time * 0.7).fract() as f32;
let w = width * 0.3;
let x = (width + w) * phase - w;
(x.max(0.0), (x + w).min(width))
}
+3 -3
View File
@@ -115,10 +115,10 @@ fn egui_easing_stops_with_reduce_motion_on_and_returns_when_off() {
#[test]
fn the_activity_bar_stands_still_with_reduce_motion_on() {
use crate::panels::activity::indeterminate_span;
let still: Vec<_> = (0..120).map(|f| indeterminate_span(200.0, f as f64 / 60.0, true)).collect();
use crate::progress::sweep_span;
let still: Vec<_> = (0..120).map(|f| sweep_span(200.0, f as f64 / 60.0, true)).collect();
assert!(still.windows(2).all(|w| w[0] == w[1]), "no movement between frames");
assert!(still[0].1 > still[0].0, "but something is shown");
let moving: Vec<_> = (0..120).map(|f| indeterminate_span(200.0, f as f64 / 60.0, false)).collect();
let moving: Vec<_> = (0..120).map(|f| sweep_span(200.0, f as f64 / 60.0, false)).collect();
assert!(moving.windows(2).any(|w| w[0] != w[1]), "it sweeps when motion is on");
}
+5 -2
View File
@@ -404,8 +404,11 @@ impl<'a> Button<'a> {
let slot_rect = Rect::from_center_size(pos2(x + slot / 2.0, rect.center().y), vec2(slot, slot));
if self.busy {
if ui.is_rect_visible(rect) {
crate::progress::paint_spinner(p, slot_rect, lk.content, ui.input(|i| i.time));
ui.ctx().request_repaint_after(std::time::Duration::from_millis(33));
let reduced = crate::motion::reduced(ui.ctx());
crate::progress::paint_spinner(p, slot_rect, lk.content, ui.input(|i| i.time), reduced);
if !reduced {
ui.ctx().request_repaint_after(std::time::Duration::from_millis(33));
}
}
} else if let Some(icon) = self.icon {
paint(p, slot_rect, icon, lk.content);
+36 -14
View File
@@ -9,8 +9,9 @@
//! ```
//!
//! A bar announces itself to screen readers as a progress indicator with its percentage. Motion
//! asks for repaints only while it is on screen. There is no reduced-motion setting in the app,
//! so the motion is kept slow and small: one gentle sweep, one slow turning arc.
//! asks for repaints only while it is on screen. The motion is kept slow and small (one gentle
//! sweep, one slow turning arc), and with Settings ▸ Interface ▸ Reduce motion on ([`crate::motion`])
//! it stands still: the sweeping segment stays at the bar's left end and the arc becomes a dot.
use std::f32::consts::TAU;
@@ -129,13 +130,14 @@ impl Progress {
let fill = match self.fraction {
Some(f) => Rect::from_min_size(inner.min, vec2(inner.width() * f, inner.height())),
None => {
// a short bar sweeping across and back, eased so it slows at the ends
let phase = (ui.input(|i| i.time) / SWEEP_SECONDS).fract() as f32;
let eased = 0.5 - 0.5 * (phase * TAU).cos();
let len = inner.width() * 0.3;
let x = inner.left() + (inner.width() - len) * eased;
ui.ctx().request_repaint_after(FRAME);
Rect::from_min_size(pos2(x, inner.top()), vec2(len, inner.height()))
// a short bar sweeping across and back, eased so it slows at the ends (still when
// motion is reduced)
let reduced = crate::motion::reduced(ui.ctx());
let (x, len) = sweep_span(inner.width(), ui.input(|i| i.time), reduced);
if !reduced {
ui.ctx().request_repaint_after(FRAME);
}
Rect::from_min_size(pos2(inner.left() + x, inner.top()), vec2(len, inner.height()))
}
};
if fill.width() > 0.0 {
@@ -155,6 +157,18 @@ impl Progress {
}
}
/// The sweeping segment of an indeterminate bar `width` wide at `time` seconds: its offset from the
/// bar's left edge and its length. With reduced motion it stands at the left end.
pub(crate) fn sweep_span(width: f32, time: f64, reduced: bool) -> (f32, f32) {
let len = width * 0.3;
if reduced {
return (0.0, len);
}
let phase = (time / SWEEP_SECONDS).fract() as f32;
let eased = 0.5 - 0.5 * (phase * TAU).cos();
((width - len) * eased, len)
}
/// The arc a spinner draws at `time` seconds: points on a circle of `radius` around `center`,
/// covering three quarters of the turn and rotating once per [`TURN_SECONDS`].
fn arc_points(center: Pos2, radius: f32, time: f64) -> Vec<Pos2> {
@@ -168,10 +182,15 @@ fn arc_points(center: Pos2, radius: f32, time: f64) -> Vec<Pos2> {
.collect()
}
/// Draw a spinner of `size` points centred in `rect`, in `color`, at `time` seconds. Callers that
/// draw by hand (a busy button) use this; it asks for no repaint itself.
pub fn paint_spinner(p: &egui::Painter, rect: Rect, color: Color32, time: f64) {
/// Draw a spinner of `size` points centred in `rect`, in `color`, at `time` seconds; with `reduced`
/// motion a still dot of the same room. Callers that draw by hand (a busy button) use this; it asks
/// for no repaint itself.
pub fn paint_spinner(p: &egui::Painter, rect: Rect, color: Color32, time: f64, reduced: bool) {
let size = rect.width().min(rect.height());
if reduced {
p.circle_filled(rect.center(), size * 0.18, color);
return;
}
let width = (size / 8.0).max(1.5);
let radius = ((size - width) / 2.0).max(0.5);
p.add(Shape::line(arc_points(rect.center(), radius, time), Stroke::new(width, color)));
@@ -184,8 +203,11 @@ pub fn spinner(ui: &mut Ui, size: f32) -> Response {
let (rect, resp) = ui.allocate_exact_size(vec2(size, size), Sense::hover());
resp.widget_info(|| egui::WidgetInfo::new(egui::Role::ProgressIndicator));
if ui.is_rect_visible(rect) {
paint_spinner(ui.painter(), rect, t.text_dim, ui.input(|i| i.time));
ui.ctx().request_repaint_after(FRAME);
let reduced = crate::motion::reduced(ui.ctx());
paint_spinner(ui.painter(), rect, t.text_dim, ui.input(|i| i.time), reduced);
if !reduced {
ui.ctx().request_repaint_after(FRAME);
}
}
resp
}
+1 -1
View File
@@ -479,7 +479,7 @@ differences and missing bindings are in [ui-parity.md](ui-parity.md#shortcuts).
| LR-BEHAV-TOOLTIPS | Tooltips with shortcuts | P0 | ✅ | `crates/ui-egui/src/panels/bottombar.rs` | |
| LR-BEHAV-TEXTFIELD | Text fields behave alike | P1 | 🟡 | `crates/ui-egui/src/widgets/text_field.rs`, `crates/ui-egui/src/panels/topbar.rs`, `crates/ui-egui/src/widgets.rs`, `crates/ui-egui/src/panels/right.rs` (`meta_field`), `crates/ui-egui/src/dialogs.rs`, `crates/ui-egui/src/panels/unnamed.rs` | one shared field: right-click Cut / Copy / Paste / Select All (no Paste in the browser), Esc gives back the text from before the edit, Return / leaving / Esc reported to the caller, optional select-on-focus; agents use `ui.clipboard` (MCP `clipboard`) and `ui.inspect` → `copied`. Used by Search Photos, slider values, the Info panel's metadata fields (multi-line captions), the one-field dialogs (New / Rename Album, New Smart Album, Rename / Merge Keywords, text prompts) and the unnamed faces' name field so far; the other text fields (most dialogs, import, settings, masking, keywords …) still use egui's own and have no menu |
| LR-BEHAV-HEADLESS | Headless UI snapshots | P2 | ✅ | `apps/lightcraft-cli/src/main.rs`, `crates/ui-egui/src/headless.rs`, `docs/control-protocol.md` | `snapshot` rasterizes the UI and defaults photo development to the CPU before the first frame, without adapter discovery; scaled dimensions are validated before allocation, and UI zoom preserves the requested physical viewport; JSON-lines control scripts are supported |
| LR-BEHAV-ACCESS | Accessibility | P2 | 🟡 | `crates/ui-egui/src/widgets.rs`, `crates/ui-egui/src/widgets/text_field.rs`, `crates/ui-egui/src/panels/grid.rs`, `crates/ui-egui/tests/it/accessibility.rs` | AccessKit (VoiceOver / Narrator / AT-SPI): sliders announce control, value, range and step and take Increment / Decrement (the value field beside each is named `<slider> value` and describes how to type or drag), buttons / icon buttons / dropdowns / section headers / sources their labels and state, text fields their caption, grid thumbnails file name, rating, flag and label. `tests/it/accessibility.rs` fails on an unnamed control, a slider without range or an untitled dialog in every view, Develop tool and 13 dialogs, and checks that Crop and Remove sliders are reached with Tab and that Tab walks the right panels top to bottom. Canvas tools by keyboard (`crates/ui-egui/src/canvas_keys.rs`, `crates/ui-egui/src/tests/canvas_keys.rs`): crop corners, edges and box, spot targets and sources, a New spot point (Return adds), radial / linear gradient handles and mask pins take the focus, are announced with their position and move with the arrows (Shift: further). Dialogs with one name field (New Album, New Smart Album, Save Metadata Preset, the renames) take the focus once when they open, so Tab and Shift+Tab reach their check box, Cancel and OK, and Return and Esc still confirm and cancel (`crates/ui-egui/src/tests/dialog_tab.rs`). The photo in Detail is named like its grid cell, `Photo: <file>, <rating>, <flag>, <label>` (`crates/ui-egui/src/panels/detail.rs`, `crates/ui-egui/tests/it/photo_name.rs`). The grid's Thumbnail size control is a slider with its value and range; Increment / Decrement and Up / Down move it one step (`crates/ui-egui/src/panels/bottombar.rs`, `crates/ui-egui/tests/it/thumb_size_slider.rs`). Icon-only buttons (the tool strip, the view and Before/After / Filmstrip buttons of the bottom bar, the top bar's Import, the mask overlay and White Balance Selector buttons, the slideshow controls; `crates/ui-egui/src/panels/topbar.rs`) are named by their bare label and the tooltip's key hint ("Edit (E)" → name "Edit", description "E") is their description, which VoiceOver reads after a pause instead of on every visit. The top bar, tool strip and bottom bar are announced as toolbars, and the sidebar, photos, Tools / Presets panel and filmstrip as landmarks (`widgets::announce_region`, `crates/ui-egui/tests/it/landmarks.rs`). The Flatpak may talk to the accessibility bus (`--talk-name=org.a11y.Bus` in both manifests, checked by `packaging/check-app-specific.sh`), which AccessKit needs to reach AT-SPI inside the sandbox. Brush strokes and red-eye ellipses are pointer-only; not tried with a real screen reader ([audit](ui-parity.md#accessibility-audit)). The sidebar's and the keyword list's disclosure triangles say which row they open or close, as "Expand Travel" (`crates/ui-egui/tests/it/sidebar_names.rs`). A date header in the photo grid is named with the text it shows (`crates/ui-egui/tests/it/grid_names.rs`). Reduce motion (Settings ▸ Interface, `cmd:view.reduceMotion {on?}`, off by default, `crates/ui-egui/src/motion.rs`): a click or Z zooms at once, egui's widget easing, the sync spinner and the activity bar's sweep stop; toast and slideshow fades stay; the OS reduce-motion preference is not read yet (it needs native calls outside `crates/sysmem`). Tested in `crates/ui-egui/src/tests/reduce_motion.rs`. |
| LR-BEHAV-ACCESS | Accessibility | P2 | 🟡 | `crates/ui-egui/src/widgets.rs`, `crates/ui-egui/src/widgets/text_field.rs`, `crates/ui-egui/src/panels/grid.rs`, `crates/ui-egui/tests/it/accessibility.rs` | AccessKit (VoiceOver / Narrator / AT-SPI): sliders announce control, value, range and step and take Increment / Decrement (the value field beside each is named `<slider> value` and describes how to type or drag), buttons / icon buttons / dropdowns / section headers / sources their labels and state, text fields their caption, grid thumbnails file name, rating, flag and label. `tests/it/accessibility.rs` fails on an unnamed control, a slider without range or an untitled dialog in every view, Develop tool and 13 dialogs, and checks that Crop and Remove sliders are reached with Tab and that Tab walks the right panels top to bottom. Canvas tools by keyboard (`crates/ui-egui/src/canvas_keys.rs`, `crates/ui-egui/src/tests/canvas_keys.rs`): crop corners, edges and box, spot targets and sources, a New spot point (Return adds), radial / linear gradient handles and mask pins take the focus, are announced with their position and move with the arrows (Shift: further). Dialogs with one name field (New Album, New Smart Album, Save Metadata Preset, the renames) take the focus once when they open, so Tab and Shift+Tab reach their check box, Cancel and OK, and Return and Esc still confirm and cancel (`crates/ui-egui/src/tests/dialog_tab.rs`). The photo in Detail is named like its grid cell, `Photo: <file>, <rating>, <flag>, <label>` (`crates/ui-egui/src/panels/detail.rs`, `crates/ui-egui/tests/it/photo_name.rs`). The grid's Thumbnail size control is a slider with its value and range; Increment / Decrement and Up / Down move it one step (`crates/ui-egui/src/panels/bottombar.rs`, `crates/ui-egui/tests/it/thumb_size_slider.rs`). Icon-only buttons (the tool strip, the view and Before/After / Filmstrip buttons of the bottom bar, the top bar's Import, the mask overlay and White Balance Selector buttons, the slideshow controls; `crates/ui-egui/src/panels/topbar.rs`) are named by their bare label and the tooltip's key hint ("Edit (E)" → name "Edit", description "E") is their description, which VoiceOver reads after a pause instead of on every visit. The top bar, tool strip and bottom bar are announced as toolbars, and the sidebar, photos, Tools / Presets panel and filmstrip as landmarks (`widgets::announce_region`, `crates/ui-egui/tests/it/landmarks.rs`). The Flatpak may talk to the accessibility bus (`--talk-name=org.a11y.Bus` in both manifests, checked by `packaging/check-app-specific.sh`), which AccessKit needs to reach AT-SPI inside the sandbox. Brush strokes and red-eye ellipses are pointer-only; not tried with a real screen reader ([audit](ui-parity.md#accessibility-audit)). The sidebar's and the keyword list's disclosure triangles say which row they open or close, as "Expand Travel" (`crates/ui-egui/tests/it/sidebar_names.rs`). A date header in the photo grid is named with the text it shows (`crates/ui-egui/tests/it/grid_names.rs`). Reduce motion (Settings ▸ Interface, `cmd:view.reduceMotion {on?}`, off by default, `crates/ui-egui/src/motion.rs`): a click or Z zooms at once, egui's widget easing, the sync spinner and the activity bar's sweep stop; toast and slideshow fades stay; the system's reduce-motion preference is not read (that needs a native call, and `unsafe` lives only in `crates/sysmem`). Tested in `crates/ui-egui/src/tests/reduce_motion.rs`. |
| LR-BEHAV-LOCALE | Language options | P2 | ✅ | `cmd:app.language.english`, `cmd:app.language.simplifiedChinese`, `cmd:app.language.traditionalChinese`, `cmd:app.language.japanese`, `cmd:app.language.portuguese`, `cmd:app.language.french`, `cmd:app.language.spanish`, `cmd:app.language.german`, `cmd:app.language.russian`, `cmd:app.language.ukrainian`, `cmd:app.language.georgian`, `cmd:app.language.polish`, `cmd:app.language.czech`, `cmd:app.language.italian`, `cmd:app.language.swedish`, `cmd:app.language.finnish`, `cmd:app.language.indonesian`, `cmd:app.language.vietnamese` | Edit > Language lists every language in the table and the active one is checked; shared with Settings > General (docs/localization.md) |
| LR-BEHAV-LOCALIZE | Localisation | P2 | 🟡 | `crates/ui-egui/src/i18n.rs`, `crates/ui-egui/locales/`, `docs/localization.md`, `docs/localization-zh-hans.md`, `docs/localization-zh-hant.md`, `docs/localization-ja.md`, `docs/localization-pt-br.md`, `docs/localization-es.md`, `docs/localization-de.md`, `docs/localization-ru.md`, `docs/localization-ka.md`, `docs/localization-pl.md` | One table entry per language (code, endonym, ISO 15924 script, catalog): English, Simplified Chinese, Traditional Chinese (Taiwan), Japanese, Brazilian Portuguese, Spanish, German, Russian, French, Ukrainian, Polish, Czech, Italian, Georgian, Swedish, Finnish, Indonesian and Vietnamese UI with a persisted language preference and craft-fonts regular/bold faces per script (a variable face, as for Arabic, is drawn heavier for bold from its one file); menus, edit, crop/masks, settings, import/export and primary progress messages. Adding a language registers the locale and its language command, plus two catalogs. Stock presets/profiles, history steps, library headings, date headings and capture times are localised (user-named items stay verbatim); the Ukrainian catalog covers every existing catalog key, command/control label and rule-editor label; the German catalog reports newly added gaps; the other catalogs fall back to English for messages they lack. Technical errors remain English; release notes are translated in German and Ukrainian; craft-fonts faces for other scripts (Thai, Arabic, …) are UI fallbacks in every language, for file, folder and album names (#736); Traditional Chinese borrows the Simplified Chinese face (no TC face in craft-fonts yet), and the web build embeds the Japanese, Thai and Georgian faces in WASM while loading the Simplified Chinese face from a separate font file. |
| LR-BEHAV-LEARN | Tutorials | OOS | 🚫 | | |
+1 -1
View File
@@ -261,7 +261,7 @@
## 2026-10-24
### Reduce motion
- **Settings ▸ Interface ▸ Reduce motion** (also View ▸ Reduce Motion, `view.reduceMotion`) turns off the animations
- **Settings ▸ Interface ▸ Reduce motion** (`view.reduceMotion` for scripts and agents) turns off the animations
that move or turn: a click on the photo or Z zooms at once instead of easing in, the interface's own small easing
stops, the Synchronize Folder spinner becomes a still dot, and the activity panel's sweeping bar becomes a still
segment. Fades that tell you something changed (toasts, the slideshow's crossfade and its control bar) stay. Off by