Skip to content

[hold for payment 2025-12-01] [$250] Refactor provided component to use useSearchSelector hook and remove unused and duplicated code (Task 7) #71064

Closed

Description

@pecanoro

Background

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:

  1. options selection
  2. options sorting
  3. options filtering
  4. phone contacts importing

Using that hook will make the user experience more consistent across all components.

Task 7

💡 This one should be done with extra care as there is more advanced logic inside the component

Refactor provided component to use useSearchSelector hook and remove unused and duplicated code.
Components:

  1. MoneyRequestAttendeeSelector

Important notes:

  1. you can use InviteReportParticipantsPage as an example of the implementation
  2. you should create new const value to use as context param: CONST.SEARCH_SELECTOR.SEARCH_CONTEXT_ATTENDEES
  3. you need to ensure all functionalities are working correctly. Especially: selection, filtering, ordering, and inviting new users
  4. After refactoring, we can remove getAttendees

cc/ @mountiny @sosek108

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021970471013319193514
  • Upwork Job ID: 1970471013319193514
  • Last Price Increase: 2025-09-23
  • Automatic offers:
    • NJ-2020 | Contributor | 108945814
Issue OwnerCurrent Issue Owner: @joekaufmanexpensify

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Sep 23, 2025
  2. melvin-bot commented on Sep 23, 2025

    @melvin-bot

    Triggered auto assignment to @joekaufmanexpensify (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.

  3. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Sep 23, 2025
  4. melvin-bot commented on Sep 23, 2025

    @melvin-bot
  5. changed the title [-]Refactor provided component to use useSearchSelector hook and remove unused and duplicated code (Task 7)[/-] [+][$250] Refactor provided component to use useSearchSelector hook and remove unused and duplicated code (Task 7)[/+] on Sep 23, 2025
  6. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Sep 23, 2025
  7. melvin-bot commented on Sep 23, 2025

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @sobitneupane (External)

  8. removed
    BugSomething is broken. Auto assigns a BugZero manager.
    on Sep 23, 2025
  9. NJ-2020 commented on Sep 23, 2025

    @NJ-2020
    Contributor

    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 7

    What is the root cause of that problem?

    Improvement/Refactor

    What changes do you think we should make in order to solve the problem?

    • Follow this page as an example
    • Create new const value to use as context param CONST.SEARCH_SELECTOR.SEARCH_CONTEXT_ATTENDEES
    • Remove unused/duplicated code
    • Test all functionalities
    • Remove getAttendees

    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)

  10. NJ-2020 commented on Sep 23, 2025

    @NJ-2020
    Contributor

    I would like to work on this, the problem and solution has been defined in the OP. Thanks

  11. 30 remaining items

  12. joekaufmanexpensify commented on Nov 3, 2025

    @joekaufmanexpensify
    Contributor

    PR in review

  13. joekaufmanexpensify commented on Nov 10, 2025

    @joekaufmanexpensify
    Contributor

    Same!

  14. joekaufmanexpensify commented on Nov 17, 2025

    @joekaufmanexpensify
    Contributor

    PR close to merge

  15. joekaufmanexpensify commented on Nov 24, 2025

    @joekaufmanexpensify
    Contributor

    PR merged and on staging

  16. joekaufmanexpensify commented on Dec 1, 2025

    @joekaufmanexpensify
    Contributor

    Automation failed. PR is on prod and payment due today.

  17. changed the title [-][$250] Refactor provided component to use useSearchSelector hook and remove unused and duplicated code (Task 7)[/-] [+][hold for payment 2025-12-01] [$250] Refactor provided component to use useSearchSelector hook and remove unused and duplicated code (Task 7)[/+] on Dec 1, 2025
  18. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on Dec 1, 2025
  19. joekaufmanexpensify commented on Dec 1, 2025

    @joekaufmanexpensify
    Contributor

    Payment Summary

  20. joekaufmanexpensify commented on Dec 1, 2025

    @joekaufmanexpensify
    Contributor

    @NJ-2020 $250 sent and contract ended!

  21. joekaufmanexpensify commented on Dec 1, 2025

    @joekaufmanexpensify
    Contributor

    @sobitneupane please request payment at your earliest convenience. Closing as this is otherwise all set 👍

  22. quinthar commented on Dec 8, 2025

    @quinthar
    Contributor

    Approved $250 to @sobitneupane

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionDailyKSv2ExternalAdded to denote the issue can be worked on by a contributorReviewingHas a PR in reviewTask

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions