RoomListViewModel: Support primary filters in the view model (#29454)

* Track available filters and expose this info from the vm

- Adds a separate hook that tracks the filtered rooms and the available
  filters.
- When secondary filters are added, some of the primary filters will be
  selectively hidden. So track this info in the vm.

* Write tests

* Fix typescript error

* Fix translation

* Explain what a primary filter is
This commit is contained in:
R Midhun Suresh
2025-03-10 18:53:38 +05:30
committed by GitHub
parent af476905b6
commit fd91e78152
4 changed files with 145 additions and 14 deletions
@@ -27,7 +27,7 @@ describe("<RoomList />", () => {
matrixClient = stubClient();
const rooms = Array.from({ length: 10 }, (_, i) => mkRoom(matrixClient, `room${i}`));
vm = { rooms, openRoom: jest.fn() };
vm = { rooms, openRoom: jest.fn(), primaryFilters: [] };
// Needed to render a room list cell
DMRoomMap.makeShared(matrixClient);