batch: 2026-11-05 wanderer work into deploy (#55 #52 #53 #54 #56 #58 #59 #62) #64

Merged
jmz merged 43 commits from batch/2026-11-05 into deploy 2026-11-05 17:52:37 +00:00
Member

Batch merge of the 2026-11-05 wanderer work into deploy (fast-forward-only repo, so one batch PR = one CI round instead of 8 rebase+CI rounds). Fast-forwarding deploy to this branch marks the PRs below as merged.

Merged in this order (--no-ff, one merge commit each):

  • #55 chore: sync main into deploy
  • #52 trails: default sort newest first (closes #50)
  • #53 route editor: Optimise order (#45)
  • #54 #49 part 2: basic-info auto-fill, pace stats, suggested difficulty/category
  • #56 #51 part 1: trail view layout + route facts
  • #58 #49 part 1a: map centring, maximise, stats overlay, colour
  • #59 #49 part 1b: profile toggle, colour-by-metric, gradient track by default
  • #62 #51 data: surface/way/SAC map-matching endpoint (db image not deployed yet: needs our own db image + VALHALLA_URL + pb_data backup, separate window)

Conflicts: only additive ones (en.json keys from #54 + #56; imports in trail/edit/[id]/+page.svelte from #54 + #58). Resolved by keeping both sides.

Local verification (spl-vm05): svelte-check 0 errors (2 old a11y warnings); vitest 1093 passed / 13 skipped (+ the known Node 24 unhandled rejection, #57); go vet ./... clean, go test ./services/... ok. Full Go suite in CI.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XMf4EGfBC9xbQ6rjD6HxgP

Batch merge of the 2026-11-05 wanderer work into `deploy` (fast-forward-only repo, so one batch PR = one CI round instead of 8 rebase+CI rounds). Fast-forwarding `deploy` to this branch marks the PRs below as merged. Merged in this order (`--no-ff`, one merge commit each): - #55 chore: sync main into deploy - #52 trails: default sort newest first (closes #50) - #53 route editor: Optimise order (#45) - #54 #49 part 2: basic-info auto-fill, pace stats, suggested difficulty/category - #56 #51 part 1: trail view layout + route facts - #58 #49 part 1a: map centring, maximise, stats overlay, colour - #59 #49 part 1b: profile toggle, colour-by-metric, gradient track by default - #62 #51 data: surface/way/SAC map-matching endpoint (**db image not deployed yet**: needs our own db image + VALHALLA_URL + pb_data backup, separate window) Conflicts: only additive ones (`en.json` keys from #54 + #56; imports in `trail/edit/[id]/+page.svelte` from #54 + #58). Resolved by keeping both sides. Local verification (spl-vm05): svelte-check 0 errors (2 old a11y warnings); vitest 1093 passed / 13 skipped (+ the known Node 24 unhandled rejection, #57); `go vet ./...` clean, `go test ./services/...` ok. Full Go suite in CI. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01XMf4EGfBC9xbQ6rjD6HxgP
Adds chooseInsertionIndex(anchors, point): scores prepend / each interior
gap / append by route-length increase and returns the least-detour anchor
index, so a clicked point that belongs mid-route is inserted there instead
of always appended. Pure + unit-tested (8 vitest cases); reuses
haversineDistance. Wiring into the map click handler follows separately.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Wire chooseInsertionIndex into the route editor's map-click handler so a
clicked point is placed where it grows total route length the least: a
point that belongs mid-route is inserted between its neighbouring anchors
(re-routing both halves, mirroring the segment-drag path) instead of always
being appended. Points that extend the route still append; k=0 prepends.

Also fixes insertIntoRoute() to splice at index 0 — the `if (index)` guard
treated 0 as falsy and appended; prepend relies on splicing at 0. No
existing caller passes 0.

svelte-check clean (0 errors); route_insertion unit tests green.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
- removeAnchor: clear the track when <2 anchors remain (was leaving a
  dangling segment / stale route line); drop the gpx_data gate that skipped
  the map refresh while drawing; rebuild via setRoute when removing the end
  anchor so the last segment can't dangle.
- Tag anchorsBefore/anchorsAfter on add actions so undo/redo restores the
  anchor list instead of rebuilding from the emptied route (fixes: add two
  points then undo removes both).
- addAnchorSmart: mid-insert uses a single insertAnchorSplit change so undo
  reverts the whole insertion in one step; prepend routes new->start.
- deleteFromRoute: compute totals from the reduced snapshot, not the
  pre-delete route.

svelte-check clean; unit tests green.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
- applyAnchorSnapshot(): on undo/redo, remove markers for anchors no longer
  present and (re-)add markers for restored ones. Fixes: the added point's
  marker stayed on the map after undo even though it left the anchor list.
- Placing the first anchor now records an anchor-only undo entry
  (pushAnchorOnlyChange) so it is undoable (undo was greyed / a no-op).

Co-Authored-By: Claude Opus 4.8 <[email protected]>
feat(route-editor): append by default, opt-in smart insert (toggle + Alt/⌘-click)
Some checks failed
CI / go (push) Has been cancelled
CI / web (push) Has been cancelled
6ee8ceb695
Always-on min-detour insertion misfired when planning loops (a click meant
to extend the route landed near an early segment and got inserted
mid-route). Now a plain click appends to the end; smart insert-at-nearest
is opt-in via an 'Insert' toggle in the drawing panel or by holding Alt/⌘
while clicking. i18n en/fr/de.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
A GPX waypoint whose description exceeds the waypoints collection's 5000
character limit made createWaypoints' app.Save return a validation error,
aborting the ENTIRE trail import — the track and every other waypoint were
lost, not just the one over-long POI. komoot highlight/POI descriptions
routinely run 5-6.5k characters, so bulk GPX imports of multi-day routes
failed outright (oss/wanderer #15).

Clamp the description to the collection's own description-field limit (rune-
safe, with an ellipsis) before saving, mirroring how photoFiles already skips
individual bad media rather than failing the whole trail.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Generalizes the #15 guard. The importer also wrote the trail name/description
and the waypoint name unclamped, so an over-long value in any of them aborted
the whole import the same way (confirmed for waypoint name:
'name: Must be no more than 255 character(s)').

Add clampTextField(collection, field, value), which clamps to that field's own
rune limit (no-op for unbounded/non-text fields), and apply it to every
external text field createWaypoints and ImportTrail write.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
refactor(importer): leave rich-text descriptions to the bounded sanitizer
Some checks failed
CI / go (push) Has been cancelled
CI / web (push) Has been cancelled
d45b7875e9
Upstream v0.21.1 (#1320) runs util.SanitizeHTMLFieldsWithLimits on every
imported trail and waypoint, which already shortens descriptions to the
field limit in an HTML-aware way. Clamping the raw HTML first could cut a
tag in half, so only the plain-text name fields are clamped now. The
description test stays as a regression guard for #15.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01M1AaXnEghenJ4BDxNryKvs
Adds .forgejo/workflows/upstream-sync.yml: a weekly (and manually dispatchable)
job that checks whether upstream's default branch has commits the fork's base
branch is missing and, if so, pushes a dated branch and opens a sync PR into
main. Merging is left to a human via the PR so Forgejo surfaces any conflicts.

Kept in .forgejo/ (not .github/) so it does not diverge the workflows shared
with upstream and does not run on the upstream GitHub repo.

Closes #8.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
ci(forgejo): make upstream-sync run on our runner and never clobber branches
Some checks failed
CI / go (push) Has been cancelled
CI / web (push) Has been cancelled
5d4c9bcc2f
- runs-on: docker + checkout@v4 + apt-installed git/jq/curl (no sudo), the
  same setup as ci.yml on the NAS forgejo-runner v12.
- The sync branch is now the base branch plus a merge of upstream, so it
  keeps .forgejo/ (our CI runs on it, not upstream's release workflows) and
  the PR fast-forwards main. On a conflict it falls back to the raw upstream
  commit so the PR shows the conflict.
- Only ever pushes a new refs/heads/upstream-sync/<date> ref, without
  --force; an existing sync branch is left untouched.
- workflow_dispatch dry_run input; PR title names the upstream release tag;
  optional SYNC_TOKEN secret; token passed via a header file, not argv.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01M1AaXnEghenJ4BDxNryKvs
CI runs on a capacity-1 runner on the NAS and only had a push trigger.
Pushes made with the automatic Actions token (the upstream-sync branch)
do not start workflows, and CI often has to wait for a quiet window, so
add workflow_dispatch to run it on any branch on demand.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01M1AaXnEghenJ4BDxNryKvs
ci(forgejo): move upstream sync to Sunday 03:10 UTC, add a local dry run
All checks were successful
CI / go (push) Successful in 26m37s
CI / web (push) Successful in 2m7s
96295b75c5
- Schedule: Sunday 03:10 UTC instead of Monday 04:17, which collided
  with mail-archive-gmail (04:17) and sat next to Renovate (04:30) and
  the 03:30-04:30 backup jobs on the NAS that also hosts the runner.
- Document the token model: the branch push uses the automatic token
  (so it does not start CI at night); SYNC_TOKEN is optional and only
  for the PR API call if the automatic token is refused.
- Add .forgejo/scripts/upstream-sync-dry-run.sh: shows the behind count,
  the branch and PR it would create, conflicting files (git merge-tree,
  no worktree) and the incoming commits, in a throwaway bare repo,
  without pushing anything.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01M1AaXnEghenJ4BDxNryKvs
test(e2e): cover append-by-default and smart insertion in the route editor
All checks were successful
CI / go (push) Successful in 22m41s
CI / web (push) Successful in 1m52s
f4576f12a6
Drive the trail editor's route drawing in Chromium with routing,
elevation and reverse geocoding mocked in the browser (straight legs),
so it needs no Valhalla or Nominatim:

- a plain click appends to the end of the route;
- with the "insert at nearest" toggle on, a point beside the A-B leg is
  inserted between A and B, while a point beyond the end still appends;
- Alt-click inserts once and the next plain click appends again;
- undo/redo of the split insert, and down to the very first anchor,
  restores the anchor list, its order and the anchor markers on the map.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01M1AaXnEghenJ4BDxNryKvs
fix(importer): clamp names at PocketBase's default limit when Max is 0
Some checks failed
CI / go (push) Failing after 2m54s
CI / web (push) Successful in 2m7s
ae14894ed2
The trails and waypoints name fields have TextField.Max = 0, which
PocketBase treats as its 5000-character default, but clampTextField
read Max = 0 as "no limit" and never clamped: on the real schema the
name clamp was a no-op and an over-long external name still failed the
import. Fall back to 5000 like util.SanitizeHTMLFieldsWithLimits does,
and test it against a Max 0 field (the earlier test used Max 255).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01M1AaXnEghenJ4BDxNryKvs
test(importer): pass the media log context added to createWaypoints in v0.21.2
All checks were successful
CI / go (push) Successful in 20m11s
CI / web (push) Successful in 1m40s
212909d21c
Upstream v0.21.2 added a pluginMediaLogContext parameter to createWaypoints;
the waypoint clamp tests still called it with the old arity, so `go vet`
failed to compile the package.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01M1AaXnEghenJ4BDxNryKvs
Merge main (v0.21.2 + upstream-sync) into fix/waypoint-description-clamp
All checks were successful
CI / go (push) Successful in 23m50s
CI / web (push) Successful in 1m29s
9229f6f91c
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XMf4EKLnjYyjFp8QGWgFFq
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XMf4EKLnjYyjFp8QGWgFFq
test(route-editor): cover prepend, split insert and undo in the valhalla store
All checks were successful
CI / web (push) Successful in 54s
CI / go (push) Successful in 12m2s
f9f8cbf9af
Unit tests for the store operations behind smart insertion: insertIntoRoute
at index 0 prepends (it used to append), insertAnchorSplit replaces one
segment by two halves in a single undo step and refreshes totals, an
anchor-only change is undoable without touching the route, and
deleteFromRoute recomputes totals from the shortened route.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XMf4EKLnjYyjFp8QGWgFFq
ci: cache Go modules, build/test cache and the TinyGo .deb
All checks were successful
CI / go (push) Successful in 12m10s
CI / web (push) Successful in 53s
0d56e4dcd7
The go job ran fully cold every time (setup-go cache: false, TinyGo .deb
fetched from GitHub on every run), about 11-13 min.

Restore and save ~/go/pkg/mod, ~/.cache/go-build (which also holds the
go test results, so unchanged packages are not re-run) and TinyGo's
build cache with actions/cache@v4. There is one entry per commit, with
restore-keys on the go.sum set and the Go/TinyGo version. The TinyGo .deb
is cached separately, keyed on its version. Actions stay on the
node20-era majors this file already uses (checkout@v4, setup-go@v5).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XMf4EKNjKMd6bwCpS7K4jU
Brings deploy back in line with the fork trunk. main is upstream's release
line plus fork CI and upstreamable work; deploy is main plus the live-only
features, so main flows into deploy, never the other way.

Conflicts (route editor, de/en/fr locales, valhalla store, route_insertion)
resolved to deploy's side: deploy already carries the smart-insertion chain
(cfeb45dc..ab00270a, patch-equivalent to main's 6c469f72..6ee8ceb6) and has
since moved on (f9668d34 shortest-path insert by default + one undo step per
action, ba0a249a loop close, per-segment modes). main's "append-to-end" /
"insert-at-nearest" / "insert-modifier-hint" keys are unused on deploy, which
uses "append-only-mode" / "shortest-path-mode" / "mode-modifier-hint".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
test(e2e): drop main's append-by-default route-insertion spec on deploy
All checks were successful
CI / web (push) Successful in 1m4s
CI / go (push) Successful in 14m35s
66f7511a09
The spec came in with the main merge and asserts main's route-editor UI:
append by default, an "Adding to end of route" / "Inserting at nearest
point" toggle and Alt/⌘ to insert once. deploy inverted that in f9668d34
(shortest-path insert by default, "Shortest-path insertion" / "Appending
to end of route", Alt/⌘ = the other mode once) and added the loop close
(ba0a249a), so most cases here would fail against deploy. The Playwright
e2e suite is not run in CI and needs the full stack, so it cannot be
adapted and verified here; port it to deploy's semantics in a follow-up.
The store-level coverage from main (valhalla_store_insert.test.ts) stays
and passes on deploy.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XMf4EGfBC9xbQ6rjD6HxgP
feat(trails): default trail overview sort to newest first
All checks were successful
CI / web (push) Successful in 1m22s
CI / go (push) Successful in 14m33s
fcf5872a5b
Sort the trail overview by creation date, newest first, when the user has
not chosen a sort. A saved field or direction (localStorage sort /
sort_order) still wins, and the map view now honours it too.

- Add DEFAULT_TRAIL_SORT and pure helpers (resolveTrailSort,
  applyStoredTrailSort, defaultTrailSortOrder) in trail_filter_util.
- A saved field without a saved direction gets that field's default
  (created: newest first, others: ascending), so picking "name" from the
  fresh default still sorts A-Z.
- sanitizeTrailFilter falls back to the default direction instead of
  hard-coding ascending.
- Widen TrailFilter.sort to every sort option offered in the UI.

Meilisearch already lists `created` as sortable (db/main.go index
settings), so no backend change is needed.

Closes #50

Claude-Session: https://claude.ai/code/session_01XMf4EGfBC9xbQ6rjD6HxgP
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Pure module for the "Optimise order" action (#45). Up to 10 movable
points it solves exactly (Held-Karp); above that it runs 2-opt + Or-opt
from the current and a nearest-neighbour order. Distances are haversine.
The first and last point never move, a loop keeps its direction, and an
order that is not strictly shorter is not returned.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XMf4EGfBC9xbQ6rjD6HxgP
feat(route-editor): add an "Optimise order" action with one undo step
All checks were successful
CI / go (push) Successful in 14m3s
CI / web (push) Successful in 1m4s
1efcc3b4b4
A shuffle button next to "Reverse direction" reorders the anchors between
the fixed start and end (#45). The order comes from the straight-line
solver; legs that keep their direction are reused, and only the new legs
are routed, four at a time. The result is applied only if the routed
route is shorter, as exactly one undo entry. A toast shows the length
before and after, or says why nothing changed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XMf4EGfBC9xbQ6rjD6HxgP
feat(trail-edit): centre on the user, maximise map, stats overlay, colour (#49)
All checks were successful
CI / web (push) Successful in 1m45s
CI / go (push) Successful in 14m21s
f9017fad02
Map and layout items of #49 on the trail editor:

- Centre a new trail on the user's position. MapLibre's GeolocateControl
  cannot be triggered before its async setup finishes, so the existing
  autoGeolocateOnDrawing call did nothing on load (and later switched the
  map into tracking mode on every "Edit route"). A one-shot helper now asks
  the browser once, jumps there unless the user already moved the map or
  started a route, and caches the last fix for an instant first view.
- Maximise the map: a map control (and the F key, Esc to leave) expands the
  map over the whole page, top bar and sidebar included.
- Stats overlay: distance, D+, D- and estimated time (personal pace when
  estimated, else the router's) as coloured tiles on the map while the
  sidebar is hidden or the map is maximised.
- Design: the same stat tiles in the sidebar, accent-coloured section
  headings and a tinted pace panel, all on Tailwind palette tones with
  light and dark variants.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XMf4EGfBC9xbQ6rjD6HxgP
feat(trail-edit): auto-fill basic info from the route (#49)
Some checks failed
CI / web (push) Successful in 1m29s
CI / go (push) Has been cancelled
1cfab50a86
- Add a "Use pace estimate" button that copies the estimator's moving
  time and D+/D- into the Basic-info fields (kept until the route changes).
- Suggest the name ("<start> – <end>" or "<start> loop", loop = ends
  <= 200 m apart) and location from the reverse-geocoded start/end,
  debounced and cached per ~110 m cell; only empty or untouched fields
  are filled, and typing claims a field.
- Pre-select difficulty and category from track heuristics (effort km,
  max/avg climb gradient, recorded speed, routing profile, SAC floor)
  in the pure, tested trail_heuristics module, mapped to the DB
  categories with fallbacks; only while the user has not chosen.
- Fix the read-only elevation_loss hidden input posting elevation_gain.

Refs #49

Claude-Session: https://claude.ai/code/session_01XMf4EGfBC9xbQ6rjD6HxgP
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Pure helpers for the trail view (#51): highest/lowest point, steepest
climb and descent over a 100 m sliding window, distance per 5 % gradient
class (coloured like the elevation profile), and a generic
{type, distance} breakdown summary for surface / way-type data once a
source exists.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XMf4EGfBC9xbQ6rjD6HxgP
feat(trail-view): lead with map, profile and route facts
All checks were successful
CI / web (push) Successful in 59s
CI / go (push) Successful in 13m30s
799015dea1
On /trail/view the map (full width, ~55vh) and the stats now come first,
followed by the gradient-coloured elevation profile and a route-insights
block (highest/lowest point, steepest climb/descent, gradient breakdown
that doubles as the profile legend). The description moves below and is
hidden when empty (owners get an "Add a description" button). The
empty-state header illustration is skipped when a trail has no photos.

Map and list modes of the shared panel keep their layout.

Refs #51

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XMf4EGfBC9xbQ6rjD6HxgP
feat(trail-edit): colour track and profile by metric, toggle profile (#49)
Some checks failed
CI / go (push) Has been cancelled
CI / web (push) Has been cancelled
88c68b0ed2
Elevation/pace profile and track-line items of #49:

- Track metrics module (util/track_metrics.ts): per-point elevation,
  signed gradient (centred distance window) and speed/pace from the pace
  engine's pace_series, bucketed into classes with a colour and a legend
  label each. Metrics are a registry (TRACK_METRICS), so categorical ones
  such as surface or way type (BRouter segment tags, #5) plug in later.
- Track line: a coloured overlay layer on top of the editor's route
  (interactions stay on the route layer underneath), with a legend on the
  map. Speed and pace need a personal pace estimate.
- Profile: the elevation and the pace curve are coloured by independently
  chosen metrics; without a choice the chart keeps its legacy |grade|
  palette (now exported as PROFILE_GRADE_COLOURS for #51/#56 to share).
- Toggle the profile from a visible map control (and P); the stats overlay,
  legend and controls follow the profile's height. The chart's own button
  icon now follows the theme (it was black on dark glass).
- Colour menu with metric chips per target and a preview strip of how the
  metric colours this route; choices are remembered per browser.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XMf4EGfBC9xbQ6rjD6HxgP
feat(trail-edit): colour the track line by gradient by default (#49)
All checks were successful
CI / web (push) Successful in 59s
CI / go (push) Successful in 13m14s
c2218663d2
Bear's call on #59: the editor's track line starts coloured by gradient,
with its legend, instead of the plain violet line. A stored choice
(including "None") is kept. The palette button is now highlighted only
while its menu is open, since a metric is nearly always active.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XMf4EGfBC9xbQ6rjD6HxgP
feat(trail-edit): replace placeholder GPX names, use pace mode for category
Some checks failed
CI / go (push) Has been cancelled
CI / web (push) Has been cancelled
1453ea2bdc
- Treat filename-like and device/app default names from uploaded files
  ("Morning_Run.gpx", "Activity_123", "Track 001", "Current Track: …",
  date-only names, Strava EN/FR/DE/IT and Garmin defaults) as unfilled,
  so the route-based name replaces them. Detection is a narrow, pure,
  unit-tested function; anything unrecognised is kept.
- For drawn routes (no recorded speed), the pace estimator's run/hike
  mode decides Running vs the walk/hike rule; recorded tracks keep the
  speed rule and bicycle routing still wins.

Refs #49

Claude-Session: https://claude.ai/code/session_01XMf4EGfBC9xbQ6rjD6HxgP
Co-Authored-By: Claude Opus 5.5 <[email protected]>
fix(trail-edit): only treat Garmin names as placeholders at their start locality
All checks were successful
CI / web (push) Successful in 1m49s
CI / go (push) Successful in 14m28s
065230cac9
Garmin names activities "<start locality> <Activity>". Treat such a name
as a placeholder only when its prefix matches a locality of the
reverse-geocoded start (case-, accent- and hyphen-insensitive; short
place, hamlet, village, suburb, town, city, municipality). Without a
match, or when the lookup fails, the name is kept, so "Gorges du Verdon
Hiking" starting in Castellane survives. A bare activity ("Hiking")
stays a placeholder.

Refs #49

Claude-Session: https://claude.ai/code/session_01XMf4EGfBC9xbQ6rjD6HxgP
Co-Authored-By: Claude Opus 5.5 <[email protected]>
GET /trail/{id}/surface map-matches the stored GPX track with Valhalla
trace_attributes (thinned to 10 m, chunks of <=2000 points / 50 km) and
aggregates the matched edges into contiguous per-kind segments in track
distances, with normalised types (surface, way, sac) and the raw values.

Results are cached in the new superuser-only trail_surface collection
(one record per trail, keyed by geometry hash and algorithm version) and
computed lazily on first view. Access follows the trails view rule; every
refusal is a 404. Valhalla is read from VALHALLA_URL.

Refs #51, #49

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XMf4EGfBC9xbQ6rjD6HxgP
feat(web): typed client for the trail surface breakdown
All checks were successful
CI / web (push) Successful in 58s
CI / go (push) Successful in 13m27s
e42ffb5258
Adds the GET /api/v1/trail/{id}/surface proxy (forwards only the share
token), the TrailSurface types and trail_surface_get plus helpers that
split segments and totals by kind and find the segment at a distance,
for the #51 trail view and #49 track colouring.

Refs #51, #49

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XMf4EGfBC9xbQ6rjD6HxgP
merge: #59 feat/49-map-profile-colouring into deploy (batch 2026-11-05)
All checks were successful
CI / web (push) Successful in 59s
CI / go (push) Successful in 11m31s
0d0d85a40c
jmz merged commit 0d0d85a40c into deploy 2026-11-05 17:52:37 +00:00
jmz deleted branch batch/2026-11-05 2026-11-05 17:52:37 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
public/wanderer!64
No description provided.