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
This commit is contained in:
Bkk1234 committed 2026-11-04 00:53:37 +07:00
1 parent c0b70ff845
commit 4b5a4d33d3
22 files changed
+1473 -453

No files matched your search

+41 -3
View File
@@ -131,10 +131,10 @@
"stops.noOffset": "No travel time from the first stop yet",
"stops.noBusLine": "No bus line listed",
"stops.modeCode": "Search by stop code",
"stops.modeNear": "Near me",
"stops.modeNear": "Near me",
"stops.nearCta": "Use my location",
"stops.nearHint": "We ask your device for a location, then rank stops by real distance from their coordinates.",
"stops.modePlace": "Search by place name",
"stops.modePlace": "Search by place name",
"stops.codePh": "3+000",
"stops.codeHint": "Type 4 digits and the + sign is added automatically (e.g. 3000 → 3+000)",
"stops.codeHintBox": "Type digits in the boxes — empty boxes are filled with 0 automatically. For 4-digit codes such as 8+591, enter 08+591",
@@ -267,5 +267,43 @@
"check.noMoreToday": "No departures left today",
"check.stopsCount": "stops",
"check.toStopDetail": "View stop detail",
"common.routes": "routes"
"common.routes": "routes",
"nav.stats": "Stats",
"update.applying": "New version — updating…",
"stats.title": "Search statistics on this device",
"stats.lead": "Only counts and search terms are kept — no cookies, no user id, no IP, and nothing leaves this device",
"stats.kpi.views": "Page views",
"stats.kpi.searches": "Searches",
"stats.kpi.terms": "Unique terms",
"stats.kpi.noResult": "No results",
"stats.chart.title": "Last 14 days",
"stats.chart.lead": "Solid bar = page views · light bar = searches",
"stats.terms.title": "Top search terms",
"stats.terms.lead": "Terms are sanitised — emails, phone numbers and long digit runs are stripped before saving",
"stats.terms.empty": "No searches on this device yet — try the stop search page, then come back",
"stats.views.title": "Most opened pages",
"stats.views.lead": "Counts route and stop detail pages only (not tied to any user)",
"stats.views.empty": "No data yet — open a route or stop detail once",
"stats.views.stopPrefix": "Stop {code}",
"stats.views.routePrefix": "Route {n}",
"stats.noresult.title": "Searched, nothing found",
"stats.noresult.lead": "A signal that data is missing — these terms should exist if they are real routes",
"stats.privacy.title": "Privacy",
"stats.privacy.collect": "Stored: page-view counts · sanitised search terms · no-result counts · last-used time",
"stats.privacy.reject": "Not stored: IP · User-Agent · location · cookies · device id · cross-site history",
"stats.privacy.local": "Data lives in this browser's localStorage only — clear it anytime",
"stats.privacy.optoutTitle": "Turn off stats on this device",
"stats.privacy.optoutLead": "Switching this on stops recording immediately (existing numbers stay visible). Do Not Track / GPC are respected anyway.",
"stats.privacy.off": "Stats turned off — nothing new is recorded",
"stats.privacy.on": "Stats turned on",
"stats.btn.export": "Download data (JSON)",
"stats.btn.clear": "Clear data on this device",
"stats.clear.confirm": "Clear all stats on this device? This cannot be undone.",
"stats.clear.done": "Data cleared",
"stats.export.done": "File downloaded",
"stats.since": "Collecting since",
"stats.col.term": "Term",
"stats.col.count": "Hits",
"stats.col.last": "Last",
"stats.col.target": "Page"
}