Skip to content

[Due for payment 2026-05-07] Migrate SearchFiltersChatsSelector.tsx from useOptionsList to useFilteredOptions #82188

Closed

Description

@mountiny

Problem

SearchFiltersChatsSelector.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/SearchFiltersChatsSelector.tsx

How options are used:

  • options is fed into getSearchOptions() to build defaultOptions when initialized and screen transition has ended
  • Output of getSearchOptions is used in filterAndOrderOptions() for chatOptions
  • areOptionsInitialized guards defaultOptions (falls back to defaultListOptions otherwise)
  • areOptionsInitialized guards section building
  • areOptionsInitialized is part of showLoadingPlaceholder computation

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 defaultOptions, section building, and showLoadingPlaceholder guards accordingly

Complexity: Medium

Reference PR: #74071

Tests

  • Verify the search filters chats selector works correctly
  • Verify chat 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 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, @mountiny, @shubham1206agra 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. 16 remaining items

  6. changed the title [-]Migrate SearchFiltersChatsSelector.tsx from useOptionsList to useFilteredOptions[/-] [+][Due for payment 2026-05-07] Migrate SearchFiltersChatsSelector.tsx from useOptionsList to useFilteredOptions[/+] on Apr 30, 2026
  7. melvin-bot commented on Apr 30, 2026

    @melvin-bot

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

  8. melvin-bot commented on Apr 30, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.64-31 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-05-07. 🎊

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

  9. melvin-bot commented on May 4, 2026

    @melvin-bot

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

  10. melvin-bot commented on May 6, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  11. hoangzinh commented on May 7, 2026

    @hoangzinh
    Contributor

    This issue is part of on-going project. 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

Awaiting PaymentAuto-added when associated PR is deployed to productionDailyKSv2Task

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions