Skip to content

[Due for payment 2025-11-12] [$250] Refactor provided component to use useSearchSelector hook and remove unused and duplicated code (Task 4) #71061

@pecanoro

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 4

Refactor listed components to use useSearchSelector hook and remove unused and duplicated code.
Components:

  1. UserSelectPopup
  2. SearchFiltersParticipantsSelector
  3. NewChatPage

Important notes:

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

cc/ @sosek108 @mountiny

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021970467874158935409
  • Upwork Job ID: 1970467874158935409
  • Last Price Increase: 2025-09-23
  • Automatic offers:
    • mkzie2 | Contributor | 108901126
Issue OwnerCurrent Issue Owner: @mkzie2

Metadata

Metadata

Labels

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

Type

No type

Projects

Status

LOW

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions