trails/openspec/changes/planner-route-interactions/specs/route-drag-reshape/spec.md
Ullrich Schäfer b080a15fb1
Add route interactions: click-to-split, drag-to-reshape, colored route rendering
- Enrich BRouter response with per-point 3D coordinates and segment boundary
  tracking (EnrichedRoute interface)
- ColoredRoute component: plain, elevation gradient (green→yellow→red), and
  surface color modes with invisible wide polyline for click targeting
- Click-to-split: click on route polyline inserts waypoint at nearest point,
  mapped to correct segment via boundary indices
- MidpointHandles: draggable CircleMarkers at route segment midpoints for
  reshaping, hidden below zoom 12, opaque on hover
- Color mode toggle (select) synced via Yjs routeData
- i18n keys for color mode labels (en + de)
- Unit tests for segment boundary tracking (13 tests)
- E2E tests for enriched route response and color mode toggle

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 21:15:55 +01:00

1 KiB

ADDED Requirements

Requirement: Midpoint drag handles on route segments

The Planner SHALL display draggable midpoint handles between consecutive waypoints on the route, allowing users to reshape the route by dragging.

Scenario: Midpoint handle visible

  • WHEN a route is displayed with at least two waypoints
  • THEN a small circular handle appears at the geographic midpoint of each route segment (using the actual route geometry, not straight-line distance)

Scenario: Drag midpoint to reshape

  • WHEN a user drags a midpoint handle to a new position
  • THEN a new waypoint is inserted at the dropped position between the two adjacent waypoints, and the route recomputes through the new point

Scenario: Handle visibility control

  • WHEN the map zoom level is below 12
  • THEN midpoint handles are hidden to reduce visual clutter

Scenario: Reshape syncs to other participants

  • WHEN a user reshapes the route by dragging a midpoint
  • THEN all other participants see the new waypoint and recomputed route via Yjs sync