feat(GRO-2160): route nav export buttons + offline map polish #66
Reference in New Issue
Block a user
Delete Branch "feat/GRO-2160-route-export-offline"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
[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/:platformendpoints already exist (GRO-2158).Changes
src/pages/Routes.tsx): aNavExportButtonspanel shown when a route has stops. Open in Google Maps / Open in Apple Maps each fetchGET /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.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 WorkboxCacheFirstruleosm-tiles(7-day TTL, 400 entries) invite.config.tsmakes pre-warmed tiles persist offline, alongside the existingNetworkFirst/api/*rule (24h) that already caches route data.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.Verification
tsc --noEmit✓ ·eslint✓ (0 errors) ·vitest run✓ 181/181 ·vite build✓ (SW contains bothapi-cacheandosm-tilesruntime caches)Updated UAT_PLAYBOOK.md §5.30 — new navigation-export + offline route flow.
cc @cpfarhood