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: LMR: fix length, mass and speed reset #10447

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

Akctarus
Copy link
Contributor

@Akctarus Akctarus commented Jan 20, 2025

closes #10106 and fix #10270

should respect the expectations of this: https://github.com/osrd-project/osrd-confidential/issues/903

@Akctarus Akctarus requested a review from a team as a code owner January 20, 2025 14:05
@Akctarus Akctarus changed the title front: fix length, mass and speed reset in lmr front: LMR: fix length, mass and speed reset Jan 20, 2025
@github-actions github-actions bot added the area:front Work on Standard OSRD Interface modules label Jan 20, 2025
@codecov-commenter
Copy link

codecov-commenter commented Jan 20, 2025

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

Codecov Report

Attention: Patch coverage is 75.91241% with 66 lines in your changes missing coverage. Please review.

Project coverage is 81.91%. Comparing base (eeb8aa2) to head (18ed7af).
Report is 4 commits behind head on dev.

Files with missing lines Patch % Lines
...c/applications/stdcm/hooks/useStatusWithMessage.ts 1.49% 66 Missing ⚠️

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

Additional details and impacted files
@@            Coverage Diff             @@
##              dev   #10447      +/-   ##
==========================================
- Coverage   81.93%   81.91%   -0.03%     
==========================================
  Files        1078     1081       +3     
  Lines      107555   107790     +235     
  Branches      733      734       +1     
==========================================
+ Hits        88125    88293     +168     
- Misses      19391    19458      +67     
  Partials       39       39              
Flag Coverage Δ
editoast 74.39% <ø> (-0.01%) ⬇️
front 89.36% <75.91%> (-0.06%) ⬇️
gateway 2.18% <ø> (ø)
osrdyne 3.28% <ø> (ø)
railjson_generator 87.50% <ø> (ø)
tests 88.14% <ø> (ø)

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.

@Akctarus Akctarus force-pushed the tmn/front/lmr/fix-length-mass-speed-reset branch 5 times, most recently from 854df7b to 1522505 Compare January 22, 2025 14:28
@achrafmohye
Copy link
Contributor

achrafmohye commented Jan 23, 2025

@Akctarus When i select Traction engine using the combobox above i have these messages on each filled input is it the intended behaviour ? and have to close them manually which is more of a ui-core improvement
image

@Akctarus
Copy link
Contributor Author

@Akctarus When i select Traction engine using the combobox above i have these messages on each filled input is it the intended behaviour ? and have to close them manually which is more of a ui-core improvement image

yes it is, the user must be informed visually as soon as the app changes a piece of data he had previously changed. To close them, yes maybe we should improve that, but in any case the messages close by themselves, if we change traction engine

@Akctarus Akctarus requested review from SharglutDev and removed request for emersion January 24, 2025 08:38
@Akctarus Akctarus force-pushed the tmn/front/lmr/fix-length-mass-speed-reset branch 2 times, most recently from 78cd147 to 8e73583 Compare January 24, 2025 12:45
@Akctarus Akctarus requested a review from a team as a code owner January 24, 2025 16:10
@Maymanaf Maymanaf removed the request for review from a team January 27, 2025 09:43
front/src/applications/stdcm/utils/getStatusWithMessage.ts Outdated Show resolved Hide resolved
front/src/applications/stdcm/hooks/useStdcmConsist.ts Outdated Show resolved Hide resolved
front/public/locales/en/stdcm.json Outdated Show resolved Hide resolved
front/public/locales/fr/stdcm.json Outdated Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

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

If I change the speed limit tag, the length and mass fields are updated when there should be only the vmax one who changes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed by : 6c4c0d8

Copy link
Contributor

Choose a reason for hiding this comment

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

Some of the changes you made here broke some things :

Enregistrement.de.l.ecran.2025-01-31.a.09.01.43.mov

Sometimes when I just change the mass after switching a rs, the tooltip pops. Same if I change the speed limit tag.

Copy link
Contributor

Choose a reason for hiding this comment

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

Normal behavior :

  • I select a BB 15 000 > the vmax goes to 160
  • I put a ME 120 speed limit tag > the vmax goes to 120
  • I switch to BB 64700 > the vmax goes to 80 (even with ME 120 as expected) > no message as expected

Same test with one change :

  • I select a BB 15 000 > the vmax goes to 160
  • I manually change the vmax to 150
  • I put a ME 120 speed limit tag > the vmax goes to 120
  • I switch to BB 64700 > the vmax goes to 80 (even with ME 120 as expected) > there is a info tooltip
    I don't think we should have one as the vmax I manually entered has already been overridden by the change of the speed limit tag. Maybe when we pass in onSpeedLimitByTagChange, we should setMaxSpeedChanged(false); ? (didn't test)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed :)

@Akctarus Akctarus force-pushed the tmn/front/lmr/fix-length-mass-speed-reset branch 2 times, most recently from 30f3388 to 75eecee Compare January 27, 2025 15:47
@Maymanaf Maymanaf self-requested a review January 27, 2025 16:38
@Akctarus Akctarus force-pushed the tmn/front/lmr/fix-length-mass-speed-reset branch 2 times, most recently from 575c36e to 0901f41 Compare February 5, 2025 14:37
@Akctarus Akctarus force-pushed the tmn/front/lmr/fix-length-mass-speed-reset branch from 0901f41 to 9d86d3c Compare February 10, 2025 15:53
CONSIST_TOTAL_MASS_MAX,
} from '../utils/consistValidation';

const useConsistFieldStatus = (
Copy link
Contributor

Choose a reason for hiding this comment

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

i think it's better to have different names for useConsistFieldStatus and useStatusWithMessage , was the naming of the two hooks with the same name intentional ?!

@achrafmohye
Copy link
Contributor

Can you rebase your branch please, for easier testing :)

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
4 participants