mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-18 21:16:47 +00:00
fix(mobile): pick the plan timeline's hotel legs by what the route drew (#2501)
On a day that opens with a flight, where the traveller also put the hotel on the day as a stop of their own, the phone timeline started the day with a hotel row and the drive from that stop to the next place, above the flight, and then showed the same drive again in its own spot. hotelLegsForDay guessed the bookends from coordinates: the first segment leaving the hotel's spot was the morning leg. The route had correctly drawn no morning leg on that day, but the stop on the hotel's spot starts a leg there too, so that hop was taken for it. The route calculation now tags the two legs it draws from and to the accommodation, and the timeline reads that tag instead. The hotel end of a tagged leg still has to be the day's own stay, because the calculation keeps the previous day's legs until the new day has routed. The stop to stop connectors leave tagged legs alone, so one leg can no longer show up in both places.
This commit is contained in:
@@ -255,6 +255,12 @@ export interface RouteSegment {
|
||||
noteText?: string
|
||||
/** The travel mode this leg was routed with (#1281) — drives the connector icon. */
|
||||
mode?: string
|
||||
/**
|
||||
* Set on the drive from the day's accommodation to its first stop ('morning') or
|
||||
* from its last stop back to it ('evening'), so a list can show that leg at the
|
||||
* day's edge without guessing it from coordinates a stop may share (#2501).
|
||||
*/
|
||||
hotelBookend?: 'morning' | 'evening'
|
||||
}
|
||||
|
||||
/** An intermediate stop a plugin route places on the drawn line (charging stop, rest area). */
|
||||
|
||||
Reference in New Issue
Block a user