From 451a99d49ef76ee296a6367224f8db780a42bc26 Mon Sep 17 00:00:00 2001 From: R Midhun Suresh Date: Wed, 11 Jun 2025 17:06:29 +0530 Subject: [PATCH] Show `EmptyRoomListView` when low priority filter matches zero rooms (#30122) * Implement empty section for low prio filter * Write test --- .../rooms/RoomListPanel/EmptyRoomList.tsx | 8 ++++++ src/i18n/strings/en_EN.json | 1 + .../RoomListPanel/EmptyRoomList-test.tsx | 1 + .../__snapshots__/EmptyRoomList-test.tsx.snap | 25 +++++++++++++++++++ 4 files changed, 35 insertions(+) diff --git a/src/components/views/rooms/RoomListPanel/EmptyRoomList.tsx b/src/components/views/rooms/RoomListPanel/EmptyRoomList.tsx index 1f04e4c86e..0e3412f588 100644 --- a/src/components/views/rooms/RoomListPanel/EmptyRoomList.tsx +++ b/src/components/views/rooms/RoomListPanel/EmptyRoomList.tsx @@ -76,6 +76,14 @@ export function EmptyRoomList({ vm }: EmptyRoomListProps): JSX.Element | undefin filter={vm.activePrimaryFilter} /> ); + case FilterKey.LowPriorityFilter: + return ( + + ); default: return undefined; } diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index d83c2d6f2d..1d18ec8c73 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -2122,6 +2122,7 @@ "no_favourites": "You don't have favourite chat yet", "no_favourites_description": "You can add a chat to your favourites in the chat settings", "no_invites": "You don't have any unread invites", + "no_lowpriority": "You don't have any low priority rooms", "no_mentions": "You don't have any unread mentions", "no_people": "You don’t have direct chats with anyone yet", "no_people_description": "You can deselect filters in order to see your other chats", diff --git a/test/unit-tests/components/views/rooms/RoomListPanel/EmptyRoomList-test.tsx b/test/unit-tests/components/views/rooms/RoomListPanel/EmptyRoomList-test.tsx index a8f87a4241..06215d09ca 100644 --- a/test/unit-tests/components/views/rooms/RoomListPanel/EmptyRoomList-test.tsx +++ b/test/unit-tests/components/views/rooms/RoomListPanel/EmptyRoomList-test.tsx @@ -54,6 +54,7 @@ describe("", () => { { key: FilterKey.UnreadFilter, name: "unread", action: "Show all chats" }, { key: FilterKey.MentionsFilter, name: "mention", action: "See all activity" }, { key: FilterKey.InvitesFilter, name: "invite", action: "See all activity" }, + { key: FilterKey.LowPriorityFilter, name: "low priority", action: "See all activity" }, ])("should display the empty state for the $name filter", async ({ key, name, action }) => { const user = userEvent.setup(); const activePrimaryFilter = { diff --git a/test/unit-tests/components/views/rooms/RoomListPanel/__snapshots__/EmptyRoomList-test.tsx.snap b/test/unit-tests/components/views/rooms/RoomListPanel/__snapshots__/EmptyRoomList-test.tsx.snap index 1e6fb38ab1..99314b38fe 100644 --- a/test/unit-tests/components/views/rooms/RoomListPanel/__snapshots__/EmptyRoomList-test.tsx.snap +++ b/test/unit-tests/components/views/rooms/RoomListPanel/__snapshots__/EmptyRoomList-test.tsx.snap @@ -88,6 +88,31 @@ exports[` should display the empty state for the invite filter `; +exports[` should display the empty state for the low priority filter 1`] = ` + +
+ + You don't have any low priority rooms + + +
+
+`; + exports[` should display the empty state for the mention filter 1`] = `