Unread Sorting - Add option for sorting in OptionsMenuView (#31754)

* Add new sort option

* Support new sorting algorithm in vm

* Add option item for unread sorter

* Add tests
This commit is contained in:
R Midhun Suresh
2026-01-22 15:26:47 +05:30
committed by GitHub
parent b9cdc0390a
commit d6d647f56d
6 changed files with 65 additions and 5 deletions

View File

@@ -271,6 +271,7 @@ describe("RoomListHeaderViewModel", () => {
it.each([
["recent" as const, SortingAlgorithm.Recency],
["alphabetical" as const, SortingAlgorithm.Alphabetic],
["unread-first" as const, SortingAlgorithm.Unread],
])("should resort when sort is called with '%s'", (option, expectedAlgorithm) => {
const resortSpy = jest.spyOn(RoomListStoreV3.instance, "resort").mockImplementation(jest.fn());
vm = new RoomListHeaderViewModel({ matrixClient, spaceStore: SpaceStore.instance });