Skip to content
This repository was archived by the owner on Oct 22, 2024. It is now read-only.

Commit bb245af

Browse files
committed
Remove release announcement of new header
1 parent 51495e7 commit bb245af

File tree

6 files changed

+64
-107
lines changed

6 files changed

+64
-107
lines changed

src/components/views/rooms/RoomHeader.tsx

+55-73
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,6 @@ import { useIsVideoRoom } from "../../../utils/video-rooms";
4646
import { notificationLevelToIndicator } from "../../../utils/notifications";
4747
import { CallGuestLinkButton } from "./RoomHeader/CallGuestLinkButton";
4848
import { ButtonEvent } from "../elements/AccessibleButton";
49-
import { ReleaseAnnouncement } from "../../structures/ReleaseAnnouncement";
50-
import { useIsReleaseAnnouncementOpen } from "../../../hooks/useIsReleaseAnnouncementOpen";
51-
import { ReleaseAnnouncementStore } from "../../../stores/ReleaseAnnouncementStore";
5249
import WithPresenceIndicator, { useDmMember } from "../avatars/WithPresenceIndicator";
5350
import { IOOBData } from "../../../stores/ThreepidInviteStore";
5451
import RoomContext from "../../../contexts/RoomContext";
@@ -225,8 +222,6 @@ export default function RoomHeader({
225222
voiceCallButton = undefined;
226223
}
227224

228-
const isReleaseAnnouncementOpen = useIsReleaseAnnouncementOpen("newRoomHeader");
229-
230225
const roomContext = useContext(RoomContext);
231226
const isVideoRoom = useIsVideoRoom(room);
232227
const showChatButton =
@@ -237,75 +232,62 @@ export default function RoomHeader({
237232
return (
238233
<>
239234
<Flex as="header" align="center" gap="var(--cpd-space-3x)" className="mx_RoomHeader light-panel">
240-
<ReleaseAnnouncement
241-
feature="newRoomHeader"
242-
header={_t("room|header|release_announcement_header")}
243-
description={_t("room|header|release_announcement_description")}
244-
closeLabel={_t("action|ok")}
245-
placement="bottom"
235+
<button
236+
aria-label={_t("right_panel|room_summary_card|title")}
237+
tabIndex={0}
238+
onClick={() => RightPanelStore.instance.showOrHidePanel(RightPanelPhases.RoomSummary)}
239+
className="mx_RoomHeader_infoWrapper"
246240
>
247-
<button
248-
aria-label={_t("right_panel|room_summary_card|title")}
249-
tabIndex={0}
250-
onClick={() => {
251-
if (isReleaseAnnouncementOpen) {
252-
ReleaseAnnouncementStore.instance.nextReleaseAnnouncement();
253-
}
254-
RightPanelStore.instance.showOrHidePanel(RightPanelPhases.RoomSummary);
255-
}}
256-
className="mx_RoomHeader_infoWrapper"
257-
>
258-
<WithPresenceIndicator room={room} size="8px">
259-
<RoomAvatar room={room} size="40px" oobData={oobData} />
260-
</WithPresenceIndicator>
261-
<Box flex="1" className="mx_RoomHeader_info">
262-
<BodyText
263-
as="div"
264-
size="lg"
265-
weight="semibold"
266-
dir="auto"
267-
role="heading"
268-
aria-level={1}
269-
className="mx_RoomHeader_heading"
270-
>
271-
<span className="mx_RoomHeader_truncated mx_lineClamp">{roomName}</span>
272-
273-
{!isDirectMessage && joinRule === JoinRule.Public && (
274-
<Tooltip label={_t("common|public_room")} placement="right">
275-
<PublicIcon
276-
width="16px"
277-
height="16px"
278-
className="mx_RoomHeader_icon text-secondary"
279-
aria-label={_t("common|public_room")}
280-
/>
281-
</Tooltip>
282-
)}
283-
284-
{isDirectMessage && e2eStatus === E2EStatus.Verified && (
285-
<Tooltip label={_t("common|verified")} placement="right">
286-
<VerifiedIcon
287-
width="16px"
288-
height="16px"
289-
className="mx_RoomHeader_icon mx_Verified"
290-
aria-label={_t("common|verified")}
291-
/>
292-
</Tooltip>
293-
)}
294-
295-
{isDirectMessage && e2eStatus === E2EStatus.Warning && (
296-
<Tooltip label={_t("room|header_untrusted_label")} placement="right">
297-
<ErrorIcon
298-
width="16px"
299-
height="16px"
300-
className="mx_RoomHeader_icon mx_Untrusted"
301-
aria-label={_t("room|header_untrusted_label")}
302-
/>
303-
</Tooltip>
304-
)}
305-
</BodyText>
306-
</Box>
307-
</button>
308-
</ReleaseAnnouncement>
241+
<WithPresenceIndicator room={room} size="8px">
242+
<RoomAvatar room={room} size="40px" oobData={oobData} />
243+
</WithPresenceIndicator>
244+
<Box flex="1" className="mx_RoomHeader_info">
245+
<BodyText
246+
as="div"
247+
size="lg"
248+
weight="semibold"
249+
dir="auto"
250+
role="heading"
251+
aria-level={1}
252+
className="mx_RoomHeader_heading"
253+
>
254+
<span className="mx_RoomHeader_truncated mx_lineClamp">{roomName}</span>
255+
256+
{!isDirectMessage && joinRule === JoinRule.Public && (
257+
<Tooltip label={_t("common|public_room")} placement="right">
258+
<PublicIcon
259+
width="16px"
260+
height="16px"
261+
className="mx_RoomHeader_icon text-secondary"
262+
aria-label={_t("common|public_room")}
263+
/>
264+
</Tooltip>
265+
)}
266+
267+
{isDirectMessage && e2eStatus === E2EStatus.Verified && (
268+
<Tooltip label={_t("common|verified")} placement="right">
269+
<VerifiedIcon
270+
width="16px"
271+
height="16px"
272+
className="mx_RoomHeader_icon mx_Verified"
273+
aria-label={_t("common|verified")}
274+
/>
275+
</Tooltip>
276+
)}
277+
278+
{isDirectMessage && e2eStatus === E2EStatus.Warning && (
279+
<Tooltip label={_t("room|header_untrusted_label")} placement="right">
280+
<ErrorIcon
281+
width="16px"
282+
height="16px"
283+
className="mx_RoomHeader_icon mx_Untrusted"
284+
aria-label={_t("room|header_untrusted_label")}
285+
/>
286+
</Tooltip>
287+
)}
288+
</BodyText>
289+
</Box>
290+
</button>
309291
<Flex align="center" gap="var(--cpd-space-2x)">
310292
{additionalButtons?.map((props) => {
311293
const label = props.label();

src/i18n/strings/en_EN.json

-2
Original file line numberDiff line numberDiff line change
@@ -1965,8 +1965,6 @@
19651965
"one": "Asking to join",
19661966
"other": "%(count)s people asking to join"
19671967
},
1968-
"release_announcement_description": "Enjoy a simpler, more accessible room header.",
1969-
"release_announcement_header": "New design!",
19701968
"room_is_public": "This room is public",
19711969
"show_widgets_button": "Show Widgets",
19721970
"video_call_button_ec": "Video call (%(brand)s)",

src/stores/ReleaseAnnouncementStore.ts

+1-1
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", "newRoomHeader"] as const;
20+
const FEATURES = ["threadsActivityCentre"] as const;
2121
/**
2222
* All the features that can be shown in the release announcements.
2323
*/

test/components/structures/__snapshots__/RoomView-test.tsx.snap

-8
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ exports[`RoomView for a local room in state CREATING should match the snapshot 1
1010
style="--mx-flex-display: flex; --mx-flex-direction: row; --mx-flex-align: center; --mx-flex-justify: start; --mx-flex-gap: var(--cpd-space-3x);"
1111
>
1212
<button
13-
aria-expanded="false"
14-
aria-haspopup="dialog"
1513
aria-label="Room info"
1614
class="mx_RoomHeader_infoWrapper"
1715
tabindex="0"
@@ -182,8 +180,6 @@ exports[`RoomView for a local room in state ERROR should match the snapshot 1`]
182180
style="--mx-flex-display: flex; --mx-flex-direction: row; --mx-flex-align: center; --mx-flex-justify: start; --mx-flex-gap: var(--cpd-space-3x);"
183181
>
184182
<button
185-
aria-expanded="false"
186-
aria-haspopup="dialog"
187183
aria-label="Room info"
188184
class="mx_RoomHeader_infoWrapper"
189185
tabindex="0"
@@ -439,8 +435,6 @@ exports[`RoomView for a local room in state NEW should match the snapshot 1`] =
439435
style="--mx-flex-display: flex; --mx-flex-direction: row; --mx-flex-align: center; --mx-flex-justify: start; --mx-flex-gap: var(--cpd-space-3x);"
440436
>
441437
<button
442-
aria-expanded="false"
443-
aria-haspopup="dialog"
444438
aria-label="Room info"
445439
class="mx_RoomHeader_infoWrapper"
446440
tabindex="0"
@@ -773,8 +767,6 @@ exports[`RoomView for a local room in state NEW that is encrypted should match t
773767
style="--mx-flex-display: flex; --mx-flex-direction: row; --mx-flex-align: center; --mx-flex-justify: start; --mx-flex-gap: var(--cpd-space-3x);"
774768
>
775769
<button
776-
aria-expanded="false"
777-
aria-haspopup="dialog"
778770
aria-label="Room info"
779771
class="mx_RoomHeader_infoWrapper"
780772
tabindex="0"

test/components/views/rooms/__snapshots__/RoomHeader-test.tsx.snap

+4-15
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ exports[`RoomHeader dm does not show the face pile for DMs 1`] = `
77
style="--mx-flex-display: flex; --mx-flex-direction: row; --mx-flex-align: center; --mx-flex-justify: start; --mx-flex-gap: var(--cpd-space-3x);"
88
>
99
<button
10-
aria-expanded="false"
11-
aria-haspopup="dialog"
1210
aria-label="Room info"
1311
class="mx_RoomHeader_infoWrapper"
1412
tabindex="0"
@@ -46,27 +44,18 @@ exports[`RoomHeader dm does not show the face pile for DMs 1`] = `
4644
style="--mx-flex-display: flex; --mx-flex-direction: row; --mx-flex-align: center; --mx-flex-justify: start; --mx-flex-gap: var(--cpd-space-2x);"
4745
>
4846
<button
49-
aria-label="Close lobby"
47+
aria-disabled="true"
48+
aria-label="There's no one here to call"
5049
class="_icon-button_bh2qc_17"
5150
role="button"
5251
style="--cpd-icon-button-size: 32px;"
5352
tabindex="0"
5453
>
5554
<div
5655
class="_indicator-icon_133tf_26"
57-
style="--cpd-icon-button-size: 100%;"
56+
style="--cpd-icon-button-size: 100%; --cpd-color-icon-tertiary: var(--cpd-color-icon-disabled);"
5857
>
59-
<svg
60-
fill="currentColor"
61-
height="1em"
62-
viewBox="0 0 24 24"
63-
width="1em"
64-
xmlns="http://www.w3.org/2000/svg"
65-
>
66-
<path
67-
d="M6.293 6.293a1 1 0 0 1 1.414 0L12 10.586l4.293-4.293a1 1 0 1 1 1.414 1.414L13.414 12l4.293 4.293a1 1 0 0 1-1.414 1.414L12 13.414l-4.293 4.293a1 1 0 0 1-1.414-1.414L10.586 12 6.293 7.707a1 1 0 0 1 0-1.414Z"
68-
/>
69-
</svg>
58+
<div />
7059
</div>
7160
</button>
7261
<button

test/stores/ReleaseAnnouncementStore-test.tsx

+4-8
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,11 @@ describe("ReleaseAnnouncementStore", () => {
8989
// Sanity check
9090
expect(releaseAnnouncementStore.getReleaseAnnouncement()).toBe("threadsActivityCentre");
9191

92-
let promise = listenReleaseAnnouncementChanged();
92+
const promise = listenReleaseAnnouncementChanged();
9393
await releaseAnnouncementStore.nextReleaseAnnouncement();
9494

95-
expect(await promise).toBe("newRoomHeader");
96-
expect(releaseAnnouncementStore.getReleaseAnnouncement()).toBe("newRoomHeader");
97-
98-
promise = listenReleaseAnnouncementChanged();
99-
await releaseAnnouncementStore.nextReleaseAnnouncement();
10095
expect(await promise).toBeNull();
96+
expect(releaseAnnouncementStore.getReleaseAnnouncement()).toBeNull();
10197

10298
const secondStore = new ReleaseAnnouncementStore();
10399
// All the release announcements have been viewed, so it should be updated in the store account
@@ -112,7 +108,7 @@ describe("ReleaseAnnouncementStore", () => {
112108
const promise = listenReleaseAnnouncementChanged();
113109
await secondStore.nextReleaseAnnouncement();
114110

115-
expect(await promise).toBe("newRoomHeader");
116-
expect(releaseAnnouncementStore.getReleaseAnnouncement()).toBe("newRoomHeader");
111+
expect(await promise).toBeNull();
112+
expect(releaseAnnouncementStore.getReleaseAnnouncement()).toBeNull();
117113
});
118114
});

0 commit comments

Comments
 (0)