Epic: M1 — Smart waypoint insertion #2
Labels
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
public/wanderer#2
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?
Problem: clicking a new point appends it to the end of the route; it should insert into the nearest existing segment (Komoot behavior), avoiding manual drag-reordering.
Design: the anchor model already supports
spliceat any index with a changeset/undo stack (web/src/lib/stores/valhalla_store.svelte.ts:117). The change is choosing the insertion index = segment minimizing added detour (perpendicular/added-distance), instead of pushing to the end.Acceptance: clicking near a mid-route segment inserts the anchor there; start/finish clicks still extend ends; drag + undo/redo unaffected.
Design confirmed + reframed after reading the code.
Mid-route insertion already exists via line-drag (
splitSegment,valhalla_store.svelte.ts:223— re-routes both halves). The real gap: a click always appends. So M1 = smart click.Agreed behavior: min-detour insertion with automatic endpoint guard — a clicked point lands at the anchor gap that grows total route length the least; extending wins at the ends, refining wins in the middle. Algorithm + unit tests done in #11.
M1.3 wiring done (#12, commit
f0ea569e). The smart-insertion feature is code-complete onfeat/smart-insertion(M1.2 chooser + M1.3 wiring), typechecked and unit-tested. Remaining for M1: browser/e2e validation (needs M0.2 deploy or local dev), then the upstream issue (#10) and PR (#13).🚀 Deployed to
wanderer.ziefle.org(web imageoss/wanderer-web:si-f0ea569e, commitf0ea569e). Ready for browser testing of smart insertion. After the user validates the UX, remaining: upstream issue (#10) + PR (#13). Behavior may be tuned against real clicks first.🔧 Redeployed
si-5e20f773with route-editor fixes found during testing (see the new bug ticket): track now clears correctly on anchor removal, and undo of point-adds restores the anchor list instead of wiping the track. Mid-insert is now a single clean undo step too. Live at wanderer.ziefle.org.✅ Undo round 2 fixed (deploy
b98b47e1):applyAnchorSnapshot()now removes the undone anchor's marker from the map and re-adds restored ones on redo — previously the anchor left the list but its marker stayed drawn.pushAnchorOnlyChange), so undo is enabled and actually removes it (was greyed / a no-op).Live at wanderer.ziefle.org — please re-test: (1) drop one point → undo removes it; (2) two points → undo removes the 2nd point + its marker + the segment.
Design change — 2026-07-27 (decided with the user). Always-on smart-insert misfires when planning loops (a click meant to extend the route lands geometrically near an early segment and gets inserted mid-route). New design:
This makes the feature purely additive over upstream (better odds of acceptance). Implementing now on our fork first; the
pr/smart-insertionbranch + PR text will be re-staged around the append-default design before any upstream submission.