Commit Graph
3 Commits
Author SHA1 Message Date
Bkk1234 4b5a4d33d3 sync from mock: motion, privacy-first search stats, auto-update UX
- frontend/src/lib/ui/motion.ts + components/MotionBoot.tsx: page-enter and
  scroll reveal per pathname change (ported from mock motion.js); IntersectionObserver
  plus sweep fallback for jump-scroll/hidden tabs, maps never transformed
- frontend/src/lib/ui/analytics.ts: cookie-less local-first search analytics
  (localStorage at_stats_v1, DNT/GPC + opt-out, term sanitiser, 900ms debounce,
  caps 300 terms / 200 views / 120 days); optional Umami endpoint via AT_ANALYTICS
- /stats page (StatsView + styles/pages/stats.css): KPIs, 14-day chart, top terms,
  top route/stop pages, no-result terms, JSON export, clear, opt-out
- hooks: stops search apply(), stop detail route filter
- remove footer visitor counter (lib/ui/visitors.ts, .mu-visitor/.mu-vreset, i18n keys)
- remove floating install-app button; PwaBoot keeps SW + guarded version toast
  (sessionStorage guard, silent reload when tab hidden)
- i18n th/en: nav.stats, update.applying, stats.* (public + src/data locales)
- version.json + sw VERSION -> 2026.10.24.3; docs/UI-PORT.md section for this round
2026-11-04 00:53:37 +07:00
Bkk1234 18f7a6e34b Serve HTML with no-store so a plain reload picks up a new deploy
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.
2026-10-24 00:34:51 +07:00
Bkk1234 0cf391afba PWA: publish an app version so stale shells are detectable
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.
2026-10-24 00:27:23 +07:00