breadbar: reconnect Hyprland event stream, fix notification spec violations, point lock button at breadlock

- src/bar/workspaces.rs: the Hyprland EventStream loop exited permanently
  on the first Err/end-of-stream (Hyprland restart/reload, IPC hiccup),
  freezing every workspace button for the bar's remaining life. Now wrapped
  in a reconnect loop with capped exponential backoff, re-syncing workspace
  state on every reconnect
- src/notifications/mod.rs + popup.rs: three spec deviations fixed —
  expire_timeout=0 now means never-expire instead of being coerced to 5s
  (and a critical-urgency notification with no explicit timeout also
  persists by default); NotificationClosed is now emitted with the correct
  reason code whenever a notification actually goes away (expiry or an
  explicit CloseNotification call); replaces_id no longer races its
  auto-dismiss timer against the replacement's, via a per-id generation
  counter checked before a stale timer is allowed to dismiss anything
- src/main.rs + README.md + assets/icons-needed.txt: lock button (and its
  docs) now invoke breadlock instead of hyprlock, the thing breadlock was
  built to replace
- src/notifications/mod.rs: added 4 unit tests for the new expire_timeout/
  urgency mapping (pulled into a pure compute_expire() for testability) —
  this crate had zero test coverage before
This commit is contained in:
Breadway 2026-07-17 08:40:32 +08:00
parent e8d5fd5a52
commit 1f2d58d97f
6 changed files with 229 additions and 46 deletions

View file

@ -392,7 +392,10 @@ impl SimpleComponent for App {
let power_row = gtk4::Box::new(gtk4::Orientation::Horizontal, 4);
power_row.add_css_class("power-row");
for (label, cmd) in [
("🔒", vec!["hyprlock"]),
// breadlock is the ecosystem's own screen locker — hyprlock is
// the thing it was built to replace; the bar shouldn't still
// be pointing at it.
("🔒", vec!["breadlock"]),
("💤", vec!["systemctl", "suspend"]),
("🔄", vec!["systemctl", "reboot"]),
("", vec!["systemctl", "poweroff"]),