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

front: enhance pathfinding loading state management #10292

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

SarahBellaha
Copy link
Contributor

Completes this PR

This PR will add a loader while the pathfinding is still computing, and the map's viewport will be updated only once it is finished, avoiding the 'shaking' effect.

@SarahBellaha SarahBellaha requested a review from a team as a code owner January 9, 2025 08:34
@github-actions github-actions bot added the area:front Work on Standard OSRD Interface modules label Jan 9, 2025
@codecov-commenter
Copy link

codecov-commenter commented Jan 9, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.79%. Comparing base (ecb261f) to head (1e7311c).

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev   #10292      +/-   ##
==========================================
- Coverage   81.85%   81.79%   -0.06%     
==========================================
  Files        1075     1057      -18     
  Lines      107172   106211     -961     
  Branches      728      728              
==========================================
- Hits        87726    86877     -849     
+ Misses      19407    19295     -112     
  Partials       39       39              
Flag Coverage Δ
editoast 74.24% <ø> (ø)
front 89.38% <100.00%> (-0.01%) ⬇️
gateway 2.18% <ø> (ø)
osrdyne 3.28% <ø> (ø)
railjson_generator 87.50% <ø> (ø)
tests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@SarahBellaha SarahBellaha self-assigned this Jan 9, 2025
Copy link
Contributor

@Caracol3 Caracol3 left a comment

Choose a reason for hiding this comment

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

LGTM and tested !

Copy link
Contributor

@SharglutDev SharglutDev left a comment

Choose a reason for hiding this comment

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

Tested and everything works great, good job ! Just a few comments.

Also before merging, I would rather show the loader animation on the map to @thibautsailly to be sure it's ok for him since he also requested to @Caracol3 the blue loader below the form.

@SarahBellaha SarahBellaha force-pushed the sba/front/manage-pathfinding-loading-state-10144 branch 2 times, most recently from 82d01b4 to 0b3faca Compare January 14, 2025 17:19
@SarahBellaha SarahBellaha force-pushed the sba/front/manage-pathfinding-loading-state-10144 branch from 0b3faca to 228a8c8 Compare January 15, 2025 14:04
Copy link
Contributor

@SharglutDev SharglutDev left a comment

Choose a reason for hiding this comment

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

Lgtm and tested, one last comment. Just waiting for you to fix conflicts to test one more time and we should be good to go :)

@SarahBellaha SarahBellaha force-pushed the sba/front/manage-pathfinding-loading-state-10144 branch 2 times, most recently from 7349719 to 8cc275a Compare January 15, 2025 17:34
@SharglutDev
Copy link
Contributor

This PR can be rebase with last changes from this one :)

@SarahBellaha SarahBellaha force-pushed the sba/front/manage-pathfinding-loading-state-10144 branch from 8cc275a to 1e7311c Compare January 31, 2025 13:14
Copy link
Contributor

@SharglutDev SharglutDev left a comment

Choose a reason for hiding this comment

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

After the rebase, I have 2 behaviors issues. Both are probably related and coming from the switch from useLazyQuery to useQuery.

Copy link
Contributor

Choose a reason for hiding this comment

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

When a pathfinding is loading, it seems the loading banner is always green and not blue

Copy link
Contributor

Choose a reason for hiding this comment

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

For a path like Brest > Narbonne > Perpignan (but should work for any path with a via), if I remove the origin, pathProperties endpoint is fired again (but it shouldn't, it's not the case right now) and bbox on map is updated with a path containing the via as if it was the origin and the destination.
When checking the network tab in dev tools, we see only pathProperties endpoint launching but in its payload, we can see that the track_section_ranges doesn't have the same length. So rtk query is probably relaunching pathfinding blocks as well in the dark.

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.

4 participants