Skip to content

Conversation

@emersion
Copy link
Member

@emersion emersion commented Oct 31, 2025

See individual commits.

First two commits address #554 (comment)

Rest starts addressing the last paragraph of #554 (review)

Some more follow-up cleanups haven't been written yet.

Note, each time we access TrainrunSectionViewObject.trainrunSections[0] needs to be re-evaluated to figure out whether we really should grab the first section, or the last one, or compute something over all sections (e.g. travel time).

@emersion emersion requested a review from Math-R October 31, 2025 15:47
@emersion emersion requested a review from aiAdrian as a code owner October 31, 2025 15:47
@emersion emersion requested a review from louisgreiner October 31, 2025 15:47
@emersion emersion force-pushed the emr/modify-node-display branch from 7a5a5a3 to 5aebc21 Compare October 31, 2025 16:06
TrainrunSectionViewObject will represent multiple trainrun sections
soon. Add a helper to get the parent trainrun to reduce reliance
on a single trainrun.

Signed-off-by: Simon Ser <[email protected]>
This makes it clear that there isn't a single trainrun section
per TrainrunSectionViewObject: a single TrainrunSectionViewObject
can hold multiple sections. The full collapsed chain is stored.

For now, blindly replace trainrunSection with trainrunSections[0],
to be cleaned up in future commits.

Signed-off-by: Simon Ser <[email protected]>
@emersion emersion force-pushed the emr/modify-node-display branch from 5aebc21 to 6939966 Compare October 31, 2025 16:28
The TrainrunSectionViewObject already contains the full chain, no
need to re-compute it.

Signed-off-by: Simon Ser <[email protected]>
@emersion emersion force-pushed the emr/modify-node-display branch from 6939966 to 2aaeb51 Compare October 31, 2025 16:34
Copy link
Contributor

@louisgreiner louisgreiner left a comment

Choose a reason for hiding this comment

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

Very nice, it makes the code easier, thanks

The path drawing is still missing some things, but I believe this does not belong to this PR to fix. Already discussed with @Math-R about it:
Capture d'écran 2025-11-03 091208

Copy link

@Math-R Math-R left a comment

Choose a reason for hiding this comment

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

Thanks for this work. It makes the code cleaner and clearer.

Nit: For getCollapsedChainValueToShow, personally, I would have kept the function as is. Because its signature allows for self-documentation of this part of the code.

@louisgreiner
Copy link
Contributor

@Math-R, note that another implementation of the Iterator has been proposed by @clarani here: https://github.com/OpenRailAssociation/netzgrafik-editor-frontend/pull/590/files

@emersion emersion merged commit 7ade86b into mrd/modify-node-display Nov 4, 2025
@emersion emersion deleted the emr/modify-node-display branch November 4, 2025 13:55
@emersion emersion mentioned this pull request Nov 5, 2025
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants