11import {
22 RoomListEntriesDynamicFilterKind ,
33 RoomListEntriesDynamicFilterKind_Tags ,
4+ RoomListFilterCategory ,
45} from "./generated/matrix_sdk_ffi" ;
56
7+ // Special keys for People and Rooms filters since they use Category tag
8+ export const PEOPLE_FILTER_KEY = "Category_People" as const ;
9+ export const ROOMS_FILTER_KEY = "Category_Rooms" as const ;
10+
611type FiltersToBePicked = typeof RoomListEntriesDynamicFilterKind_Tags ;
712
8- export type SupportedFilters = keyof Pick <
9- FiltersToBePicked ,
10- "NonLeft" | "Unread" | "Favourite" | "Invite"
11- > ;
13+ export type SupportedFilters =
14+ | keyof Pick <
15+ FiltersToBePicked ,
16+ "NonLeft" | "Unread" | "Favourite" | "Invite"
17+ >
18+ | typeof PEOPLE_FILTER_KEY
19+ | typeof ROOMS_FILTER_KEY ;
1220
1321export const FILTERS = {
1422 [ RoomListEntriesDynamicFilterKind_Tags . NonLeft ] : {
@@ -29,6 +37,30 @@ export const FILTERS = {
2937 ] ,
3038 } ) ,
3139 } ,
40+ [ PEOPLE_FILTER_KEY ] : {
41+ name : "People" ,
42+ method : new RoomListEntriesDynamicFilterKind . All ( {
43+ filters : [
44+ new RoomListEntriesDynamicFilterKind . Category ( {
45+ expect : RoomListFilterCategory . People ,
46+ } ) ,
47+ new RoomListEntriesDynamicFilterKind . Joined ( ) ,
48+ new RoomListEntriesDynamicFilterKind . DeduplicateVersions ( ) ,
49+ ] ,
50+ } ) ,
51+ } ,
52+ [ ROOMS_FILTER_KEY ] : {
53+ name : "Rooms" ,
54+ method : new RoomListEntriesDynamicFilterKind . All ( {
55+ filters : [
56+ new RoomListEntriesDynamicFilterKind . Category ( {
57+ expect : RoomListFilterCategory . Group ,
58+ } ) ,
59+ new RoomListEntriesDynamicFilterKind . Joined ( ) ,
60+ new RoomListEntriesDynamicFilterKind . DeduplicateVersions ( ) ,
61+ ] ,
62+ } ) ,
63+ } ,
3264 [ RoomListEntriesDynamicFilterKind_Tags . Favourite ] : {
3365 name : "Favourites" ,
3466 method : new RoomListEntriesDynamicFilterKind . All ( {
0 commit comments