Commit graph

13 commits

Author SHA1 Message Date
kianiadee
cbf40bd32a Add web/status.html — full project status / docs page
Some checks are pending
build / lint-test (push) Waiting to run
build / build-push (push) Blocked by required conditions
Single self-contained HTML doc covering:
  - Headline metrics + timeline
  - All capabilities live today (map, filters, trip dock, auth)
  - Architecture (3 roles, data flow ASCII diagram)
  - Coolify deployment notes + the migration apply gotcha
  - Data model (events/state/domain/serve/slo/ops/auth schemas)
  - API endpoints
  - All 20 migrations
  - Trip detection algorithm + calibration table
  - Known issues
  - P1-P4 roadmap
  - Push receiver cut-over plan (P3 scope, what's built, what's needed)
  - Decisions log

Served at /status.html alongside the dashboard.
2026-05-28 02:45:00 +03:00
kianiadee
281a5ec634 Per-trip colour coding in single-vehicle mode
Some checks are pending
build / lint-test (push) Waiting to run
build / build-push (push) Blocked by required conditions
When viewing one driver's day, each trip is drawn in its own colour
from a 12-colour palette (cycling past 12). The matching colour shows
as the left edge of the trip card so card ↔ polyline pair up at a
glance.

Trip selection moves from border-swap to an outline, so the
trip-colour swatch stays visible when a card is selected.

Multi-mode (>1 vehicle) still uses per-vehicle SELECTION_PALETTE so a
fleet comparison reads as one colour per driver.
2026-05-27 23:31:57 +03:00
kianiadee
c7369caf71 Trip panel: multi-vehicle overlay + aggregate KPIs (⌘-click to compare)
Some checks are pending
build / lint-test (push) Waiting to run
build / build-push (push) Blocked by required conditions
Plain-click on a vehicle marker: single-vehicle mode, full trip-card
list, click a card → animated playback (unchanged behaviour).

⌘/Ctrl/Shift-click: add/remove the vehicle from the selection. Each
selected vehicle's day routes are drawn on the map as a polyline in a
distinct colour from an 8-colour selection palette. Trip dock switches
to a compact per-vehicle row layout with ✕ remove buttons; the header
shows aggregate trip count + distance + drive / idle / stop minutes
summed across the selection.

Date change re-fetches every selected vehicle; CSV button downloads one
file per selected vehicle. Map auto-fits to the union of bounds.

Click a vehicle row in multi-mode → map flies to just that vehicle's
trips. Removing the last vehicle empties the dock; the X button closes
it entirely.

Internals: replaced singular `_tripState` with a `_selection` Map keyed
by vehicle_id. Single-trip animation layers still exist for the
single-mode trip-card playback; multi-mode uses per-vehicle line-only
layers (vroute-line-{id}) with no marker animation.
2026-05-27 23:24:12 +03:00
kianiadee
4100002b4e Lighter basemap (Positron) + Fireside HQ POI marker
Some checks are pending
build / lint-test (push) Waiting to run
build / build-push (push) Blocked by required conditions
- Basemap switched from dark-matter to Positron — light grey, minimal,
  higher contrast for the cost-centre coloured markers.
- HQ POI: red dot + soft halo + 'Fireside Group HQ' label at
  -1.24089, 36.72880. Layered above vehicles so it stays visible when
  vehicles park there.
- Flipped vehicle plate-label colours to dark text + white halo for
  readability on the light map (was light-on-dark).
2026-05-27 22:26:52 +03:00
kianiadee
cba1a3b044 Strip SLO from frontend: remove _renderSlos, sloRoot param, slo-* CSS,
Some checks are pending
build / lint-test (push) Waiting to run
build / build-push (push) Blocked by required conditions
and the 'Stale' tile (which was derived from the SLO freshness count).
Backend still computes slo_status for future use; UI just ignores it.
2026-05-27 22:14:24 +03:00
kianiadee
de34103f18 UI tweaks + city case fix
Some checks are pending
build / lint-test (push) Waiting to run
build / build-push (push) Blocked by required conditions
- Migration 20: collapse `Nairobi`/`nairobi` in domain.vehicles → 'nairobi'
- Remove the SLO panel from the top band (filter + tile rows stay)
- Offline vehicles render as solid grey instead of dim-cost-centre tint;
  opacity now only differentiates moving (1.0) vs parked (0.75) vs
  offline (0.55) so colour carries identity + state cleanly
2026-05-27 22:07:03 +03:00
kianiadee
20958c0293 UI: top-band layout + bottom trip dock + multi-select filters + always-on tint
Some checks are pending
build / lint-test (push) Waiting to run
build / build-push (push) Blocked by required conditions
Restructure:
  - FLEET NOW tiles + SLOs + Filters in a horizontal top band; full-width map
  - Trip panel moved to a bottom dock that slides up; trips render as a
    horizontally-scrollable card strip instead of a vertical right-panel list

Multi-select filter widgets:
  - cost_centre + assigned_city are now dropdowns with an "All …" toggle
    and per-option checkboxes
  - cost_centre options carry a colour swatch matching the marker tint —
    the filter doubles as a live colour legend
  - Server-side filter still applies when exactly one option is picked;
    multi-selection within a widget is narrowed client-side via setFilter
    so the existing serve.fn_live_view contract is unchanged

Cost-centre tint always visible:
  - circle-color now uses cost_centre_color unconditionally
  - operational_state is shown via opacity (moving=1.0 / parked=0.7 /
    offline=0.35), keeping colour as a stable identity cue

applyClientFilter() is a new exported helper called by the page after
each refresh to narrow markers by multi-selection state.
2026-05-27 21:56:53 +03:00
kianiadee
9393491869 Trip panel UI: click vehicle → side panel, trip list, animated playback
Some checks are pending
build / lint-test (push) Waiting to run
build / build-push (push) Blocked by required conditions
Click any vehicle on the map to open a 360px slide-in panel showing:
  - reporting time (first ACC_ON of the day)
  - day totals: trip count, distance, drive/idle/stop minutes
  - per-trip rows with start/end/duration/distance/idling, click to
    select; selected trip renders its polyline + animates a marker
    along it over 10 seconds
  - end-reason badge per trip (work stop, reporting silence, long gap,
    day end) with colour-coded accent
  - date picker (defaults to today EAT)
  - CSV download button → /trips.csv?date=...

Map clicks query rendered features across circle/arrow/label layers and
take the topmost — single click handler, no per-layer duplicates. The
existing hover popup remains untouched.

Wraps #map in #map-container so the panel can absolute-position over
the right side without disturbing the existing left-aside grid layout.
authClient gets a getToken() helper so the CSV download path can attach
the Authorization header for a plain fetch (apiFetch returns JSON only).
2026-05-27 14:14:06 +03:00
kianiadee
26ce35e8eb UX: zoom-scaled vehicle markers + hide labels at city overview
Some checks are pending
build / lint-test (push) Waiting to run
build / build-push (push) Blocked by required conditions
At z=10 (Nairobi overview) the constant 13px circles + always-on plate
labels overlapped into an unreadable blob. Markers now interpolate
across zoom:

  circle:  2px @ z5 → 7px @ z12 → 13px @ z15 → 20px @ z18
  arrow:   0.2 @ z5 → 0.45 @ z12 → 0.7 @ z15 → 1.0 @ z18
  label:   minzoom 11; text 8px @ z11 → 14px @ z17

text-offset is in ems so it scales with text-size automatically.
2026-05-27 12:07:50 +03:00
kianiadee
9852eff985 Popup: pre-emptive driver-name extraction from device_name (until P3 roster lands)
Some checks are pending
build / lint-test (push) Waiting to run
build / build-push (push) Blocked by required conditions
2026-05-23 23:13:46 +03:00
kianiadee
45974b3810 Geocoder: cron job + state.geocoded_positions; label uses device_name last 4 (fallback plate); popup address row
Some checks are pending
build / lint-test (push) Waiting to run
build / build-push (push) Blocked by required conditions
2026-05-23 23:06:25 +03:00
kianiadee
6c5ba3b22b UI: arrow + plate-short label + cost-centre marker palette + hover popup; richer state.live_positions + serve.fn_live_view v2; multi-target poll plumbing
Some checks are pending
build / lint-test (push) Waiting to run
build / build-push (push) Blocked by required conditions
2026-05-23 09:29:04 +03:00
kianiadee
1fb2a5be5e Phase 1 — foundation, push gateway, parser, projector, live view, frontend 2026-05-23 00:53:42 +03:00