Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 6be85e7

Browse files
authored
Prevent sliding sync from showing a room under multiple sublists (#9266)
* Prevent sliding sync from showing a room under multiple sublists * Add tests (cherry picked from commit 96656e4)
1 parent 28a418d commit 6be85e7

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

cypress/e2e/sliding-sync/sliding-sync.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,4 +319,16 @@ describe("Sliding Sync", () => {
319319
"Join", "Test Room",
320320
]);
321321
});
322+
323+
it("should show a favourite DM only in the favourite sublist", () => {
324+
cy.createRoom({
325+
name: "Favourite DM",
326+
is_direct: true,
327+
}).as("room").then(roomId => {
328+
cy.getClient().then(cli => cli.setRoomTag(roomId, "m.favourite", { order: 0.5 }));
329+
});
330+
331+
cy.get('.mx_RoomSublist[aria-label="Favourites"]').contains(".mx_RoomTile", "Favourite DM").should("exist");
332+
cy.get('.mx_RoomSublist[aria-label="People"]').contains(".mx_RoomTile", "Favourite DM").should("not.exist");
333+
});
322334
});

src/stores/room-list/SlidingRoomListStore.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ const filterConditions: Record<TagID, MSC3575Filter> = {
5555
is_dm: true,
5656
is_invite: false,
5757
is_tombstoned: false,
58+
// If a DM has a Favourite & Low Prio tag then it'll be shown in those lists instead
59+
not_tags: ["m.favourite", "m.lowpriority"],
5860
},
5961
[DefaultTagID.Untagged]: {
6062
is_dm: false,
@@ -66,6 +68,8 @@ const filterConditions: Record<TagID, MSC3575Filter> = {
6668
},
6769
[DefaultTagID.LowPriority]: {
6870
tags: ["m.lowpriority"],
71+
// If a room has both Favourite & Low Prio tags then it'll be shown under Favourites
72+
not_tags: ["m.favourite"],
6973
is_tombstoned: false,
7074
},
7175
// TODO https://github.com/vector-im/element-web/issues/23207

0 commit comments

Comments
 (0)