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: add waypoint menu in manchette #9398

Merged
merged 3 commits into from
Dec 12, 2024
Merged

Conversation

SharglutDev
Copy link
Contributor

@SharglutDev SharglutDev commented Oct 21, 2024

@SharglutDev SharglutDev changed the title Pfn/front/add waypoint menu front: add waypoint menu in manchette Oct 21, 2024
@codecov-commenter
Copy link

codecov-commenter commented Oct 21, 2024

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

Codecov Report

Attention: Patch coverage is 92.56757% with 11 lines in your changes missing coverage. Please review.

Project coverage is 80.04%. Comparing base (5a176ec) to head (3704e82).
Report is 7 commits behind head on dev.

Files with missing lines Patch % Lines
front/src/utils/hooks/useModalFocusTrap.ts 0.00% 11 Missing ⚠️

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

Additional details and impacted files
@@           Coverage Diff            @@
##              dev    #9398    +/-   ##
========================================
  Coverage   80.03%   80.04%            
========================================
  Files        1049     1050     +1     
  Lines      105293   105423   +130     
  Branches      757      757            
========================================
+ Hits        84276    84390   +114     
- Misses      20976    20992    +16     
  Partials       41       41            
Flag Coverage Δ
editoast 74.21% <ø> (-0.05%) ⬇️
front 89.25% <92.56%> (+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.

@SharglutDev SharglutDev force-pushed the pfn/front/add-waypoint-menu branch 3 times, most recently from accef67 to 589c8f7 Compare October 22, 2024 06:07
@SharglutDev SharglutDev marked this pull request as ready for review October 22, 2024 07:36
@SharglutDev SharglutDev requested a review from a team as a code owner October 22, 2024 07:36
@SharglutDev SharglutDev requested a review from Synar October 22, 2024 14:20
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.

Overall I'm not a huge fan of having the menu outside of ui-manchette. IMHO the positioning and styling of the menu belongs to osrd-ui.

I'm especially concerned about the positioning logic which is quite fragile: it hardcodes a lot of assumptions about the manchette, and desynchronizes when elements move around. Example bug: zoom in the manchette, open the menu, and then scroll. This is just one example, other interactions may break the menu alike.

out

@emersion
Copy link
Member

Actually, maybe this coule be used instead?

https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_anchor_positioning/Using

@SharglutDev
Copy link
Contributor Author

SharglutDev commented Oct 23, 2024

Overall I'm not a huge fan of having the menu outside of ui-manchette. IMHO the positioning and styling of the menu belongs to osrd-ui.

I'm especially concerned about the positioning logic which is quite fragile: it hardcodes a lot of assumptions about the manchette, and desynchronizes when elements move around. Example bug: zoom in the manchette, open the menu, and then scroll. This is just one example, other interactions may break the menu alike.

You're totally right, I will check for solutions

@SharglutDev SharglutDev force-pushed the pfn/front/add-waypoint-menu branch from bd08fca to 93ccaa9 Compare October 24, 2024 06:48
Copy link
Contributor

@Synar Synar left a comment

Choose a reason for hiding this comment

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

LGTM beyond the positioning issue pointed out by emersion. But it is my understanding that https://github.com/OpenRailAssociation/osrd-ui/pull/668/files should solve this issue?

@SharglutDev
Copy link
Contributor Author

LGTM beyond the positioning issue pointed out by emersion. But it is my understanding that https://github.com/OpenRailAssociation/osrd-ui/pull/668/files should solve this issue?

Yes exactly it's on wip :)

@SharglutDev SharglutDev force-pushed the pfn/front/add-waypoint-menu branch from 93ccaa9 to f2325dd Compare November 28, 2024 11:10
@github-actions github-actions bot added the area:front Work on Standard OSRD Interface modules label Nov 28, 2024
@SharglutDev
Copy link
Contributor Author

Nothing new, just rebased with dev to be not too far behind with conflicts :)

@SharglutDev SharglutDev force-pushed the pfn/front/add-waypoint-menu branch 2 times, most recently from 8cdbe23 to bdc093f Compare December 6, 2024 17:11
@SharglutDev SharglutDev force-pushed the pfn/front/add-waypoint-menu branch from fba2b87 to 19967ca Compare December 10, 2024 18:02
- Change the listener to be on the document to be able to catch all events even if the focus was elsewhere
- Add a parameter to set the focus on the first element of the modal/div if provided
- Fix the focusTrap on the manchette menu

Signed-off-by: SharglutDev <[email protected]>
@SharglutDev SharglutDev force-pushed the pfn/front/add-waypoint-menu branch from 19967ca to 4f87f08 Compare December 12, 2024 07:27
Copy link
Contributor

@theocrsb theocrsb 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 ! I just posted a little comment

Copy link
Contributor

@clarani clarani left a comment

Choose a reason for hiding this comment

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

LGTM ✅

- When clicking on a waypoint in the manchette, display a menu with some
actions
- Only action for now is to hide the waypoint in the manchette

Signed-off-by: SharglutDev <[email protected]>
@SharglutDev SharglutDev force-pushed the pfn/front/add-waypoint-menu branch from 344170d to 3704e82 Compare December 12, 2024 10:00
@SharglutDev SharglutDev added this pull request to the merge queue Dec 12, 2024
Merged via the queue into dev with commit 18d57fa Dec 12, 2024
27 checks passed
@SharglutDev SharglutDev deleted the pfn/front/add-waypoint-menu branch December 12, 2024 10:50
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.

Manchette : hide a waypoint by clicking on it
6 participants