trails/openspec/changes/map-core-package/proposal.md
Ullrich Schäfer fff77a2ed2
Add mobile app, map-core, nearby sync, and activity recording specs
mobile-app: Unified React Native + Expo app combining Planner and
Journal. OAuth2 PKCE auth, MapLibre maps, versioned REST API with
Zod schemas, configurable server URL, offline SQLite, Web Push relay
notifications. TanStack Query + Zustand state management. Jest +
Maestro testing. 76 tasks across 5 phases.

map-core-package: Extract renderer-agnostic map definitions (tiles,
color palettes, POI categories, z-index) into @trails-cool/map-core.
Pure refactor preparing for MapLibre on mobile. 27 tasks.

mobile-activity-recording: GPS recording, live stats, HealthKit/Health
Connect export. Separated from mobile-app for independent scheduling.

mobile-nearby-sync: BLE route sync between nearby devices for offline
group riding. QR waypoint sharing as simpler v1. TXQR noted as future.

journal-rest-api spec: Full API contract — endpoints, auth, pagination,
errors, discovery, versioning, BRouter proxy.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 21:52:30 +02:00

1.7 KiB

Why

Map configuration is scattered across Planner components: tile URLs in packages/map/src/layers.ts, color palettes in ColoredRoute.tsx, POI categories in poi-categories.ts, z-index constants in z-index.ts, and overlay configs hardcoded in PlannerMap.tsx. This makes it impossible to share map definitions with a future mobile app (MapLibre) or migrate the web to a different renderer without duplicating everything.

What Changes

  • New packages/map-core/ package: Renderer-agnostic map definitions — tile sources, overlay configs, route color palettes, POI category configs, z-index layering constants. Pure TypeScript data, no rendering code, no DOM dependencies.
  • Refactor packages/map/: Import tile configs from map-core instead of defining its own
  • Refactor Planner components: Import color palettes, POI categories, and z-index constants from map-core instead of defining them locally

Capabilities

New Capabilities

  • map-core: Shared renderer-agnostic map definitions (tiles, colors, overlays, POI categories, z-index)

Modified Capabilities

  • map-display: Tile layer configs sourced from map-core instead of locally defined
  • route-coloring: Color palettes and grade functions sourced from map-core
  • osm-poi-overlays: POI category definitions sourced from map-core

Impact

  • New package: packages/map-core/ added to pnpm workspace and Turborepo
  • packages/map/src/layers.ts → thin re-export from map-core
  • apps/planner/app/components/ColoredRoute.tsx → imports palettes from map-core
  • apps/planner/app/lib/poi-categories.ts → moves to map-core
  • apps/planner/app/lib/z-index.ts → moves to map-core
  • No user-facing changes — pure refactor