S015: .directory folder metadata (lossless dirmeta, folder icons/names/views, appearance dialog)

Needs S016's Bridge::elevation() and tunal-elevate to build.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
astar76 2026-11-18 20:28:31 -06:00
commit 7ba6ae8eae

View file

@ -160,6 +160,16 @@ One entry per session, newest last, ≤ 15 lines: done, verified how, not done,
- Not done: no live window (real pointer, Shift/Ctrl keys, tab hover switch, menu choice running a job); count badge not looked at (single-item image only).
- Later: autoscroll at list edges while dragging; select the row a drag starts from; spring-open folders on hover; breadcrumb crumbs overlap in a long path (seen in S014 smoke, already in HEAD before S014).
## S015 — `.directory` folder metadata
- Done: `tunal-dirmeta` `DirMeta` (`parse/load/save`, lossless line store: comments, blank lines, unknown groups/keys, `Name[de]`, missing final newline kept; `get/set(group, key, Option)`, empty group dropped; empty file removed on save). Typed: `icon/set_icon` (`[Desktop Entry] Icon`), `name/set_name` (localized by LC_ALL/LC_MESSAGES/LANG), `glyph/set_glyph` and `view/set_view/has_view/clear_view` in `[X-Tunal]` (`Glyph`, `View` details|grid, `Sort` name|size|type|modified|playlist, `SortOrder`, `Group`, `ShowHidden`, `Previews` (read/written, not applied: no previews setting yet), `Playlist` file name for D-021).
- Per folder: view mode, sort + order, grouping, hidden files, playlist sort. Opening a folder with them applies them over the pane's settings and restores the pane's own on leaving (`inherited`); a folder that remembers its view writes later changes back (off-thread).
- Apply: `folder/look.rs` (`Look {name, glyph, picture}` read off-thread after the listing, cached by `.directory` mtime; `Icon` resolved via `IconTheme::load_places()`); rows show name/glyph/picture, shape stays the folder's (`DetailRow.shape-glyph`, `picture`, `has-picture`); the display name sorts and filters, rename edits the real name. Breadcrumb and sidebar show the name with the real name as tooltip (`Crumb.tip`, `PlaceItem.tip`).
- Dialog: action `appearance` ("Folder appearance…", in the folder and empty-area menus; one selected folder, else the folder shown): `ui/dialogs/folder-appearance.slint`, `folder/appearance.rs`. Display name, icon picker (Default, 17 Material glyphs, theme `folder-*` icons), image path field, "remember view" switch. Save runs off-thread; `PermissionDenied` shows an error and turns Save into "Save as administrator" (`Elevation::write_file` from S016).
- Small changes outside the plan files: `desktop_apps.rs` (`IconTheme::load_places`, `names`), `TextField.focus-input`, `Shape`/`ListRow` picture, `actions.rs`/`menus.rs`/`shell/mod.rs` (action, `run_action`, `show_chrome` pub(crate)), `main.rs` (`TUNAL_APPEARANCE`).
- Verified: workspace build, clippy -D warnings, fmt --check; round trip with `cargo run -p tunal-dirmeta --example roundtrip -- <dir>` (diff = the Icon line only); screenshots: folder list with custom names, glyphs and a theme image icon; the dialog.
- Not done: no live window (menu click, real save, polkit prompt via "Save as administrator" is a user check); previews not applied; image picker is a path field (no file chooser); grid view not looked at; sidebar/crumb names only for local folders.
- Later: file chooser for the image; `Previews` once a setting exists; names for places other than local folders.
## Later
- (orchestrator) Breadcrumb: a long path is hard-clipped at the bar's left edge with no elision mark, and the root crumb elides at 960 px — for S034.
-