Highlight autocomplete value on a match#56243
Conversation
Kicu
left a comment
There was a problem hiding this comment.
Nice work 👍
I left some comments, but they are mainly related to naming
src/components/Search/SearchRouter/getQueryWithSubstitutions.ts
Outdated
Show resolved
Hide resolved
src/components/Search/SearchRouter/getUpdatedSubstitutionsMap.ts
Outdated
Show resolved
Hide resolved
src/CONST.ts
Outdated
| LOWER_THAN: 'lt', | ||
| LOWER_THAN_OR_EQUAL_TO: 'lte', | ||
| }, | ||
| SYNTAX_KEY: 'syntax', |
There was a problem hiding this comment.
this name might be confusing for other developers.
However for now I can't come up with a name better than SYNTAX_KEY_NAME. The main problem is that this const is not simply some "syntax key" but the NAME for key representing syntax 😅 which is why I would like it to have a bit longer more descriptive name.
If you can't come up with anything better just leave as is
There was a problem hiding this comment.
How about SYNTAX_RANGE_NAME?
|
@ikevin127 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
@luacmartins it's ready for review. Hopefully we can merge it soon. |
|
Amazing! @ikevin127 let's prioritize reviewing this one once you're online! |
Reviewer Checklist
Screenshots/VideosAndroid: Nativeandroid.webmAndroid: mWeb Chromeandroid-mweb.webmiOS: Nativeios.mp4iOS: mWeb Safariios-mweb.mp4MacOS: Chrome / Safariweb.movMacOS: Desktopdesktop.mov |
ikevin127
left a comment
There was a problem hiding this comment.
🚀 LGTM - tests well and I confirm that both follow-up points mentioned in #50949 (comment) are implemented and working as expected 🟢.
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/luacmartins in version: 9.0.95-0 🚀
|
|
🚀 Deployed to production by https://github.com/Julesssss in version: 9.0.95-6 🚀
|
| 'worklet'; | ||
|
|
||
| tagSharedValue.set(tagAutocompleteList); | ||
| }); |
There was a problem hiding this comment.
@289Adam289 You made a mistake here. You might want to fix this.
There was a problem hiding this comment.
@shubham1206agra what do you think about me fixing this in my PR for short-mentions, its a quick small change, and my PR is also related to running parser code in worklet?
| if (!isEqual(autocompleteSubstitutions, updatedSubstitutionsMap)) { | ||
| setAutocompleteSubstitutions(updatedSubstitutionsMap); | ||
| } |
There was a problem hiding this comment.
Looks like this condition logic led to the following issue:
which we fixed by adjusting the check such that we only setAutocompleteSubstitutions when the updatedSubstitutionsMap is not empty.
if (!isEqual(autocompleteSubstitutions, updatedSubstitutionsMap) && !isEmpty(updatedSubstitutionsMap)) {
setAutocompleteSubstitutions(updatedSubstitutionsMap);
}
Explanation of Change
This pr is a follow up of #54403 and address issues from #50949 (comment).
Current highlighting rules
category,tag,currency, values are highlighted when the string value is present in Onyx.expenseType,typeandstatusvalues are highlighted when the string value is present in CONST.ts file.from,to,in,taxRate,cardIDvalues are highlighted only when AutocompleteList has been used to insert them(This assures user that query is correct)
Fixed Issues
$ #50949
PROPOSAL:
Tests
Repeat steps 1-7 on main Search Page
Offline tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Screen.Recording.2025-02-04.at.16.44.05.mp4
Android: mWeb Chrome
Screen.Recording.2025-02-04.at.16.45.39.mp4
iOS: Native
Screen.Recording.2025-02-04.at.16.38.47.mp4
iOS: mWeb Safari
Screen.Recording.2025-02-04.at.16.41.27.mp4
MacOS: Chrome / Safari
Screen.Recording.2025-02-04.at.16.46.22.mp4
MacOS: Desktop