-
Notifications
You must be signed in to change notification settings - Fork 3k
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
User's name containing accent not shown in results if no accent in search query #54806
base: main
Are you sure you want to change the base?
Conversation
The original issue mentioned about countries search
Country names are filtered using
Which removes diacritics and special characters (e.g., "Côte d'Ivoire" can be found by searching "Cote divoire"). Meanwhile, in this PR, user names are filtered using StringUtils.normalizeAccents , which results in no matches when searching for "D'artagnan" with "Dartagnan". To get a result, the query must include a space, such as "D artagnan" or "D'artagnan".However, applying StringUtils.sanitizeString to user names may lead to the removal of special characters, potentially affecting expected results.
What is the expected behavior here? Should we exclude apostrophes and hyphens in this case? Maybe something like this: StringUtils.normalizeAccents(text).replace(/['-]/g, ''); What do you think? @c3024 |
If we use The search seems to work fine after replacing with Screen.Recording.2025-01-07.at.9.29.25.PM.mov |
This comment was marked as outdated.
This comment was marked as outdated.
Sanitizing the Apostrophes are not considered as accents or diacritics, they are treated as special characters. If we want to address this, we can use an approach like in this comment to remove apostrophes. |
@nyomanjyotisa @MonilBhavsar , what do you think? |
It's fair that user can type apostrophe easily on a keyboard, but I think we should definitely return results for |
Let's do this like you suggested. StringUtils.normalizeAccents(text).replace(/['-]/g, ''); |
The PR has been updated! |
I think we should make the changes and not suppress the lint error. There are many places to change but the change is simple enough that nothing should break IMO. |
PR updated @c3024 |
|
||
expect(filteredReports).toEqual(reports); | ||
}); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a test for text containing '
and -
?
Explanation of Change
Fixed Issues
$ #53671
PROPOSAL: #53671 (comment)
Tests
Same as QA Steps
Offline tests
Same as QA Steps
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Android-Native.mp4
Android: mWeb Chrome
Android-mWeb.Chrome.mp4
iOS: Native
iOS-Native.mp4
iOS: mWeb Safari
iOS-mWeb.Safari.mp4
MacOS: Chrome / Safari
MacOS-Chrome.mp4
MacOS: Desktop
MacOS-Desktop.mp4