Skip to content

[Due for payment 2026-07-30] [Tracking] Remove OptionListContextProvider and migrate all consumers to useFilteredOptions #82193

Closed
12 of 12 issues completed

Description

@mountiny

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 lastVisibleActionCreated and limits to top N (default 500)
  • Pagination support -- loadMore / hasMore for incremental loading
  • Per-screen control -- each consumer manages its own lifecycle via enabled config

Solution

Migrate all remaining consumers of useOptionsList to useFilteredOptions, then remove the OptionListContextProvider entirely.

Migration Pattern

Follow the approach from PR #74071 (NewChatPage migration):

  1. Replace useOptionsList() with useFilteredOptions({ enabled: didScreenTransitionEnd, ... })
  2. Replace areOptionsInitialized checks with isLoading from useFilteredOptions
  3. Replace options usage -- output is now OptionList | null (null when loading)
  4. Remove any shouldInitialize logic (replaced by enabled config)
  5. Test the full user flow on all platforms

Sub-Issues

Phase 1 -- Simple migrations (good for community contributors)

Phase 2 -- Medium migrations

Phase 3 -- High-impact shared hook

Phase 4 -- Final cleanup (depends on all above)

Notes

Issue OwnerCurrent Issue Owner: @mallenexpensify

Activity

  1. self-assigned this
    on Feb 11, 2026
  2. 47 remaining items

  3. changed the title [-][Tracking] Remove OptionListContextProvider and migrate all consumers to useFilteredOptions[/-] [+][Due for payment 2026-07-30] [Tracking] Remove OptionListContextProvider and migrate all consumers to useFilteredOptions[/+] on Jul 30, 2026
  4. melvin-bot commented on Jul 30, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  5. shubham1206agra commented on Jul 30, 2026

    @shubham1206agra
    Contributor

    @mountiny How about 3k for each cause #82191 required multiple PRs?

  6. mountiny commented on Jul 30, 2026

    @mountiny
    ContributorAuthor

    I think $2500 is good, because some of them were not that complex so that is where I agree with Melvin

  7. mountiny commented on Jul 30, 2026

    @mountiny
    ContributorAuthor

    Also you have the benefit that the entire project was handled by same C+ and contributor

  8. melvin-bot commented on Jul 30, 2026

    @melvin-bot

    Payment Summary

    Upwork Job

    BugZero Checklist (@mallenexpensify)

    • I have verified the correct assignees and roles are listed above and updated the necessary manual offers
    • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants//hired)
    • I have verified the PR was not reverted
    • I have applied any discounts due to bugs/regressions introduced by this PR
    • I have paid out the Upwork contracts or cancelled the ones that are incorrect
    • I have verified the payment summary above is correct
  9. hoangzinh commented on Jul 30, 2026

    @hoangzinh
    Contributor

    I think $2500 is good, because some of them were not that complex so that is where I agree with Melvin

    @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:

  10. mountiny commented on Jul 31, 2026

    @mountiny
    ContributorAuthor

    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.

  11. mallenexpensify commented on Aug 4, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor+: @shubham1206agra due $2500 via NewDot
    Contributor+: @hoangzinh due $2500 via NewDot

    Think/hope we're good to close.

  12. laurenreidexpensify commented on Aug 4, 2026

    @laurenreidexpensify
    Contributor

    $2500 approved for @hoangzinh

  13. JmillsExpensify commented on Aug 10, 2026

    @JmillsExpensify
    Contributor

    $2,500 approved for @shubham1206agra

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 productionDailyKSv2Task

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions