S009: icon grid view, view switch and list motion

Grid view with virtualized lines of cells laid out by the folder model,
a segmented details/grid switch with a cross-fade, list motion for
inserts, removals and reorders driven by a transition clock, and a
slide in the direction of travel when a folder opens. Reduced motion
makes all of it instant.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
astar76 2026-11-18 14:35:47 -06:00
commit c6ae55f477

View file

@ -85,5 +85,12 @@ One entry per session, newest last, ≤ 15 lines: done, verified how, not done,
- Not done: audible check not done (volume 0); cancel path of waveforms exercised only by code; mid-stream spec changes skip the packet; device loss mid-play reports `Output` error and stops (no reconnect).
- Later: waveform worker pool instead of a thread per request; resume on default-device change.
## S009 — Icon grid view and list motion
- Done: `views/grid-view.slint` `GridView` (ListView of `GridRow { header, start, count, headers-before }` lines from `FolderModel::grid_lines()`; columns = visible width / 112 px, reported by `columns-changed` → `set_columns`; cells stretch; 48 px icon, two-line word-wrapped elided name, selection fill grows like ListRow, cursor ring; Left/Right/Up/Down/Page/Home/End by grid line). `views/view-switch.slint` `ViewSwitch { mode; selected(ViewMode) }` (sliding pill) and `FolderView` (both views over one model, cross-fade, list and travel clocks; same callbacks as DetailsView + `columns-changed`, `motion-settled`, in `lines`). Shared `FolderKeys`, `FilterChip`, `FolderMessages`, `HeaderCell`, `Columns` exported from details-view.slint; `NavKey.left/right`; `Travel`, `ViewMode`.
- `folder/motion.rs`: keys per row (raw name / header label), leaving copies merged after their old neighbour, details `from-y` (rows) with grow/collapse heights, grid `from`/`to` in cells, cell lines and header lines; interruptions continue from drawn positions; > 2000 rows instant. Model API: `set_mode`, `set_columns`, `grid_lines`, `motion_settled`, `set_list_time`, `open_travel` (`activate` = `Travel::Into`). Tokens: `MotionPrefs.list-change`, `Motion.travel-shift`, `Motion.settle()`, `MotionClock`; icon `view-list`. Mode location: D-033.
- Verified: real tree (with S010's shell, which wires FolderView/ViewSwitch): workspace build, clippy -D warnings, fmt --check, literal grep empty; details + grid screenshots light + dark in the shell (grid only after keeping the Shell alive in a scratch copy: S010's screenshot path drops it, reported). In a scratch copy with S010 reverted: screenshots details/grid light + dark, 720×480 grouped grid, selection + cursor; a dump of row motion data for sort flip, filter, interrupted filter, grid sort and grid filter; first frame after a sort flip draws the old order (clock starts before paint) in both views; with `TUNAL_REDUCED_MOTION=1` the new order at once. Literal grep empty.
- Not done: navigation slide and live motion not watched (no event loop offscreen; S035); `tunal --screenshot` in the grid view shows one column until S010 keeps the Shell alive in its screenshot path. Screenshot env `TUNAL_VIEW=grid` added.
- Later: a live switch to reduced motion during a change leaves its leaving rows until the next change; entering rows interrupted mid-growth jump to full height; grid thumbnails (S018) go in `GridCell`.
## Later
-