Skip to content

[Due for payment 2026-04-23] Migrate SearchAutocompleteList.tsx from useOptionsList to useFilteredOptions #82187

Closed

Description

@mountiny

Problem

SearchAutocompleteList.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: no arguments (defaults to shouldInitialize: true)
  • File: src/components/Search/SearchAutocompleteList.tsx

How options are used:

  • options is passed into getSearchOptions() to build searchOptions in a useMemo
  • options is passed into getSearchOptions() again for autocomplete participants and IN filter in autocompleteSuggestions useMemo
  • areOptionsInitialized controls early return in searchOptions useMemo (falls back to defaultListOptions when false)
  • areOptionsInitialized conditionally renders the main SelectionList

Migration steps:

  1. Replace import {useOptionsList} from '@components/OptionListContextProvider' with import useFilteredOptions from '@hooks/useFilteredOptions'
  2. Replace useOptionsList() call with useFilteredOptions({ enabled: true })
  3. Replace areOptionsInitialized with !isLoading (or options !== null)
  4. Update the searchOptions useMemo guard to check options !== null instead of areOptionsInitialized
  5. Update the autocompleteSuggestions useMemo similarly
  6. Update the conditional render for SelectionList

Complexity: Medium -- multiple usages of options across different code paths

Reference PR: #74071

Tests

  • Verify search autocomplete works correctly when typing in the search bar
  • Verify autocomplete suggestions appear for participants, chats, and IN filters
  • Verify fallback to defaultListOptions works when options are loading
  • 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. hoangzinh commented on Mar 6, 2026

    @hoangzinh
    Contributor
  6. 10 remaining items

  7. mountiny commented on Mar 18, 2026

    @mountiny
    ContributorAuthor

    same

  8. hoangzinh commented on Mar 18, 2026

    @hoangzinh
    Contributor

    I'm going to pick this issue next

  9. added 2 commits that reference this issue on Mar 20, 2026
    61b1638
    d749d89
  10. changed the title [-]Migrate SearchAutocompleteList.tsx from useOptionsList to useFilteredOptions[/-] [+][Due for payment 2026-04-23] Migrate SearchAutocompleteList.tsx from useOptionsList to useFilteredOptions[/+] on Apr 16, 2026
  11. melvin-bot commented on Apr 16, 2026

    @melvin-bot

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

  12. melvin-bot commented on Apr 16, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.59-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-23. 🎊

    For reference, here are some details about the assignees on 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