Skip to content

[Due for payment 2026-04-30] Migrate MoneyRequestAccountantSelector.tsx from useOptionsList to useFilteredOptions #82190

Closed

Description

@mountiny

Problem

MoneyRequestAccountantSelector.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/pages/iou/request/MoneyRequestAccountantSelector.tsx

How options are used:

  • options.reports and options.personalDetails are passed to getValidOptions() to build accountant selection options
  • areOptionsInitialized guards defaultOptions computation
  • areOptionsInitialized guards chatOptions computation
  • areOptionsInitialized guards section building
  • areOptionsInitialized is used in showLoadingPlaceholder

Migration steps:

  1. Replace import {useOptionsList} from '@components/OptionListContextProvider' with import useFilteredOptions from '@hooks/useFilteredOptions'
  2. Replace useOptionsList({ shouldInitialize: didScreenTransitionEnd }) with useFilteredOptions({ enabled: didScreenTransitionEnd })
  3. Replace areOptionsInitialized with !isLoading (or options !== null)
  4. Update all guards (defaultOptions, chatOptions, section building, showLoadingPlaceholder) accordingly
  5. Handle the null options case in getValidOptions() call

Complexity: Medium

Reference PR: #74071

Tests

  • Verify the accountant selector in money request flow works correctly
  • Verify accountant filtering and selection works
  • 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 OwnerCurrent Issue Owner: @hoangzinh

Activity

  1. melvin-bot commented on Feb 19, 2026

    @melvin-bot

    @hoangzinh, @mountiny, @shubham1206agra Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  2. mountiny commented on Feb 20, 2026

    @mountiny
    ContributorAuthor

    In the backlog

  3. melvin-bot commented on Mar 5, 2026

    @melvin-bot

    @hoangzinh 12 days overdue now... This issue's end is nigh!

  4. mountiny commented on Mar 5, 2026

    @mountiny
    ContributorAuthor

    @shubham1206agra @hungvu193 How is this one looking?

  5. hoangzinh commented on Mar 6, 2026

    @hoangzinh
    Contributor

    @mountiny we're finding an approach for ShareTab here first, before apply to this MoneyRequestAccountantSelector

  6. 29 remaining items

  7. melvin-bot commented on Apr 10, 2026

    @melvin-bot

    @hoangzinh 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

  8. changed the title [-]Migrate MoneyRequestAccountantSelector.tsx from useOptionsList to useFilteredOptions[/-] [+][Due for payment 2026-04-30] Migrate MoneyRequestAccountantSelector.tsx from useOptionsList to useFilteredOptions[/+] on Apr 23, 2026
  9. melvin-bot commented on Apr 23, 2026

    @melvin-bot

    Reviewing label has been removed, please complete the "BugZero Checklist".

  10. melvin-bot commented on Apr 23, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.61-4 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

    If no regressions arise, payment will be issued on 2026-04-30. 🎊

    For reference, here are some details about the assignees on this issue:

  11. hoangzinh commented on Apr 24, 2026

    @hoangzinh
    Contributor

    Cool. We can close this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions