trails/apps/planner/app/components
Ullrich Schäfer 3a1c34317d
route-surface-breakdown (Phase 1): Planner-path surface/waytype bars
Synchronous path + rendering for the surface/waytype breakdown:
- map-core `computeSurfaceBreakdown(coords, surfaces, highways)` → distance-
  weighted metres per surface + waytype category (unit-tested);
- `SurfaceBreakdownSchema` in @trails-cool/api;
- nullable `surfaceBreakdown` jsonb on routes + activities;
- Planner `SaveToJournalButton` computes it from the BRouter waytags already in
  routeData and sends it; `api.save-to-journal` forwards it; the journal route
  callback validates + persists (journal is the authoritative validator);
- `SurfaceBreakdown` component (stacked bars per dimension, map-core palettes,
  legend category · % · km largest-first, unknown → "other", hidden when empty)
  on route + activity detail; journal gains a @trails-cool/map-core dep;
- i18n journal.surface.* (en + de).

Phase 2 (async Overpass backfill + SSE for imports/uploads, and the e2e that
seeds a breakdown) follows in a separate PR.

Tests: computeSurfaceBreakdown unit (map-core 36); SurfaceBreakdown component
(jsdom, journal 326). typecheck + lint green; verified in the browser.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-14 18:46:49 +02:00
..
ClientOnly.tsx Fix SSR and automerge timing 2026-03-23 00:49:54 +01:00
ColoredRoute.tsx planner: give the Yjs document a typed schema seam 2026-06-10 01:35:04 +02:00
DayBreakdown.tsx Fix i18n: use planner namespace in sidebar components 2026-04-10 23:59:27 +02:00
ElevationChart.tsx planner: give the Yjs document a typed schema seam 2026-06-10 01:35:04 +02:00
ExportButton.tsx planner: give the Yjs document a typed schema seam 2026-06-10 01:35:04 +02:00
MapHelpers.tsx remove the map and ui shim packages 2026-06-10 07:47:59 +02:00
MidpointHandles.tsx Add route interactions: click-to-split, drag-to-reshape, colored route rendering 2026-03-26 21:15:55 +01:00
NearbyPoiMarkers.tsx Add per-waypoint notes and nearby POI snap to Planner 2026-05-17 23:58:21 +02:00
NoGoAreaLayer.tsx chore(ts): replace 7 \as unknown as\ shims with proper types 2026-05-26 01:02:25 +02:00
NotesPanel.tsx Fix notes not loading on session reload 2026-04-11 03:00:51 +02:00
ParticipantList.tsx Fix mobile header layout: hide secondary items on small screens 2026-04-12 19:39:19 +02:00
PlannerMap.tsx remove the map and ui shim packages 2026-06-10 07:47:59 +02:00
PoiPanel.tsx chore(ts): replace 7 \as unknown as\ shims with proper types 2026-05-26 01:02:25 +02:00
ProfileSelector.tsx planner: give the Yjs document a typed schema seam 2026-06-10 01:35:04 +02:00
RouteInteraction.tsx chore(ts): replace 7 \as unknown as\ shims with proper types 2026-05-26 01:02:25 +02:00
SaveToJournalButton.tsx route-surface-breakdown (Phase 1): Planner-path surface/waytype bars 2026-06-14 18:46:49 +02:00
SessionView.tsx planner: give the Yjs document a typed schema seam 2026-06-10 01:35:04 +02:00
WaypointContextMenu.tsx Replace right-click behavior with context menu on waypoints 2026-04-11 02:42:43 +02:00
WaypointSidebar.tsx planner: give the Yjs document a typed schema seam 2026-06-10 01:35:04 +02:00
YjsDebugPanel.tsx planner: give the Yjs document a typed schema seam 2026-06-10 01:35:04 +02:00