- theme.css: colour-scheme per theme for select/input/textarea and explicit
option/optgroup colours (native popup was rendering light text on white in
dark mode); :checked uses the purple tint
- _shared.css: token fallbacks on .mu-pop-* so the theme/language menus stay
readable if tokens fail to load
- VERSION 2026.10.24.7
- 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
Root cause of 'the change never appears': pages are statically prerendered,
so Next replied with Cache-Control: s-maxage=31536000. The browser kept the
old HTML for up to a year, which is why editing sw.js and the footer version
changed nothing for an existing visitor.
next.config now adds, for any request whose Accept includes text/html:
Cache-Control: private, no-cache, no-store, max-age=0, must-revalidate
Static assets are untouched (hashed files under _next/static keep their
immutable caching).
Bumped version.json and the SW VERSION to 2026.10.24.2.
Verified with curl (Accept: text/html) that /, /stops, /routes, /about and
/credits all return no-store, while images still return public, max-age=0;
and in the browser an ordinary reload returns the three-tab /stops page with
the v2026.10.24.2 footer badge.
The service worker version had never moved past 1.0.0 and nothing on the page
said which build was loaded, so an old cached shell looked identical to a
fresh one.
- public/version.json: app, version, builtAt, pwa
- sw.js VERSION -> 2026.10.24.1 (new cache name, old caches dropped on activate)
- next.config: sw.js and version.json are served no-cache, no-store, plus
Service-Worker-Allowed: / ; ui-manifest.json must-revalidate
- layout: <html data-app-version> read from version.json at build time
- PwaBoot: paints the version into the footer badge, polls /version.json
(1.5s then every 5 min) and reloads once when it differs; guards against
reload loops
- footer shows v2026.10.24.1 in mono next to the copyright
Verified: sw.js, /version.json and <html data-app-version> all report
2026.10.24.1, the footer badge shows it, and /stops renders the three search
tabs with the near-me panel in its own tab.