matx64/synche

Opt-in desktop notifications for sync events

Aperta

#26 aperta il 27 mag 2026

 (0 commenti) (0 reazioni) (0 assegnatari)Rust (1 fork)auto 404
enhancementhelp wanted

Metriche repository

Star
 (0 stelle)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

Goal

Today the only way to know that something happened (a peer connected, a conflict was created, a directory was added) is to have the GUI open. Add OS-level desktop notifications so important events surface even when the browser tab is closed.

Requirements

  • New app/src/infra/notifications/ module using a small cross-platform crate such as notify-rust. Behind the existing port pattern if there's an obvious home, otherwise an in-place adapter is fine for this iteration.
  • Subscribe the notifier to the same ServerEvent broadcast that drives SSE (AppState::sse_sender()), so we don't grow a second event bus.
  • Emit notifications for at least:
    • Peer connected / disconnected
    • Conflict created (depends on / aligns with the conflicts GUI issue)
    • Sync directory added / removed
  • Opt-in via config.toml. Default is off. Per-event-class toggles would be nice but a single notifications.enabled = true is acceptable for this iteration.
  • Failures to display a notification must not crash or block the synchronizer — log at warn and move on.

Out of scope

  • A system tray / menu-bar icon (separate, larger issue)
  • Notification actions (''click to open GUI'') — nice to have, but optional for this iteration
  • Aggregating notification storms (revisit if it turns out to be annoying)

Acceptance criteria

  • With notifications.enabled = true, connecting a peer on another device fires a desktop notification
  • With notifications disabled (default), no notifications fire even when events occur
  • The notifier never blocks ServerEvent propagation to the GUI
  • Linux (libnotify) verified; macOS / Windows ''best-effort'' is acceptable for now if the crate covers them

Guida contributor