front: in simulation sheets show last time as passage if no stop#15290
Merged
front: in simulation sheets show last time as passage if no stop#15290
Conversation
if the last path item doesn't have a stop duration, show its time in the
"passage" column instead of the "end"/"arrival" column.
- `endTime` (arrival time): set iff it's not the first path item and the
path item has a stop duration (and not unconditionally if the path
item is the last)
- `passageStop` (passage time or stop duration): we relax the condition
to set it also when the last path item has no stop duration
- `startTime` (departure time): we just inline `isStop` here because
it's not used elsewhere (the `!isFirst` condition in `isStop` is
always true here, because otherwise it is catched by the `isFirst ||`,
so we drop it)
For anyone curious, the condition to set `passageStop`
!isFirst && (!isLast || !step.duration)
is actually not the opposite of to the condition to set `startTime`:
isFirst || (!isLast && !!step.duration)
because
. isFirst || (!isLast && !!step.duration)
= isFirst || !(isLast || !step.duration)
= !(!isFirst && (isLast || !step.duration))
≠ !(!isFirst && (!isLast || !step.duration))
Signed-off-by: Hubert Hirtz <hubert@hirtz.pm>
kmer2016
approved these changes
Feb 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow up of #15287
Closes #12372
if the last path item doesn't have a stop duration, show its time in the "passage" column instead of the "end"/"arrival" column.
endTime(arrival time): set iff it's not the first path item and the path item has a stop duration (and not unconditionally if the path item is the last)passageStop(passage time or stop duration): we relax the condition to set it also when the last path item has no stop durationstartTime(departure time): we just inlineisStophere because it's not used elsewhere (the!isFirstcondition inisStopis always true here, because otherwise it is catched by theisFirst ||, so we drop it)For anyone curious, the condition to set
passageStopis actually not the opposite of to the condition to set
startTime:because
How to test
Using this timetable on small infra:
https://github.com/user-attachments/files/25362255/timetable.14.json
Click on the simulation sheet button at the bottom of the table. All train schedules should have the same output as in
devexcept the one with no stop at the end. This one should have the last path item time in the "passage" column instead of the "arrival" column.