Skip to content

Commit e427b71

Browse files
authored
Remove release announcement on thread activity centre (#29892)
* Remove release announcement on thread activity centre Signed-off-by: Michael Telatynski <[email protected]> * Update tests Signed-off-by: Michael Telatynski <[email protected]> * Update tests Signed-off-by: Michael Telatynski <[email protected]> * Update tests Signed-off-by: Michael Telatynski <[email protected]> --------- Signed-off-by: Michael Telatynski <[email protected]>
1 parent d553be6 commit e427b71

File tree

12 files changed

+102
-236
lines changed

12 files changed

+102
-236
lines changed

playwright/e2e/release-announcement/releaseAnnouncement.spec.ts

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,34 @@ test.describe("Release announcement", () => {
1515
feature_release_announcement: true,
1616
},
1717
},
18-
labsFlags: ["threadsActivityCentre"],
18+
room: async ({ app, user }, use) => {
19+
const roomId = await app.client.createRoom({
20+
name: "Test room",
21+
});
22+
await app.viewRoomById(roomId);
23+
await use({ roomId });
24+
},
1925
});
2026

21-
test("should display the release announcement process", { tag: "@screenshot" }, async ({ page, app, util }) => {
22-
// The TAC release announcement should be displayed
23-
await util.assertReleaseAnnouncementIsVisible("Threads Activity Centre");
24-
// Hide the release announcement
25-
await util.markReleaseAnnouncementAsRead("Threads Activity Centre");
26-
await util.assertReleaseAnnouncementIsNotVisible("Threads Activity Centre");
27+
test(
28+
"should display the pinned messages release announcement",
29+
{ tag: "@screenshot" },
30+
async ({ page, app, room, util }) => {
31+
await app.toggleRoomInfoPanel();
2732

28-
await page.reload();
29-
// Wait for EW to load
30-
await expect(page.getByRole("navigation", { name: "Spaces" })).toBeVisible();
31-
// Check that once the release announcement has been marked as viewed, it does not appear again
32-
await util.assertReleaseAnnouncementIsNotVisible("Threads Activity Centre");
33-
});
33+
const name = "All new pinned messages";
34+
35+
// The release announcement should be displayed
36+
await util.assertReleaseAnnouncementIsVisible(name);
37+
// Hide the release announcement
38+
await util.markReleaseAnnouncementAsRead(name);
39+
await util.assertReleaseAnnouncementIsNotVisible(name);
40+
41+
await page.reload();
42+
await app.toggleRoomInfoPanel();
43+
await expect(page.getByRole("menuitem", { name: "Pinned messages" })).toBeVisible();
44+
// Check that once the release announcement has been marked as viewed, it does not appear again
45+
await util.assertReleaseAnnouncementIsNotVisible(name);
46+
},
47+
);
3448
});

playwright/e2e/spaces/threads-activity-centre/threadsActivityCentre.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ test.describe("Threads Activity Centre", { tag: "@no-firefox" }, () => {
1919
test.use({
2020
displayName: "Alice",
2121
botCreateOpts: { displayName: "Other User" },
22-
labsFlags: ["threadsActivityCentre"],
2322
});
2423

2524
test(

src/components/views/spaces/threads-activity-centre/ThreadsActivityCentre.tsx

Lines changed: 28 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,7 @@ import { type NotificationLevel } from "../../../../stores/notifications/Notific
2424
import PosthogTrackers from "../../../../PosthogTrackers";
2525
import { getKeyBindingsManager } from "../../../../KeyBindingsManager";
2626
import { KeyBindingAction } from "../../../../accessibility/KeyboardShortcuts";
27-
import { ReleaseAnnouncement } from "../../../structures/ReleaseAnnouncement";
28-
import { useIsReleaseAnnouncementOpen } from "../../../../hooks/useIsReleaseAnnouncementOpen";
2927
import { useSettingValue } from "../../../../hooks/useSettings";
30-
import { ReleaseAnnouncementStore } from "../../../../stores/ReleaseAnnouncementStore";
3128

3229
interface ThreadsActivityCentreProps {
3330
/**
@@ -43,7 +40,6 @@ interface ThreadsActivityCentreProps {
4340
export function ThreadsActivityCentre({ displayButtonLabel }: ThreadsActivityCentreProps): JSX.Element {
4441
const [open, setOpen] = useState(false);
4542
const roomsAndNotifications = useUnreadThreadRooms(open);
46-
const isReleaseAnnouncementOpen = useIsReleaseAnnouncementOpen("threadsActivityCentre");
4743
const settingTACOnlyNotifs = useSettingValue("Notifications.tac_only_notifications");
4844

4945
const emptyCaption = settingTACOnlyNotifs
@@ -65,59 +61,39 @@ export function ThreadsActivityCentre({ displayButtonLabel }: ThreadsActivityCen
6561
}
6662
}}
6763
>
68-
{isReleaseAnnouncementOpen ? (
69-
<ReleaseAnnouncement
70-
feature="threadsActivityCentre"
71-
header={_t("threads_activity_centre|release_announcement_header")}
72-
description={_t("threads_activity_centre|release_announcement_description")}
73-
closeLabel={_t("action|ok")}
74-
>
64+
<Menu
65+
align="start"
66+
side="top"
67+
open={open}
68+
onOpenChange={(newOpen) => {
69+
// Track only when the Threads Activity Centre is opened
70+
if (newOpen) PosthogTrackers.trackInteraction("WebThreadsActivityCentreButton");
71+
72+
setOpen(newOpen);
73+
}}
74+
title={_t("threads_activity_centre|header")}
75+
trigger={
7576
<ThreadsActivityCentreButton
76-
disableTooltip={true}
7777
displayLabel={displayButtonLabel}
7878
notificationLevel={roomsAndNotifications.greatestNotificationLevel}
79-
onClick={async () => {
80-
// Open the TAC after the release announcement closing
81-
setOpen(true);
82-
await ReleaseAnnouncementStore.instance.nextReleaseAnnouncement();
83-
}}
8479
/>
85-
</ReleaseAnnouncement>
86-
) : (
87-
<Menu
88-
align="start"
89-
side="top"
90-
open={open}
91-
onOpenChange={(newOpen) => {
92-
// Track only when the Threads Activity Centre is opened
93-
if (newOpen) PosthogTrackers.trackInteraction("WebThreadsActivityCentreButton");
94-
95-
setOpen(newOpen);
96-
}}
97-
title={_t("threads_activity_centre|header")}
98-
trigger={
99-
<ThreadsActivityCentreButton
100-
displayLabel={displayButtonLabel}
101-
notificationLevel={roomsAndNotifications.greatestNotificationLevel}
80+
}
81+
>
82+
{/* Make the content of the pop-up scrollable */}
83+
<div className="mx_ThreadsActivityCentre_rows">
84+
{roomsAndNotifications.rooms.map(({ room, notificationLevel }) => (
85+
<ThreadsActivityCentreRow
86+
key={room.roomId}
87+
room={room}
88+
notificationLevel={notificationLevel}
89+
onClick={() => setOpen(false)}
10290
/>
103-
}
104-
>
105-
{/* Make the content of the pop-up scrollable */}
106-
<div className="mx_ThreadsActivityCentre_rows">
107-
{roomsAndNotifications.rooms.map(({ room, notificationLevel }) => (
108-
<ThreadsActivityCentreRow
109-
key={room.roomId}
110-
room={room}
111-
notificationLevel={notificationLevel}
112-
onClick={() => setOpen(false)}
113-
/>
114-
))}
115-
{roomsAndNotifications.rooms.length === 0 && (
116-
<div className="mx_ThreadsActivityCentre_emptyCaption">{emptyCaption}</div>
117-
)}
118-
</div>
119-
</Menu>
120-
)}
91+
))}
92+
{roomsAndNotifications.rooms.length === 0 && (
93+
<div className="mx_ThreadsActivityCentre_emptyCaption">{emptyCaption}</div>
94+
)}
95+
</div>
96+
</Menu>
12197
</div>
12298
);
12399
}

src/i18n/strings/en_EN.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3292,9 +3292,7 @@
32923292
"threads_activity_centre": {
32933293
"header": "Threads activity",
32943294
"no_rooms_with_threads_notifs": "You don't have rooms with thread notifications yet.",
3295-
"no_rooms_with_unread_threads": "You don't have rooms with unread threads yet.",
3296-
"release_announcement_description": "Threads notifications have moved, find them here from now on.",
3297-
"release_announcement_header": "Threads Activity Centre"
3295+
"no_rooms_with_unread_threads": "You don't have rooms with unread threads yet."
32983296
},
32993297
"time": {
33003298
"about_day_ago": "about a day ago",

src/stores/ReleaseAnnouncementStore.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { Features } from "../settings/Settings";
1717
/**
1818
* The features are shown in the array order.
1919
*/
20-
const FEATURES = ["threadsActivityCentre", "pinningMessageList"] as const;
20+
const FEATURES = ["pinningMessageList"] as const;
2121
/**
2222
* All the features that can be shown in the release announcements.
2323
*/

test/unit-tests/components/structures/ReleaseAnnouncement-test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ describe("ReleaseAnnouncement", () => {
2323
function renderReleaseAnnouncement() {
2424
return render(
2525
<ReleaseAnnouncement
26-
feature="threadsActivityCentre"
26+
feature="pinningMessageList"
2727
header="header"
2828
description="description"
2929
closeLabel="close"

test/unit-tests/components/views/right_panel/RoomSummaryCard-test.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ import { tagRoom } from "../../../../../src/utils/room/tagRoom";
3131
import { DefaultTagID } from "../../../../../src/stores/room-list/models";
3232
import { Action } from "../../../../../src/dispatcher/actions";
3333
import { ReportRoomDialog } from "../../../../../src/components/views/dialogs/ReportRoomDialog.tsx";
34+
import SettingsStore from "../../../../../src/settings/SettingsStore.ts";
35+
import { SettingLevel } from "../../../../../src/settings/SettingLevel.ts";
3436

3537
jest.mock("../../../../../src/utils/room/tagRoom");
3638

@@ -78,6 +80,8 @@ describe("<RoomSummaryCard />", () => {
7880
jest.clearAllMocks();
7981
DMRoomMap.makeShared(mockClient);
8082

83+
SettingsStore.setValue("releaseAnnouncementData", null, SettingLevel.DEVICE, { pinningMessageList: true });
84+
8185
mockClient.getRoom.mockReturnValue(room);
8286
jest.spyOn(room, "isElementVideoRoom").mockRestore();
8387
jest.spyOn(room, "isCallRoom").mockRestore();

test/unit-tests/components/views/spaces/__snapshots__/SpacePanel-test.tsx.snap

Lines changed: 7 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ exports[`<SpacePanel /> should show all activated MetaSpaces in the correct orde
88
>
99
<div
1010
class="mx_UserMenu"
11-
data-floating-ui-inert=""
1211
>
1312
<div
1413
aria-expanded="false"
@@ -43,7 +42,6 @@ exports[`<SpacePanel /> should show all activated MetaSpaces in the correct orde
4342
<ul
4443
aria-label="Spaces"
4544
class="mx_AutoHideScrollbar mx_SpaceTreeLevel"
46-
data-floating-ui-inert=""
4745
data-rbd-droppable-context-id="0"
4846
data-rbd-droppable-id="top-level-spaces"
4947
role="tree"
@@ -231,17 +229,18 @@ exports[`<SpacePanel /> should show all activated MetaSpaces in the correct orde
231229
class="mx_ThreadsActivityCentre_container"
232230
>
233231
<button
234-
aria-controls="«r12»"
235-
aria-describedby="«r12»"
236-
aria-expanded="true"
237-
aria-haspopup="dialog"
232+
aria-disabled="false"
233+
aria-expanded="false"
234+
aria-haspopup="menu"
238235
aria-label="Threads"
239-
aria-labelledby="«r14»"
236+
aria-labelledby="«r12»"
240237
class="_icon-button_m2erp_8 mx_ThreadsActivityCentreButton"
241-
data-floating-ui-inert=""
238+
data-state="closed"
239+
id="radix-«r10»"
242240
role="button"
243241
style="--cpd-icon-button-size: 32px;"
244242
tabindex="0"
243+
type="button"
245244
>
246245
<div
247246
class="_indicator-icon_zr2a0_17"
@@ -261,37 +260,11 @@ exports[`<SpacePanel /> should show all activated MetaSpaces in the correct orde
261260
</svg>
262261
</div>
263262
</button>
264-
<span
265-
aria-hidden="true"
266-
data-floating-ui-inert=""
267-
style="border: 0px; height: 1px; margin: -1px; overflow: hidden; padding: 0px; position: fixed; white-space: nowrap; width: 1px; top: 0px; left: 0px;"
268-
tabindex="-1"
269-
/>
270-
<span
271-
data-floating-ui-focus-guard=""
272-
data-type="outside"
273-
role="button"
274-
style="border: 0px; height: 1px; margin: -1px; overflow: hidden; padding: 0px; position: fixed; white-space: nowrap; width: 1px; top: 0px; left: 0px;"
275-
tabindex="0"
276-
/>
277-
<span
278-
aria-owns="«r19»"
279-
data-floating-ui-inert=""
280-
style="border: 0px; height: 1px; margin: -1px; overflow: hidden; padding: 0px; position: fixed; white-space: nowrap; width: 1px; top: 0px; left: 0px;"
281-
/>
282-
<span
283-
data-floating-ui-focus-guard=""
284-
data-type="outside"
285-
role="button"
286-
style="border: 0px; height: 1px; margin: -1px; overflow: hidden; padding: 0px; position: fixed; white-space: nowrap; width: 1px; top: 0px; left: 0px;"
287-
tabindex="0"
288-
/>
289263
</div>
290264
<div
291265
aria-expanded="false"
292266
aria-label="Quick settings"
293267
class="mx_AccessibleButton mx_QuickSettingsButton"
294-
data-floating-ui-inert=""
295268
role="button"
296269
tabindex="0"
297270
/>

0 commit comments

Comments
 (0)