Smart waypoint insertion + route-editor fixes #17
No reviewers
Labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
public/wanderer!17
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/smart-insertion"
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?
Smart waypoint insertion (M1, #2) plus the route-editor fixes found while testing it. Base:
main(upstream v0.21.2 + fork CI). Behaviour:Commits
6c469f72chooseInsertionIndex(min-detour index chooser), 8 vitest cases.1425ae49Wires it into the map click. FixesinsertIntoRouteat index 0, which used to append instead of prepend.eb369d2dRoute-editor fixes:insertAnchorSplit, so a mid-route insert is a single undo step;deleteFromRoutetotals.da68d6ebUndo/redo marker sync, and the first anchor is undoable.6ee8ceb6Append by default; insert is opt-in (toggle + Alt/⌘-click).f4576f12Playwright e2e:web/tests/playwright/e2e/trail/route-insertion.spec.ts. Routing is mocked, so no Valhalla is needed.402280d6Merge of currentmain(#37 importer clamp, #38 upstream-sync). No conflicts.f9f8cbf9Store unit tests:web/src/lib/stores/valhalla_store_insert.test.ts, 6 cases.deleteFromRoutetotals.Verified 2026-10-31. All test runs were on the test VM spl-vm03 (NixOS, node 22, Chromium 155), not on the NAS.
npm ci,svelte-check: 0 errors, 0 warnings.deleteFromRoutetotals fix fails 2 of the 6 cases, as intended.route-insertion.spec.ts, 4 tests + auth setup): 5/5 passed. The stack was local: PocketBase built fromdb/, Meilisearch, and the adapter-node build ofweb/.f4576f12was green (runs 13683/13685); this push starts CI forf9f8cbf9.Still for Jörg
wanderer-p2/upstream-drafts/. Split the feature from the fixes, target upstreamdev, and change onlyen.json.Tracking #2, #11, #12, #16. Closes nothing yet.
🤖 Generated with Claude Code
https://claude.ai/code/session_01XMf4EKLnjYyjFp8QGWgFFq
597185c4a76ee8ceb695Phase-1 catch-up review (upstream v0.21.2)
Rebased onto
main-v0.21.2(=main+ merge of upstream v0.21.2 + CI toolchain bump), and the PR base is retargeted to it. The old head is kept asarchive/feat-smart-insertion-pre-v0.21.2(597185c4).The branch now matches the opt-in design that is live on
deploy:6c469f72chooseInsertionIndex + 8 vitest cases1425ae49click wiringeb369d2droute-editor fixes: clear track on anchor removal, undo anchor sync,insertAnchorSplit, deleteFromRoute totalsda68d6ebundo/redo marker sync + undoable first anchor6ee8ceb6append by default, opt-in insert (toggle + Alt/⌘-click), cherry-picked from deployab00270aThe only conflict was context: deploy's personal-pace state sat next to the
insertModedeclaration.Why the last CI failed (597185c4, "Web CI / test"): not the code. Before 2026-10-06 the fork had no
.forgejo/workflows, so Forgejo ran upstream's.github/workflows/web.yaml. Itsactions/checkout@v6+/setup-node@v6areruns.using: node24, which the old forgejo-runner v6.3.1 rejected within about 2 s ("must be one of [composite docker node12 node16 node20 go], got node24"). The #37 runs fail with the same log text. The job never reachednpm ci. The rebased branch carries.forgejo/workflows/ci.yml(svelte-check + vitest), but it has not run yet: CI on the NAS runner was paused tonight, so the run was cancelled.Code review (read, not executed):
chooseInsertionIndexis correct. The cost model is the added length; ties go to append; prepend is handled; n=0 and n=1 are special-cased.insertIntoRouteindex-0 fix (index !== undefined) is correct and needed for prepend.tagLastRouteUndoattaches anchor snapshots, so one undo reverts the whole insert. Correct.applyAnchorSnapshotreconciles markers on undo/redo. Correct.trksegwithwanderer:anchormarks and splits it again on edit. The segments made byinsertAnchorSplitcarry no extensions, so they join and split cleanly.Verdict: needs work before upstreaming. Do not merge into the fork's
main. The content is already ondeploy, andmainstays upstream + CI. Remaining for M1:🤖 Generated with Claude Code
https://claude.ai/code/session_01M1AaXnEghenJ4BDxNryKvs
Manual browser test (for Jörg)
The same feature is live on wanderer.ziefle.org:
deploycarries it on top of the routing port, where Shift+click means off-road. Run the steps there, or on a local build of this branch.wanderer:anchormarks) and insertion still works.Things to watch:
🤖 Generated with Claude Code
https://claude.ai/code/session_01XMf4EKLnjYyjFp8QGWgFFq