You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[HOLD for payment 2023-09-20] Web - Profile - Pronouns Displayed Without Performing Search #26074
1, Settings > profile > pronouns section, pronouns are displayed without the need for performing a search.
Expected Result:
Pronouns should only be displayed when something is entered in the search bar.
Actual Result:
Pronouns are displayed without any search being performed.
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Android / native
Android / Chrome
iOS / native
iOS / Safari
MacOS / Chrome / Safari
MacOS / Desktop
Version Number: 1.3.57.5 Reproducible in staging?: y Reproducible in production?: n 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 Notes/Photos/Videos: Any additional supporting documentation
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open StagingDeployCash deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
Identify the pull request that introduced this issue and revert it.
Just FYI, rolling back to memo will break the highlight, because the sections will start empty and the list won't be able to determine which is the initially focused index
Please re-state the problem that we are trying to solve in this issue.
Pronouns displayed without search value
What is the root cause of that problem?
Regression from #25921 as for empty search string indexOf will return 0 for all items and show the filtered pronouns list.
What changes do you think we should make in order to solve the problem?
We can revert the useMemo part for the filteredPronounsList.
This will lead to missing highlight due to initiallyFocusedOptionKey passed as empty bcoz pronounsList gets filled but setSearchValue depends on the initiallyFocusedOption which will be called later(by that time filteredPronounsList remains empty and we renders the SelectionList component). So I think we can move the setSearchValue(initiallyFocusedOption.text); here with the setInitiallyFocusedOption and remove that useEffect. With that, it will set the searchValue if isCurrentPronouns is available before setting the pronounsList which will work correctly for the filteredPronounsList.
Above we are also adding one more check - searchValue.trim() ( we can improve this like checking length, or some function from underscore, ex - _.isEmpty()), but to summarise we can have this check and it will only display list in case of search value is non empty.
As this function is not costly, we can avoid adding useMemo and un-necessary dependency.
Screen.Recording.2023-08-28.at.8.04.31.PM.mov
What alternative solutions did you explore? (Optional)
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.68-17 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2023-09-20. 🎊
After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.
External issue reporter
Contributor that fixed the issue
Contributor+ that helped on the issue and/or PR
For reference, here are some details about the assignees on this issue:
Activity
OSBotify commentedon Aug 28, 2023
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open
StagingDeployCashdeploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:melvin-bot commentedon Aug 28, 2023
Triggered auto assignment to @amyevans (
Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.Nikhil-Vats commentedon Aug 28, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
Profile - Pronouns Displayed Without Performing Search
What is the root cause of that problem?
In this PR, the logic to hide pronouns when search value is empty was removed.
App/src/pages/settings/Profile/PronounsPage.js
Line 81 in 9819021
What changes do you think we should make in order to solve the problem?
We need to use the following code for
filteredPronounsListusing useMemo (this was the code before that PR)What alternative solutions did you explore? (Optional)
NA
Screen.Recording.2023-08-28.at.5.48.55.PM.mov
dummy-1111 commentedon Aug 28, 2023
This issue was from this PR
Nikhil-Vats commentedon Aug 28, 2023
Yes, sorry I linked the wrong PR. Thanks @s-alves10 . Fixed now.
thiagobrez commentedon Aug 28, 2023
Just FYI, rolling back to memo will break the highlight, because the sections will start empty and the list won't be able to determine which is the initially focused index
Pujan92 commentedon Aug 28, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
Pronouns displayed without search value
What is the root cause of that problem?
Regression from #25921 as for empty search string
indexOfwill return 0 for all items and show the filtered pronouns list.What changes do you think we should make in order to solve the problem?
We can revert the
useMemopart for thefilteredPronounsList.This will lead to missing highlight due to
initiallyFocusedOptionKeypassed as empty bcozpronounsListgets filled butsetSearchValuedepends on theinitiallyFocusedOptionwhich will be called later(by that timefilteredPronounsListremains empty and we renders theSelectionListcomponent). So I think we can move thesetSearchValue(initiallyFocusedOption.text);here with thesetInitiallyFocusedOptionand remove thatuseEffect. With that, it will set the searchValue ifisCurrentPronounsis available before setting the pronounsList which will work correctly for the filteredPronounsList.App/src/pages/settings/Profile/PronounsPage.js
Lines 85 to 87 in a14511a
App/src/pages/settings/Profile/PronounsPage.js
Lines 45 to 48 in a14511a
Screen.Recording.2023-08-28.at.19.20.44.mov
What alternative solutions did you explore? (Optional)
We can add
useEffectin the selection list component to refocus the item ifinitiallyFocusedOptionKeygets changed.App/src/components/SelectionList/BaseSelectionList.js
Lines 139 to 140 in 6ce9f55
BhuvaneshPatil commentedon Aug 28, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
Pronouns displayed without search value
What is the root cause of that problem?
This was caused by this PR - #25921
What changes do you think we should make in order to solve the problem?
We shall change the logic for generating
filteredPronounsListhere -App/src/pages/settings/Profile/PronounsPage.js
Line 81 in dfb7e23
We can just change it to -
Above we are also adding one more check -
searchValue.trim()( we can improve this like checking length, or some function from underscore, ex -_.isEmpty()), but to summarise we can have this check and it will only display list in case of search value is non empty.As this function is not costly, we can avoid adding useMemo and un-necessary dependency.
Screen.Recording.2023-08-28.at.8.04.31.PM.mov
What alternative solutions did you explore? (Optional)
15 remaining items
melvin-bot commentedon Sep 13, 2023
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.68-17 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2023-09-20. 🎊
After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.
For reference, here are some details about the assignees on this issue:
As a reminder, here are the bonuses/penalties that should be applied for any External issue:
melvin-bot commentedon Sep 22, 2023
Triggered auto assignment to @maddylewis (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Sep 22, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)amyevans commentedon Sep 22, 2023
Hey @maddylewis, this is all set to close except for payout. Can you help pay @tewodrosGirmaA the reporting bonus please?
maddylewis commentedon Sep 22, 2023
offer sent to @tewodrosGirmaA
tewodrosGirmaA commentedon Sep 22, 2023
maddylewis commentedon Sep 22, 2023
paid!