S035: motion audit, idle frame check, review PNGs (review pending)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
astar76 2026-11-19 05:15:10 -06:00
commit fa09c1b5b1
14 changed files with 70 additions and 4 deletions

View file

@ -97,6 +97,7 @@ Never modify: `PROMPT.md` (the user's brief), the user's other projects under `~
| `TUNAL_TAGS=editor\|lookup\|mapping\|apply:<file>:<file> TUNAL_TAGS_SYNC=1 TUNAL_MUSICBRAINZ=<mock url> XDG_CONFIG_HOME=<scratch> cargo run -p tunal -- <dir> --screenshot <png> --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 <png> [--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 <dir>` (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 `<dir>/fixture`, config in `<dir>/config`. Hooks: `TUNAL_POINTER=x,y[,press\|click\|menu]` (hover/press/select/right-click before the frame), `TUNAL_ACTION=<action id>` (runs a menu action on the selection) | S034 |
| `TUNAL_FRAMES=1 target/debug/tunal <dir>` (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.

View file

@ -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: …`

View file

@ -149,9 +149,26 @@ fn gallery(page: GalleryPage) -> Result<Gallery, slint::PlatformError> {
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<Vec<PathBuf>>,

View file

@ -114,7 +114,8 @@ component Toast inherits Rectangle {
// Runs only during the exit: then the owner removes the toast from its model.
property <bool> 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;

View file

@ -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
-

40
docs/motion-audit.md Normal file
View file

@ -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 <dir>`
logged 5 frames during start-up (until 3.2 s), then none from 5 s to 16 s.

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

BIN
docs/review/player-dark.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB