Fix travelTime and backwardTravelTime textElement#1011
Conversation
ee7e1dd to
034fcc3
Compare
| new DirectedTrainrunSectionProxy(this.selectedTrainrunSection, direction), | ||
| this.timeStructure, | ||
| ); | ||
| this.trainrunSectionService.updateText(); |
There was a problem hiding this comment.
This is already called from inside setTimeStructureToSingleTrainrunSection(), do we need to do it twice?
There was a problem hiding this comment.
Mmh I don't see where this is called in setTimeStructureToSingleTrainrunSection(), but it seems that this call can be removed anyway, since I see surprisingly no difference with or without.
There was a problem hiding this comment.
Oh, I mixed up with setTimeStructureToTrainrunSections().
I find it surprising that setTimeStructureToTrainrunSections() calls the function, while setTimeStructureToSingleTrainrunSection() doesn't.
| this.trainrunSectionTimesUpdated(pair.trainrunSection); | ||
| } | ||
|
|
||
| this.updateText(); |
There was a problem hiding this comment.
Travel times may be updated for many reasons, e.g. time propagation, transition undocking, and so on. This only covers a narrow case.
Additionally, this is a pretty big hammer - it affects all trainrun sections.
I think we should try to find a better way to fix this, e.g. by removing isBackwardTravelTimeDisplayed in placeTextOnTrainrunSection().
There was a problem hiding this comment.
I totally agree. However, I have no clue on how to proceed elsewise, since the text positions are directly bound with the travel times values. Also, this update logic will be removed in #654.
There was a problem hiding this comment.
Sorry for the delay, I've come up to this fixup commit (7c68321), following your advice. It works well :)
Enregistrement.de.l.ecran.2026-05-28.112709.mp4
There was a problem hiding this comment.
Would the fixup commit resolve this thread?
034fcc3 to
98365a6
Compare
Uriel-Sautron
left a comment
There was a problem hiding this comment.
Tested, the bug has been fixed
…lapping) Because if travelTime === backwardTravelTime, if we start from that state and press +/-1, the positions are not updated and times overlap. By doing so, positions are recalculated at each update. Signed-off-by: Louis Greiner <louis.greiner@proton.me>
7c68321 to
100db03
Compare
Fixes the travel times positions. Bug can only be reproduce in a specific source-target position.
Before fix (bug, positions overlap):
Enregistrement.de.l.ecran.2026-05-12.185048.mp4
After fix:
Enregistrement.de.l.ecran.2026-05-12.184912.mp4
Bug can be reproduced using this: networkGraphic(9).json