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} 项更改待上传",
'sync.pending_other': "{count} 项更改待上传",
'sync.now': "立即同步",
// — Notifications push & indicateur hors-ligne —
'push.device': "此设备上的通知",
'push.deviceHint': "即使应用已关闭也会提醒。下方的选项同样适用。",
'push.iosInstall': "在 iPhone 和 iPad 上,请先将 AzuuCine 添加到主屏幕(iOS 16.4 或更高版本),再从图标打开应用以开启通知。",
'push.unsupported': "此浏览器不支持推送通知。",
'push.denied': "此网站的通知已被阻止。请在浏览器设置中允许后重试。",
'push.notReady': "服务器暂未开放推送通知。",
'push.error': "无法开启通知。请检查网络连接后重试。",
'netPill.offlineSync': "离线 — 你的修改将稍后同步",
'netPill.offlineLocal': "离线 — 所有内容都保存在此设备上",
'netPill.synced': "已同步",
'netPill.hide': "隐藏",
}
export default dict