window.AtShare was assigned the module namespace object from
import('./share'), which is frozen. share.init.ts then threw
'Cannot add property refresh, object is not extensible', aborting the
click handler so the share button did nothing on every page.
- runtime.ts: spread the namespace into a plain object
- share.init.ts: expose the updater as window.AtShareRefresh
- home.init.ts / stop.init.ts: call AtShareRefresh
- remove the temporary probe marker from StopView
Verified: /?s=at_main_terminal, /stops/:code?q=, /routes/:id, /check/:id
all produce short links and restore state on load (TH and EN).
- src/lib/site.ts: single source for site name/url/description (rename via env only)
- src/app/robots.ts: allow all, disallow /api /files, explicit Googlebot/Bingbot/DuckDuckBot/Bravebot/Applebot
- src/app/sitemap.ts: static pages + routes/check/stops from backend, falls back to static when API is down
- src/components/JsonLd.tsx: WebSite + Organization + SearchAction, BreadcrumbList, BusStop, Service
- layout.tsx: metadataBase, canonical, keywords, robots, openGraph, twitter
- generateMetadata for /stops/[code], /routes/[routeId], /check/[routeId]
- canonical + description on /stops /routes /blog /about /credits
- public/og-image.png 1200x630
The five code cells are now the only way to enter a stop code. The numpad
was redundant on touch devices (the cells use inputMode=numeric, so the
system keyboard already switches to digits) and it crowded the 375px
layout.
- StopsView.tsx: drop the .mu-numpad markup.
- stops.search.ts: drop initNumpad(), its call and the pad show/hide toggle.
- stops.css: drop all .mu-numpad rules.
tsc clean, npm run build passes.
Android (Samsung S23, One UI 6) refuses 'Install app' / standalone mode
when the origin is not secure or the app has no service worker. The ported
Next.js app shipped neither: only a manifest existed, and no sw.js at all.
- public/sw.js: navigation network-first with an offline fallback,
cache-first for static assets, /api and /files bypassed, versioned
cache with skipWaiting + clients.claim.
- public/offline.html: offline shell.
- src/components/PwaBoot.tsx: registers the worker, wires
beforeinstallprompt into an in-app install button, and shows a
share-sheet hint on iOS/Samsung Internet where the event never fires.
- ui-manifest.json: add id, display_override, prefer_related_applications,
launch_handler, handle_links, a maskable icon for Android 14 and
screenshots for the install preview.
- layout.tsx: viewport-fit=cover, interactive-widget, maximumScale 5
(never user-scalable=no), appleWebApp metadata, format detection off,
and drop manually duplicated meta tags that Next already emits.
Verified: manifest passes 8/8 installability checks, sw.js and offline.html
serve with correct content types, tsc clean, npm run build passes.
Verified each path against every .ts/.tsx/.css under src plus every JSON
under public. Kept all dynamic lookup directories (routes/qrcode/stations/
stops/partners/icons) because the ported modules resolve those per id and
try several extensions at runtime.
Deleted (nothing references them):
- image/extras/boat.jpeg, boat-market2transta.jpg
- image/landmarks/*.{png,jpg} (stations.json has no landmarks[] entries)
- image/icons/minibus-256x256.ico (Next serves app/icon.png instead)
- image/partners/_original/ (local backup of the tcl999 source photo)
public/image: 39.8 MB -> 30.1 MB. npm run build still prerenders all routes.
The merge of origin/main left 13 conflict markers across 9 files under
frontend/src/app, so 'next build' failed with 21 parse errors and the
Docker frontend image never built.
Resolution:
- Keep the HEAD side (views + PageRuntime shell) for all 8 route pages.
- Rebuild layout.tsx by hand: it mixed both sides outside the conflict
blocks (Viewport/headers/langFromCookie were only imported on the
merged-in side). Kept IconSprite/SiteHeader/SiteFooter/SiteBoot,
the mock CSS order (shared -> map -> shell -> responsive), the
vendored K2D and Leaflet links, and set lang="th" because i18n.ts
sets document.documentElement.lang at runtime.
Verified: tsc --noEmit clean, npm run build compiles and prerenders
all 12 static + 5 dynamic routes.
CARGO_BUILD_JOBS=2 on the 1-vCPU VPS spiked load (~30) and destabilised
the swarm during deploy (health checks timed out, Dokploy restarted and
killed the build). Build with a single job; combined with the 4 GB
swapfile added on the host this keeps the build from starving services.
Deploy failed on the VPS:
error: rustc 1.88.0 is not supported by the following packages:
[email protected].0 requires rustc 1.89.0
No Cargo.lock is committed, so cargo resolves the newest crates on every
build; the transitive MSRV has moved past the 1.88 builder. Bump to
rust:1.90-bookworm (>= uuid 1.28's required 1.89).