Skip to content

[Due for payment 2026-03-30] Migrate RoomInvitePage.tsx from useOptionsList to useFilteredOptions #82185

@mountiny

Description

@mountiny

Problem

RoomInvitePage.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/pages/RoomInvitePage.tsx

How options are used:

  • options.personalDetails is passed to getMemberInviteOptions() to build invite options
  • areOptionsInitialized guards early return in getDefaultOptions(), section building, and showLoadingPlaceholder

Migration steps:

  1. Replace import {useOptionsList} from '@components/OptionListContextProvider' with import useFilteredOptions from '@hooks/useFilteredOptions'
  2. Replace useOptionsList() call with useFilteredOptions({ enabled: true }) (or tie to screen transition if applicable)
  3. Replace areOptionsInitialized with !isLoading (or options !== null)
  4. Update getDefaultOptions() guard, section building guard, and showLoadingPlaceholder accordingly
  5. Handle the null options case in getMemberInviteOptions() call

Complexity: Simple-Medium

Reference PR: #74071

Tests

  • Verify room invite flow works correctly (invite members to a room)
  • Verify the member list populates correctly
  • Verify search/filter within the invite page works
  • Verify loading placeholders show correctly while options compute
  • Verify no errors appear in the JS console
  • Test on all platforms (iOS, Android, Web, Desktop)

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionTaskWeeklyKSv2

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions