-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Open
Labels
Description
Problem
SearchFiltersParticipantsSelector.tsx currently uses the useOptionsList hook from OptionListContextProvider, which causes unnecessary background recalculations on every personal details or reports change.
This is part of a larger effort to remove OptionListContextProvider entirely. See parent issue #82193 for full context.
Solution
Replace useOptionsList with useFilteredOptions following the pattern established in PR #74071 (NewChatPage migration).
Current usage:
- Properties used:
options,areOptionsInitialized - Called with:
{ shouldInitialize: didScreenTransitionEnd } - File:
src/components/Search/SearchFiltersParticipantsSelector.tsx
How options are used:
options.reportsandoptions.personalDetailsare passed togetValidOptions()to build participant options- Output flows into
defaultOptionsand thenfilterAndOrderOptions areOptionsInitializedguardsdefaultOptionscomputationareOptionsInitializedguardssections/headerMessageuseMemoareOptionsInitializedis part ofshowLoadingPlaceholdercomputation
Migration steps:
- Replace
import {useOptionsList} from '@components/OptionListContextProvider'withimport useFilteredOptions from '@hooks/useFilteredOptions' - Replace
useOptionsList({ shouldInitialize: didScreenTransitionEnd })withuseFilteredOptions({ enabled: didScreenTransitionEnd }) - Replace
areOptionsInitializedwith!isLoading(oroptions !== null) - Update
defaultOptions, sections/headerMessage, andshowLoadingPlaceholderguards accordingly - Handle the
nulloptions case ingetValidOptions()call
Complexity: Medium
Reference PR: #74071
Tests
- Verify the search filters participants selector works correctly
- Verify participant filtering and selection works within search filters
- Verify loading placeholders show correctly while options compute
- Verify the screen transition delay is properly handled
- Verify no errors appear in the JS console
- Test on all platforms (iOS, Android, Web, Desktop)
Issue Owner
Current Issue Owner: @shubham1206agraReactions are currently unavailable