S012: properties dialog, open in default app, Open with chooser and desktop entry helpers

Also carries S013's shared-file hunks (actions.rs, app.slint, main.rs, shell/mod.rs).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
astar76 2026-11-18 18:49:24 -06:00
commit cbbfa9875d

View file

@ -122,5 +122,11 @@ One entry per session, newest last, ≤ 15 lines: done, verified how, not done,
- Not done: sidebar place menu still its own fixed list (Open in new tab, bookmark edit). No live drag run (pointer drag, motion); clippy not clean until S012 lands. `TUNAL_SETTINGS=<page>` opens the dialog in a screenshot. Shared files `actions.rs`, `app.slint`, `main.rs`, `shell/mod.rs` hold S012 hunks too: left uncommitted here.
- Later: autoscroll while dragging in a long menu; Previews page (S018); sidebar menu from the model.
## S012 — Properties, Open and Open with
- Done: `properties.rs` (`Properties::show(uris)`; `gather` thread: stat, then recursive count with live updates every 100 ms, cancelled when the dialog closes; type, location, link target, dates (accessed/created for local files), owner/group from /etc/passwd + /etc/group, `rwx` text + 3×3 grid, multi-selection summary; empty-area menu = the folder). `open.rs`: `open(path, done)` = portal `OpenURI.OpenFile` (zbus, fd) then `xdg-open` (no shell); `Opener` (Enter/double-click on a file via `FolderModel::activate` → `Option<Uri>`, actions `open`, `open-with`). `desktop_apps.rs`: `.desktop` scan (XDG dirs, ids, localized Name), `mimeapps.list` (defaults/added/removed, all XDG files), `Apps::choices(mime)`, `set_default` (atomic, keeps other lines), `split_exec` + `command_lines` (%f %F %u %U %i %c %k %%, one launch per file when no list code), `launch` (detached, no shell, `Terminal=true` via `xdg-terminal-exec`), `IconTheme::load().find(name, size)` (gtk theme + Inherits + hicolor + pixmaps; **S015 reuses this**). Dialogs `dialogs/{properties,open-with}.slint`; actions `open`, `open-with`, `properties` (no shortcuts) in the registry and S013's default menus.
- Verified: workspace build, clippy -D warnings, fmt --check; screenshots (temporary hook, removed): properties for a file (light) and a folder (dark, count 2 files/2 folders, 298 KiB), Open with for a text file (icons from theme, svg ok); temporary test (removed): Exec splitting/expansion for %f, %U, one launch per file, `set_default` on an empty and an existing mimeapps.list in a scratch `XDG_CONFIG_HOME`.
- Not done: no live window (double-click open, portal call, a real launch); Alt+Enter shortcut; mixed file+folder selection with Open sends folders to the portal.
- Later: properties editing (permissions, owner); open folders in new tabs; Alt+Enter; icons loaded lazily for long lists.
## Later
-