Skip to content

Commit 5014f0b

Browse files
authored
Add release announcement for the sounds (#30900)
* Add release announcement for sounds * Update jest test and snapshots * lint * Update e2e test * Add screenshot * Fix order * Fix snapshots
1 parent 1415354 commit 5014f0b

File tree

9 files changed

+139
-232
lines changed

9 files changed

+139
-232
lines changed

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

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,26 @@ test.describe("Release announcement", () => {
3232
// dismiss the toast so the announcement appears
3333
await page.getByRole("button", { name: "Dismiss" }).click();
3434

35-
const name = "Chats has a new look!";
35+
const newSoundsName = "We’ve refreshed your sounds";
36+
// The new sounds release announcement should be displayed
37+
await util.assertReleaseAnnouncementIsVisible(newSoundsName);
38+
// Hide the new sounds release announcement
39+
const newSoundsDialog = util.getReleaseAnnouncement(newSoundsName);
40+
await newSoundsDialog.getByRole("button", { name: "OK" }).click();
3641

37-
// The release announcement should be displayed
38-
await util.assertReleaseAnnouncementIsVisible(name);
39-
// Hide the release announcement
40-
const dialog = util.getReleaseAnnouncement(name);
42+
const newRoomListName = "Chats has a new look!";
43+
// The new room list release announcement should be displayed
44+
await util.assertReleaseAnnouncementIsVisible(newRoomListName);
45+
// Hide the new room list release announcement
46+
const dialog = util.getReleaseAnnouncement(newRoomListName);
4147
await dialog.getByRole("button", { name: "Next" }).click();
4248

43-
await util.assertReleaseAnnouncementIsNotVisible(name);
49+
await util.assertReleaseAnnouncementIsNotVisible(newRoomListName);
4450

4551
await page.reload();
4652
await expect(page.getByRole("button", { name: "Room options" })).toBeVisible();
47-
// Check that once the release announcement has been marked as viewed, it does not appear again
48-
await util.assertReleaseAnnouncementIsNotVisible(name);
53+
// Check that once the release announcements has been marked as viewed, it does not appear again
54+
await util.assertReleaseAnnouncementIsNotVisible(newRoomListName);
4955
},
5056
);
5157
});
71.5 KB
Loading

src/components/views/spaces/SpacePanel.tsx

Lines changed: 65 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ import { ThreadsActivityCentre } from "./threads-activity-centre/";
6868
import AccessibleButton from "../elements/AccessibleButton";
6969
import { Landmark, LandmarkNavigation } from "../../../accessibility/LandmarkNavigation";
7070
import { KeyboardShortcut } from "../settings/KeyboardShortcut";
71+
import { ReleaseAnnouncement } from "../../structures/ReleaseAnnouncement";
7172

7273
const useSpaces = (): [Room[], MetaSpace[], Room[], SpaceKey] => {
7374
const invites = useEventEmitterState<Room[]>(SpaceStore.instance, UPDATE_INVITED_SPACES, () => {
@@ -379,61 +380,72 @@ const SpacePanel: React.FC = () => {
379380
onDragEndHandler();
380381
}}
381382
>
382-
<nav
383-
className={classNames("mx_SpacePanel", {
384-
collapsed: isPanelCollapsed,
385-
newUi: newRoomListEnabled,
386-
})}
387-
onKeyDown={(ev) => {
388-
const navAction = getKeyBindingsManager().getNavigationAction(ev);
389-
if (
390-
navAction === KeyBindingAction.NextLandmark ||
391-
navAction === KeyBindingAction.PreviousLandmark
392-
) {
393-
LandmarkNavigation.findAndFocusNextLandmark(
394-
Landmark.ACTIVE_SPACE_BUTTON,
395-
navAction === KeyBindingAction.PreviousLandmark,
396-
);
397-
ev.stopPropagation();
398-
ev.preventDefault();
399-
return;
400-
}
401-
onKeyDownHandler(ev);
402-
}}
403-
ref={ref}
404-
aria-label={_t("common|spaces")}
383+
<ReleaseAnnouncement
384+
feature="newNotificationSounds"
385+
header={_t("settings|notifications|sounds_release_announcement|title")}
386+
description={_t("settings|notifications|sounds_release_announcement|description")}
387+
closeLabel={_t("action|ok")}
388+
displayArrow={false}
389+
placement="right-start"
405390
>
406-
<UserMenu isPanelCollapsed={isPanelCollapsed}>
407-
<AccessibleButton
408-
className={classNames("mx_SpacePanel_toggleCollapse", { expanded: !isPanelCollapsed })}
409-
onClick={() => setPanelCollapsed(!isPanelCollapsed)}
410-
title={isPanelCollapsed ? _t("action|expand") : _t("action|collapse")}
411-
caption={
412-
<KeyboardShortcut
413-
value={{ ctrlOrCmdKey: true, shiftKey: true, key: "d" }}
414-
className="mx_SpacePanel_Tooltip_KeyboardShortcut"
415-
/>
391+
<nav
392+
className={classNames("mx_SpacePanel", {
393+
collapsed: isPanelCollapsed,
394+
newUi: newRoomListEnabled,
395+
})}
396+
onKeyDown={(ev) => {
397+
const navAction = getKeyBindingsManager().getNavigationAction(ev);
398+
if (
399+
navAction === KeyBindingAction.NextLandmark ||
400+
navAction === KeyBindingAction.PreviousLandmark
401+
) {
402+
LandmarkNavigation.findAndFocusNextLandmark(
403+
Landmark.ACTIVE_SPACE_BUTTON,
404+
navAction === KeyBindingAction.PreviousLandmark,
405+
);
406+
ev.stopPropagation();
407+
ev.preventDefault();
408+
return;
416409
}
417-
/>
418-
</UserMenu>
419-
<Droppable droppableId="top-level-spaces">
420-
{(provided, snapshot) => (
421-
<InnerSpacePanel
422-
{...provided.droppableProps}
423-
isPanelCollapsed={isPanelCollapsed}
424-
setPanelCollapsed={setPanelCollapsed}
425-
isDraggingOver={snapshot.isDraggingOver}
426-
innerRef={provided.innerRef}
427-
>
428-
{provided.placeholder}
429-
</InnerSpacePanel>
430-
)}
431-
</Droppable>
432-
433-
<ThreadsActivityCentre displayButtonLabel={!isPanelCollapsed} />
434-
435-
<QuickSettingsButton isPanelCollapsed={isPanelCollapsed} />
436-
</nav>
410+
onKeyDownHandler(ev);
411+
}}
412+
ref={ref}
413+
aria-label={_t("common|spaces")}
414+
>
415+
<UserMenu isPanelCollapsed={isPanelCollapsed}>
416+
<AccessibleButton
417+
className={classNames("mx_SpacePanel_toggleCollapse", {
418+
expanded: !isPanelCollapsed,
419+
})}
420+
onClick={() => setPanelCollapsed(!isPanelCollapsed)}
421+
title={isPanelCollapsed ? _t("action|expand") : _t("action|collapse")}
422+
caption={
423+
<KeyboardShortcut
424+
value={{ ctrlOrCmdKey: true, shiftKey: true, key: "d" }}
425+
className="mx_SpacePanel_Tooltip_KeyboardShortcut"
426+
/>
427+
}
428+
/>
429+
</UserMenu>
430+
<Droppable droppableId="top-level-spaces">
431+
{(provided, snapshot) => (
432+
<InnerSpacePanel
433+
{...provided.droppableProps}
434+
isPanelCollapsed={isPanelCollapsed}
435+
setPanelCollapsed={setPanelCollapsed}
436+
isDraggingOver={snapshot.isDraggingOver}
437+
innerRef={provided.innerRef}
438+
>
439+
{provided.placeholder}
440+
</InnerSpacePanel>
441+
)}
442+
</Droppable>
443+
444+
<ThreadsActivityCentre displayButtonLabel={!isPanelCollapsed} />
445+
446+
<QuickSettingsButton isPanelCollapsed={isPanelCollapsed} />
447+
</nav>
448+
</ReleaseAnnouncement>
437449
</DragDropContext>
438450
)}
439451
</RovingTabIndexProvider>

src/i18n/strings/en_EN.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2860,6 +2860,10 @@
28602860
"rule_suppress_notices": "Messages sent by bot",
28612861
"rule_tombstone": "When rooms are upgraded",
28622862
"show_message_desktop_notification": "Show message in desktop notification",
2863+
"sounds_release_announcement": {
2864+
"description": "Your notification ping and call ringer have been updated—clearer, quicker, and less disruptive",
2865+
"title": "We’ve refreshed your sounds"
2866+
},
28632867
"voip": "Audio and Video calls"
28642868
},
28652869
"preferences": {

src/stores/ReleaseAnnouncementStore.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,13 @@ import ToastStore from "./ToastStore";
1818
/**
1919
* The features are shown in the array order.
2020
*/
21-
const FEATURES = ["newRoomList_intro", "newRoomList_sort", "newRoomList_filter", "newRoomList_settings"] as const;
21+
const FEATURES = [
22+
"newNotificationSounds",
23+
"newRoomList_intro",
24+
"newRoomList_sort",
25+
"newRoomList_filter",
26+
"newRoomList_settings",
27+
] as const;
2228
/**
2329
* All the features that can be shown in the release announcements.
2430
*/

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="newRoomList_intro"
26+
feature="newNotificationSounds"
2727
header="header"
2828
description="description"
2929
closeLabel="close"

0 commit comments

Comments
 (0)