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: pathfinding: allow completion by station name in search by trigram #6768

Merged

Conversation

Caracol3
Copy link
Contributor

  • add operationalPointsSearch API call in TypeAndPath.tsx
  • add possibility to search a trigram by station name in the rocket input
  • display results in the list below the component
  • edit _typeAndPath.scss

close #6626

@Caracol3 Caracol3 requested a review from a team as a code owner February 29, 2024 09:54
Copy link

codecov bot commented Feb 29, 2024

Codecov Report

Attention: Patch coverage is 0% with 187 lines in your changes are missing coverage. Please review.

Project coverage is 28.31%. Comparing base (69250c3) to head (1cb8b20).
Report is 3 commits behind head on dev.

Files Patch % Lines
front/src/common/Pathfinding/TypeAndPath.tsx 0.00% 165 Missing ⚠️
front/src/utils/inputManipulation.ts 0.00% 21 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##                dev    #6768      +/-   ##
============================================
- Coverage     28.34%   28.31%   -0.04%     
  Complexity     2250     2250              
============================================
  Files          1087     1090       +3     
  Lines        136329   136477     +148     
  Branches       2744     2745       +1     
============================================
- Hits          38648    38637      -11     
- Misses        96085    96243     +158     
- Partials       1596     1597       +1     
Flag Coverage Δ
core 80.08% <ø> (ø)
editoast 74.78% <ø> (-0.05%) ⬇️
front 8.95% <0.00%> (-0.02%) ⬇️
gateway 2.45% <ø> (ø)
railjson_generator 87.15% <ø> (ø)
tests 83.07% <ø> (ø)

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.

@Caracol3 Caracol3 force-pushed the mcy/front-enhancing-rocket-launcher-with-auto-completion branch 2 times, most recently from ca59387 to a209acd Compare February 29, 2024 10:29
front/src/common/Pathfinding/TypeAndPath.tsx Show resolved Hide resolved
front/src/common/Pathfinding/TypeAndPath.tsx Outdated Show resolved Hide resolved
front/src/common/Pathfinding/TypeAndPath.tsx Outdated Show resolved Hide resolved
Copy link
Contributor

@nicolaswurtz nicolaswurtz left a comment

Choose a reason for hiding this comment

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

Hello! Thx for the code!
Here some minor bugs I've found ;) Good luck!

@nicolaswurtz
Copy link
Contributor

The column expands when too much suggestions, it should stay with same width.

record1.mp4

@nicolaswurtz
Copy link
Contributor

  • Add two stations
  • Type text between, don't click
  • Remove text
  • Click on suggestions

Suggestions should be removed when text is removed.

record2.mp4

@nicolaswurtz
Copy link
Contributor

  • Add a station
  • write inside trigram, suggestions appears on input only not the whole word

Suggestions should appear only with whole word (so nothing here)

record3.mp4

@nicolaswurtz
Copy link
Contributor

  • Add a station
  • Type before station trigram
  • Remove, suggestions stay

Suggestions should be removed when removing text OR take the whole word in consideration

record4.mp4

@nicolaswurtz
Copy link
Contributor

  • Add two stations
  • Begin to type with no space before second trigram
  • click on suggestion
  • trigrams became sticked

Same as above: you can fix this by taking care about the whole word and not only what is entered.

record5.mp4

@nicolaswurtz
Copy link
Contributor

nicolaswurtz commented Mar 1, 2024

  • be careful about spacing, it should be harmonized
  • only display 3 lines of results, put a "..." if overflow
  • add border-radius: 4px; for buttons and white background
  • order stations by names alphabetically
  • the arrow have to be sticked to the suggestion white background
  • the arrow have to be centered on input text

image

image

@Caracol3 Caracol3 force-pushed the mcy/front-enhancing-rocket-launcher-with-auto-completion branch from 817fac5 to 7bcd3f5 Compare March 14, 2024 17:46
@Caracol3 Caracol3 requested a review from Math-R March 14, 2024 17:47
front/src/styles/scss/common/components/_typeAndPath.scss Outdated Show resolved Hide resolved
front/src/common/Pathfinding/TypeAndPath.tsx Outdated Show resolved Hide resolved
front/src/common/Pathfinding/TypeAndPath.tsx Outdated Show resolved Hide resolved
front/src/common/Pathfinding/TypeAndPath.tsx Outdated Show resolved Hide resolved
@Caracol3 Caracol3 force-pushed the mcy/front-enhancing-rocket-launcher-with-auto-completion branch from 7bcd3f5 to a3722a7 Compare March 15, 2024 13:21
@nicolaswurtz
Copy link
Contributor

Hi! Thx for corrections. A few bugs persist, see below ;-)

@nicolaswurtz
Copy link
Contributor

  • type text, select a suggestion
  • remove text, type text again
  • select a suggestion: it doesn't disappear
  • select again a suggestion: it is duplicated
bug1.mp4

@nicolaswurtz
Copy link
Contributor

  • type text that correspond to a trigram (SG here)
  • suggestions appear too
  • add a letter that correspond too to a valid trigram but not to suggestions
  • same suggestions stay (it shouldn't)
bug2.mp4

@nicolaswurtz
Copy link
Contributor

  • begin to type part of a trigram that exists (LO) wait for suggestions
  • add a letter that will transform trigram into something valid BUT not for suggestions
  • suggestions appear again but for previous search (same bug as above)
  • if you click on it, it will change the first occurence of trigram in input field

This one is a little bit tricky but frequently comes when you "hesitate" during typing.

bug3.mp4

@Caracol3 Caracol3 force-pushed the mcy/front-enhancing-rocket-launcher-with-auto-completion branch from ed5c9af to bb37242 Compare March 19, 2024 16:24
@nicolaswurtz
Copy link
Contributor

nicolaswurtz commented Mar 21, 2024

The last one! Don't despair... ;-)

  1. enter 2 OPs
  2. put cursor between
  3. remove space
  4. add space
  5. click on suggestion
  6. sprotch

I think the good behaviour would either propose suggestions for next text ("RE" in my example) either propose nothing.

pouet.mp4

@Caracol3 Caracol3 force-pushed the mcy/front-enhancing-rocket-launcher-with-auto-completion branch from bb37242 to b613733 Compare March 22, 2024 13:18
Copy link
Contributor

@nicolaswurtz nicolaswurtz left a comment

Choose a reason for hiding this comment

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

Functionnaly tested & ok! Good job, GG!

@Caracol3 Caracol3 force-pushed the mcy/front-enhancing-rocket-launcher-with-auto-completion branch from b613733 to 85ce38c Compare April 4, 2024 19:32
…gram

- add operationalPointsSearch API call in TypeAndPath.tsx
- add possibility to search a trigram by station name in the rocket input
- display results in the list below the component
- edit _typeAndPath.scss
- allow the search of a trigram between two trigrams
- add a pseudo ellipsis to show there is too much results
- the arrow follow the current word in the center of it
- create typeAndPath.json in locales/common for fr and en translation
- move isCursorSurroundedBySpace, findCurrentWord and calculateAdjustedCursorPositionRem functions in utils/inputManipulation.ts
@Caracol3 Caracol3 force-pushed the mcy/front-enhancing-rocket-launcher-with-auto-completion branch from 85ce38c to 1cb8b20 Compare April 5, 2024 05:59
@Caracol3 Caracol3 added this pull request to the merge queue Apr 5, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 5, 2024
@Caracol3 Caracol3 added this pull request to the merge queue Apr 5, 2024
Merged via the queue into dev with commit 174ef9a Apr 5, 2024
22 checks passed
@Caracol3 Caracol3 deleted the mcy/front-enhancing-rocket-launcher-with-auto-completion branch April 5, 2024 06:53
Caracol3 added a commit that referenced this pull request Apr 10, 2024
- during rebase in pr #6768 some fixup commits were dropped by mistake, they were retrieve with reflog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow longer text inputs in the rocket pathfinding
3 participants