trails/apps/planner/app
Ullrich Schäfer 3b9672e0ff
planner: give the Yjs document a typed schema seam
The routeData Y.Map's ~15 string keys (geojson, coordinates,
segmentBoundaries, road metadata, profile, colorMode, baseLayer,
overlays, poiCategories) were read and written raw at ~30 call sites,
each with its own JSON parsing and casts; parseJsonArray existed twice
and waypoint extraction four times. GPX assembly was duplicated between
SaveToJournalButton and ExportButton, so the saved plan and the
exported file could silently diverge.

- new lib/route-data.ts owns the routeData (+ noGoAreas) schema:
  typed read/write, JSON encoding internal, ColorMode moves here
  (re-exported from ColoredRoute for existing importers)
- new lib/gpx-export.ts owns GPX assembly: buildRouteGpx /
  buildPlanGpx / buildDayGpxFiles / hasDayBreaks; multi-day splitting
  becomes a pure, tested function
- waypoint-ymap.ts gains extractWaypoints / extractWaypointData; the
  four hand-rolled copies (use-routing, use-waypoint-manager,
  WaypointSidebar, use-days) now share it, and WaypointSidebar's
  moveWaypoint reuses the round-trip helpers instead of re-listing
  every waypoint field
- all hooks/components consume the seam; no raw routeData key strings
  remain outside route-data.ts

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-10 01:35:04 +02:00
..
components planner: give the Yjs document a typed schema seam 2026-06-10 01:35:04 +02:00
jobs Add pg-boss background job queue with session expiry 2026-04-13 21:17:24 +02:00
lib planner: give the Yjs document a typed schema seam 2026-06-10 01:35:04 +02:00
routes fix(planner): bound /api/sessions listing (default 50, max 200) 2026-05-26 00:46:38 +02:00
types chore(ts): replace 7 \as unknown as\ shims with proper types 2026-05-26 01:02:25 +02:00
entry.client.tsx Add legal pages, ToS acceptance, and alpha banner 2026-04-18 00:08:48 +02:00
entry.server.tsx Consolidate Sentry config into shared package; fix inconsistencies 2026-04-18 00:30:09 +02:00
root.tsx Disable page zoom on iOS to prevent accidental pinch-to-zoom 2026-04-12 19:35:56 +02:00
routes.ts fix(planner): keep journal callback token off the client (#2 Phase A) 2026-05-26 00:29:24 +02:00