plans: playlist sort in S008 (D-021)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
astar76 2026-11-18 09:30:10 -06:00
commit 0d82cc3975
3 changed files with 4 additions and 1 deletions

View file

@ -10,6 +10,7 @@ Status: planned → done (later plans update their rows when they ship a feature
| Copy, cut, paste, rename, delete, move to trash, file operations with progress, cancel and conflicts | planned | S007, S011 | tunal-core, tunal |
| Details view and icon grid view, type-to-filter | planned | S008, S009 | tunal |
| Sorting, grouping, hidden files toggle | planned | S008 | tunal |
| Playlist sort in the music folder (m3u, m3u8, pls, xspf order) | planned | S008 | tunal-core::playlist, tunal |
| Tabs, split view, editable breadcrumb path bar, back / forward / up, places sidebar | planned | S010 | tunal |
| Copy path, properties, Open, Open with | planned | S012 | tunal |
| Settings dialog and context menus the user can edit (add, remove, reorder) | planned | S013 | tunal |

View file

@ -1,7 +1,7 @@
# S008 — Folder model and details view
> Category 03 File browsing · Model: Opus · Effort: medium · Depends on: S006, S005 · Size: L · Human: no
> Files touched: crates/tunal/src/folder/**, crates/tunal/src/icons.rs, crates/tunal/ui/views/details-view.slint, crates/tunal/src/main.rs, crates/tunal/ui/app.slint
> Files touched: crates/tunal-core/src/playlist.rs, crates/tunal/src/folder/**, crates/tunal/src/icons.rs, crates/tunal/ui/views/details-view.slint, crates/tunal/src/main.rs, crates/tunal/ui/app.slint
## Goal
A folder model fed from the location layer off the UI thread (sorting, grouping, hidden files, type-to-filter, live updates, selection) shown in a virtualized details view.
@ -12,6 +12,7 @@ CLAUDE.md §3, §4; crates/tunal-core trait; crates/tunal/ui/components/list-row
## Steps
- [ ] `FolderModel`: load off-thread in chunks, apply watch diffs (insert/remove/change) keeping selection; a Slint `Model` that stays fast at 10 000+ rows.
- [ ] Sorting (natural name order, size, type, modified; folders first toggle; asc/desc) and grouping (none, type, modified date buckets, size buckets) with group header rows.
- [ ] Playlist sort (D-021): in folders under `XDG_MUSIC_DIR` that hold a playlist (`.m3u`, `.m3u8`, `.pls`, `.xspf`), the sort options show **Playlist sort** (one entry per playlist when there are several); files listed in the playlist come first in playlist order, the rest follow in natural name order; desc reverses; the playlist file is watched and re-sorts on change. Parser in `tunal-core::playlist` (relative/absolute paths, `file://` URLs, percent-decoding, `#EXT` lines skipped).
- [ ] Hidden files toggle (dot files) and type-to-filter (typing filters by substring, a filter chip shows the text, Esc clears).
- [ ] Mime → Material Symbols glyph map (folder, image, audio, video, text, code, archive, PDF, executable, generic, symlink badge).
- [ ] Details view: `ListView` rows on `ListRow`, column header with click-to-sort and animated indicator, empty/loading/error states.

View file

@ -22,3 +22,4 @@ D-017 — 2026-11-18 — `.directory`: standard `[Desktop Entry]` `Icon` and `Na
D-018 — 2026-11-18 — Elevation via pkexec/polkit: `tunal --elevated-helper` over stdin/stdout pipes; the polkit agent asks for the password, Tunal never sees it; policy file in assets/polkit, installed by the install script (needs root, printed not run) — user — S016, S036, S037.
D-019 — 2026-11-18 — TLS and SSH crypto on rustls + ring (no aws-lc-rs, no OpenSSL) — user — S020, S028.
D-020 — 2026-11-18 — Accepted SSH host keys go to `$XDG_CONFIG_HOME/tunal/known_hosts`, read together with `~/.ssh/known_hosts`; Tunal never writes under ~/.ssh — plan-generate — S027–S029.
D-021 — 2026-11-18 — Playlist sort: a sort option "Playlist sort" offered only in folders under XDG_MUSIC_DIR that contain a playlist file (.m3u, .m3u8, .pls, .xspf); listed files first in playlist order, unlisted entries after in natural name order; several playlists → one option each; desc reverses; re-sorts when the playlist changes; stored as the folder's sort in `.directory` like other sorts — user request (details chosen by orchestrator, user may revise) — S008, S015.