feat(GRO-2160): route nav export buttons + offline map polish #66

Merged
Flea Flicker merged 1 commits from feat/GRO-2160-route-export-offline into dev 2026-06-09 04:31:24 +00:00
Member

[Phase 3.3] Route Optimization — Export buttons + offline polish

Implements GRO-2160. Final phase of the Mobile Groomer Route Optimization feature. Frontend-only — the /api/routes/:routeId/export/:platform endpoints already exist (GRO-2158).

Changes

  • Navigation export (src/pages/Routes.tsx): a NavExportButtons panel shown when a route has stops. Open in Google Maps / Open in Apple Maps each fetch GET /api/routes/:routeId/export/{google-maps,apple-maps} and open the returned deep link. Device OS is detected (iOS / Android / desktop); the relevant app's button is rendered prominently (filled) and the other as a secondary outline button (iOS → Apple Maps leads; otherwise Google Maps). A blank tab is pre-opened in the click gesture to survive mobile popup blockers, and closed with an inline error on failure.
  • Offline map tiles: prewarmRouteTiles() fetches the OSM tiles covering the route's bounding box (zooms 12–14, capped at 80 tiles) on every route load and after each optimize/reorder. New Workbox CacheFirst rule osm-tiles (7-day TTL, 400 entries) in vite.config.ts makes pre-warmed tiles persist offline, alongside the existing NetworkFirst /api/* rule (24h) that already caches route data.
  • Responsive polish: a useIsMobile() media-query hook switches the map/stop-list grid to a single column, shrinks the map, and makes export buttons full-width below 768px.
  • Tests: added cases for export-button rendering and the Google Maps deep-link fetch+open. Full suite green (181 tests).
  • UAT_PLAYBOOK.md: added §5.30 — Route Planner — Navigation Export & Offline (GRO-2160) (8 test cases).

Verification

  • tsc --noEmit ✓ · eslint ✓ (0 errors) · vitest run ✓ 181/181 · vite build ✓ (SW contains both api-cache and osm-tiles runtime caches)

Updated UAT_PLAYBOOK.md §5.30 — new navigation-export + offline route flow.

cc @cpfarhood

## [Phase 3.3] Route Optimization — Export buttons + offline polish Implements [GRO-2160](/GRO/issues/GRO-2160). Final phase of the Mobile Groomer Route Optimization feature. Frontend-only — the `/api/routes/:routeId/export/:platform` endpoints already exist (GRO-2158). ### Changes - **Navigation export** (`src/pages/Routes.tsx`): a `NavExportButtons` panel shown when a route has stops. **Open in Google Maps** / **Open in Apple Maps** each fetch `GET /api/routes/:routeId/export/{google-maps,apple-maps}` and open the returned deep link. Device OS is detected (iOS / Android / desktop); the relevant app's button is rendered prominently (filled) and the other as a secondary outline button (iOS → Apple Maps leads; otherwise Google Maps). A blank tab is pre-opened in the click gesture to survive mobile popup blockers, and closed with an inline error on failure. - **Offline map tiles**: `prewarmRouteTiles()` fetches the OSM tiles covering the route's bounding box (zooms 12–14, capped at 80 tiles) on every route load and after each optimize/reorder. New Workbox `CacheFirst` rule `osm-tiles` (7-day TTL, 400 entries) in `vite.config.ts` makes pre-warmed tiles persist offline, alongside the existing `NetworkFirst` `/api/*` rule (24h) that already caches route data. - **Responsive polish**: a `useIsMobile()` media-query hook switches the map/stop-list grid to a single column, shrinks the map, and makes export buttons full-width below 768px. - **Tests**: added cases for export-button rendering and the Google Maps deep-link fetch+open. Full suite green (181 tests). - **UAT_PLAYBOOK.md**: added **§5.30 — Route Planner — Navigation Export & Offline (GRO-2160)** (8 test cases). ### Verification - `tsc --noEmit` ✓ · `eslint` ✓ (0 errors) · `vitest run` ✓ 181/181 · `vite build` ✓ (SW contains both `api-cache` and `osm-tiles` runtime caches) Updated UAT_PLAYBOOK.md §5.30 — new navigation-export + offline route flow. cc @cpfarhood
Flea Flicker added 1 commit 2026-06-09 04:26:41 +00:00
feat(GRO-2160): route nav export buttons + offline map polish
CI / Test (pull_request) Successful in 22s
CI / Lint & Typecheck (pull_request) Successful in 26s
CI / Build & Push Docker Image (pull_request) Successful in 38s
ef974f1a5e
Phase 3.3 of the Mobile Groomer Route Optimization work (groombook/web).

- Add "Open in Google Maps" / "Open in Apple Maps" export buttons that fetch
  the route deep-link from /api/routes/:routeId/export/:platform and open it.
  Device OS is detected (iOS/Android/desktop); the relevant app's button is
  prominent and the other is offered as a secondary option.
- Pre-warm OSM map tiles for the route's bounding box (zooms 12-14, capped at
  80 tiles) on every route load and after each optimize/reorder so the map is
  viewable offline; add a Workbox CacheFirst rule (osm-tiles, 7d) alongside the
  existing NetworkFirst /api/* rule (24h) that already caches route data.
- Responsive polish: single-column stacking, shorter map, and full-width export
  buttons below 768px for phone use during the day.
- Tests for export button rendering + deep-link open; UAT_PLAYBOOK.md §5.30 added.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
Flea Flicker merged commit 044eeaae61 into dev 2026-06-09 04:31:24 +00:00
Flea Flicker deleted branch feat/GRO-2160-route-export-offline 2026-06-09 04:31:25 +00:00
Sign in to join this conversation.