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

Prevent sliding sync from showing a room under multiple sublists #9266

Merged
merged 6 commits into from
Sep 12, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions cypress/e2e/sliding-sync/sliding-sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -319,4 +319,18 @@ describe("Sliding Sync", () => {
"Join", "Test Room",
]);
});

it("should show a favourite DM only in the favourite sublist", () => {
cy.createRoom({
name: "Favourite DM",
is_direct: true,
}).as("room").then(roomId => {
cy.contains(".mx_RoomSublist", "Apple");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need actually need this? You surely don't prior to setting the room tag?

Copy link
Member Author

@t3chguy t3chguy Sep 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to wait for the app to settle before continuing, definitely not needed but personally preferred

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heck, I didn't update it from Apple to Favourite DM so it definitely wasn't working :P


cy.getClient().then(cli => cli.setRoomTag(roomId, "m.favourite", { order: 0.5 }));
});

cy.get('.mx_RoomSublist[aria-label="Favourites"]').contains(".mx_RoomTile", "Favourite DM").should("exist");
cy.get('.mx_RoomSublist[aria-label="People"]').contains(".mx_RoomTile", "Favourite DM").should("not.exist");
});
});
4 changes: 4 additions & 0 deletions src/stores/room-list/SlidingRoomListStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ const filterConditions: Record<TagID, MSC3575Filter> = {
is_dm: true,
is_invite: false,
is_tombstoned: false,
// If a DM has a Favourite & Low Prio tag then it'll be shown in those lists instead
not_tags: ["m.favourite", "m.lowpriority"],
},
[DefaultTagID.Untagged]: {
is_dm: false,
Expand All @@ -66,6 +68,8 @@ const filterConditions: Record<TagID, MSC3575Filter> = {
},
[DefaultTagID.LowPriority]: {
tags: ["m.lowpriority"],
// If a room has both Favourite & Low Prio tags then it'll be shown under Favourites
not_tags: ["m.favourite"],
is_tombstoned: false,
},
// TODO https://github.com/vector-im/element-web/issues/23207
Expand Down