Notifications: opt-in architecture (shared enable flag, manager autostart, liveness) + evidence-based defaults

Aperta
#1,435 7 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 4 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva

Direzione di ricerca

Il lavoro coinvolge più repository: aw-notify-rs (Rust) per il flag di abilitazione e l’heartbeat, aw-qt/aw-tauri (Python/JavaScript) per i toggle della tray e la logica di avvio, aw-webui (JavaScript/TypeScript) per la UI del pannello delle impostazioni e la visualizzazione della liveness, e aw-android (Kotlin) per migrare il relativo worker delle notifiche. Inizia esaminando l’API delle impostazioni condivisa in /0/settings/aw-notify e i moduli di notifica esistenti. Controlla le issue precedenti collegate per il contesto. «Done» significa che il flag controlla l’avvio del modulo su tutte le piattaforme, che esiste un toggle nella tray e che la webui mostra lo stato di esecuzione dal bucket dell’heartbeat.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Problem

The notifications settings panel (AwNotifySettings, shared thresholds for Android/desktop) is now reachable (ActivityWatch/aw-webui#972 fixed the 404), but on default desktop installs it is silently inert: neither aw-qt nor aw-tauri autostarts aw-notify by default, so thresholds get saved to /0/settings/aw-notify and nothing consumes them. Android is the opposite: NotifyWorker runs by default with baked-in alerts. Users have also reported not being able to turn the module on at all (#1175).

Product stance (Erik): notifications must be opt-in — but with excellent opt-in defaults, grounded in the intervention/nudging literature (positive reward framing over limit-nagging, timing at natural breakpoints, habituation avoidance), plus user-facing guidance on using them effectively. A research pass to derive those defaults is running separately and will be linked here.

Design

1. Opt-in flag in the shared settings key. enabled: false by default in /0/settings/aw-notify — single source of truth for all platforms. Android's NotifyWorker honors the same flag (today it defaults on; unify to opt-in with a migration note).

2. Managers read the flag at startup and start aw-notify iff enabled. This is a one-directional manager→server read after server-up (managers already start/probe the server; no module management enters the server).

3. Tray toggle for immediacy. aw-qt/aw-tauri get an "Enable notifications" tray item that writes the flag AND starts/stops the module immediately. The webui toggle alone takes effect on next launch; the tray covers "I want it now". No webui→manager channel is introduced.

4. Liveness without manager coupling. aw-notify sends a periodic heartbeat to its own bucket (aw-notify_<host>). The settings panel derives "running / not running (how to enable)" from bucket freshness — server-data-only, works on every surface including remote/Android.

5. Module management stays OUT of the webui/server. The server remains pure storage/query; process control stays with the managers. (If module control ever needs a remote surface it should be a manager-owned endpoint — out of scope here.)

6. Target aw-notify-rs. Python aw-notify is deprecated (ActivityWatch/aw-notify#16); the enable-flag + heartbeat work lands in aw-notify-rs (which already reads the shared settings API, ActivityWatch/aw-notify-rs#38). This also makes an always-run-silent fallback viable later if wanted, but the opt-in autostart design above doesn't need it.

Evidence-based defaults (separate deliverable, feeds this issue)

  • Default alert set + thresholds + timing rules with citations (JITAI, notification-fatigue/habituation, framing effects, implementation intentions)
  • User-facing doc: how to use notifications for reward/nudging effectively; linked from the settings panel
  • Ties into the existing reward-framing direction: achievements/streaks (ActivityWatch/aw-android#205), anomaly-detection alerts (ActivityWatch/aw-android#200)

Prior work

  • ActivityWatch/aw-android#201 (shared settingsStore + webui config surface — the panel this builds on)
  • ActivityWatch/aw-android#196 (Android aw-notify support)
  • ActivityWatch/aw-notify-rs#38 (shared config via settings API)
  • ActivityWatch/aw-notify#8 (user demand for configurable category prompts)
  • #1175 (module cannot be toggled on — the UX gap this closes)

Rough scope by repo

Repo Work
aw-notify-rs honor enabled flag; heartbeat bucket
aw-qt / aw-tauri read flag at startup; tray toggle (write flag + start/stop)
aw-webui enable toggle in panel; liveness display from bucket freshness; link usage doc
aw-android honor shared enabled flag (migrate from default-on)
docs user guidance page from the research deliverable
Lingua principale
Python
Stelle
19.7k
Fork
1.1k
Merge medio
2g 19h
PR unite (30g)
14

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di ActivityWatch/activitywatch

Tutte le issue di ActivityWatch/activitywatch

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.