Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stdcm: map shakes when adjusting time #10144

Closed
Castavo opened this issue Dec 19, 2024 · 6 comments · Fixed by #10288
Closed

stdcm: map shakes when adjusting time #10144

Castavo opened this issue Dec 19, 2024 · 6 comments · Fixed by #10288
Labels
area:front Work on Standard OSRD Interface modules kind:bug Something isn't working module:stdcm Short-Term DCM severity:minor Minor severity bug

Comments

@Castavo
Copy link
Contributor

Castavo commented Dec 19, 2024

What happened?

When clicking on the time adjusting buttons of the form (among other inputs), the map "shakes" I guess it's reloading.

Enregistrement.de.l.ecran.2024-12-19.172215.mp4

What did you expect to happen?

I expect the map to either stay stable or to not reload at all when editing the time component

How can we reproduce it (as minimally and precisely as possible)?

  1. Start a STDCM request
  2. Fill in the origin
  3. Fill in a waypoint / the destination (in order to have two pins placed on the map)
  4. Now adjust the time component as shown on video
  5. Witness

On which environments the bug occurs?

Recette (SNCF)

On which browser the bug occurs?

Firefox

OSRD version (top right corner Account button > Informations)

6580cfe

@Castavo Castavo added area:front Work on Standard OSRD Interface modules kind:bug Something isn't working module:stdcm Short-Term DCM severity:minor Minor severity bug labels Dec 19, 2024
@theocrsb
Copy link
Contributor

theocrsb commented Jan 6, 2025

I can't reproduce the bug. Is it still there?

@Castavo
Copy link
Contributor Author

Castavo commented Jan 6, 2025

This might be obscured by #10240

@sim51
Copy link
Contributor

sim51 commented Jan 7, 2025

The map is recenter automatically when a user changes :

  • traction engine
  • time
  • date
  • tolerance
  • A CH code
  • a CI
  • ...

Question : does the map should be automatically recenter on the "path" when the form's modifications don't impact it ?

sim51 added a commit that referenced this issue Jan 8, 2025
Adding optional parameters on function `computeBBoxViewport` to take
care of the map height/width

Related to #10240 & #10144

Signed-off-by: Benoit Simard <[email protected]>
@sim51
Copy link
Contributor

sim51 commented Jan 8, 2025

I respond to my question : yes we need to recenter it (except for the time, date & tolerance).
When an input is changed, we call the API to find a path between the origin/destination, and the found path can be completely different than the previous one, and so the BBOX can changed.

I can reproduce it with :

  • engine : 26000US - BB 26000
  • Origin: valence
  • Destination: Miramas
  • via : orange

Bug explanation :

  • when we change a field, a call is made to find a path (see useStaticPathfinding).
  • during this process the pathfinding is set to undefined before to be set it with the API return
  • For each new instance of the pathfinding (even undefined), the map is redraw and the BBOX computed. And if the path is undefined, the BBOX is computed with the markersInfo

So when we change the time field, we have one map render with a bbox for the marker, and a second later with pathfinding bbox. The blink effect comes from those 2 renders which can be different.

@thibautsailly
Copy link

This blinking doesn't scream "quality". Ideally, there should be a map state of "computing new path", and a transition between the two displays rather than a sudden move when the new path becomes available.
As a first step we can prevent it from happening when time related data is edited, and improve upon it later.

@SharglutDev
Copy link
Contributor

I don't think we should recompute the pathfinding when we change an input not related to it (tolerance, date, time)

sim51 added a commit that referenced this issue Jan 8, 2025
fix #10144

Adding a state for pathStepsLocations and only changes its value when
there is a deep diff

Signed-off-by: Benoit Simard <[email protected]>
sim51 added a commit that referenced this issue Jan 9, 2025
Adding optional parameters on function `computeBBoxViewport` to take
care of the map height/width

Related to #10240 & #10144

Signed-off-by: Benoit Simard <[email protected]>
github-merge-queue bot pushed a commit that referenced this issue Jan 9, 2025
Adding optional parameters on function `computeBBoxViewport` to take
care of the map height/width

Related to #10240 & #10144

Signed-off-by: Benoit Simard <[email protected]>
sim51 added a commit that referenced this issue Jan 9, 2025
fix #10144

Adding a state for pathStepsLocations and only changes its value when
there is a deep diff

Signed-off-by: Benoit Simard <[email protected]>
sim51 added a commit that referenced this issue Jan 9, 2025
fix #10144

Adding a state for pathStepsLocations and only changes its value when
there is a deep diff

Signed-off-by: Benoit Simard <[email protected]>
github-merge-queue bot pushed a commit that referenced this issue Jan 9, 2025
fix #10144

Adding a state for pathStepsLocations and only changes its value when
there is a deep diff

Signed-off-by: Benoit Simard <[email protected]>
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 kind:bug Something isn't working module:stdcm Short-Term DCM severity:minor Minor severity bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants