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
[Due for payment 2025-11-19] [$250] Refactor provided component to use useSearchSelector hook and remove unused and duplicated code (Task 5) #71062
Across the application, around 15 components serve the same or very similar functionality: search users. These components use the same source of truth, OptionListContextProvider, and use getValidOptions to properly filter and sort options with contact.
Problem
Although the functionality of these components is almost the same, their implementation is the same or differs slightly. There is a lot of code duplication, which leads to situations where users experience different behaviours across these functionalities.
Working on these components (for example, with performance optimizations) is also problematic for developers, as there are many places that should be checked and updated. For example, when we implemented new parameters in getValidOptions there is a need to update all of these components
Solution
To improve code quality and developers’ and users' experience, we’ve implemented the useSearchSelector hook, which will be a single place of truth for all components that provide user searching. These components serve:
options selection
options sorting
options filtering
phone contacts importing
Using that hook will make the user experience more consistent across all components.
Task 5
Refactor listed components to use useSearchSelector hook and remove unused and duplicated code.
Components:
MoneyRequestParticipantsSelector
VacationDelegatePage
Important notes:
you can use InviteReportParticipantsPage as an example of the implementation
you should use context param: CONST.SEARCH_SELECTOR.SEARCH_CONTEXT_GENERAL
you need to ensure all functionalities are working correctly. Especially: selection, filtering, ordering, and inviting new users
changed the title [-]Refactor provided component to use useSearchSelector hook and remove unused and duplicated code (Task 5)[/-][+][$250] Refactor provided component to use useSearchSelector hook and remove unused and duplicated code (Task 5)[/+]on Sep 23, 2025
I'd like to work on this if it's open for contributors with detailed solution in the OP
The solution should be similar with InviteReportParticipantsPage in this PR #66964
Proposal
Please re-state the problem that we are trying to solve in this issue.
Refactor provided component to use useSearchSelector hook and remove unused and duplicated code (Task 5)
What is the root cause of that problem?
Improvement
What changes do you think we should make in order to solve the problem?
The solution should be similar with InviteReportParticipantsPage in this PR #66964
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
NA
What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
changed the title [-][$250] Refactor provided component to use useSearchSelector hook and remove unused and duplicated code (Task 5)[/-][+][Due for payment 2025-11-19] [$250] Refactor provided component to use useSearchSelector hook and remove unused and duplicated code (Task 5)[/+]on Nov 12, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.2.54-1 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@linhvovan29546 can you fill out the bugzero checklist and confirm whether this needs a regression test?
also note that you're assigned the 2nd bulletpoint in the automated comment above when you should be on the 3rd bulletpoint (essentially switching places with @lorretheboy), @mallenexpensify is aware of this and will work on a fix
Activity
[-]Refactor provided component to use useSearchSelector hook and remove unused and duplicated code (Task 5)[/-][+][$250] Refactor provided component to use useSearchSelector hook and remove unused and duplicated code (Task 5)[/+]melvin-bot commentedon Sep 23, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021970468599774553248
melvin-bot commentedon Sep 23, 2025
Triggered auto assignment to Contributor-plus team member for initial proposal review - @linhvovan29546 (
External)melvin-bot commentedon Sep 23, 2025
Triggered auto assignment to @brianlee-expensify (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.lorretheboy commentedon Sep 23, 2025
I'd like to work on this if it's open for contributors with detailed solution in the OP
The solution should be similar with
InviteReportParticipantsPagein this PR #66964Proposal
Please re-state the problem that we are trying to solve in this issue.
Refactor provided component to use useSearchSelector hook and remove unused and duplicated code (Task 5)
What is the root cause of that problem?
Improvement
What changes do you think we should make in order to solve the problem?
The solution should be similar with
InviteReportParticipantsPagein this PR #66964What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
NA
What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
PiyushChandra17 commentedon Sep 23, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
Refactor provided component to use useSearchSelector hook and remove unused and duplicated code
What is the root cause of that problem?
Refactor
What changes do you think we should make in order to solve the problem?
We need to refactor
MoneyRequestParticipantsSelector&&VacationDelegatePagecomponentJust like we do in
InviteReportParticipantsPageApp/src/pages/InviteReportParticipantsPage.tsx
Lines 59 to 66 in 14a6935
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
n/A
What alternative solutions did you explore? (Optional)
38 remaining items
[-][$250] Refactor provided component to use useSearchSelector hook and remove unused and duplicated code (Task 5)[/-][+][Due for payment 2025-11-19] [$250] Refactor provided component to use useSearchSelector hook and remove unused and duplicated code (Task 5)[/+]melvin-bot commentedon Nov 12, 2025
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Nov 12, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.2.54-1 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 2025-11-19. 🎊
For reference, here are some details about the assignees on this issue:
brianlee-expensify commentedon Nov 13, 2025
@linhvovan29546 can you fill out the bugzero checklist and confirm whether this needs a regression test?
also note that you're assigned the 2nd bulletpoint in the automated comment above when you should be on the 3rd bulletpoint (essentially switching places with @lorretheboy), @mallenexpensify is aware of this and will work on a fix
linhvovan29546 commentedon Nov 17, 2025
@brianlee-expensify This is a refactor task, so I don’t think we need the checklist here.
I’m the reviewer (C+), so the second bullet is correct.
I’ve also reviewed two PRs separate, so I would like to request adjustment to the payment accordingly for myself, since this took more time to review than expected:
Replace getValidReports by enrichReports and introduce optionsOrderAnddGroupBy
Refactor provided component to use useSearchSelector hook and remove unused and duplicated code
brianlee-expensify commentedon Nov 17, 2025
@linhvovan29546 thanks for clarifying! and for the adjustment, will provide an update here shortly
brianlee-expensify commentedon Nov 17, 2025
Payment Summary
Contributor: @lorretheboy paid $250 via Upwork on the 19th (see posting)
Contributor+: @linhvovan29546 paid $500 via Upwork (confirmed with @AndrewGable - will edit this offer when paying out on the 19th)
brianlee-expensify commentedon Nov 19, 2025
confirmed payment today for both @lorretheboy and @linhvovan29546 - closing out now