Displaying Return To Start Path on Route Map - #219
Conversation
ReviewNice fix for the underlying problem (routes visually ending mid-trip instead of showing the drive home) — the 🔴 Blocking: duplicate/orphaned polylines on load
The placeholder is still attached to the map and is now unreachable from any tracked state, so it's never cleaned up — not even by the next effect-1 cleanup pass, which only iterates whatever's currently in the ref. This isn't a rare interleaving; it reproduces on essentially every initial load of the results page with routes on it (mount → effect 1 clears+starts → effect 2 creates placeholders → each resolves and overwrites without disposing). Expect visible overlapping straight-line + road-line duplicates per route, plus a It's also more likely to trigger now that Suggested fix: before overwriting 🟡 Smaller things
Nit: |
Append the starting point (depot, or first stop when no depot) to the end of each route path so the polyline shows the drive home, even though the optimizer output omits the return leg. Applies to road-following and straight-line fallback paths, and includes the return leg in distance. Co-authored-by: Cursor <cursoragent@cursor.com>
a4ec460 to
fb2a024
Compare
Summary
depot → stops → depot; without a depot, the first stop acts as home.Motivation
Changes
Frontend (
app/ui)Map.tsx—buildRoutePathBackend / mobile app / infra
Validation
Frontend
npm --prefix app/ui run lintnpm --prefix app/ui run format:checknpm --prefix app/ui run typechecknpm --prefix app/ui run testnpm --prefix app/ui run buildnpm --prefix app/ui run test:e2enpm --prefix app/mobile run lintnpm --prefix app/mobile run typecheckBackend
cmake --preset dev.github/scripts/check-backend-static.sh build/devcmake --build --preset dev --parallelctest --preset dev --output-on-failure --no-tests=error -LE 'e2e|docker'docker compose -f deploy/compose/docker-compose.arm64.yml --env-file deploy/env/http-server.arm64.env configManual checks
/results: each route polyline returns to the depot/start along roads.Risk
Rollout and Recovery
app/ui; no migrations or feature flags.saving-marker-location(this branch adds one commit on top).High-Signal PR Checklist