Notifications push (Web Push) et indicateur hors-ligne / synchro en attente

- Réglages → Notifications : interrupteur « Notifications sur cet appareil »
  (permission demandée au clic uniquement, iOS : explication « installe l'app »,
  permission refusée, navigateur non compatible). Désinscription à la déconnexion.
- Service worker : push-sw.js chargé via workbox.importScripts (affichage +
  clic qui ouvre/focalise l'app sur le bon écran via « /?open=… »).
- Serveur : table push_subscriptions (RLS, anti-SSRF, 10 appareils max),
  déclencheur pg_net + secret dans Vault, fonction send-push (aes128gcm +
  VAPID ES256 en WebCrypto, testée sur le vecteur RFC 8291), regroupement des
  épisodes, préférences notifPrefs, ménage des abonnements expirés.
- scripts/gen-vapid.mjs et supabase/PUSH_SETUP.md (étapes manuelles).
- Pastille discrète hors-ligne / « N modifications en attente » (mobile au-dessus
  de la barre de nav, ordinateur dans la barre latérale), basée sur l'état du
  moteur de synchro existant.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YVo1qxKoBQCaMd7Ue8PGbe
This commit is contained in:
Claude committed 2026-10-09 15:21:17 +00:00
1 parent c246b16e7e
commit 6f7064f53f
35 files changed
+1779

No files matched your search

+12
View File
@@ -897,6 +897,18 @@ const dict: Translations = {
'sync.pending_one': "{count} modifica in attesa",
'sync.pending_other': "{count} modifiche in attesa",
'sync.now': "Sincronizza",
// — Notifications push & indicateur hors-ligne —
'push.device': "Notifiche su questo dispositivo",
'push.deviceHint': "Anche con l’app chiusa. Valgono anche le scelte qui sotto.",
'push.iosInstall': "Su iPhone e iPad, aggiungi prima AzuuCine alla schermata Home (iOS 16.4 o successivo), poi apri l’app dalla sua icona per attivare le notifiche.",
'push.unsupported': "Questo browser non supporta le notifiche push.",
'push.denied': "Le notifiche sono bloccate per questo sito. Consentile nelle impostazioni del browser, poi riprova.",
'push.notReady': "Le notifiche push non sono ancora disponibili sul server.",
'push.error': "Impossibile attivare le notifiche. Controlla la connessione e riprova.",
'netPill.offlineSync': "Offline — le modifiche verranno sincronizzate",
'netPill.offlineLocal': "Offline — tutto resta salvato su questo dispositivo",
'netPill.synced': "Sincronizzato",
'netPill.hide': "Nascondi",
}
export default dict