feat: battery-aware itinerary nudge + PWA / offline support
Battery nudge:
- lib/batteryPlan: project SoC through the planned stops using current
Tesla battery (or 80% default), 85% of rated range, and conservative
per-stop charge rates (Supercharger 1.5%/min, dest charger 0.4%/min).
- LegRow shows "arrive X%" plus a tone (red/amber/transparent) and a
TIGHT / WON'T REACH chip if the projected arrival is below 15%/5%.
- Top-of-itinerary banner when any leg is danger or warning, naming the
current SoC source (live Tesla vs assumed 80%).
PWA / offline:
- vite-plugin-pwa with autoUpdate strategy; ServiceWorker registered in
main.tsx (prod-only).
- Workbox cache strategies:
map tiles CacheFirst, 30 days, 800 entries
nominatim/OSRM NetworkFirst with cached fallback
/api/* NetworkFirst, short TTL, last response stays usable
- App shell precached so the planner renders offline; navigateFallback
ensures deep links serve index.html without a network round trip.
- manifest.webmanifest + theme-color + favicon.svg (replaces dead
/tesla-icon.svg reference). Installable to home screen.
- Sonner toasts on offline-ready and update-available.
This commit is contained in:
+3
-1
@@ -2,7 +2,9 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/tesla-icon.svg" />
|
||||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
||||
<link rel="apple-touch-icon" href="/favicon.svg" />
|
||||
<meta name="theme-color" content="#0a0a0c" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Tesla Trip Planner • Grok</title>
|
||||
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"
|
||||
|
||||
Reference in New Issue
Block a user