Repository navigation
Description
Status: done
TL;DR
Goal: A rider plans a trip of 15 to 64 riding days in the web planner on a big screen, sees the whole trip and one week in detail, sees the line of a 64-day trip in seconds, not in half a minute, and sends the trip to the bike computer as one route per day, in two parts above 32 days.
Problem: At 32 and 64 days the height profile, the day list and the map cannot be read, the map of a 64-day cycling trip is quiet only after 31.4 s, one point far from a road stops the whole trip, and the web planner sends a trip as one route, which the bike computer cannot hold above about 1,500 km (cycling) or 1,000 km (hiking).
Decision: From 15 riding days, a strip of all days stands above the profile, and a window of 7 calendar days on it (the week in focus) chooses what the day list, the profile, the map and the night search show in detail. Up to 14 riding days, the screen does not change. The planner sends the route requests of a long plan two at a time; a point far from a road is left out with a note, and a leg with no legal path becomes a gap. The web planner sends a multi-day trip as one route per riding day plus a trip object, as the phone does; a trip of 33 to 64 riding days goes as two trips ("parts") of at most 32 days. A day route that the rider deleted on the bike computer goes again only when its file changes. The web planner and the phone keep a route point at each change that the 3 m dead band of the climb books (and, as today, at bends and surface changes), so the climb stays exact with 25 to 37 % fewer points. The planner allows 64 riding days.
Rejected:
- Weeks that fold in the list (direction A) and a day table (direction C): the owner chose B.
- Small fixes before the new screen: the owner chose the screen first. The faults that the screen does not replace are their own small step (Planner: rest-day column and "Show whole route" fixes #3715).
- Keep the routed legs of a stored plan in the library: a 64-day cycling plan has 320,557 line points with heights, times and road facts, so each stored plan grows by tens of megabytes; every new routing package makes the stored legs wrong; and it helps only a second open. Two requests at a time help every full route, in one file.
- Halve a failing request down to the single bad leg: about 6 rounds of failing requests. The service names the point or the leg in its error instead (one field).
- A 3 m step for the web planner only (a parameter of
points_to_obcr): it adds a parameter to an API that the phone shares, for no gain; the phone's route files get smaller in the same way. - A WebAssembly export for the trip object: a TypeScript writer of about 20 lines, pinned by
specs/vectors/trip-v3.binas the phone's Swift writer is, needs no bridge change and no size budget. - A random trip key kept in the browser: it dies with its stored entry, and a reversed loop keeps it. A key derived from the plan survives both.
- Raise the device limits (64 days per trip, more menu routes, longer routes): the owner chose two parts and no firmware change.
- A strip for every trip: the owner wants no added complexity for 1 to 14 days.
- A
donemarker of the complete parts: with it, a new name or any other change makes all deleted days again, and they need their room. A CRC for each sent day keeps them out (Planner: 64 riding days, sent to the bike computer as two parts #3713). - A paint expression on the week range for the map: for a data-driven paint change, MapLibre lays out and loads the whole
tripsource again. A feature state of each day sends no line data (Planner map: the week in colour, the rest of a long trip quiet #3714).
Systems: route-planning, web-planner, library, routing (an error field of the route service), navigation (the obc-route converter), simulators (sim/phone/host, the converter that the iOS app links), planner search (the line limit of the search contract, the fix)
Contracts: specs/route-api.md Errors (a point or leg field), specs/obcr-route.md §5 (a point where the 3 m dead band books a change), specs/planner-plan.md (days 1 to 64), specs/library-backup.md (the browser state sent, SentRoute), planner/search/query/contract.json (the line limit in one place). The trip object (specs/ble-interface.md §7.7) and the route file layout do not change.
Size: L (7 systems, a stored browser state changes) — an epic of 7 steps and one fix, 8 pull requests, about 3,000 changed lines.
Facts
Checked on origin/develop 90bb591, and on origin/claude/planner-ux-merge-develop-2 edce9c0 (the head of #3338 with the develop merge of #3662) where it says so.
Screen:
- The planner limit is 32 riding days:
maxRidingDaysinbuilder/web/src/lib/planner/editor.ts:12. At the limit the + of the day count isdisabledand says nothing (builder/web/src/components/planner/DayCount.svelte:38). - Day colours repeat every 4 riding days (
builder/web/src/lib/planner/day-colors.ts:2-7). - The profile of a multi-day trip draws, for each day, the area and the line of the whole route and clips them to the day (
builder/web/src/components/planner/PlannerProfile.svelte:240and:254), again for each piece between rest columns. For the 32-day cycling plan, each such path is 5.76 M characters. A 64-day cycling plan opened in headless Chromium with the route service and the dev page under one 3 GB memory cap was killed twice by the cap on this PC; with each day drawing only its own slice, the same run passed. - The profile switch "Map view / Whole route" (
PlannerProfile.svelte:194) shows the stretch of the map or the whole route. - The day list shows all days, or only the open day (
builder/web/src/components/planner/Itinerary.svelte:52). Each day uses about 170 px. - The planner searches places to sleep for every night that is not pinned (
nightWindows,builder/web/src/lib/planner/stops.ts:82-88, used atPlannerApp.svelte:264). Each search request carries the whole simplified trip line (builder/web/src/lib/planner/search/types.ts:70-73). The town search refuses a line of more than 20,000 points (planner/search/validation.mjs); the simplified line of the 64-day cycling plan has 28,065.proposeNightschains: the window of night N uses the proposals of the nights before it (stops.ts:130-150). The proposals live only in the page (PlannerApp.svelte:272-274). - The map day colours are a
colorproperty of thetripsource, and each change sets the whole source again (builder/web/src/components/planner/PlannerMap.svelte:228-230,:572). - The map cannot show more than the region:
maxBounds: config.bounds(PlannerMap.svelte:453). So "Show whole route" cuts a route that fills the region on a wide map. - planner: less text, clear controls, a night picker that follows the stay kinds, no route alternatives (#3286) #3338 deletes route options and the day labels of the profile, puts the trip totals into the title row of the elevation drawer, shows the route notes as one row ("41 things to check"), puts the start date, the day count and the kinds of night place at the top of the day list, and makes the profile plot higher (edce9c0, seen in the pictures).
Routing:
-
A run of routed legs goes out in requests of at most 63 legs (
MAX_REQUEST_POINTS64,routing.ts:132;chunks,builder/web/src/lib/planner/route-legs.ts:58), one after the other, because each one is pinned to the road position where the one before ended (route-legs.ts:100-103). -
The route service answers
busywhen a request waits more than 1 s for a worker (QUEUE_WAIT,planner/service/src/http.rs:24); the planner tries a busy request again after 1 s, at most twice (route-legs.ts:54).gpx-import.ts:49shapes lines one at a time. -
no_snap(a point more than 1 km from a usable road) knows the point (Error::NoSnap(index),planner/service/src/lib.rs:98-101), but the answer gives it only in the message text. The planner then shows no line at all. -
A train or bus after night N is a transfer leg that starts riding day N + 1 (
trainAfter,editor.ts:572,:592);calculateLinekeeps it in the line as a straight segment of 0 s. The phone starts such a day after the transfer (companion-ios/.../OBCDomain/TripLine.swift:113-114). -
Measurement, 64-day cycling plan (3,909 km, 6 requests, 320,557 line points), median of 3 loads, dev page, headless Chromium on the GTX 1660, local route service with 2 workers, terrain run active, one 3 GB cap at nice 19: first line on the map 25.7 s, map quiet 31.4 s. Route requests 9.0 s, profile 6.7 s, night search 7.4 s. With the profile slices and no night search: map quiet at 11.1 s.
-
Experiment for this design (throwaway edits,
tools/exp.pyandtools/speed.mjsof the design folder; same plan, machine and service, 1920 × 1080; time from the navigation start to the first map idle after the line is set; profile slices; night search only for nights 1 to 7; the search answered each request at once with an error, so no answer was proposed):Route requests Map quiet with the line, 3 loads Requests One after the other, as today 12.5 s (11.9, 12.5, 12.8) 6 Two at a time, unpinned; a leg that does not join its neighbour goes out again, pinned to both 7.8 s (7.7, 7.8, 8.2) 9 In every load, 3 of the 5 joins between the 6 requests landed on another road position. Real night search answers were not measured: each answer runs
proposeNights, a new day split, list, profile and map. Both rows also had the night search of the first week only, which is Planner: a strip of all days and a week in focus for trips of 15 days or more #3712's change. -
Experiment with only the two-at-a-time change (and the profile slices, which change memory only; night search of every night, search off; 3 loads; terrain run active): from the first route request to the last answer 9.2 s (8.4, 9.2, 9.4) one after the other, 5.1 s (4.9, 5.1, 6.2) two at a time with 9 requests; map quiet 21.1 s and 14.4 s.
Bike computer:
-
The web planner sends a plan as one route, nights and stops as waypoints (
builder/web/src/lib/device-sync/route.ts:25-41), and keeps one device object for each plan (SentRoute,builder/web/src/lib/library/records.ts:145;sync.ts:148). These read that object:sync.ts:105-116(leaving),sync.ts:132-134(the target of a put, the copies of other plans),sync.ts:157-161(lost objects),pages/routes/state.ts:19,pages/Device.svelte:100,pages/Area.svelte:94. Asentvalue that failsisSentreads as no value (library/store.ts:419-422); a backup with such a value fails as "damaged" (library/backup.ts:46). These tests seed the old form:src/lib/library/store.test.ts:86,tests/browser/planner/device.test.js:66,routes.test.js:35,route-rows.test.js:78and:310. "Do not send" only takes a plan out ofwaiting(pages/Route.svelte:103,pages/routes/SelectedCard.svelte:51). -
The phone sends a trip as one route per day with no waypoints, then a trip object; it skips a day whose CRC is unchanged and replaces a changed day by its object id (
companion-ios/.../OBCTransport/Codecs/TripDayRoutes.swift,.../Transfer/TripUploadPlanner.swift). -
The phone encodes each route and trip day through
RouteObjectCodec.encode→obc_format_route_encode→obc_route::convert::points_to_obcr(sim/phone/host/src/route_codec.rs:130), in the staticlib that the iOS app links (sim/phone/host/Cargo.toml:7-9). The web bridge uses the same function (builder/wasm/src/convert_web.rs:34). It keeps a point at each height change of 1 m (ele_keep_m,firmware/obc-route/src/convert.rs:263,:304);keep_elevation_detail(convert.rs:319) sets the step. -
The trip object (§7.7,
write_trip,firmware/obc-route/src/trip.rs:168, vectorspecs/vectors/trip-v3.bin) holds a key, a name of at most 48 bytes, a start date and one route object id per day. The device reads at most 32 days of it (MAX_TRIP_DAYS,firmware/obc-route/src/trip.rs:24), keeps at most 16 trips (MAX_TRIPS,firmware/obc-app/src/trip.rs:28) and at most 64 routes in its menu: the newest 64 route ids win (firmware/obc-fw-nrf54l/src/flat_store.rs:1651,firmware/obc-storage/src/flat/catalog_read.rs:30-40). The device's own routes count: one built trip day at a time and temporary directions (FLAG_BUILT_DAY,FLAG_TEMPORARY,firmware/obc-formats/src/obcr.rs:26-30). A trip day whose route is not in the menu does not resolve. -
The device files a trip upload from the cable as from the phone (
flat_store.rs:1253-1255). It keeps trip progress by key: a re-upload with the same key keeps it; fewer days drop the progress of the removed days (firmware/obc-app/src/trip.rs:292-300). §7.7: "A re-upload of the same trip writes the same key"; "Reversing a trip makes a new trip with a new key". -
The next trip day comes from the trip of the latest progress record (
next_trip_day,obc-app/src/trip.rs:261); a ride stores its trip key (TripRef,:272). The device dates day k as start date + k until the rider rides (:384-389). -
specs/planner-plan.md:34:daysis an integer from 1 to 32. The phone opens no.obcplanfile;PlannerPlan.maxDays(32,companion-ios/Packages/OBCKit/Sources/OBCDomain/PlannerPlan.swift:235) limits only the plans that the phone makes (:164,:241). -
A trip object may list a route that is gone (§7.7: "Dangling refs are tolerated on read"); the device skips that day, and the later days keep their numbers (
firmware/obc-app/src/trip.rs:103-118). The card never gives an object id twice (firmware/obc-storage/src/flat/store.rs:1403-1407). -
Points of real routed lines, model of the shipped converter (
tools/daypoints.pyof the design folder), days of equal length:Plan Today (1 m), points/km 3 m from the dead-band reference (Route files: keep a point at each 3 m height change (web planner and phone) #3710), points/km Largest day route, today → Route files: keep a point at each 3 m height change (web planner and phone) #3710 Cycling, 32 days, 1,972 km 42.8 26.9 3,518 → 2,186 Cycling, 64 days, 3,916 km 40.9 26.2 3,531 → 2,168 Hiking, 32 days, 716 km 67.8 50.9 2,176 → 1,680 Hiking, 64 days, 1,448 km 63.0 46.3 2,469 → 1,688 A plain 3 m step from the last kept point loses up to 26 m of climb on a day; the rule of Route files: keep a point at each 3 m height change (web planner and phone) #3710 keeps it exact (table in Route files: keep a point at each 3 m height change (web planner and phone) #3710).
A route file holds 65,281 points (specs/obcr-route.md§5): the limits of a trip are its 32 days and the 64 menu routes, not the points.
Other work on the same files: #3338 (the planner tidy-up) and #3662 are merged into develop; #3712 to #3715 are checked against develop 1bbced3.
The screen
Built on #3338. Sizes on 1440 × 900 with the layout of #3338: top bar 48 px, trip bar 56 px, side panel 360 px, map 1072 × 462 px, elevation drawer 260 px, status line 38 px.
1 to 14 riding days. No strip, no week: the screen of #3338, with the "Map view / Whole route" switch.
15 to 64 riding days.
- Strip. A row of 40 px under the title row of the drawer: bars of 28 px and a line of day numbers of 12 px. The drawer is 40 px higher, the map 40 px lower (422 px). One slot for each calendar day over the width of the drawer (1024 px): 32 px a slot at 32 days, 16 px at 64, 2 px between slots. The bar of a riding day has a height in proportion to its riding time (4 to 26 px; the longest day of the trip is 26 px). Outside the week the bars are quiet (
--ink-faintmixed 45 % into--panel), inside they have their day colour. A rest day is a slot with a 6 px square outline at the bottom. Under the bars: the number of every 7th day, or its date with a start date. The "Map view / Whole route" switch is gone. - The week in focus. Always 7 calendar days, rest days included (a strip has 15 days or more). A frame of 2 px in
--amberwith a light amber fill. A plan opens on days 1 to 7. The week is page state. After every change of the trip (undo, fewer days) the week is clamped into the trip; a plan that drops under 15 days and grows again keeps its start day, clamped. - How the week moves. A click on a slot makes the day the 4th day of the week (clamped). A drag moves the week with the pointer, one day at a time. The strip is one focusable slider ("Days 36 to 42"): arrows one day, Page Up and Page Down 7 days, Home and End. The mouse wheel over the strip: one day a step. ‹ and › in the week header: 7 days. When the rider opens a day (a day row, a night or a quiet line on the map, a night badge) or a search result lies outside the week, the week moves the least that puts it inside.
- Pointer on a slot outside the week. A tip of one line over the slot: "Day 45 · 57.5 km · 3h 57m · ↑ 1,441 m". The day lights up on the map in its colour, 6 px wide. The map and the week do not move.
- Day list. Above the rows, a week header of 36 px that stays on top while the list scrolls: ‹, "Days 36–42" in bold, the distance and climb of the week, ›. Then only the rows of the week: days, nights, rest days and the + between days; the Start row only with day 1 in the week, the Finish row only with the last day. The rows are the rows of planner: less text, clear controls, a night picker that follows the stay kinds, no route alternatives (#3286) #3338.
- Profile. The riding days of the week, from the start of the first to the end of the last, over the full plot (964 px, about 138 px a day). As in planner: less text, clear controls, a night picker that follows the stay kinds, no route alternatives (#3286) #3338, no day labels: the days have their colours and the nights their badges, with the night before the week at the left edge. The distance ticks count from the trip start. A day end drags as today. The height scale is the scale of the whole trip. An open day shows that day. The surface row shows the week.
- Rest day. A column of 64 px after its night, as today, but only over the plot, never over the ticks and the surface row. The night badges keep their numbers, as in the day list and on the map: a night has the number of the day that ends there, so after a rest day 11 the numbers run 10, Rest, 12. When the week starts with a rest day, its column is the left edge of the plot. This also holds for trips of 14 days or fewer.
- Map. Each feature of the
tripsource has its riding day as its id. The look of a day is a feature state: the days of the week have their colours, the other days are a line of 2.5 px in a quiet colour, and the day of the tip is lit in its colour, 6 px wide. A week step and the tip send no line data to the map. Night marks outside the week become 10 px dots with no number (a class on the marker); shaping points and stops outside the week are hidden. Start and Finish keep their marks. A click on a dot opens its night, as a click on a night mark does; a click on a quiet line opens its day, as a day row does. Neither changes the plan. One fit rule: the map fits the week only after the rider moves the week with the strip or ‹ ›, when the week rests, and only when the week's line is not inside the padded view. An opened day or night, or a move of the map by the rider, cancels the fit. A plan opens on the whole trip. - Totals and warnings. As planner: less text, clear controls, a night picker that follows the stay kinds, no route alternatives (#3286) #3338 shows them (totals in the drawer title, notes as one row). From 33 riding days one quiet line under the trip settings: "Goes to the bike computer in 2 parts".
- Night search. Only for the nights of the week and the night before it (at most 8 nights, 16 requests), and only when the week rests (300 ms after the last change of the week; during a strip drag, 300 ms after the drag ends). Proposals exist only for these nights; every other night shows its even day end. So the day ends of a week never depend on which weeks the rider looked at before. The finder keeps its 40 recent answers, so a step back costs no search.
- Show whole route. Fits the whole trip and does not move the week. The map may show up to one region size outside the region on each side; the planner still opens on the region as today.
- Day count at the limit. At 64 the + looks off (
aria-disabled, it keeps the focus). A press writes "64 riding days is the most a trip can have" in the status line. - A point far from a road (
no_snap). The planner routes through its neighbours without it and shows the existing note "Route passes 1.2 km from the selected point — no accessible path", now with Show (routeGapsmeasures from the line to the point). - No legal path between two points (
no_path). That leg is a gap: a dashed straight line, astrip-gapdraws today, and the note "No legal path between 2 points". Its straight length counts in the distance; it adds no time and no climb. GPX and FIT export write the gap as a straight segment.
Mock-ups on #3338: long-trips-design-sheet.webp (design folder /media/timo/OSM1/tmp/explore-3506/long-trips-design/).
The bike computer
What goes. A plan of one riding day: one route, as today. A plan of 2 or more riding days: one route for each riding day ("day route") and one trip object for each part. Riding days 1 to 32 are part 1, days 33 to 64 part 2. A rest day has no route.
Day ends. From the stored plan only: planView(trip, line).days with no proposals, so pinned nights, moved day ends (splits), else the even day end. The device cuts a day exactly where the planner shows a kept or moved night. At a night that is still a suggestion, the planner shows the suggested town, but the device cuts at the even day end, up to half a day away; the rider keeps the night to send the town.
A day route. The line from the start to the end of the day, with interpolated end points (height interpolated, surface of the segment). A day that starts with a transfer starts after it, as the phone cuts; a transfer inside a day stays a straight segment. Waypoints: the stops of the day, distances from the day start, at most 32. Name: "Day k ‹place›": k is the position of the day in its part (1 to 32), the number the device shows; the place is the label of the pinned night point; with no pinned night, and for the last day of the trip, "Day k". At most 48 bytes, cut on a character boundary, never inside "Day k". After a rest day or in part 2 the device number is not the planner's calendar number (planner day 12 after one rest day is "Day 11"; day 36 is "Day 4" of part 2).
A trip object. Written by tripObject() in TypeScript, pinned by specs/vectors/trip-v3.bin. Key: FNV-1a 64 of "‹plan id›|‹id of route point 1›|‹id of route point 2›|‹part›" (0 becomes 1). It stays while the plan keeps its first two points: a moved start keeps its id. Any reversal, also of a loop, changes the order of the points and so the key, as §7.7 asks; a new point right after the start changes it too. The key needs no storage. Name: the plan name, with " 1/2" or " 2/2" at the end when there are two parts, inside 48 bytes. Start date: days since 1970 of the calendar day of the part's first riding day, or 0. Days: one whole day for each day route.
Progress. A send with the same key keeps the progress on the device; a part with fewer days drops the progress of the removed days. A new key starts empty.
Gaps block the send. A line with a no_path gap does not go: the plan stays in waiting, and the report says "“Alps” waits: 1 leg has no legal path. Change it in the planner." A point left out for no_snap does not block: the line is complete without it. A leg that the rider drew or made straight goes as today.
Stored state. As merged with #3711: SentRoute is { key, card, days: string[], trip: string | null, tripKey: string | null } (library/records.ts:147-153); an empty string in days is a day with no object on the card; allOnCard needs a key and no empty slot. #3713 makes it { key, card, days: string[], crcs: number[], gone: string[], trips: string[], tripKeys: string[] }: trips and tripKeys hold one trip object and one stored key for each part; crcs[i] is the CRC-32 of the file of day i as last put or found on the card; gone holds the day ids that the last listing of the card did not hold, and days keeps them. allOnCard then needs only this card and a key. Each id is written right after its put or removal; an entry of another card counts as no entry.
One sync of a plan in waiting, as merged with #3711 (sendRoute, device-sync/sync.ts:263-350): the gap check; the day routes; the entry (entryOn), which takes this library's trip object by an entry's id or by a stored or current key and never touches a route that a foreign trip lists; the copies of lost puts; for a one-day plan, the removal of its trip and days 2 and later; the room of the menu (64 routes, 16 trips), with the surplus days removed first when the new days need their room; then each day (skip by length and CRC, replace in place, or create), the stored trip key, the trip object, and the removal of the surplus days. #3713 first removes the trip objects of the parts that the plan no longer has, then runs these steps for part 1, then part 2, and removes the surplus days after all parts. Part 1's new routes count against part 2's room (card.count). A part whose days are all left out (below) is skipped. A part that does not fit stops the plan with "Part 2 of “Alps” waits: the bike computer has room for 2 more routes, it needs 8. Remove ridden or unused routes on the bike computer."
Days that the rider deleted on the bike computer (#3713). A day whose route is gone from the card, and whose new file has the CRC in crcs, is left out: no put, no room, and its trip object lists its old id. A changed day goes again with a new id, so only what changed takes room.
Walk: a 40-day trip, 30 other routes on the device. Sync 1: part 1 needs 32, room 34: it goes (62 routes). Part 2 needs 8, room 2: it waits. The rider rides days 1 to 20 and deletes those 20 day routes on the device (42 routes). Sync 2: days 1 to 20 are left out; days 21 to 32 and "Alps 1/2" did not change. Part 2 needs 8, room 22: it goes (50 routes). No route of the rider leaves the menu. The plan shows "On the device". A later change of a stop in day 5 makes day 5 again with a new id (51 routes), and "Alps 1/2" is replaced in place with that id and the old ids of the other deleted days.
A send that stops halfway (cable out): the entry holds every id that a put finished; the plan stays in waiting. The next sync skips finished days by CRC, takes a copy of a lost answer, and sends the rest. A second sync of an unchanged, complete plan sends nothing.
Removal and lost objects (#3711, with the day rule of #3713). A plan in leaving (deleted): the sync removes its trip objects, then its days, the last first. At the end of a sync, gone gets the day ids that the card no longer holds; a gone day does not change key. A trip object that is gone while a day of its part is on the card empties its slot and key, so the next send makes it again. An entry with no object left on the card goes. So a plan whose ridden days the rider deleted shows "On the device", and "Send to device" is off, because a send puts nothing. After a change of the plan, a send puts only what changed. When nothing of the plan is left on the bike computer, the plan is not on the device, and a send puts all of it again. Nothing goes again by itself.
Old entries. A sent value of an older form (also the one-part form of #3711) fails isSent and reads as empty; backup.ts drops a state value that fails its check, so an old backup still loads. The routes of old entries stay on the device as single routes until the rider deletes them there; they count in the room check.
On the device. Two trips, "Alps 1/2" (days 1 to 32) and "Alps 2/2" (days 33 to 64), each with its own progress and "Trip to go". When part 1 is done, the device does not go on to part 2 by itself: the rider opens "Alps 2/2" in the trip menu. The rest of a short day 32 is not joined to day 33. The journal shows the rides as two trips. With a full menu (a 64-day trip and nothing else), the device's own built day or directions push the oldest route out of the menu, which is day 1 of part 1.
Plan
#3709, #3710, #3711 and #3715 are merged. #3712 is built and reviewed. The search fix has no sub-issue: it is one small pull request (Mode: fix) and lands before #3713. #3713 follows #3712, #3711 and the search fix; #3714 follows #3712 and #3715. #3713 and #3714 can be built at the same time. Each step is one pull request, and each merges alone. Each sub-issue holds its files, cases, tests, checks and the owner's check.
- Planner: route long plans two requests at a time, and keep the trip when one point or leg fails #3709 Planner: route long plans two requests at a time, and keep the trip when one point or leg fails (M, about 550 lines; now, on
develop) - Route files: keep a point at each 3 m height change (web planner and phone) #3710 Route files: keep a point at each 3 m height change (web planner and phone) (S, about 100 lines; now, on
develop) - Device sync: send a trip of up to 32 days as day routes and a trip object #3711 Device sync: send a trip of up to 32 days as day routes and a trip object (M, about 700 lines; after Planner: route long plans two requests at a time, and keep the trip when one point or leg fails #3709 and Route files: keep a point at each 3 m height change (web planner and phone) #3710)
- Planner: a strip of all days and a week in focus for trips of 15 days or more #3712 Planner: a strip of all days and a week in focus for trips of 15 days or more (M, about 800 lines in two commits, the profile slices first; can start now; ends with the speed gate with town search answering)
- Search fix: the place search takes the line of a long trip:
searchLinethins the line until it has at most the service's limit of points (S, about 35 lines; lands before Planner: 64 riding days, sent to the bike computer as two parts #3713) - Planner: 64 riding days, sent to the bike computer as two parts #3713 Planner: 64 riding days, sent to the bike computer as two parts (M, about 550 lines; after Planner: a strip of all days and a week in focus for trips of 15 days or more #3712, Device sync: send a trip of up to 32 days as day routes and a trip object #3711 and the search fix; ends with the speed gate of the 64-day plan with town answers)
- Planner map: the week in colour, the rest of a long trip quiet #3714 Planner map: the week in colour, the rest of a long trip quiet (M, about 200 lines; after Planner: a strip of all days and a week in focus for trips of 15 days or more #3712 and Planner: rest-day column and "Show whole route" fixes #3715)
- Planner: rest-day column and "Show whole route" fixes #3715 Planner: rest-day column and "Show whole route" fixes (S, about 30 lines; can start now)
Files
planner/service/src/lib.rs,planner/router/src/lib.rs,planner/router/src/router.rs,specs/route-api.md: change:pointandlegin the error answers (Planner: route long plans two requests at a time, and keep the trip when one point or leg fails #3709).builder/web/src/lib/planner/route-legs.ts,routing.ts,route-gaps.ts,routing.test.ts: change: two in flight, bad joins, left-out points, gap legs (Planner: route long plans two requests at a time, and keep the trip when one point or leg fails #3709).builder/web/src/lib/planner/gpx-import.ts: change: the comment at line 49 (Planner: route long plans two requests at a time, and keep the trip when one point or leg fails #3709).builder/web/src/lib/device-sync/sync.ts,sync.test.ts: change: gap block (Planner: route long plans two requests at a time, and keep the trip when one point or leg fails #3709); one sync of a trip (Device sync: send a trip of up to 32 days as day routes and a trip object #3711); parts, left-out days, the end of a sync, the one-part seeds (Planner: 64 riding days, sent to the bike computer as two parts #3713).firmware/obc-route/src/convert.rs,firmware/obc-route/tests/cases/convert.rs,specs/obcr-route.md: change: the height rule from the dead-band reference (Route files: keep a point at each 3 m height change (web planner and phone) #3710).companion-ios/Packages/OBCKit/Tests/OBCTransportTests/RouteObjectCodecTests.swift: no change expected; CI runs it (Route files: keep a point at each 3 m height change (web planner and phone) #3710).builder/web/src/lib/device-sync/trip.ts,trip.test.ts: create: the trip object writer (Device sync: send a trip of up to 32 days as day routes and a trip object #3711); change:PART_DAYS, the key, name and start date of a part (Planner: 64 riding days, sent to the bike computer as two parts #3713).builder/web/src/lib/device-sync/route.ts: change: day routes (Device sync: send a trip of up to 32 days as day routes and a trip object #3711), the day number in its part (Planner: 64 riding days, sent to the bike computer as two parts #3713).builder/web/src/lib/library/records.ts: change:SentRoute,isSent(Device sync: send a trip of up to 32 days as day routes and a trip object #3711);SentRoute,isSent,allOnCardof the parts (Planner: 64 riding days, sent to the bike computer as two parts #3713).builder/web/src/lib/library/backup.ts: change: drop a state value that fails its check (Device sync: send a trip of up to 32 days as day routes and a trip object #3711).builder/web/src/pages/routes/state.ts,builder/web/src/pages/Device.svelte,builder/web/src/pages/Area.svelte: change:copy.card === card(Device sync: send a trip of up to 32 days as day routes and a trip object #3711); the comment ofdeviceState, the count ofDevice.sveltewithoutgone, andstate.test.ts(Planner: 64 riding days, sent to the bike computer as two parts #3713).builder/web/src/lib/library/store.test.ts,builder/web/tests/browser/planner/device.test.js,routes.test.js,route-rows.test.js: change: the newsentform (Device sync: send a trip of up to 32 days as day routes and a trip object #3711); the form of the parts, also inbuilder/web/test-support/device-sync/fake-device.ts(Planner: 64 riding days, sent to the bike computer as two parts #3713).docs/design/web-planner.md: change: the device sync (Device sync: send a trip of up to 32 days as day routes and a trip object #3711); the strip (Planner: a strip of all days and a week in focus for trips of 15 days or more #3712); parts and left-out days (Planner: 64 riding days, sent to the bike computer as two parts #3713); the map of a week (Planner map: the week in colour, the rest of a long trip quiet #3714).specs/library-backup.md: change: the rowsent(Planner: 64 riding days, sent to the bike computer as two parts #3713).builder/web/src/lib/planner/search/plan.ts,plan.test.ts,planner/search/query/contract.json,planner/search/query/schema.py,planner/search/validation.mjs: change: the line limit in one place, andsearchLinethins until the line fits (the search fix).builder/web/src/lib/planner/week.ts,week.test.ts: create (Planner: a strip of all days and a week in focus for trips of 15 days or more #3712); change:dayLook,pinLook(Planner map: the week in colour, the rest of a long trip quiet #3714).builder/web/src/lib/planner/map-types.ts: change:dayonMapSegmentandMapPoint(Planner map: the week in colour, the rest of a long trip quiet #3714).builder/web/test-support/planner/MapStub.svelte: change:showWeek, which counts its calls (Planner map: the week in colour, the rest of a long trip quiet #3714).builder/web/src/lib/planner/profile-data.ts: change: day slices (Planner: a strip of all days and a week in focus for trips of 15 days or more #3712).builder/web/src/lib/planner/profile-axis.ts,profile-axis.test.ts: change: the rest columns of a week (Planner: a strip of all days and a week in focus for trips of 15 days or more #3712).builder/web/src/components/planner/PlannerApp.svelte.test.ts: change: open day 32 after a week move (Planner: a strip of all days and a week in focus for trips of 15 days or more #3712); one test of the week fit (Planner map: the week in colour, the rest of a long trip quiet #3714).builder/web/src/components/planner/TripStrip.svelte,TripStrip.svelte.test.ts: create (Planner: a strip of all days and a week in focus for trips of 15 days or more #3712); change:onHover(Planner map: the week in colour, the rest of a long trip quiet #3714).builder/web/src/components/planner/PlannerApp.svelte: change: start day, week header, night search start (Planner: a strip of all days and a week in focus for trips of 15 days or more #3712); the limit sentence and the line about the device (Planner: 64 riding days, sent to the bike computer as two parts #3713);moveWeek, the week fit, the map props, the day of shaping points (Planner map: the week in colour, the rest of a long trip quiet #3714).builder/web/src/components/planner/Itinerary.svelte: change: rows of the week (Planner: a strip of all days and a week in focus for trips of 15 days or more #3712).builder/web/src/components/planner/PlannerProfile.svelte: change: week range, slices, surface row (Planner: a strip of all days and a week in focus for trips of 15 days or more #3712); rest column (Planner: rest-day column and "Show whole route" fixes #3715).builder/web/src/lib/planner/stops.ts,stops.test.ts: change: the week's nights only (Planner: a strip of all days and a week in focus for trips of 15 days or more #3712).docs/content/software/trips.md: change: strip and week (Planner: a strip of all days and a week in focus for trips of 15 days or more #3712), 64 days and parts (Planner: 64 riding days, sent to the bike computer as two parts #3713), the map of a week (Planner map: the week in colour, the rest of a long trip quiet #3714), indocs:commits. The page is at its word cap: each step cuts as many words as it adds.builder/web/src/lib/planner/editor.ts,specs/planner-plan.md: change: 64 days (Planner: 64 riding days, sent to the bike computer as two parts #3713).builder/web/src/components/planner/DayCount.svelte,DayCount.svelte.test.ts: change: the limit,onLimit(Planner: 64 riding days, sent to the bike computer as two parts #3713).builder/web/src/components/planner/TripRow.svelte: change: passesonLimit(Planner: 64 riding days, sent to the bike computer as two parts #3713).builder/web/src/components/planner/PlannerMap.svelte: change: day ids and feature states, marker looks, the quiet line,showWeek(Planner map: the week in colour, the rest of a long trip quiet #3714); bounds (Planner: rest-day column and "Show whole route" fixes #3715).builder/web/src/components/planner/Planner.svelte.test.ts: change: rest column (Planner: rest-day column and "Show whole route" fixes #3715).
Done when
- In
builder/web:npx vitest runof the test files that each step lists passes, andnpm run check. obc test -p obc-route,obc test -p obc-ios-host,obc test -p planner-router,obc test -p planner-router-build,obc test -p planner-serviceandobc exec cargo clippy -p <crate> --all-targets -- -D warningsfor each pass; the OBCKitRouteObjectCodecTestspass.- Speed, 64-day cycling test plan (3,909 km), against the real change (dev page at 1920 × 1080, headless Chromium on this PC's GTX 1660, local route service with 2 workers, one 3 GB cap at nice 19; the pull request says whether the terrain run was active and gives the load average), median of 3 loads. Each gate has its own measure:
- Planner: route long plans two requests at a time, and keep the trip when one point or leg fails #3709,
tools/speed.mjsof the design folder, search off, measurerouteMs, from the first route request to the last answer: 6.0 s or less (today 9.2 s; 5.1 s with only that change); - Planner: a strip of all days and a week in focus for trips of 15 days or more #3712,
build-3709/tools/speed.mjs(extended as Planner: a strip of all days and a week in focus for trips of 15 days or more #3712 says), the town search of the worktree answering on a read-only copy of the search files of thelocaltarget (build-3712/tools/run.shwithSEARCH=1;obc data serve localstarts two route services and two searches, and the 3 GB cap killed it), measure from the navigation start to the later of the first map idle with the line (obc:idle) and the answers of the week's nights (obc:nights): the median after Planner: a strip of all days and a week in focus for trips of 15 days or more #3712 plus 15 %. Planner: a strip of all days and a week in focus for trips of 15 days or more #3712 measures it on the 32-day cycling test plan, because the town search refuses the line of the 64-day plan (more than 20,000 points) until the search fix: 10.4 s or less (measured median 9.0 s; before 14.7 s). The 64-day plan without town answers: 8.2 s (before 16.8 s). The run passes under the 3 GB cap. - Planner: 64 riding days, sent to the bike computer as two parts #3713, the same measure and setup (
build-3712/toolscopied tobuild-3713/tools), on the 64-day plan with town answers, which the search fix makes possible: the measured median plus 15 %: 12.5 s or less (measured median 10.9 s, with the towns of all 7 nights of the week answering). - Planner map: the week in colour, the rest of a long trip quiet #3714, the same setup: after one → on the focused strip, no
tripsource data reaches the map with search off; with town answers, the time from the → to the map idle after the answers of the new week's nights is at most the median of the base plus 15 %.
- Planner: route long plans two requests at a time, and keep the trip when one point or leg fails #3709,
- The 64-day test plan with one shaping point moved 2 km from a road shows the whole trip without that point, and the note.
- Pictures of the 14-, 32- and 64-day test plans at 1440 × 900 on the planner after Planner: 64 riding days, sent to the bike computer as two parts #3713 and Planner map: the week in colour, the rest of a long trip quiet #3714 match the mock-ups, except the rest-night numbers: the mock-up's "10, Rest, 11, 12" is not built (the badges read 10, Rest, 12); the 14-day picture equals the one of planner: less text, clear controls, a night picker that follows the stay kinds, no route alternatives (#3286) #3338.
- The owner keeps all nights of a 40-day trip and sends it from the web planner: the trip menu shows "1/2" with 32 days and "2/2" with 8 days, and "next day" works in both. He rides (or marks done) day 1, changes a stop in day 20, sends again, and finds day 1 still done and only day 20 sent again. He deletes days 2 and 3 on the bike computer, renames the plan and sends again: both trips have the new name, days 2 and 3 do not come back, and the planner shows "On the device".
- On the 64-day test plan, the map draws the week in colour and the other days as thin grey lines with small dots; it moves to the week only after a move of the week with the strip or ‹ ›; the tip lights its day on the map (Planner map: the week in colour, the rest of a long trip quiet #3714's owner check).
Limits
- 1 to 14 riding days: the screen does not change, except the rest column and the map bounds (Planner: rest-day column and "Show whole route" fixes #3715). A plan of 2 to 14 days now goes to the device as a trip, and a bad point now gives a note or a gap.
- The elevation profile stays the timeline of the trip.
- No firmware change, no new route file format, no new trip object version.
- The device knows no rest days: until the rider rides, it dates a day after a rest day one day early.
- On the device, day numbers count the riding days of a part; the planner counts calendar days.
- A trip in parts: each part has its own progress and "Trip to go"; the device does not go on from part 1 to part 2 by itself; the journal shows two trips.
- A 64-day trip needs all 64 menu routes; the device's own built day then pushes day 1 of part 1 out of the menu.
- A night that is still a suggestion reaches the device as the even day end.
- A day route that the rider deleted on the bike computer goes again only when its file changes, or when nothing of the plan is left there. To have deleted days back, he deletes the plan's trips on the bike computer and sends the plan again. A plan whose ridden days he deleted shows "On the device" with nothing to send.
- A new routing data release can change the file of every day. The next send after any change of the plan then makes the deleted days again, and they need their room.
- The entry knows one card: a send to another bike computer and back makes the deleted days again on the first one.
- Routes sent before this change are no longer known to the planner; they stay on the device as single routes.
- The phone makes plans of at most 32 days, as today.
- The web planner is for big screens; no phone-width work.
Out of scope
- A way for the phone to send part 2 of a web trip.
- New long-trip features (day length in place of day count, season check, resupply gaps).
As built
The seven steps and one fix are merged: #3709 (pull request #3719), #3710 (#3718), #3711 (#3727), #3715 (#3733), #3712 (#3735), the search fix (#3736), #3714 (#3738) and #3713 (#3739). Differences from the first plan:
- Search. The place search took the line of a long trip through a fix of its own:
searchLinethins the line until it has at most the service's limit of points, and the limit lives once in the search contract. No request cuts the line to a part of the trip. - Night numbers. The night badges keep their numbers (10, Rest, 12); the mock-up's "10, Rest, 11, 12" is not built.
- Show whole route. The map may show one region size around the region, and a position outside the region is not a place for a click or a drag.
- The map. The look of a riding day is a feature state on the existing layers; a week step and the tip send no line data to the map. Where two days share a road, a press takes the day in colour.
- Deleted days. No
donemarker: the planner stores a CRC for each sent day, and a day that is gone from the card and unchanged is left out. - Day ends. A day end within 1 mm of a line point snaps to the nearer point, so that an unchanged day keeps its file.
Measured on the development PC, each as its pull request states it: the route requests of the 64-day cycling plan take 4.4 s (gate 6.0 s; before 9.2 s); the 32-day plan with town answers is ready after 9.0 s (gate 10.4 s; before 14.7 s); the 64-day plan with town answers after 10.9 s (gate 12.5 s; before, 25.7 s to the first line and no town answers); a week step on the map settles in 0.4 s with no line data sent.
Open, by the owner's decision to merge first and test later: his checks on the real bike computer for #3710 (the climb of a phone trip and of a web route before and after), #3711 (a 10-day trip as a trip; a changed day; a deleted trip; a deleted day) and #3713 (a 40-day trip as two trips; progress kept; deleted days stay gone; his own routes stay in the menu). The steps are in the owner briefs of the pull requests. A fail reopens that step.
Found on the way and not part of this change: #3740 (a pointer move over the map of a long trip costs 60 to 70 ms).
Activity
timohueser commentedon Nov 18, 2026
Owner answers (2026-11-18)
The owner on the brainstorm: the concept is "really good", "definitely the right direction".
Nothing of this is built. The next step is the design of direction B and of the day routes from the web planner (cairn
design), after the measurement of answer 7.timohueser commentedon Nov 19, 2026
Measurement: where the time of a 64-day plan goes
Cycling, 64 days, 3,909 km, 6 route requests, 320,557 line points. From "page starts to load the stored plan" to "first routed line drawn on the map", median of 3 loads:
What grows with what: route time grows with the number of legs and the length of each leg (about 4 ms per 4.7 km hiking leg, 25 ms per 10.7 km cycling leg). The profile grows with days × line points; the night search with the number of nights. Hiking 32 days: 3.4 s, cycling 32 days: 9.8 s, hiking 64 days: 10.4 s.
Biggest parts and simple fixes:
With both page experiments (not committed), the first line came at 11.0 s. Conditions: development PC with the terrain run active, dev page, headless Chromium on the GTX 1660, local route service with 2 workers, everything under one 3 GB cap at nice 19.
Generated by Claude Code
timohueser commentedon Nov 19, 2026
The design is in the issue body now (
Status: designed). It passed two reader tests (critic and readiness) and one plan review; their findings are fixed in the text. The mock-ups are drawn into the planner of #3338, on which the screen parts are to be built. Four questions are with the owner: the base for the screen parts, part 2 when the bike computer is full, the bar height in the strip, and the other days on the map. No sub-issue is open and nothing is built before his approval.Generated by Claude Code
timohueser commentedon Nov 19, 2026
The owner approved the plan ("Approve, all picks"): the screen parts are built after the planner tidy-up (#3338) is merged, and the bike computer and speed parts start now; part 2 waits when the bike computer is full, and the rider frees room by deleting ridden days; the bars of the strip show riding time; the other days are thin grey lines and small night dots on the map.
Status: approved.Generated by Claude Code
timohueser commentedon Nov 20, 2026
Three of the seven steps are merged: #3709 (pull request #3719), #3710 (#3718) and #3711 (#3727).
Open checks of the owner on the real bike computer (he decided to merge first and test everything with the bike computer later):
A fail of a step reopens that step.
Generated by Claude Code
timohueser commentedon Nov 20, 2026
Closed in the backlog cleanup: all 7 steps are merged (#3719, #3718, #3727, #3735, #3736, #3733, #3738, #3739). The owner's checks on the bike computer (#3710 climb within 1 m, the six steps of #3711, a trip in two parts #3713) are now in the acceptance checklist #1978. As the comment of 11-20 says, a failed check reopens its step. #3740 (pointer cost on a long trip) stays open on its own.
Generated by Claude Code