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: cancel fetch request when user cancels simulation in lmr #9948

Merged
merged 1 commit into from
Dec 19, 2024

Conversation

RomainValls
Copy link
Contributor

close #9779

Also, had a minor bug where the button to launch the simulation disappeared after canceling a request, added a fix.

@RomainValls RomainValls self-assigned this Dec 4, 2024
@RomainValls RomainValls requested a review from a team as a code owner December 4, 2024 14:17
@github-actions github-actions bot added the area:front Work on Standard OSRD Interface modules label Dec 4, 2024
@RomainValls RomainValls force-pushed the rvs/front-cancel-stdcm-fetch-request branch from c66967c to 28e6202 Compare December 4, 2024 14:21
@codecov-commenter
Copy link

codecov-commenter commented Dec 4, 2024

⚠️ 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 79.82%. Comparing base (a0c8333) to head (c7e7614).
Report is 2 commits behind head on dev.

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

Additional details and impacted files
@@           Coverage Diff           @@
##              dev    #9948   +/-   ##
=======================================
  Coverage   79.82%   79.82%           
=======================================
  Files        1054     1054           
  Lines      105530   105541   +11     
  Branches      726      726           
=======================================
+ Hits        84242    84251    +9     
- Misses      21246    21248    +2     
  Partials       42       42           
Flag Coverage Δ
editoast 73.73% <ø> (-0.01%) ⬇️
front 89.14% <100.00%> (+<0.01%) ⬆️
gateway 2.18% <ø> (ø)
osrdyne 3.28% <ø> (ø)
railjson_generator 87.50% <ø> (ø)
tests 87.00% <ø> (ø)

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.

@RomainValls RomainValls force-pushed the rvs/front-cancel-stdcm-fetch-request branch from 28e6202 to 2573fbe Compare December 5, 2024 13:12
@RomainValls RomainValls requested a review from emersion December 5, 2024 15:43
@RomainValls
Copy link
Contributor Author

When canceling a simulation, the button to start another one isn't displayed anymore, unless we change the value of one of the inputs. I understand that we might not want to launch a simulation again with the same inputs if we decided to cancel it (@SharglutDev), but it does feel weird.
If we keep the button hidden until a value changes, can we at least inform the user he has to change a value in the form ?
@thibautsailly any idea ?

@SharglutDev
Copy link
Contributor

SharglutDev commented Dec 5, 2024

When canceling a simulation, the button to start another one isn't displayed anymore, unless we change the value of one of the inputs. I understand that we might not want to launch a simulation again with the same inputs if we decided to cancel it (@SharglutDev), but it does feel weird. If we keep the button hidden until a value changes, can we at least inform the user he has to change a value in the form ? @thibautsailly any idea ?

If the user cancels the simulation in progress, it's probably because he forgot one parameter in the form or the simulation was taking too long because some inputs weren't good enough. So in any case, I don't think he will want to launch the same simulation again.

It's the same thing if the simulation succeeds, does he might want to relaunch the same simulation ? We decided he can't at the moment.

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.

LGTM!

@RomainValls RomainValls force-pushed the rvs/front-cancel-stdcm-fetch-request branch 3 times, most recently from 8d1b655 to 518b23c Compare December 10, 2024 14:45
@thibautsailly
Copy link

Sorry for being so late to answer, my bad 😬.
I can see 3 possible situations in which the computation could be cancelled by the user:

  1. She realises that one of the parameter isn't right, and needs to fix it.
  2. She changes her mind about this configuration being the right one to test.
  3. She mis-clicks the button.

In situation 1, the button presence will be guaranteed by the form update.
Situation 2 leads to two other ones: A, she carries on and updates the form to test another configuration; B, she realises that actually this configuration is worth testing and needs to restart it right away. 2A is similar to 1, but in 2B we would need to display the button.
In situation 3, we would need to display the button.

In the nominal use case, the button isn't displayed because it is replaced by the confirmation message. Since we changed the "ongoing compute" message, we could also alter how the compute result is shown, and show the button in all cases, with a confirmation message if we detect the user is about to use the same configuration as a previous one. But it's too much work for now, so let's just display the button when the user cancels the simulation computation.

@RomainValls RomainValls force-pushed the rvs/front-cancel-stdcm-fetch-request branch 3 times, most recently from cad1e5c to 178731d Compare December 17, 2024 09:24
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, great job !

Signed-off-by: romainvalls <romain.valls95@gmail.com>
@Wadjetz Wadjetz force-pushed the rvs/front-cancel-stdcm-fetch-request branch from 178731d to c7e7614 Compare December 19, 2024 09:38
@Wadjetz Wadjetz added this pull request to the merge queue Dec 19, 2024
@Wadjetz Wadjetz removed this pull request from the merge queue due to a manual request Dec 19, 2024
@Wadjetz Wadjetz added this pull request to the merge queue Dec 19, 2024
Merged via the queue into dev with commit 6580cfe Dec 19, 2024
27 checks passed
@Wadjetz Wadjetz deleted the rvs/front-cancel-stdcm-fetch-request branch December 19, 2024 10:29
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.

stdcm - results are printed for canceled requests
6 participants