-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Open
3 / 123 of 12 issues completedOpen
3 / 123 of 12 issues completed
Copy link
Labels
Description
Problem
OptionListContextProvider recalculates options in the background on every personal details or reports change, causing lag across the app. PR #74071 demonstrated a better pattern using useFilteredOptions, which only computes options when a screen is mounted and visible.
Key benefits of useFilteredOptions over OptionListContextProvider:
- No background recalculations -- options are only computed when the screen is mounted/enabled
- Smart pre-filtering -- sorts reports by
lastVisibleActionCreatedand limits to top N (default 500) - Pagination support --
loadMore/hasMorefor incremental loading - Per-screen control -- each consumer manages its own lifecycle via
enabledconfig
Solution
Migrate all remaining consumers of useOptionsList to useFilteredOptions, then remove the OptionListContextProvider entirely.
Migration Pattern
Follow the approach from PR #74071 (NewChatPage migration):
- Replace
useOptionsList()withuseFilteredOptions({ enabled: didScreenTransitionEnd, ... }) - Replace
areOptionsInitializedchecks withisLoadingfromuseFilteredOptions - Replace
optionsusage -- output is nowOptionList | null(null when loading) - Remove any
shouldInitializelogic (replaced byenabledconfig) - Test the full user flow on all platforms
Sub-Issues
Phase 1 -- Simple migrations (good for community contributors)
- [Due for payment 2026-03-30] Migrate ShareTab.tsx from useOptionsList to useFilteredOptions #82181 Migrate ShareTab.tsx
- [Due for payment 2026-03-04] Migrate UserSelectPopup.tsx from useOptionsList to useFilteredOptions #82182 Migrate UserSelectPopup.tsx
- Migrate IOURequestEditReportCommon.tsx from useOptionsList to useFilteredOptions #82183 Migrate IOURequestEditReportCommon.tsx
- Migrate TroubleshootPage.tsx from useOptionsList to useFilteredOptions #82184 Migrate TroubleshootPage.tsx (special case -- only uses
resetOptions)
Phase 2 -- Medium migrations
- [Due for payment 2026-03-30] Migrate RoomInvitePage.tsx from useOptionsList to useFilteredOptions #82185 Migrate RoomInvitePage.tsx
- Migrate SearchRouter.tsx from useOptionsList to useFilteredOptions #82186 Migrate SearchRouter.tsx
- Migrate SearchAutocompleteList.tsx from useOptionsList to useFilteredOptions #82187 Migrate SearchAutocompleteList.tsx
- Migrate SearchFiltersChatsSelector.tsx from useOptionsList to useFilteredOptions #82188 Migrate SearchFiltersChatsSelector.tsx
- Migrate SearchFiltersParticipantsSelector.tsx from useOptionsList to useFilteredOptions #82189 Migrate SearchFiltersParticipantsSelector.tsx
- Migrate MoneyRequestAccountantSelector.tsx from useOptionsList to useFilteredOptions #82190 Migrate MoneyRequestAccountantSelector.tsx
Phase 3 -- High-impact shared hook
- Migrate useSearchSelector.base.ts from useOptionsList to useFilteredOptions #82191 Migrate useSearchSelector.base.ts (indirectly migrates ~10 screens)
Phase 4 -- Final cleanup (depends on all above)
- Remove OptionListContextProvider from AuthScreens.tsx and delete the provider #82192 Remove OptionListContextProvider from AuthScreens.tsx and delete the provider
Notes
NewChatPage.tsxwas already migrated in PR [POC] OptionListContextProvider optimization #74071 and is not listed above.useSearchSelector.base.ts(Migrate useSearchSelector.base.ts from useOptionsList to useFilteredOptions #82191) is used by ~10 screens indirectly (MoneyRequestParticipantsSelector, WorkspaceInvitePage, InviteReportParticipantsPage, TaskAssigneeSelectorModal, etc.). Migrating it automatically benefits all indirect consumers.TroubleshootPage.tsx(Migrate TroubleshootPage.tsx from useOptionsList to useFilteredOptions #82184) is a special case -- it only usesresetOptionsto clear the cache. SinceuseFilteredOptionsreads from Onyx directly, theresetOptionscall may be unnecessary after migration.- The final cleanup (Remove OptionListContextProvider from AuthScreens.tsx and delete the provider #82192) can only be done after all other sub-issues are completed.
Issue Owner
Current Issue Owner: @mountinyReactions are currently unavailable
Metadata
Metadata
Labels
Type
Projects
Status
No status