Skip to content

front: in simulation sheets show last time as passage if no stop#15290

Merged
hhirtz merged 1 commit intodevfrom
uber/stop2
Feb 20, 2026
Merged

front: in simulation sheets show last time as passage if no stop#15290
hhirtz merged 1 commit intodevfrom
uber/stop2

Conversation

@hhirtz
Copy link
Copy Markdown
Member

@hhirtz hhirtz commented Feb 17, 2026

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 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))

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 dev except 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.

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>
@github-actions github-actions Bot added the area:front Work on Standard OSRD Interface modules label Feb 17, 2026
@hhirtz hhirtz marked this pull request as ready for review February 17, 2026 13:05
@hhirtz hhirtz requested a review from a team as a code owner February 17, 2026 13:05
@hhirtz hhirtz requested review from Pivouane and kmer2016 February 17, 2026 13:06
Copy link
Copy Markdown
Contributor

@Pivouane Pivouane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM !

@hhirtz hhirtz added this pull request to the merge queue Feb 20, 2026
Merged via the queue into dev with commit 14c8fa2 Feb 20, 2026
29 checks passed
@hhirtz hhirtz deleted the uber/stop2 branch February 20, 2026 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:front Work on Standard OSRD Interface modules

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Non consistent informations when a train doesn't stop at end

3 participants