feat(android): live dashboard screen (Phase 28.4)
This commit is contained in:
+19
-17
@@ -154,27 +154,29 @@ android/
|
||||
- [x] Retry button per failed file (tracks failed uploads via `failedUploads` StateFlow)
|
||||
- [x] Commit: `feat: upload queue screen — upload all + per-file retry`
|
||||
|
||||
### 28.4 — Live dashboard ⬜ NOT STARTED
|
||||
### 28.4 — Live dashboard ✅ DONE (2026-08-15) — MapLibre map deferred
|
||||
**Depends on: 28.1 (networking layer). Independent of 28.2/28.3.**
|
||||
|
||||
#### 28.4.1 — Data layer
|
||||
- [ ] Retrofit interface additions to `PiApi`:
|
||||
#### 28.4.1 — Data layer ✅
|
||||
- [x] Retrofit interface additions to `PiApi`:
|
||||
- `GET /api/gps/status` → `GpsStatus` (has_fix, lat, lon, fix_age_seconds, thread_alive)
|
||||
- `GET /api/obd/status` → `ObdStatus` (adapter_present, port, car_connected)
|
||||
- `GET /api/stats` → `Stats` (speed, rpm, coolant_temp, fuel_level, throttle_pos, mil_on, dtc_count, odometer_km)
|
||||
- [ ] Polling scheduler: coroutine `while(true) { delay(2000); fetch() }` scoped to ViewModel
|
||||
- [ ] Commit: `feat: dashboard data polling`
|
||||
- `GET /api/obd/status` → `ObdStatus` (adapter_present, port, car_connected, speed, rpm,
|
||||
coolant_temp, fuel_level, throttle_position, mil_on)
|
||||
- `GET /api/stats` → `Stats` (trip_count, total_km, active_dtc, video_count, odometer_km)
|
||||
- [x] Polling scheduler: `DashboardViewModel` with `startPolling()`/`stopPolling()` — fetches
|
||||
immediately then every 2s; stopped via `DisposableEffect` when the tab loses focus.
|
||||
- [x] Server `/health` check (cellular) alongside Pi polling for the connection bar.
|
||||
|
||||
#### 28.4.2 — Dashboard UI
|
||||
- [ ] GPS card: MapLibre MapView centered on last fix with car marker
|
||||
- [ ] Speed card: large number (km/h), OBD or GPS source label
|
||||
- [ ] RPM card: gauge or number with color scale (green → yellow → red)
|
||||
- [ ] Engine stats row: coolant temp (°C), fuel level (%), throttle (%)
|
||||
- [ ] MIL/DTC indicator: check-engine icon (green/grey = no MIL, yellow/red = MIL on)
|
||||
with DTC code count badge
|
||||
- [ ] Connection status bar: Pi WiFi icon (green = connected), cellular icon (green = online)
|
||||
- [ ] Auto-refresh every 2s, pause when app is backgrounded
|
||||
- [ ] Commit: `feat: live dashboard screen`
|
||||
#### 28.4.2 — Dashboard UI ✅ (map deferred)
|
||||
- [x] Speed card: large number (km/h), "OBD speed"/"OBD offline" source label
|
||||
- [x] RPM card: number with color scale (green < 3000, amber < 5000, red ≥ 5000)
|
||||
- [x] Engine stats row: coolant temp (°C), fuel level (%), throttle (%)
|
||||
- [x] MIL/DTC card: check-engine warning (amber = MIL on, green = no MIL) + stored DTC count
|
||||
- [x] GPS card: fix status, lat/lon, fix age, thread alive (text — MapLibre map deferred)
|
||||
- [x] Overview card: trips, total km, all-time max speed, videos, DTCs, odometer
|
||||
- [x] Connection status bar: Pi WiFi dot + Server dot (green = online), last-update timestamp
|
||||
- [x] Auto-refresh every 2s; polling stops when navigating away from the tab
|
||||
- [ ] GPS map (MapLibre) — deferred: needs the MapLibre dep + basemap over hotspot (no internet).
|
||||
|
||||
### 28.5 — Trip history ⬜ NOT STARTED
|
||||
**Depends on: 28.1. Independent of 28.2–28.4.**
|
||||
|
||||
Reference in New Issue
Block a user