Skip to content

Conversation

@aschantraine
Copy link
Contributor

@aschantraine aschantraine commented Oct 22, 2025

Updates the getTrackReferenceLabel function to accept trackSections and use the SNCF extension's track_name instead of the track ID when available, falling back to "?" otherwise.

@github-actions github-actions bot added the area:front Work on Standard OSRD Interface modules label Oct 22, 2025
@aschantraine aschantraine linked an issue Oct 22, 2025 that may be closed by this pull request
@aschantraine aschantraine requested a review from Akctarus October 22, 2025 09:53
@emersion emersion requested a review from Synar October 22, 2025 09:53
@emersion
Copy link
Member

CC'ing @Synar since she's worked on tracks in the output table.

@aschantraine aschantraine marked this pull request as ready for review October 22, 2025 09:55
@aschantraine aschantraine requested a review from a team as a code owner October 22, 2025 09:55
@emersion emersion self-requested a review October 28, 2025 10:47
@aschantraine aschantraine removed the request for review from Akctarus October 28, 2025 13:34
@aschantraine aschantraine force-pushed the ace/missing-track-name-on-timetable branch from aa5044e to 99ccfeb Compare October 28, 2025 14:33
Copy link
Member

@emersion emersion left a comment

Choose a reason for hiding this comment

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

Nice!

Copy link
Contributor

@Synar Synar left a comment

Choose a reason for hiding this comment

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

Good job!

@aschantraine aschantraine force-pushed the ace/missing-track-name-on-timetable branch 2 times, most recently from fe84184 to 79f0ede Compare October 30, 2025 17:22
@aschantraine aschantraine force-pushed the ace/missing-track-name-on-timetable branch from 79f0ede to bee6d0e Compare October 30, 2025 19:18
return (
trackSections[trackReference.track_id]?.extensions?.sncf?.track_name ?? trackReference.track_id
);
return trackSections[trackReference.track_id]?.extensions?.sncf?.track_name ?? '?';
Copy link
Member

Choose a reason for hiding this comment

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

Nit: in general I prefer to handle formatting concerns (in other words, how unknown/missing values should be presented to the user) in the JSX template rather than storing it in the trackName field.

Hm, that said, we already use undefined to mean "unspecified", so we'd need another value to mean "specified but not found". null wouldn't be very explicit and would be easy to confuse with undefined

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So, what do you suggest ? Since it’s going to change soon, maybe we should keep track_reference.id after all ?

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.

Track_name not always displayed in timetable

6 participants