diff --git a/playwright/e2e/release-announcement/releaseAnnouncement.spec.ts b/playwright/e2e/release-announcement/releaseAnnouncement.spec.ts index c2ebd5b853..812b66b796 100644 --- a/playwright/e2e/release-announcement/releaseAnnouncement.spec.ts +++ b/playwright/e2e/release-announcement/releaseAnnouncement.spec.ts @@ -15,20 +15,34 @@ test.describe("Release announcement", () => { feature_release_announcement: true, }, }, - labsFlags: ["threadsActivityCentre"], + room: async ({ app, user }, use) => { + const roomId = await app.client.createRoom({ + name: "Test room", + }); + await app.viewRoomById(roomId); + await use({ roomId }); + }, }); - test("should display the release announcement process", { tag: "@screenshot" }, async ({ page, app, util }) => { - // The TAC release announcement should be displayed - await util.assertReleaseAnnouncementIsVisible("Threads Activity Centre"); - // Hide the release announcement - await util.markReleaseAnnouncementAsRead("Threads Activity Centre"); - await util.assertReleaseAnnouncementIsNotVisible("Threads Activity Centre"); + test( + "should display the pinned messages release announcement", + { tag: "@screenshot" }, + async ({ page, app, room, util }) => { + await app.toggleRoomInfoPanel(); - await page.reload(); - // Wait for EW to load - await expect(page.getByRole("navigation", { name: "Spaces" })).toBeVisible(); - // Check that once the release announcement has been marked as viewed, it does not appear again - await util.assertReleaseAnnouncementIsNotVisible("Threads Activity Centre"); - }); + const name = "All new pinned messages"; + + // The release announcement should be displayed + await util.assertReleaseAnnouncementIsVisible(name); + // Hide the release announcement + await util.markReleaseAnnouncementAsRead(name); + await util.assertReleaseAnnouncementIsNotVisible(name); + + await page.reload(); + await app.toggleRoomInfoPanel(); + await expect(page.getByRole("menuitem", { name: "Pinned messages" })).toBeVisible(); + // Check that once the release announcement has been marked as viewed, it does not appear again + await util.assertReleaseAnnouncementIsNotVisible(name); + }, + ); }); diff --git a/playwright/e2e/spaces/threads-activity-centre/threadsActivityCentre.spec.ts b/playwright/e2e/spaces/threads-activity-centre/threadsActivityCentre.spec.ts index 683577dce4..eec28099a5 100644 --- a/playwright/e2e/spaces/threads-activity-centre/threadsActivityCentre.spec.ts +++ b/playwright/e2e/spaces/threads-activity-centre/threadsActivityCentre.spec.ts @@ -19,7 +19,6 @@ test.describe("Threads Activity Centre", { tag: "@no-firefox" }, () => { test.use({ displayName: "Alice", botCreateOpts: { displayName: "Other User" }, - labsFlags: ["threadsActivityCentre"], }); test( diff --git a/playwright/snapshots/release-announcement/releaseAnnouncement.spec.ts/release-announcement-All-new-pinned-messages-linux.png b/playwright/snapshots/release-announcement/releaseAnnouncement.spec.ts/release-announcement-All-new-pinned-messages-linux.png new file mode 100644 index 0000000000..f466c17d64 Binary files /dev/null and b/playwright/snapshots/release-announcement/releaseAnnouncement.spec.ts/release-announcement-All-new-pinned-messages-linux.png differ diff --git a/playwright/snapshots/release-announcement/releaseAnnouncement.spec.ts/release-announcement-Threads-Activity-Centre-linux.png b/playwright/snapshots/release-announcement/releaseAnnouncement.spec.ts/release-announcement-Threads-Activity-Centre-linux.png deleted file mode 100644 index fee99165ab..0000000000 Binary files a/playwright/snapshots/release-announcement/releaseAnnouncement.spec.ts/release-announcement-Threads-Activity-Centre-linux.png and /dev/null differ diff --git a/src/components/views/spaces/threads-activity-centre/ThreadsActivityCentre.tsx b/src/components/views/spaces/threads-activity-centre/ThreadsActivityCentre.tsx index 75f4553116..be7fa2bd0e 100644 --- a/src/components/views/spaces/threads-activity-centre/ThreadsActivityCentre.tsx +++ b/src/components/views/spaces/threads-activity-centre/ThreadsActivityCentre.tsx @@ -24,10 +24,7 @@ import { type NotificationLevel } from "../../../../stores/notifications/Notific import PosthogTrackers from "../../../../PosthogTrackers"; import { getKeyBindingsManager } from "../../../../KeyBindingsManager"; import { KeyBindingAction } from "../../../../accessibility/KeyboardShortcuts"; -import { ReleaseAnnouncement } from "../../../structures/ReleaseAnnouncement"; -import { useIsReleaseAnnouncementOpen } from "../../../../hooks/useIsReleaseAnnouncementOpen"; import { useSettingValue } from "../../../../hooks/useSettings"; -import { ReleaseAnnouncementStore } from "../../../../stores/ReleaseAnnouncementStore"; interface ThreadsActivityCentreProps { /** @@ -43,7 +40,6 @@ interface ThreadsActivityCentreProps { export function ThreadsActivityCentre({ displayButtonLabel }: ThreadsActivityCentreProps): JSX.Element { const [open, setOpen] = useState(false); const roomsAndNotifications = useUnreadThreadRooms(open); - const isReleaseAnnouncementOpen = useIsReleaseAnnouncementOpen("threadsActivityCentre"); const settingTACOnlyNotifs = useSettingValue("Notifications.tac_only_notifications"); const emptyCaption = settingTACOnlyNotifs @@ -65,59 +61,39 @@ export function ThreadsActivityCentre({ displayButtonLabel }: ThreadsActivityCen } }} > - {isReleaseAnnouncementOpen ? ( - + { + // Track only when the Threads Activity Centre is opened + if (newOpen) PosthogTrackers.trackInteraction("WebThreadsActivityCentreButton"); + + setOpen(newOpen); + }} + title={_t("threads_activity_centre|header")} + trigger={ { - // Open the TAC after the release announcement closing - setOpen(true); - await ReleaseAnnouncementStore.instance.nextReleaseAnnouncement(); - }} /> - - ) : ( - { - // Track only when the Threads Activity Centre is opened - if (newOpen) PosthogTrackers.trackInteraction("WebThreadsActivityCentreButton"); - - setOpen(newOpen); - }} - title={_t("threads_activity_centre|header")} - trigger={ - + {/* Make the content of the pop-up scrollable */} +
+ {roomsAndNotifications.rooms.map(({ room, notificationLevel }) => ( + setOpen(false)} /> - } - > - {/* Make the content of the pop-up scrollable */} -
- {roomsAndNotifications.rooms.map(({ room, notificationLevel }) => ( - setOpen(false)} - /> - ))} - {roomsAndNotifications.rooms.length === 0 && ( -
{emptyCaption}
- )} -
-
- )} + ))} + {roomsAndNotifications.rooms.length === 0 && ( +
{emptyCaption}
+ )} + +
); } diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 0736b19632..e65d4809df 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -3292,9 +3292,7 @@ "threads_activity_centre": { "header": "Threads activity", "no_rooms_with_threads_notifs": "You don't have rooms with thread notifications yet.", - "no_rooms_with_unread_threads": "You don't have rooms with unread threads yet.", - "release_announcement_description": "Threads notifications have moved, find them here from now on.", - "release_announcement_header": "Threads Activity Centre" + "no_rooms_with_unread_threads": "You don't have rooms with unread threads yet." }, "time": { "about_day_ago": "about a day ago", diff --git a/src/stores/ReleaseAnnouncementStore.ts b/src/stores/ReleaseAnnouncementStore.ts index 05362dde5a..0b287d44b9 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", "pinningMessageList"] as const; +const FEATURES = ["pinningMessageList"] as const; /** * All the features that can be shown in the release announcements. */ diff --git a/test/unit-tests/components/structures/ReleaseAnnouncement-test.tsx b/test/unit-tests/components/structures/ReleaseAnnouncement-test.tsx index c68d755a3a..e53bf06d48 100644 --- a/test/unit-tests/components/structures/ReleaseAnnouncement-test.tsx +++ b/test/unit-tests/components/structures/ReleaseAnnouncement-test.tsx @@ -23,7 +23,7 @@ describe("ReleaseAnnouncement", () => { function renderReleaseAnnouncement() { return render( ", () => { jest.clearAllMocks(); DMRoomMap.makeShared(mockClient); + SettingsStore.setValue("releaseAnnouncementData", null, SettingLevel.DEVICE, { pinningMessageList: true }); + mockClient.getRoom.mockReturnValue(room); jest.spyOn(room, "isElementVideoRoom").mockRestore(); jest.spyOn(room, "isCallRoom").mockRestore(); diff --git a/test/unit-tests/components/views/spaces/__snapshots__/SpacePanel-test.tsx.snap b/test/unit-tests/components/views/spaces/__snapshots__/SpacePanel-test.tsx.snap index 9434140c4b..5086a8aafc 100644 --- a/test/unit-tests/components/views/spaces/__snapshots__/SpacePanel-test.tsx.snap +++ b/test/unit-tests/components/views/spaces/__snapshots__/SpacePanel-test.tsx.snap @@ -8,7 +8,6 @@ exports[` should show all activated MetaSpaces in the correct orde >
Threads
-
- - - -
`; diff --git a/test/unit-tests/stores/ReleaseAnnouncementStore-test.tsx b/test/unit-tests/stores/ReleaseAnnouncementStore-test.tsx index 7b02225cd6..a902616673 100644 --- a/test/unit-tests/stores/ReleaseAnnouncementStore-test.tsx +++ b/test/unit-tests/stores/ReleaseAnnouncementStore-test.tsx @@ -85,7 +85,8 @@ describe("ReleaseAnnouncementStore", () => { expect(releaseAnnouncementStore.getReleaseAnnouncement()).toBeNull(); }); - it("should return the next feature when the next release announcement is called", async () => { + // We only have a single release announcement currently + it.skip("should return the next feature when the next release announcement is called", async () => { // Sanity check expect(releaseAnnouncementStore.getReleaseAnnouncement()).toBe("threadsActivityCentre"); @@ -109,12 +110,12 @@ describe("ReleaseAnnouncementStore", () => { it("should listen to release announcement data changes in the store", async () => { const secondStore = new ReleaseAnnouncementStore(); - expect(secondStore.getReleaseAnnouncement()).toBe("threadsActivityCentre"); + expect(secondStore.getReleaseAnnouncement()).toBe("pinningMessageList"); const promise = listenReleaseAnnouncementChanged(); await secondStore.nextReleaseAnnouncement(); - expect(await promise).toBe("pinningMessageList"); - expect(releaseAnnouncementStore.getReleaseAnnouncement()).toBe("pinningMessageList"); + expect(await promise).toBe(null); + expect(releaseAnnouncementStore.getReleaseAnnouncement()).toBe(null); }); });