Skip to content

Commit 95c879c

Browse files
authored
Move room header info button to right-most position (#28754)
* Move room header info button to right-most position Signed-off-by: Michael Telatynski <[email protected]> * Update screenshots Signed-off-by: Michael Telatynski <[email protected]> * Iterate Signed-off-by: Michael Telatynski <[email protected]> * Update snapshot Signed-off-by: Michael Telatynski <[email protected]> * Update screenshots Signed-off-by: Michael Telatynski <[email protected]> --------- Signed-off-by: Michael Telatynski <[email protected]>
1 parent cbc1838 commit 95c879c

21 files changed

+780
-818
lines changed

playwright/e2e/room/room-header.spec.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ test.describe("Room Header", () => {
7171

7272
// Assert the size of buttons on RoomHeader are specified and the buttons are not compressed
7373
// Note these assertions do not check the size of mx_LegacyRoomHeader_name button
74-
const buttons = header.locator(".mx_Flex").getByRole("button");
74+
const buttons = header.getByRole("button").filter({
75+
has: page.locator("svg"),
76+
});
7577
await expect(buttons).toHaveCount(5);
7678

7779
for (const button of await buttons.all()) {
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading

src/components/views/rooms/RoomHeader.tsx

Lines changed: 60 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -310,78 +310,78 @@ export default function RoomHeader({
310310
</BodyText>
311311
</Box>
312312
</button>
313-
<Flex align="center" gap="var(--cpd-space-2x)">
314-
{additionalButtons?.map((props) => {
315-
const label = props.label();
316313

317-
return (
318-
<Tooltip label={label} key={props.id}>
319-
<IconButton
320-
aria-label={label}
321-
onClick={(event) => {
322-
event.stopPropagation();
323-
props.onClick();
324-
}}
325-
>
326-
{typeof props.icon === "function" ? props.icon() : props.icon}
327-
</IconButton>
328-
</Tooltip>
329-
);
330-
})}
314+
{additionalButtons?.map((props) => {
315+
const label = props.label();
331316

332-
{isViewingCall && <CallGuestLinkButton room={room} />}
333-
334-
{hasActiveCallSession && !isConnectedToCall && !isViewingCall ? (
335-
joinCallButton
336-
) : (
337-
<>
338-
{!isVideoRoom && videoCallButton}
339-
{!useElementCallExclusively && !isVideoRoom && voiceCallButton}
340-
</>
341-
)}
317+
return (
318+
<Tooltip label={label} key={props.id}>
319+
<IconButton
320+
aria-label={label}
321+
onClick={(event) => {
322+
event.stopPropagation();
323+
props.onClick();
324+
}}
325+
>
326+
{typeof props.icon === "function" ? props.icon() : props.icon}
327+
</IconButton>
328+
</Tooltip>
329+
);
330+
})}
331+
332+
{isViewingCall && <CallGuestLinkButton room={room} />}
333+
334+
{hasActiveCallSession && !isConnectedToCall && !isViewingCall ? (
335+
joinCallButton
336+
) : (
337+
<>
338+
{!isVideoRoom && videoCallButton}
339+
{!useElementCallExclusively && !isVideoRoom && voiceCallButton}
340+
</>
341+
)}
342342

343-
<Tooltip label={_t("right_panel|room_summary_card|title")}>
343+
{showChatButton && <VideoRoomChatButton room={room} />}
344+
345+
<Tooltip label={_t("common|threads")}>
346+
<IconButton
347+
indicator={notificationLevelToIndicator(threadNotifications)}
348+
onClick={(evt) => {
349+
evt.stopPropagation();
350+
RightPanelStore.instance.showOrHidePhase(RightPanelPhases.ThreadPanel);
351+
PosthogTrackers.trackInteraction("WebRoomHeaderButtonsThreadsButton", evt);
352+
}}
353+
aria-label={_t("common|threads")}
354+
>
355+
<ThreadsIcon />
356+
</IconButton>
357+
</Tooltip>
358+
{notificationsEnabled && (
359+
<Tooltip label={_t("notifications|enable_prompt_toast_title")}>
344360
<IconButton
361+
indicator={notificationLevelToIndicator(globalNotificationState.level)}
345362
onClick={(evt) => {
346363
evt.stopPropagation();
347-
RightPanelStore.instance.showOrHidePhase(RightPanelPhases.RoomSummary);
364+
RightPanelStore.instance.showOrHidePhase(RightPanelPhases.NotificationPanel);
348365
}}
349-
aria-label={_t("right_panel|room_summary_card|title")}
366+
aria-label={_t("notifications|enable_prompt_toast_title")}
350367
>
351-
<RoomInfoIcon />
368+
<NotificationsIcon />
352369
</IconButton>
353370
</Tooltip>
371+
)}
354372

355-
{showChatButton && <VideoRoomChatButton room={room} />}
373+
<Tooltip label={_t("right_panel|room_summary_card|title")}>
374+
<IconButton
375+
onClick={(evt) => {
376+
evt.stopPropagation();
377+
RightPanelStore.instance.showOrHidePhase(RightPanelPhases.RoomSummary);
378+
}}
379+
aria-label={_t("right_panel|room_summary_card|title")}
380+
>
381+
<RoomInfoIcon />
382+
</IconButton>
383+
</Tooltip>
356384

357-
<Tooltip label={_t("common|threads")}>
358-
<IconButton
359-
indicator={notificationLevelToIndicator(threadNotifications)}
360-
onClick={(evt) => {
361-
evt.stopPropagation();
362-
RightPanelStore.instance.showOrHidePhase(RightPanelPhases.ThreadPanel);
363-
PosthogTrackers.trackInteraction("WebRoomHeaderButtonsThreadsButton", evt);
364-
}}
365-
aria-label={_t("common|threads")}
366-
>
367-
<ThreadsIcon />
368-
</IconButton>
369-
</Tooltip>
370-
{notificationsEnabled && (
371-
<Tooltip label={_t("notifications|enable_prompt_toast_title")}>
372-
<IconButton
373-
indicator={notificationLevelToIndicator(globalNotificationState.level)}
374-
onClick={(evt) => {
375-
evt.stopPropagation();
376-
RightPanelStore.instance.showOrHidePhase(RightPanelPhases.NotificationPanel);
377-
}}
378-
aria-label={_t("notifications|enable_prompt_toast_title")}
379-
>
380-
<NotificationsIcon />
381-
</IconButton>
382-
</Tooltip>
383-
)}
384-
</Flex>
385385
{!isDirectMessage && (
386386
<BodyText as="div" size="sm" weight="medium">
387387
<FacePile

0 commit comments

Comments
 (0)