From 13e67ae0eb86b08761d28932d6bf074782941ab6 Mon Sep 17 00:00:00 2001 From: Florian Duros Date: Wed, 18 Sep 2024 11:26:17 +0200 Subject: [PATCH] Add Release announcement for the pinning message list (#46) * Add RA for the pinning message list * Update RoomSummaryCard-test.tsx snapshot * Update RA labels --- .../views/right_panel/RoomSummaryCard.tsx | 28 +- src/i18n/strings/en_EN.json | 5 + src/stores/ReleaseAnnouncementStore.ts | 2 +- .../RoomSummaryCard-test.tsx.snap | 273 +++++++++--------- test/stores/ReleaseAnnouncementStore-test.tsx | 12 +- 5 files changed, 178 insertions(+), 142 deletions(-) diff --git a/src/components/views/right_panel/RoomSummaryCard.tsx b/src/components/views/right_panel/RoomSummaryCard.tsx index ca12c180dad..39575d94f52 100644 --- a/src/components/views/right_panel/RoomSummaryCard.tsx +++ b/src/components/views/right_panel/RoomSummaryCard.tsx @@ -72,6 +72,7 @@ import { Key } from "../../../Keyboard"; import { useTransition } from "../../../hooks/useTransition"; import { useIsVideoRoom } from "../../../utils/video-rooms"; import { usePinnedEvents } from "../../../hooks/usePinnedEvents"; +import { ReleaseAnnouncement } from "../../structures/ReleaseAnnouncement.tsx"; interface IProps { room: Room; @@ -380,16 +381,25 @@ const RoomSummaryCard: React.FC = ({ {!isVideoRoom && ( <> - - - {pinCount} - - - +
+ + + {pinCount} + + +
+ )} diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index cc051ac0cf4..1ceee5b51f3 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -1853,6 +1853,11 @@ "other": "You can only pin up to %(count)s widgets" }, "menu": "Open menu", + "release_announcement": { + "close": "Ok", + "description": "Find all pinned messages here. Rollover any message and select “Pin” to add it.", + "title": "All new pinned messages" + }, "reply_thread": "Reply to a thread message", "title": "Pinned messages", "unpin_all": { diff --git a/src/stores/ReleaseAnnouncementStore.ts b/src/stores/ReleaseAnnouncementStore.ts index 3c36af91aea..ba6a79fec0f 100644 --- a/src/stores/ReleaseAnnouncementStore.ts +++ b/src/stores/ReleaseAnnouncementStore.ts @@ -17,7 +17,7 @@ import { Features } from "../settings/Settings"; /** * The features are shown in the array order. */ -const FEATURES = ["threadsActivityCentre"] as const; +const FEATURES = ["threadsActivityCentre", "pinningMessageList"] as const; /** * All the features that can be shown in the release announcements. */ diff --git a/test/components/views/right_panel/__snapshots__/RoomSummaryCard-test.tsx.snap b/test/components/views/right_panel/__snapshots__/RoomSummaryCard-test.tsx.snap index 26a7b88eda6..8300f4920d0 100644 --- a/test/components/views/right_panel/__snapshots__/RoomSummaryCard-test.tsx.snap +++ b/test/components/views/right_panel/__snapshots__/RoomSummaryCard-test.tsx.snap @@ -186,50 +186,55 @@ exports[` has button to edit topic 1`] = ` data-orientation="horizontal" role="separator" /> - + + + + + +