Skip to content

Optimize the site: SEO, data loading, UX, PWA, and tests - #59

Merged
egorikftp merged 22 commits into
mainfrom
feat/og-meta-parallel-fetch
Nov 16, 2026
Merged

egorikftp merged 22 commits into
mainfrom
feat/og-meta-parallel-fetch

Conversation

@egorikftp

@egorikftp egorikftp commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

What

A optimization sweep over the static site — one commit per concern:

SEO

  • Add robots.txt, the canonical URL and the theme color — metadata routes with force-static (required by the static export), alternates.canonical, and a light/dark themeColor via the Viewport export.
  • Add the apple-touch-icon — iOS homescreen ignores SVG favicons and pinned a page screenshot instead.
  • Add server-rendered content for search engines — the page was a bare loading placeholder in the export; now a server-rendered (visually hidden) h1 + description with the region names is the page's indexable face. app/page.tsx became a server component, the client shell moved to components/HomeClient.tsx.
  • Brand the 404 page in Russian with a way back — GitHub Pages serves 404.html for every unmatched URL.

Data loading

  • Start the CDN data fetch in parallel with the map bootstrap — the fetch no longer trails the style/tile load.
  • Time the CDN fetch out after 15 seconds — a hung CDN used to mean an eternal loading face; now it lands on the error state with a retry.
  • Drop the client-side checksum verification — the manifest's sha256 turned out to be the publisher's own change-detection key (items-serialization hash, per the pipeline's docs/integrations/cdn.md), not a served-bytes checksum. Verified against the live CDN, then removed with the contract documented in the commit message.

UX

  • Move the data status onto the map: error card and freshness pill — the status used to hide inside the closed filters panel; now an alert card with retry (errors) and a pill showing loading/freshness ("Данные от 15 ноября", stale after a week) live on the map.
  • Remember the layer toggles across visits — localStorage, same pattern as the theme and the banner.
  • Add a share button to the detail panel — navigator.share on mobile, clipboard + "Скопировано" fallback on desktop; the ?marker= URL was always shareable, now there's an affordance for it.
  • Keep the map interactive on desktop while the panel is open — inert now applies only under the 768px sheet breakpoint.
  • Lead the store banner with the platform's store — UA sniff, both badges stay.
  • Search objects by name and road in the filters panel — substring search over all three collections, picking a hit opens the detail and flies to the sign.
  • Filter the map by region: markers through the tiers, lines through the sources — the region field finally got a UI.
  • Show a name tooltip when hovering the overlay lines — the canvas lines get the dot-tier markers' hover affordance.

PWA

  • Add the PWA manifest, icons and an offline service worker — manifest + 192/512 icons rendered from the logo artwork; the worker does network-first for navigations and CDN data (last snapshot survives offline), cache-first for hashed static assets. Map tiles are deliberately not cached. Production-only registration.

Hygiene

  • Test the lib helpers with vitest — 27 tests over routing, banner TTL, layer toggles, CDN loading and search; npm test wired into CI.
  • Fix the stale satellite mention and the maplibre version in the README.

Verification

  • npm run lint, npx tsc --noEmit, npm test (27/27), npm run build — clean; CI covers all four.
  • Served out/ locally in a browser: map draws with data fetched through the parallel path; filters panel shows the search, the region select (Гродненская hides 149 of 266 markers) and the counters; the freshness pill reads "Данные от 15 ноября"; search pick opens the detail and flies to the sign; the error card was live-verified against the real checksum mismatch before the revert; 404.html renders the branded page.
  • out/index.html ships canonical + theme-color pair + manifest link; out/robots.txt, out/manifest.webmanifest, out/sw.js, out/apple-touch-icon.png all present.

The manifest sha256 turned out to be the publisher's own change-detection
key — the hash covers the items serialization only, not the served file
(docs/integrations/cdn.md, JsonCdnFeaturePublisher). Verifying it against
the response body fails on every fresh load and fixing it would mean
re-serializing the items array byte-for-byte like kotlinx does — too
fragile for a client check. A truncated upload still fails JSON.parse,
and the fetch timeout covers the hang case.
@egorikftp egorikftp changed the title Add Open Graph share meta, parallel data fetch, and preconnects Optimize the site: SEO, data loading, UX, PWA, and tests Nov 15, 2026
@egorikftp
egorikftp merged commit 5829ccc into main Nov 16, 2026
1 check passed
@egorikftp
egorikftp deleted the feat/og-meta-parallel-fetch branch November 16, 2026 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant