Repository navigation
Closed
12 / 1212 of 12 issues completedClosed
12 / 1212 of 12 issues completed
Copy link
Labels
Awaiting PaymentAuto-added when associated PR is deployed to productionAuto-added when associated PR is deployed to productionDailyKSv2KSv2Task
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
- [Due for payment 2026-07-13] 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
- [Due for payment 2026-04-23] Migrate SearchAutocompleteList.tsx from useOptionsList to useFilteredOptions #82187 Migrate SearchAutocompleteList.tsx
- [Due for payment 2026-05-07] Migrate SearchFiltersChatsSelector.tsx from useOptionsList to useFilteredOptions #82188 Migrate SearchFiltersChatsSelector.tsx
- Migrate SearchFiltersParticipantsSelector.tsx from useOptionsList to useFilteredOptions #82189 Migrate SearchFiltersParticipantsSelector.tsx
- [Due for payment 2026-04-30] 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)
- [Due for payment 2026-07-13] 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([Due for payment 2026-07-13] 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 ([Due for payment 2026-07-13] 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: @mallenexpensifyMetadata
Metadata
Labels
Awaiting PaymentAuto-added when associated PR is deployed to productionAuto-added when associated PR is deployed to productionDailyKSv2KSv2Task
Type
Projects
- StatusShow more project fieldsDone
Activity
47 remaining items
[-][Tracking] Remove OptionListContextProvider and migrate all consumers to useFilteredOptions[/-][+][Due for payment 2026-07-30] [Tracking] Remove OptionListContextProvider and migrate all consumers to useFilteredOptions[/+]melvin-bot commentedon Jul 30, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)shubham1206agra commentedon Jul 30, 2026
@mountiny How about 3k for each cause #82191 required multiple PRs?
mountiny commentedon Jul 30, 2026
I think $2500 is good, because some of them were not that complex so that is where I agree with Melvin
mountiny commentedon Jul 30, 2026
Also you have the benefit that the entire project was handled by same C+ and contributor
melvin-bot commentedon Jul 30, 2026
Payment Summary
Upwork Job
BugZero Checklist (@mallenexpensify)
hoangzinh commentedon Jul 30, 2026
@mountiny I'm happy with this base. However, I think we should reward @shubham1206agra with a higher bounty. He led this project and not only migrated all consumers to useFilteredOptions, but he also built proper hooks before the migration. For example:
mountiny commentedon Jul 31, 2026
Thanks! I think that the PRs are already incorporated in the payments breakdown, and in general, some PRs are more complex while others are easier, and the value averages out. It is common to reward the author and reviewer the same amount unless some specific circumstances occurred, so I would keep the suggested payments as they are.
mallenexpensify commentedon Aug 4, 2026
Payment Summary
Contributor+: @shubham1206agra due $2500 via NewDot
Contributor+: @hoangzinh due $2500 via NewDot
Think/hope we're good to close.
laurenreidexpensify commentedon Aug 4, 2026
$2500 approved for @hoangzinh
JmillsExpensify commentedon Aug 10, 2026
$2,500 approved for @shubham1206agra