mirror of
https://github.com/storytold/AniCraft.git
synced 2026-11-23 11:02:29 +01:00
feat(a11y): name the Sound properties from main; audit a sound keyframe too (M8)
This commit is contained in:
1 parent
24abe905f7
commit
069cfdee43
6 files changed
+17
-10
No files matched your search
+1
-1
@@ -15,7 +15,7 @@
|
||||
scale** holds up to 200 %: the stage refits, the tools column and timeline header scroll, the
|
||||
status bar shortens its message instead of overlapping. The default theme now meets WCAG AA
|
||||
everywhere (the playhead's frame number, the current-frame readout and faint hints were
|
||||
below it). A test walks the AccessKit tree in 22 states of the interface and fails on any
|
||||
below it). A test walks the AccessKit tree in 23 states of the interface and fails on any
|
||||
unnamed control. `anicraft --theme high-contrast --scale 200` previews a look for one run.
|
||||
Not yet: stage elements and single frames one by one for screen readers, following the
|
||||
system's contrast setting, the menu bar from the keyboard.
|
||||
|
||||
@@ -43,7 +43,7 @@ UI Automation on Windows, NSAccessibility on macOS, AT-SPI on Linux.
|
||||
"Stage · Selection tool · frame 12 · 1 element selected".
|
||||
* The status bar is a live region: after an action a screen reader reads its result ("Deleted
|
||||
layer — Ctrl+Z to undo") without moving focus.
|
||||
* A test (`a11y::tests`) runs the whole interface without a window in 22 states and fails if
|
||||
* A test (`a11y::tests`) runs the whole interface without a window in 23 states and fails if
|
||||
any interactive control has no name or no role.
|
||||
|
||||
### High contrast
|
||||
|
||||
@@ -32,8 +32,9 @@ shortcuts, the command palette, the shortcut editor). The rest was not there:
|
||||
slider is anonymous unless the slider shows a visible text label); `surface` marks the stage
|
||||
and the Motion Editor graph as canvases; `name_title_bar` and `name_splitter` name the parts
|
||||
egui leaves anonymous. The test `a11y::tests::every_interactive_node_has_a_name_and_a_role`
|
||||
runs the whole app on a headless `egui::Context` with AccessKit on, in 22 states (default,
|
||||
every tool's options, a selection, a movie clip with all four filters, the Motion Editor,
|
||||
runs the whole app on a headless `egui::Context` with AccessKit on, in 23 states (default,
|
||||
every tool's options, a selection, a movie clip with all four filters, the Motion Editor, a
|
||||
sound keyframe,
|
||||
every dialog, high contrast at 200 %), and fails on any focusable or clickable node without
|
||||
a name or with an unknown role. egui's scroll-area bars are the only exemption.
|
||||
2. **Names say what and how.** An icon-only control's name is its tooltip's first line with the
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ milestone ends with a green tree: build, tests, clippy, a `--screenshot` check a
|
||||
| Tests | 133 tests (adds point editing, closed-path anchors, curve fitting, pen/pencil/subselection commands, the Pen's path data, frame ranges, keyframe moves, range confirmations, frame selection and the frame clipboard): unit, analytic render, band/determinism, robustness fuzz over all commands, round trip (v1 and v2 files), structural sharing and history budget, render-service equivalence, confirmations, clipboard, transforms and align, GIF decode and timing, free-transform maths, UI-guideline enforcement, CLI. |
|
||||
| Ease of use & safety | **Visual language** (ADR 0008, revised): graphite palette, corners by role (square structure, softened controls, rounder menus and dialogs with soft depth), borders only between layout regions, flat buttons with a visible focus ring, vibrant timeline blocks (mint artwork, violet tweens), sentence-case headings, **collapsible sections with rules** (Preferences, Properties, dock, shortcut sheet), **Lucide icons** stroked as vectors via a new full SVG path reader; click targets ≥ 28 px (tools 40, rows 28, toggles 24); palette contrast, target sizes and "no raw colours or radii" are enforced by tests. Product principles written (`docs/product-principles.md`). Tiered destructive-action confirmations, enforced in the engine (ADR 0004). Unsaved-changes guard on close/new/open. **Crash-recovery autosave** (ADR 0015): unsaved work is copied in the background (every minute or 25 changes by default; Preferences › Files › Autosave, with an off switch) to `Recovery` in the settings folder, atomically and never over the user's file; an OS file lock per running window tells crashed sessions from open ones; the next start offers what was left behind in a non-blocking window (Restore as unsaved work with its original path, Discard with a second click, Later; File › Recover Autosaved Documents… brings it back); saves and clean exits remove the copy; headless `file.recovery_list/recover/discard_recovery/autosave`. Not yet: several open documents, older copies, the undo history. Overwrite checks for saves and exports. "Ctrl+Z to undo" hints. Command palette (Ctrl+K). Shortcut sheet (F1). Right-click menus on stage, frames and layers. Save As (Ctrl+Shift+S). **Shortcut editor** (F1): every menu command, tool and view key can be rebound, given extra keys or unbound; recording asks before taking a key from another action, reserved keys (palette, editor, Preferences, quit, play, Esc, Space, Tab) stay fixed, per-action and global reset; only the changes are saved in preferences, so untouched actions follow new defaults; menus, tooltips and the palette show the keys in effect. |
|
||||
| Platforms & preferences | ADR 0006 platform layer: ⌘ shortcut labels and an AniCraft app menu with a unified title bar on macOS; Exit and Preferences (Ctrl+U) on Windows and Linux; native file dialogs (XDG portal on Linux, with a fallback switch); wgpu with automatic OpenGL fallback; per-OS settings folder. **Preferences** window: theme (Graphite or High contrast), interface and data fonts (bundled default or any installed font), interface scale (75–200 %), stage render mode, file dialogs, reset confirmations. Edits render live (fixed the missing-repaint bug). Not yet: native macOS NSMenu, macOS/Linux CI runners. Verified on Windows only so far. |
|
||||
| Accessibility | **First pass** (ADR 0022, `docs/accessibility.md`): AccessKit (via eframe) gives every control a name and role, checked by a headless test that walks the tree in 22 interface states (custom-painted tools, layer rows and toggles, icon buttons, Library rows, every Properties field, the Motion Editor, every dialog; the stage is a named canvas; the status bar a polite live region). **Ctrl+F6 / Ctrl+Shift+F6** move focus between Stage, Timeline, Properties, Library and Tools (rebindable); focused controls keep Enter/Space/arrows while other shortcuts still work; pointer-only surfaces are not Tab stops. **High contrast** palette (Preferences › Theme) from the same roles, text ≥ 7:1, controls and focus ≥ 3:1; both palettes checked by the contrast test (the graphite one now meets AA everywhere). **Interface scale** 75–200 % holds up (stage refits, tools and timeline header scroll, status truncates). Not yet: stage elements and single frames exposed one by one, keyboard menu bar, following the OS contrast setting, manual passes with Narrator, VoiceOver and Orca. |
|
||||
| Accessibility | **First pass** (ADR 0022, `docs/accessibility.md`): AccessKit (via eframe) gives every control a name and role, checked by a headless test that walks the tree in 23 interface states (custom-painted tools, layer rows and toggles, icon buttons, Library rows, every Properties field, the Motion Editor, every dialog; the stage is a named canvas; the status bar a polite live region). **Ctrl+F6 / Ctrl+Shift+F6** move focus between Stage, Timeline, Properties, Library and Tools (rebindable); focused controls keep Enter/Space/arrows while other shortcuts still work; pointer-only surfaces are not Tab stops. **High contrast** palette (Preferences › Theme) from the same roles, text ≥ 7:1, controls and focus ≥ 3:1; both palettes checked by the contrast test (the graphite one now meets AA everywhere). **Interface scale** 75–200 % holds up (stage refits, tools and timeline header scroll, status truncates). Not yet: stage elements and single frames exposed one by one, keyboard menu bar, following the OS contrast setting, manual passes with Narrator, VoiceOver and Orca. |
|
||||
| Stage rendering & build | **Tiled stage** (ADR 0007): 512 px cached tiles, batched per frame with one scene evaluation per frame, look-ahead ring and playback prefetch, scaled older tiles instead of blank areas, pixel-aligned (no seams). **Space-biased build**: debug build 6.9 GB → 1.04 GB, fresh build 44 s, edit rebuild 4–6 s (`docs/development.md`). |
|
||||
| Scale & performance | Pulled forward from M2: persistent document with snapshot undo (memory-budgeted history, save-point dirty tracking, History panel), background render worker with frame cache and playback look-ahead, band-parallel renderer with culling, compact streaming file format v2, `anicraft-cli bench`. Measured numbers are in `docs/performance.md`. Memory, sharing, file-size and culling budgets are a test on every PR; timing budgets are `anicraft-cli bench --check yes` (all met; the 1080p render is 15.3–15.8 ms against 16.7 ms). |
|
||||
|
||||
|
||||
+1
-1
@@ -351,7 +351,7 @@ mod tests {
|
||||
for tool in [Tool::Rect, Tool::Star, Tool::Text, Tool::Pencil, Tool::PaintBucket, Tool::InkBottle, Tool::Pen] {
|
||||
found.extend(check(&format!("{tool:?} tool"), |a, _| a.tool = tool));
|
||||
}
|
||||
for panel in ["select", "motion", "motionspan", "prefs", "shortcuts", "palette", "about", "files", "licenses", "confirm", "recovery", "frames"] {
|
||||
for panel in ["select", "motion", "motionspan", "sound", "prefs", "shortcuts", "palette", "about", "files", "licenses", "confirm", "recovery", "frames"] {
|
||||
found.extend(check(panel, |a, _| a.open_panel(Some(panel))));
|
||||
}
|
||||
found.extend(check("movie clip with filters", |a, _| {
|
||||
|
||||
+10
-4
@@ -850,7 +850,9 @@ fn sound_rows(app: &mut App, ui: &mut egui::Ui, current: Option<anicraft_engine:
|
||||
app.run("sound.set", json!({"sound": id}));
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
.response
|
||||
.set_name("Sound");
|
||||
});
|
||||
let Some(f) = current else { return };
|
||||
row_prose(ui, "Sync", |ui| {
|
||||
@@ -860,7 +862,9 @@ fn sound_rows(app: &mut App, ui: &mut egui::Ui, current: Option<anicraft_engine:
|
||||
app.run("sound.set", json!({"sync": m.key()}));
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
.response
|
||||
.set_name("Sound sync");
|
||||
});
|
||||
if f.sync == SoundSync::Stop {
|
||||
return;
|
||||
@@ -873,11 +877,13 @@ fn sound_rows(app: &mut App, ui: &mut egui::Ui, current: Option<anicraft_engine:
|
||||
if ui.selectable_label(f.looping, "Loop").on_hover_text("Plays again and again: to the end of the movie (event) or of this span (stream)").clicked() && !f.looping {
|
||||
app.run("sound.set", json!({"loop": true}));
|
||||
}
|
||||
});
|
||||
})
|
||||
.response
|
||||
.set_name("Repeat or loop");
|
||||
if !f.looping {
|
||||
let mut n = f.repeat;
|
||||
let r = with_type(ui, Type::Data, |ui| ui.add(egui::DragValue::new(&mut n).range(1..=anicraft_engine::doc::sound::MAX_REPEAT).suffix(" ×")));
|
||||
if r.on_hover_text("Times it plays in a row").changed() {
|
||||
if r.named("Times it plays").on_hover_text("Times it plays in a row").changed() {
|
||||
live(app, "Sound repeat", "sound.set", json!({"repeat": n}));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user