-
Notifications
You must be signed in to change notification settings - Fork 3.5k
fix: incorrect selected state search term #67071
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
Conversation
src/libs/OptionsListUtils.ts
Outdated
|
|
||
| function getPersonalDetailSearchTerms(item: Partial<OptionData>) { | ||
| return [item.participantsList?.[0]?.displayName ?? '', item.login ?? '', item.login?.replace(CONST.EMAIL_SEARCH_REGEX, '') ?? '']; | ||
| function getPersonalDetailSearchTerms(item: Partial<OptionData>, shouldIncludeCurrentUser = false) { |
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.
Why are we adding shouldIncludeCurrentUser param here? Shouldn't we use getCurrentUserSearchTerms for the "current user" option
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.
The function formatSectionsFromSearchTerm uses getPersonalDetailSearchTerms here:
App/src/libs/OptionsListUtils.ts
Line 2388 in 894ea88
| const isPartOfSearchTerm = getPersonalDetailSearchTerms(participant).join(' ').toLowerCase().includes(cleanSearchTerm); |
And there's a little bit different between getPersonalDetailSearchTerms and getCurrentUserSearchTerms, so I think it's best to avoid using getCurrentUserSearchTerms in formatSectionsFromSearchTerm to prevent possible regressions.
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.
I still think calling getCurrentUserSearchTerms is what we should do if the option item is a current user option. It does not make sense to me to pass shouldIncludeCurrentUser to getPersonalDetailSearchTerms because that would make getCurrentUserSearchTerms redundant
|
@s77rt Sorry for the delay, there has been some new changes in latest main that conflicts with current PR so I had to make some updates. |
|
@s77rt I updated. App/src/libs/OptionsListUtils.ts Lines 2000 to 2006 in 0020ebc
App/src/libs/OptionsListUtils.ts Lines 2023 to 2025 in 0020ebc
App/src/libs/OptionsListUtils.ts Line 2031 in 0020ebc
And the App/src/libs/OptionsListUtils.ts Lines 2038 to 2040 in 0020ebc
So we need to set |
|
@daledah Given that the current user is included in the personal details list, let's just use that and remove the added if (item.accountID === currentUserAccountID) {
return getCurrentUserSearchTerms(item);
} |
|
@s77rt I updated. |
s77rt
left a comment
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.
Code looks good. Just left a NAB comment. Will complete checklist asap
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppBuild issue. NAB. |
|
✋ 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/JS00001 in version: 9.1.93-0 🚀
|
|
🚀 Deployed to production by https://github.com/marcaaron in version: 9.1.93-7 🚀
|





Explanation of Change
Fixed Issues
$ #63856
PROPOSAL: #63856 (comment)
Tests
(you)postfix in current user optionyouormeyouormeOffline tests
QA Steps
(you)postfix in current user optionyouormeyouormePR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand 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-06-23.at.15.25.07.mov
Android: mWeb Chrome
Screen.Recording.2025-06-23.at.15.25.35.mov
iOS: Native
Screen.Recording.2025-06-23.at.15.27.08.mov
iOS: mWeb Safari
Screen.Recording.2025-06-23.at.15.41.54.mov
MacOS: Chrome / Safari
Screen.Recording.2025-06-23.at.15.42.15.mov
MacOS: Desktop
Screen.Recording.2025-06-23.at.15.42.44.mov