trails/apps/planner/app/components
Ullrich Schäfer 55806fc84a
Fix waypoint drag, host election, segment routing, debug panel
Waypoint drag:
- Use observeDeep instead of observe to detect Y.Map property changes

Host election:
- Extracted to host-election.ts with 8 unit tests
- Simple rule: lowest real client ID is always host, deterministic
- Always sets role (host or participant), no missing roles
- Filters server docs (empty awareness state) from election

BRouter routing:
- Route segment-by-segment like bikerouter.de (one request per
  waypoint pair), guarantees route passes through every waypoint
- Merge GeoJSON segments with accumulated stats
- 8 unit tests for segment merging and waypoint splitting

Awareness cleanup:
- Track client IDs per WebSocket connection
- Immediately remove awareness on WebSocket close

Debug panel:
- Visibility + expanded state persisted in localStorage
- Hotkey (Shift+Cmd+Option+T) toggles visibility
- Labels server docs as (server)
- All logic self-contained in YjsDebugPanel.tsx

User identity:
- Color and name persisted in localStorage across reloads

Tests: 32 total (16 existing + 8 host election + 8 routing)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 08:52:52 +01:00
..
ClientOnly.tsx Fix SSR and automerge timing 2026-03-23 00:49:54 +01:00
ElevationChart.tsx Fix waypoint icons and add elevation chart scrubbing 2026-03-23 07:04:04 +01:00
ExportButton.tsx Complete Planner UI: profile selector, elevation chart, GPX export 2026-03-23 00:57:39 +01:00
PlannerMap.tsx Fix waypoint drag, host election, segment routing, debug panel 2026-03-23 08:52:52 +01:00
ProfileSelector.tsx Complete Planner UI: profile selector, elevation chart, GPX export 2026-03-23 00:57:39 +01:00
SessionView.tsx Fix waypoint drag, host election, segment routing, debug panel 2026-03-23 08:52:52 +01:00
WaypointSidebar.tsx Fix waypoint drag, host election, segment routing, debug panel 2026-03-23 08:52:52 +01:00
YjsDebugPanel.tsx Fix waypoint drag, host election, segment routing, debug panel 2026-03-23 08:52:52 +01:00