feat(trail-view): map-first layout with elevation insights (#51, slice 1) #56
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
public/wanderer!56
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/51-trail-view-layout"
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?
First slice of #51 (trail view page,
/trail/view/@handle/id). Refs #51; this does not close it.What changes
Layout (overview mode of
TrailInfoPanelonly; map and list modes keep their layout)smup).<p></p>counts as empty. Owners and editors get an "Add a description" button that opens the existing inline editor. Long descriptions keep the existing 300-character preview with "Read more".px-8topx-4belowsm. The insights tiles use a 2-column grid and the legend wraps to 1 column on narrow screens. Light and dark themes use only the existing tokens (border-input-border,text-gray-500).Komoot-style facts from the GPX we already have (
trail_route_insights.svelte)Surface / way-type breakdown: UI only, no data source yet
route_breakdown_bar.sveltetakes{type, distance}[]and draws a stacked bar plus a legend (distance and %). It merges repeated types, sorts by distance, showsunknownin grey, and renders nothing when there is no data.TrailRouteInsightstakes an optionalbreakdowns: Partial<Record<'surface' | 'way' | 'sac', BreakdownSegment[]>>and draws one bar per dimension that has data. Nothing passes it yet, so nothing renders. There is aTODO(#51)intrail_info_panel.svelteand in$lib/util/route_breakdown.ts.Missing data source. Two candidates:
properties.messagestable already has one row per change in way tags, with a distance and tags such ashighway=path surface=unknown sac_scale=mountain_hiking trail_visibility=excellent./api/v1/brouter/routepasses it through, butvalhalla_storekeeps only the duration and elevations, so the tags are dropped today. This only covers BRouter-routed segments, and the tags would need to be stored with the trail.trace_attributes(edge.use/edge.surface/edge.sac_scale). This works for any track: imported, recorded or Valhalla-routed. It is probably a separate, later PR.Whichever source lands first only has to produce
RouteBreakdowns.Files
web/src/lib/util/elevation_stats.ts(+ test):profileFromPositions,hasElevationData,elevationExtremes,steepestSections,gradeColorIndex,GRADE_CLASSES,gradeClassIndex,gradeBreakdown,trackPositions.web/src/lib/util/route_breakdown.ts(+ test):summarizeBreakdown, palette,humanizeType, and theRouteBreakdownstype.web/src/lib/components/trail/route_breakdown_bar.svelte,trail_route_insights.svelte(new).web/src/lib/components/trail/trail_info_panel.svelte: the layout changes above.galleryis now$statebecause the gallery sits inside the conditional header.web/src/lib/i18n/locales/en.json: 12 new keys. No other locale touched.Notes for #49 (profile colouring)
GRADE_PALETTEandgradeColorIndexinelevation_stats.tsmirror the privategradeColorarray and its bucketing invendor/maplibre-elevation-profile/elevationprofile.ts. A test pins the bucketing. To avoid a conflict with the #49 profile-colouring work, I did not touch the vendored chart. Ideally the chart imports this palette so the legend can't drift from it.Tests
vitest: 30 new tests acrosselevation_stats.test.tsandroute_breakdown.test.ts. They cover min/max and ties, steepest-window averaging versus spikes, sparse points, tracks shorter than the window, flat, single-point and duplicate points, the 2.5 % colour buckets, the 5 % classes and their boundaries, jitter consolidation, a short final stretch, and breakdown merging, sorting, ignoring invalid distances and empty input.src/lib/server/trail_analyze.test.ts("ReadableStream is already closed"). It is pre-existing and local-only: the file is untouched and CI is green ondeploye72a2cc5.svelte-check: 0 errors. The 2 remaining warnings are pre-existing ones intrail/edit/[id]/+page.svelte.vite build: OK.Screenshots
I couldn't take any. The shared browser gets
ERR_CONNECTION_REFUSEDon wanderer.bearoverse.com, and the trail returns 403 without a session, so neither before/after nor phone/dark captures were possible. Please check the deploy preview at phone width and in dark mode.Before: a 20rem header illustration when the trail has no photos, then title and stats, then "Description" (an empty-state illustration if empty), "Route" with the elevation profile, and the timeline in a left column, with a small 18rem map stuck to the right on xl.
After: title, larger stats, the full-width map, the profile, insight tiles (highest, lowest, steepest climb and descent) and the gradient bar, then the description only if it has content, then the timeline and tabs.
Left for #51
fine_gravel→ "Fine gravel".map_with_elevation_maplibre(e.g. an exportedhighlightSegment(latlngs)that reuses the existing segment-highlight layer).🤖 Generated with Claude Code
https://claude.ai/code/session_01XMf4EGfBC9xbQ6rjD6HxgP
Shipped via batch PR #64 (
deploy0d0d85a4), which merged this branch head unchanged; live since 2026-11-05 ~19:30 CET inwanderer-web:deploy-676a7c62(homelab-flux #843). Forgejo does not mark stacked PRs as merged, so I am closing this by hand.🤖 Generated with Claude Code
Pull request closed