App: [$500] Auto complete emojis does not pop up if a letter with tilde in spanish
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 1.4.54-0 Reproducible in staging?: y Reproducible in production?: y If this was caught during regression testing, add the test name, ID and link from TestRail: Email or phone of affected tester (no customers): Logs: https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by: @iwiznia Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1710785038489889
Action Performed:
- Go to staging.expensify.com and sign in
- Switch language to Spanish
- Open any chat
- Type any emoji name which has tilde like (:corazón:) in the composer or search for emoji in the emoji picker
Expected Result:
Should auto complete in composer field or show the results in the emoji picker.
Actual Result:
Does not auto complete in composer and no results found in emoji picker. Not treating o and ó as same
Workaround:
unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
- Android: Native
- Android: mWeb Chrome
- iOS: Native
- iOS: mWeb Safari
- MacOS: Chrome / Safari
- MacOS: Desktop
Screenshots/Videos
Add any screenshot/video evidence
https://github.com/Expensify/App/assets/38435837/bcfdfc7a-7f6f-43b4-9c91-c89d06fd8268
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~01191fbf64d1245a9f
- Upwork Job ID: 1771230550663888896
- Last Price Increase: 2024-03-22
- Automatic offers:
- tienifr | Contributor | 0
About this issue
- Original URL
- State: open
- Created 3 months ago
- Comments: 16 (11 by maintainers)
@iwiznia @thesahindia About the feasibility of using
localeCompare:localeCompareonly indicates the equality of 2 strings. And that’s the abstraction,Intldoes not expose any method to nomarlize/remove the locale charactersTrieuses exact match by key which does not allow any custom compare/search function. We can implement that but it would increase the algorithm complexity fromO(1)toO(n)considering the search operation:https://github.com/Expensify/App/blob/ed7029b33c5711736569aea8981e21fc68e12d89/src/libs/Trie/index.ts#L49
getStyledTextArraywe must find the exact location of the substring withing the emoji name and as 1️⃣ pointed out, we couldn’t do it withlocaleCompare:https://github.com/Expensify/App/blob/ed7029b33c5711736569aea8981e21fc68e12d89/src/libs/GetStyledTextArray.ts#L11
In conclusion, using
localeCompareis not feasible considering the large tradeoffs in 2️⃣ and the requirement in 3️⃣. I only found this while implementing withlocaleCompare. Additionally, the custom normalize logic has already been used in App for a very long time without any problem so I think we can safely reuse it:https://github.com/Expensify/App/blob/ed7029b33c5711736569aea8981e21fc68e12d89/src/libs/ReportUtils.ts#L1578-L1581
Yes it looks good to me!