Skip to content

front: adapt times & stops table rows for hourly timetables - #18076

Open
emersion wants to merge 16 commits into
devfrom
emr/times-stops-hourly-timetable
Open

front: adapt times & stops table rows for hourly timetables#18076
emersion wants to merge 16 commits into
devfrom
emr/times-stops-hourly-timetable

Conversation

@emersion

@emersion emersion commented Aug 10, 2026

Copy link
Copy Markdown
Member

See individual commits.

The last commit is quite large. Unfortunately, I haven't found a good way to split it up.

To test, create a hourly timetable, import these train schedules, then show the times & stops table and play with it:
timetable(5).json

References: #17626

@github-actions github-actions Bot added the area:front Work on Standard OSRD Interface modules label Aug 10, 2026
@emersion
emersion force-pushed the emr/times-stops-hourly-timetable branch 2 times, most recently from d69faad to f597045 Compare August 11, 2026 15:03
@emersion
emersion requested a review from SarahBellaha August 11, 2026 15:03
@emersion
emersion marked this pull request as ready for review August 11, 2026 15:03
@emersion
emersion requested a review from a team as a code owner August 11, 2026 15:03
@emersion
emersion force-pushed the emr/times-stops-hourly-timetable branch 2 times, most recently from 81cd6e1 to 1fd47d1 Compare August 11, 2026 15:26
@emersion
emersion requested a review from theocrsb August 11, 2026 15:28
@emersion emersion changed the title front: adapt times & stops table for hourly timetables front: adapt times & stops table rows for hourly timetables Aug 12, 2026
@emersion
emersion force-pushed the emr/times-stops-hourly-timetable branch 4 times, most recently from 0cd3edf to e918005 Compare August 12, 2026 13:06
@emersion emersion moved this to Awaiting merge in Board PI 21 Aug 12, 2026
@emersion emersion self-assigned this Aug 12, 2026
@emersion emersion linked an issue Aug 12, 2026 that may be closed by this pull request
3 tasks
@emersion emersion assigned emersion and unassigned emersion Aug 12, 2026
@theocrsb

theocrsb commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Thank's for the PR

image

I'm getting this error in the console

@theocrsb

theocrsb commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

I notice this strange behaviour when I miss one day and then another

Screen.Recording.2026-08-13.at.07.34.30.mov

@emersion emersion removed this from Board PI 21 Aug 14, 2026
@emersion emersion moved this to Awaiting merge in Board PI 21 Aug 14, 2026
DurationCell's declaration is difficult to read because its props
type is non-trivial. Extract that to a separate type.

Signed-off-by: Simon Ser <contact@emersion.fr>
Signed-off-by: Simon Ser <contact@emersion.fr>
This function performs manual time manipulation. Move
truncateToSecond() to shared utils and use that instead. Will help
with hourly timetables as well.

Signed-off-by: Simon Ser <contact@emersion.fr>
This mirrors a subset of the Temporal API, to make migration easier
to the standard once we can upgrade:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Temporal/Duration/toLocaleString

`style` and `hours` are forced to a single value because we only
need these variations from the standard API.

Signed-off-by: Simon Ser <contact@emersion.fr>
Signed-off-by: Simon Ser <contact@emersion.fr>
Signed-off-by: Simon Ser <contact@emersion.fr>
formatLocalTime() is not suitable for presenting a time value to a
human: it's meant for `<input type="time">`. Use toLocaleTimeString()
instead.

Signed-off-by: Simon Ser <contact@emersion.fr>
Will be useful for hourly timetables.

Signed-off-by: Simon Ser <contact@emersion.fr>
Will be useful for hourly timetables.

Signed-off-by: Simon Ser <contact@emersion.fr>
Will be useful for hourly timetables.

Signed-off-by: Simon Ser <contact@emersion.fr>
Will be useful for hourly timetables.

Signed-off-by: Simon Ser <contact@emersion.fr>
DurationCell will be used to edit time values relative to the start
of a timetable for hourly timetables.

Signed-off-by: Simon Ser <contact@emersion.fr>
This component selects between TimeCell and DurationCell depending
on the StartTime variant.

Signed-off-by: Simon Ser <contact@emersion.fr>
The Temporal API also supports this unit.

Signed-off-by: Simon Ser <contact@emersion.fr>
Instead, use the Duration class. This will simplify hourly timetable
support in upcoming commits.

Signed-off-by: Simon Ser <contact@emersion.fr>
Change types from Date to StartTime, using all of the toys introduced
in previous commits.

Signed-off-by: Simon Ser <contact@emersion.fr>
@emersion
emersion force-pushed the emr/times-stops-hourly-timetable branch from e918005 to c6820e4 Compare August 14, 2026 14:53
@emersion

Copy link
Copy Markdown
Member Author

I'm getting this error in the console

Indeed, fixed by moving a key attribute from UnitDisplay to a Fragment!

I notice this strange behaviour when I miss one day and then another

It seems like this is a bug which also happens on dev: the D+1 separator is only displayed if the next row is a path step (as opposed to a suggested OP). This seems to be caused by an early return in getRowDayOffset().

Can you confirm you can reproduce on dev too?

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

Status: Awaiting merge

Development

Successfully merging this pull request may close these issues.

2 participants