S033: tray, notifications, launcher progress, autostart, metainfo, test file

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
astar76 2026-11-25 22:49:31 -06:00
commit 4ac8cd9379
2 changed files with 835 additions and 11 deletions

View file

@ -227,3 +227,7 @@ Seen: boxes were ticked together after the tests, against rule 3.
- `core::rules` (Rule/Item/apply/expand/unique/defaults, first fit wins; settings `rules`, `clipboard`, `clip_types`, `clip_skip`, `drop_target`); Add's `tasks()` applies rules to what the user left as is (folder, queue, priority, tags, name template with collision numbers).
- `app::clipboard` (thread polls arboard 1 s while ask/add; ignores start content, repeats, own copies via `clipboard::copy`), `app::drop` (full-window overlay, paths and `://` paths to Add), `views/target.rs` (own viewport, always-on-top hint, ring, menu), `views/rules.rs` and two settings pages (Rules, Clipboard and drops).
- Not done: winit gives no dropped text, so browser link drags work only as paths; always-on-top is ignored by niri; no layer-shell; rules not applied by the CLI or direct engine adds; tests: `docs/tests/S027-rules-clipboard-drop.md`.
## S033 — Tray, notifications, autostart (compiled, not tested)
- `app::{shell,tray,notify,launcher,autostart}`: `Shell` (in `App`) feeds ksni tray (ring icon, speed tooltip, mode/pause/resume/add/show/quit), notifications (Watcher diffs snapshots; summaries over 3; quiet hours; actions open/folder/continue/retry via zbus), Unity launcher signal, autostart file (`--minimised`). New settings: tray, close_to_tray, start_minimised, autostart, notify, quiet*. Close-to-tray only with a tray host. Did not reuse `views/target.rs`. `assets/medlar.metainfo.xml`, `tools/validate-desktop.sh` (appstreamcli warns: homepage).
- Not done: no settings page rows for the new settings; hidden-window redraw on Wayland unverified; fake-bus tests not written (`docs/tests/S033-tray-notify.md`).

View file

@ -0,0 +1,33 @@
# S033 test file: tray, notifications, launcher, autostart
All bus checks run under `dbus-run-session` with fake services, never the user's session bus. Autostart checks use a throwaway config folder.
## HIGH
1. Fake StatusNotifierWatcher present: `Tray::start` returns Some; the fake host sees id `medlar`, an ARGB pixmap of 64x64 and a menu with Show, Add, a 4-way mode group, Pause all, Resume all, Quit.
2. No watcher on the bus: `Tray::start` returns None, no panic; closing the window then really closes it (`hides_on_close` false).
3. Fake host calls the menu items: the app receives Do::Show, Add, PauseAll, ResumeAll, Mode(x), Quit in order; Quit sets `quitting` and the window closes even with close-to-tray on.
4. Close to tray on, tray present: window close request is cancelled and the window hides; Show brings it back focused.
5. Fake Notifications service: a download going Running to Done yields one Notify call with summary "Download finished", actions open and folder, hint desktop-entry=medlar.
6. Fake service emits ActionInvoked(id, "folder") then "open": the app gets Do::Folder / Do::Open of the file. Unknown id or key: nothing happens.
7. Failed with kind Login gives a "Sign-in needed" note with action continue, which opens the sign-in dialog for that link; plain Failed gives retry, which resumes the download.
8. Autostart: `sync_with(tmp, exe, true, true)` writes `autostart/medlar.desktop` with `Exec=... --minimised`; a path with spaces is quoted; `false` removes it; removing twice is fine.
## MED
9. First snapshot after start sends no notifications (baseline only); paused-then-done also notifies; Done seen on load does not.
10. 5 finished in one batch give one "5 downloads finished" note; 3 give three.
11. "All downloads are finished" comes once when the last running download ends after at least one finish, not when the last one is paused.
12. Quiet hours: span 22:00-07:00 is quiet at 23:00 and 03:00, not at 12:00; equal ends never quiet; with quiet on, no Notify call reaches the fake service.
13. Setting `notify` off: no Notify calls.
14. Tray ring: with progress None the icon equals the app icon; at 50% the right half of the ring is opaque, left half faint, centre untouched. Tooltip reads "N running, speed" and "Nothing is downloading" when idle.
15. Launcher: a fake bus listener sees `com.canonical.Unity.LauncherEntry.Update` with `application://medlar.desktop`, progress between 0 and 1, progress-visible true while downloading and false after.
16. `medlar --minimised` is accepted by `wants`, is not passed on as a link, and starts hidden only if a tray exists.
17. `tools/validate-desktop.sh` passes; with desktop-file-validate and appstreamcli present, both report no errors.
## LOW
18. Settings round trip keeps tray, close_to_tray, start_minimised, autostart, notify, quiet, quiet_from, quiet_to; an old file without them gets the defaults.
## Doubts
- A hidden window may get no redraws on Wayland, so tray commands, notifications and launcher updates could stall while it is hidden. Check by hiding to tray, then clicking Show, and finishing a download while hidden.
- No settings page controls the new settings yet (file only); a later plan adds the rows.
- The ksni tooltip and radio group look differs per tray host; check in KDE and a GNOME host if available.
- The Unity signal body (s, a{sv}) is built with zbus tuple flattening; verify on the wire.