Repository navigation
Description
Status: done
Part of #3652 (step 7).
Depends on #3338 (the planner tidy-up): merged. Checked against develop 1bbced3; line numbers below are from it. Can start now. #3712 changes the same part of PlannerProfile.svelte (shown, restColumns, handles) and Planner.svelte.test.ts; either can merge first, and the second takes the other's few lines.
TL;DR
Goal: A rest day column covers only the height plot, and "Show whole route" shows the whole route also when the route fills the map region.
Problem: The rest column covers the distance ticks, the surface row and the data layer strip. The map cannot show more than the region (maxBounds: config.bounds, PlannerMap.svelte:452), so a route that fills the region is cut at the top and bottom on a wide map.
Decision: The rest columns move into the plot. After the map opens, its bounds grow by one region size on each side, so the planner still opens on the region as today. The night numbers do not change: the profile already numbers the nights as the day list and the map do.
Rejected:
- A badge "11" for the night of a rest day (the approved mock-up shows 10, Rest, 11, 12): the day list calls that night "Night 10" (
Itinerary.svelte:207), it is the same place as night 10, and one map marker cannot show two numbers. It would add a second numbering. - Bounds grown by half the region: too small (Facts).
- Start the map with
bounds: config.bounds: the planner then opens on the whole region with empty bands at the sides; today it opens with the region filling the map. - No
maxBounds: the rider could pan away from the region.
Systems: route-planning
Contracts: none
Size: S (1 system, about 30 lines)
Facts
-
Nights have the calendar number of the day that ends there (
dayLabels,PlannerApp.svelte:279). With a rest day after riding day 10, calendar day 11 is the rest day and riding day 11 is calendar day 12. Today the day list shows "Night 10", "Day 11 · Rest" with "Night 10 not chosen", "Day 12", "Night 12"; the map markers show 10 and 12 (PlannerApp.svelte:388,:401); the night page says "Where day 10 ends and day 12 starts" (Itinerary.svelte:172); the profile badges show 10, the Rest column, 12 (PlannerProfile.svelte:265). All agree. -
The rest columns are in
.rests(PlannerProfile.svelte:209-215), absolute over the whole drawer content (.rest,top: 0; bottom: 8px,:396-400), so they cover the ticks, the surface row (:276) and the data layer strip (:277). The surface row keeps a gap of the column width (rests={axis.rests}); that stays. -
A rest day follows a riding day (
addRestDay,editor.ts:535:after≥ 1), so no rest day stands before day 1. A rest day at the finish has no column (at < shown.to,PlannerProfile.svelte:111), as today. -
MapLibre zooms in until
maxBoundscovers the whole map in both directions. A fit asks for padding 60 px top, 40 px bottom (fitPadding,PlannerMap.svelte:89). The region of the release is 7.6–8.95° E, 46.47–47.25° N: in Web Mercator 1.35 wide and 1.14 high. For a route that fills the region:Map (window) Route height that the fit needs Smallest route height with the bounds of: region, half a region more, one region more 1072 × 422 (1440 × 900, with the strip of Planner: a strip of all days and a week in focus for trips of 15 days or more #3712) 322 px 906, 453, 302 px 1072 × 462 (1440 × 900, no strip) 362 px 906, 453, 302 px 1552 × 602 (1920 × 1080, with the strip) 502 px 1311, 656, 437 px 1552 × 642 (1920 × 1080, no strip) 542 px 1311, 656, 437 px The fit works when the smallest height is below the needed height: only with one region more.
-
The map opens at
center8.8, 48.65, zoom 7 (PlannerMap.svelte:29), north of the region; todaymaxBoundspulls it onto the region. With larger bounds at creation, the empty planner would open on the empty band north of the region. -
The compare screen uses the same map (
CompareScreen.svelte:246) and fits both routes withfitRoute(:141). It gets the same bounds and opens as today.
Plan
PlannerProfile.svelte: delete the.restswrapper (:209-215) and its style (:391-395). Inside theprofilesnippet, in.plot(:218), before the handles: each ofrestColumnsis a.restwitharia-hidden="true",leftaxisRest(axis, i)andwidthaxisColumn(axis), with the same content as today..restgetstop: 0; bottom: 0; pointer-events: noneand keepsz-index: 1(the handles stay above it). Two rest days after one night stay side by side (axisRestindex).PlannerMap.svelte: the constructor keepsmaxBounds: config.bounds, so the map opens on the region as today. Right after it, beforefitInitialRoute()(:459):map.setMaxBoundswith the region grown by its own width and height on each side, the latitudes held to ±85 and the longitudes to ±180. A comment states why the bounds change after the map opens.
Files
builder/web/src/components/planner/PlannerProfile.svelte: change: the rest columns inside the plot.builder/web/src/components/planner/PlannerMap.svelte: change: the bounds after the map opens.builder/web/src/components/planner/Planner.svelte.test.ts: change: the test "puts a rest column after its night" (:389) also checks that the one.restis inside.plotand that the badges read 1, 2. It fails when the column is outside the plot again or a rest night gets a badge.
Done when
- In
builder/web:npx vitest run src/components/planner/Planner.svelte.test.tsandnpm run checkpass. - The owner checks on the pull request's head, served on the build PC:
- A 12-day trip with a rest day after night 10, profile on "Whole route". Pass: the Rest column covers only the height drawing, not the distances and not the surface bar; the profile numbers read 9, 10, Rest, 12, as the day list and the map. Fail: the column covers the distances or the surface bar, or a number differs from the list or the map.
- The 32-day test plan, browser window at 1440 × 900 and then at 1920 × 1080: press "Show whole route". Pass: the whole line, start to finish, is on the map at both sizes. Fail: the line is cut at an edge.
- A 3-day trip: press "Show whole route". Pass: the map shows the trip as on
develop. - Open the empty planner. Pass: the map opens on the region as on
develop, with no empty band. Zoom out fully: the map stops at one region size around the region.
Limits
- The fit shows a route that fills the region only while the map is at most about 3.5 times as wide as its height less 100 px. At 1440 × 900 and 1920 × 1080 it is. A lower window, or the date bar of a data layer, can still cut the top and bottom.
- The rule for a week that starts or ends with a rest day is in Planner: a strip of all days and a week in focus for trips of 15 days or more #3712.
Activity
timohueser commentedon Nov 20, 2026
The owner's look passed on the before | after sheet of the built planner (the rest column only over the plot; the 32-day trip whole on the map at both window sizes; a 3-day trip and the empty planner unchanged; the hidden mount): "Yes, merge it".
Generated by Claude Code