Route editor: one click on the route line inserts two anchors at the same spot (0 m leg) #69
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
public/wanderer#69
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found in the live acceptance test of
deploy-676a7c62(2026-11-05), userclaude_test(#49: "dragging and clicking the coloured line still edits the route").Problem: in drawing mode with the default "Shortest-path insertion", one click on the route line inserts two anchors at the same spot. That leaves a 0 m leg ("Route Point #2 … 0 m"). Dragging the line works correctly (+1 anchor, re-routed).
Why: both handlers fire for the same click:
map_with_elevation_maplibrehandleDragStart→handleDragEnd, distance < 0.5 →onsegmentclick→handleSegmentClick:addAnchor+splitSegment, no routing call;click→handleMapClick(drawing branch) →addAnchorSmart→insertAnchorShortest: a secondaddAnchorplus 2 routing calls.Nothing in
handleMapClickskips clicks that landed on the route layer. The colour overlay from #49 is not the cause; the base layer gets the same events.Repro (1440 px, Sospel, zoom 13):
/trail/edit/newand draw 3 points (start, A, finish).Evidence:
/root/tools/wanderer-shots/acceptance/out/t3g-click-on-coloured-line.png. Script:/root/tools/wanderer-shots/acceptance/t3_editor.mjs(step 3f: anchors 3 → 5, 2 routing calls).Fix idea: when
handleDragStarthas claimed the mousedown (it already callse.preventDefault()), lethandleMapClickreturn early, for example by checkinge.defaultPreventedor a "segment click handled" flag. Alternatively, drop one of the two paths.🤖 Generated with Claude Code
Fixed in batch PR #72 (
deploy5577c715), live since 2026-11-05 ~22:10 CET inwanderer-web:deploy-5577c715(homelab-flux #857). Verified with the live e2e suite and acceptance re-runs asclaude_test.🤖 Generated with Claude Code