diff --git a/CLAUDE.md b/CLAUDE.md index afb554b..bacd590 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -97,6 +97,7 @@ Never modify: `PROMPT.md` (the user's brief), the user's other projects under `~ | `TUNAL_TAGS=editor\|lookup\|mapping\|apply:: TUNAL_TAGS_SYNC=1 TUNAL_MUSICBRAINZ= XDG_CONFIG_HOME= cargo run -p tunal -- --screenshot --size 1000x760` | tag editor / lookup / mapping over a folder; `apply` also writes the tags (scratch copies only); mock = a local server for both services | S021 | | `cargo run -p tunal -- --gallery --page connection\|host-key\|secret --screenshot [--dark] --size 960x640` | the connection editor, the unknown-host-key prompt, the password prompt over a stand-in folder; with a scratch `HOME` (own `.ssh/config`, key) and `XDG_CONFIG_HOME` holding `tunal/connections.toml`, `session.toml` (pane `sftp://…`) and a trusted `known_hosts`, a normal `--screenshot` shows the Network section and an SFTP folder (local sshd on a spare port only) | S029 | | `cargo build -p tunal && target/debug/tunal --matrix ` (about 1.5 min) | screenshot matrix: shell full/grid/empty/split, row hover/pressed/selected, context menu, drag, rename, properties, open-with, delete, appearance, player, tag editor, settings pages 0–5, gallery pages, light + dark, 720x480 minimum; stand-in folder in `/fixture`, config in `/config`. Hooks: `TUNAL_POINTER=x,y[,press\|click\|menu]` (hover/press/select/right-click before the frame), `TUNAL_ACTION=` (runs a menu action on the selection) | S034 | +| `TUNAL_FRAMES=1 target/debug/tunal ` (under `Xvfb :97`, `env -u WAYLAND_DISPLAY DISPLAY=:97`) | logs each drawn frame with seconds since start; an idle window logs nothing | S035 | Don't assume a tool exists: check first. When your plan creates a tool, add its row here. diff --git a/Plans/12 Testing/S035-motion-audit.md b/Plans/12 Testing/S035-motion-audit.md index 7f45c32..97c4943 100644 --- a/Plans/12 Testing/S035-motion-audit.md +++ b/Plans/12 Testing/S035-motion-audit.md @@ -10,9 +10,9 @@ CLAUDE.md §2 Motion rules; `improve-animations` and `animate` skills. ## Steps -- [ ] Run `/improve-animations`; save its report under `docs/` (motion-audit.md). -- [ ] Apply the fixes (interruptible, reduced motion, no idle repaint, timings from tokens). -- [ ] Check idle: with the app idle for 10 s, no frames are rendered (frame counter log behind an env var). +- [x] Run `/improve-animations`; save its report under `docs/` (motion-audit.md). +- [x] Apply the fixes (interruptible, reduced motion, no idle repaint, timings from tokens). +- [x] Check idle: with the app idle for 10 s, no frames are rendered (frame counter log behind an env var). - [ ] Render the matrix and send the key PNGs to the user; 🧑 stop and report for the visual review; apply the user's feedback in a follow-up if they ask. - [ ] PROGRESS entry, INDEX line, commit `S035: …` diff --git a/crates/tunal/src/main.rs b/crates/tunal/src/main.rs index 32fe44c..a750940 100644 --- a/crates/tunal/src/main.rs +++ b/crates/tunal/src/main.rs @@ -149,9 +149,26 @@ fn gallery(page: GalleryPage) -> Result { fn run(ui: impl theme_bridge::Themed) -> Result<(), slint::PlatformError> { theme_bridge::start(&ui, theme_bridge::Overrides::from_env()); + if std::env::var_os("TUNAL_FRAMES").is_some() { + count_frames(&ui); + } ui.run() } +/// `TUNAL_FRAMES=1`: logs each drawn frame to stderr with the seconds since start (idle +/// check: an idle window logs nothing). +fn count_frames(ui: &impl slint::ComponentHandle) { + let start = std::time::Instant::now(); + let result = ui.window().set_rendering_notifier(move |state, _| { + if matches!(state, slint::RenderingState::AfterRendering) { + eprintln!("tunal: frame {:.2}", start.elapsed().as_secs_f32()); + } + }); + if let Err(e) = result { + eprintln!("tunal: TUNAL_FRAMES: {e}"); + } +} + struct Args { /// Folders of each tab given on the command line. tabs: Vec>, diff --git a/crates/tunal/ui/components/toast.slint b/crates/tunal/ui/components/toast.slint index f6cae78..f49d172 100644 --- a/crates/tunal/ui/components/toast.slint +++ b/crates/tunal/ui/components/toast.slint @@ -114,7 +114,8 @@ component Toast inherits Rectangle { // Runs only during the exit: then the owner removes the toast from its model. property gone; Timer { - interval: Motion.short4; + // The exit's length: under reduced motion the toast goes at once. + interval: Motion.time(Motion.short4); running: root.leaving && !root.gone; triggered => { root.gone = true; diff --git a/docs/PROGRESS.md b/docs/PROGRESS.md index 9900464..98833f4 100644 --- a/docs/PROGRESS.md +++ b/docs/PROGRESS.md @@ -274,5 +274,12 @@ One entry per session, newest last, ≤ 15 lines: done, verified how, not done, - Not done: `MtpLocation`/`IosLocation` not driven (no replay hook through the location layer); keyboard-interactive auth and the ssh agent path untested; `Player` engine itself needs an audio device, only waveforms are tested; MusicBrainz backoff tests really sleep (~30 s total). - Later: video thumbnails of frames smaller than the edge are enlarged by ffmpeg (images are not): cap with `scale=min(...)`. +## S035 — Motion audit (visual review pending) +- Done: `/improve-animations` quick audit → `docs/motion-audit.md` (motion already on tokens, interruptible, reduced-motion aware; 2 findings). Fixes: toast exit Timer now `Motion.time(Motion.short4)` (instant removal under reduced motion); `TUNAL_FRAMES=1` logs every drawn frame (main.rs, CLAUDE.md §5 row). +- Idle: Xvfb `:97`, 16 s run: 5 frames at start-up (≤ 3.2 s), 0 frames from 5 s to 16 s. +- Matrix re-rendered (58/58 ok); key PNGs (60 %, PNG8) in `docs/review/`: shell full light/dark, 720x480, context menu, properties dark, settings at 720x480, player dark, gallery controls. +- Verified: workspace build, workspace clippy -D warnings, fmt --check, literal grep empty. +- Not done: 🧑 visual review (step 4) — **visual review pending**, user's verdict not recorded; INDEX not ticked. Press squeeze and live motion feel only checkable in a real window. + ## Later - diff --git a/docs/motion-audit.md b/docs/motion-audit.md new file mode 100644 index 0000000..e74fb1a --- /dev/null +++ b/docs/motion-audit.md @@ -0,0 +1,40 @@ +# Motion audit (S035) + +Quick-effort audit of `crates/tunal/ui` against the motion rules (CLAUDE.md §2, `app-taste`) and the +`improve-animations` catalog. Commit at audit time: b042dfe. + +## Recon +- Stack: Slint 1.19, `animate` blocks on properties, one `MotionClock` (animation-tick, runs only + while `running`) for folder transitions, `Timer`s for delays. +- Tokens: `motion.slint`: M3 durations short1–long4, emphasized/standard easings, squeeze scales; + `Motion.time()` returns 0 under reduced motion (portal `enable-animations` or + `TUNAL_REDUCED_MOTION=1`). +- Frequency: high: row/control hover, press squeeze, ripple, selection. Medium: menus, tabs, + view switch, toasts. Low: dialogs, player bar, settings. + +## Findings +| # | Severity | Category | Location | Finding | Fix | +|---|---|---|---|---|---| +| 1 | LOW | Accessibility | `components/toast.slint` exit Timer | Removal waited `Motion.short4` even under reduced motion, so the stack closed up 200 ms after an instant exit | `interval: Motion.time(Motion.short4)` (applied) | +| 2 | MEDIUM | Performance | app | No way to check idle repaint | `TUNAL_FRAMES=1` logs each drawn frame (applied) | + +Cleared (checked, nothing to fix): +- Easing and duration: every `animate` uses `Motion.time(...)` with token durations; enters use + emphasized-decelerate, exits standard; no ease-in on UI; no literal durations or easings outside + `motion.slint`. +- Interruptibility: all motion is property animation (retargets from the current value); + `Overlay` reverses mid-entrance; the folder transition clock is re-timed by the model when + interrupted. +- Physicality: surfaces enter from `Motion.enter-scale` (0.92), never 0; menus open from anchors. +- Idle: `MotionClock` and the wavy toast line tick only while something runs; no looping + animation otherwise. Measured 0 frames over 11 s idle (below). +- Delays (tooltip, drag-switch, toast timeout) are delays, not motion, and stay under reduced + motion by design. + +## Missed opportunities +None worth adding now. The software renderer can't draw the press squeeze, so its feel is for the +user's live review. + +## Idle check +Under `Xvfb :97`: `env -u WAYLAND_DISPLAY DISPLAY=:97 TUNAL_FRAMES=1 timeout 16 target/debug/tunal ` +logged 5 frames during start-up (until 3.2 s), then none from 5 s to 16 s. diff --git a/docs/review/context-menu-light.png b/docs/review/context-menu-light.png new file mode 100644 index 0000000..cda77d0 Binary files /dev/null and b/docs/review/context-menu-light.png differ diff --git a/docs/review/gallery-controls-light.png b/docs/review/gallery-controls-light.png new file mode 100644 index 0000000..d9b697e Binary files /dev/null and b/docs/review/gallery-controls-light.png differ diff --git a/docs/review/player-dark.png b/docs/review/player-dark.png new file mode 100644 index 0000000..5c8b472 Binary files /dev/null and b/docs/review/player-dark.png differ diff --git a/docs/review/properties-dark.png b/docs/review/properties-dark.png new file mode 100644 index 0000000..c652931 Binary files /dev/null and b/docs/review/properties-dark.png differ diff --git a/docs/review/settings-min-light.png b/docs/review/settings-min-light.png new file mode 100644 index 0000000..ab73f6d Binary files /dev/null and b/docs/review/settings-min-light.png differ diff --git a/docs/review/shell-full-dark.png b/docs/review/shell-full-dark.png new file mode 100644 index 0000000..96d7c41 Binary files /dev/null and b/docs/review/shell-full-dark.png differ diff --git a/docs/review/shell-full-light.png b/docs/review/shell-full-light.png new file mode 100644 index 0000000..2ab93a4 Binary files /dev/null and b/docs/review/shell-full-light.png differ diff --git a/docs/review/shell-min-light.png b/docs/review/shell-min-light.png new file mode 100644 index 0000000..80156cd Binary files /dev/null and b/docs/review/shell-min-light.png differ