theme & language: device-following auto theme, Thai default, dropdown sync

- ThemeSwitch: auto now follows the device (prefers-color-scheme) with a live
  matchMedia listener instead of a 06:00-18:00 clock rule; labels become
  'ตามอุปกรณ์ / Device'; auto icon is a monitor
- layout.tsx pre-paint script resolved with matchMedia (no theme flash)
- i18n: default language is Thai (no navigator guess) in lib/ui/i18n.ts;
  new 'i18nready' event so LangSwitch syncs its label after runtime boot
  (button previously stuck on ไทย when the page loaded in English)
- VERSION 2026.10.24.5
This commit is contained in:
Bkk1234 committed 2026-11-04 01:17:39 +07:00
1 parent 4b5a4d33d3
commit 29b126b188
6 files changed
+54 -30

No files matched your search

+1 -1
View File
@@ -15,7 +15,7 @@
- SW ใหม่ → skipWaiting + clients.claim + แจ้งหน้าเว็บ
============================================================ */
const VERSION = "2026.10.24.3"; /* bump เมื่อแก้ UI เพื่อบังคับให้ cache เก่าถูกทิ้ง */
const VERSION = "2026.10.24.5"; /* bump เมื่อแก้ UI เพื่อบังคับให้ cache เก่าถูกทิ้ง */
const CACHE = `atroute-${VERSION}`;
const OFFLINE_URL = "/offline.html";
const VERSION_URL = "/version.json";
+2 -2
View File
@@ -1,6 +1,6 @@
{
"app": "Atroute",
"version": "2026.10.24.3",
"builtAt": "2026-11-04T00:51:02",
"version": "2026.10.24.5",
"builtAt": "2026-11-04T01:16:49",
"pwa": true
}