pwa: automatic update UX - no more hard refresh

- ui/version.json: server-side version marker, polled by pwa.js (load, 5 min,
  tab focus, network online); mismatch -> toast + auto reload once per version
- pwa.js: silent reload when tab hidden, guarded reload (sessionStorage) so a
  partial deploy cannot loop, ATUpdate.check() exposed for testing
- _shared.css: .mu-update-toast pill (bottom center, reduced-motion aware)
- shell js/css get ?v=<version> automatically (bump-version.py) so HTTP cache
  cannot serve stale files before the service worker takes control
- sw: cache fallback now ignores query string (precache still matches ?v= URLs)
- bump-version.py: writes version.json + verifies it in --check
- VERSION 2026.09.27.108
This commit is contained in:
Bkk1234 committed 2026-11-03 00:32:41 +07:00
1 parent 449afb923a
commit fcdab3ac80
8 files changed
+248 -50

No files matched your search

+2 -1
View File
@@ -383,5 +383,6 @@
"credits.analyticsTitle": "สถิติ — แนวคิดจาก Umami",
"credits.analyticsBody": "ระบบสถิติของเว็บนี้เขียนเองใน",
"credits.analyticsBody2": "(ไม่มี dependency) — ยืมเฉพาะแนวคิด privacy-first และรูปแบบ payload ของ Umami (/api/send) ไม่ได้คัดลอกโค้ดของ Umami มาใช้",
"credits.analyticsLocal": "ข้อมูลสถิติเก็บในเบราว์เซอร์ของผู้ใช้เท่านั้น (localStorage) — ดู/ล้างได้ที่หน้า “สถิติ”"
"credits.analyticsLocal": "ข้อมูลสถิติเก็บในเบราว์เซอร์ของผู้ใช้เท่านั้น (localStorage) — ดู/ล้างได้ที่หน้า “สถิติ”",
"update.applying": "มีเวอร์ชันใหม่ — กำลังอัปเดต…"
}