Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
118 changes: 65 additions & 53 deletions src/components/views/spaces/SpacePanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ import { ThreadsActivityCentre } from "./threads-activity-centre/";
import AccessibleButton from "../elements/AccessibleButton";
import { Landmark, LandmarkNavigation } from "../../../accessibility/LandmarkNavigation";
import { KeyboardShortcut } from "../settings/KeyboardShortcut";
import { ReleaseAnnouncement } from "../../structures/ReleaseAnnouncement";

const useSpaces = (): [Room[], MetaSpace[], Room[], SpaceKey] => {
const invites = useEventEmitterState<Room[]>(SpaceStore.instance, UPDATE_INVITED_SPACES, () => {
Expand Down Expand Up @@ -379,61 +380,72 @@ const SpacePanel: React.FC = () => {
onDragEndHandler();
}}
>
<nav
className={classNames("mx_SpacePanel", {
collapsed: isPanelCollapsed,
newUi: newRoomListEnabled,
})}
onKeyDown={(ev) => {
const navAction = getKeyBindingsManager().getNavigationAction(ev);
if (
navAction === KeyBindingAction.NextLandmark ||
navAction === KeyBindingAction.PreviousLandmark
) {
LandmarkNavigation.findAndFocusNextLandmark(
Landmark.ACTIVE_SPACE_BUTTON,
navAction === KeyBindingAction.PreviousLandmark,
);
ev.stopPropagation();
ev.preventDefault();
return;
}
onKeyDownHandler(ev);
}}
ref={ref}
aria-label={_t("common|spaces")}
<ReleaseAnnouncement
feature="newNotificationSounds"
header={_t("settings|notifications|sounds_release_announcement|title")}
description={_t("settings|notifications|sounds_release_announcement|description")}
closeLabel={_t("action|ok")}
displayArrow={false}
placement="right-start"
>
<UserMenu isPanelCollapsed={isPanelCollapsed}>
<AccessibleButton
className={classNames("mx_SpacePanel_toggleCollapse", { expanded: !isPanelCollapsed })}
onClick={() => setPanelCollapsed(!isPanelCollapsed)}
title={isPanelCollapsed ? _t("action|expand") : _t("action|collapse")}
caption={
<KeyboardShortcut
value={{ ctrlOrCmdKey: true, shiftKey: true, key: "d" }}
className="mx_SpacePanel_Tooltip_KeyboardShortcut"
/>
<nav
className={classNames("mx_SpacePanel", {
collapsed: isPanelCollapsed,
newUi: newRoomListEnabled,
})}
onKeyDown={(ev) => {
const navAction = getKeyBindingsManager().getNavigationAction(ev);
if (
navAction === KeyBindingAction.NextLandmark ||
navAction === KeyBindingAction.PreviousLandmark
) {
LandmarkNavigation.findAndFocusNextLandmark(
Landmark.ACTIVE_SPACE_BUTTON,
navAction === KeyBindingAction.PreviousLandmark,
);
ev.stopPropagation();
ev.preventDefault();
return;
}
/>
</UserMenu>
<Droppable droppableId="top-level-spaces">
{(provided, snapshot) => (
<InnerSpacePanel
{...provided.droppableProps}
isPanelCollapsed={isPanelCollapsed}
setPanelCollapsed={setPanelCollapsed}
isDraggingOver={snapshot.isDraggingOver}
innerRef={provided.innerRef}
>
{provided.placeholder}
</InnerSpacePanel>
)}
</Droppable>

<ThreadsActivityCentre displayButtonLabel={!isPanelCollapsed} />

<QuickSettingsButton isPanelCollapsed={isPanelCollapsed} />
</nav>
onKeyDownHandler(ev);
}}
ref={ref}
aria-label={_t("common|spaces")}
>
<UserMenu isPanelCollapsed={isPanelCollapsed}>
<AccessibleButton
className={classNames("mx_SpacePanel_toggleCollapse", {
expanded: !isPanelCollapsed,
})}
onClick={() => setPanelCollapsed(!isPanelCollapsed)}
title={isPanelCollapsed ? _t("action|expand") : _t("action|collapse")}
caption={
<KeyboardShortcut
value={{ ctrlOrCmdKey: true, shiftKey: true, key: "d" }}
className="mx_SpacePanel_Tooltip_KeyboardShortcut"
/>
}
/>
</UserMenu>
<Droppable droppableId="top-level-spaces">
{(provided, snapshot) => (
<InnerSpacePanel
{...provided.droppableProps}
isPanelCollapsed={isPanelCollapsed}
setPanelCollapsed={setPanelCollapsed}
isDraggingOver={snapshot.isDraggingOver}
innerRef={provided.innerRef}
>
{provided.placeholder}
</InnerSpacePanel>
)}
</Droppable>

<ThreadsActivityCentre displayButtonLabel={!isPanelCollapsed} />

<QuickSettingsButton isPanelCollapsed={isPanelCollapsed} />
</nav>
</ReleaseAnnouncement>
</DragDropContext>
)}
</RovingTabIndexProvider>
Expand Down
4 changes: 4 additions & 0 deletions src/i18n/strings/en_EN.json
Original file line number Diff line number Diff line change
Expand Up @@ -2839,6 +2839,10 @@
"notify_at_room": "Notify when someone mentions using @room",
"notify_keyword": "Notify when someone uses a keyword",
"notify_mention": "Notify when someone mentions using @displayname or %(mxid)s",
"sounds_release_announcement": {
"title": "We’ve refreshed your sounds",
"description": "Your notification ping and call ringer have been updated—clearer, quicker, and less disruptive"
},
"other_section": "Other things we think you might be interested in:",
"people_mentions_keywords": "People, Mentions and Keywords",
"play_sound_for_description": "Applied by default to all rooms on all devices.",
Expand Down
2 changes: 1 addition & 1 deletion src/stores/ReleaseAnnouncementStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import ToastStore from "./ToastStore";
/**
* The features are shown in the array order.
*/
const FEATURES = ["newRoomList_intro", "newRoomList_sort", "newRoomList_filter", "newRoomList_settings"] as const;
const FEATURES = ["newNotificationSounds", "newRoomList_intro", "newRoomList_sort", "newRoomList_filter", "newRoomList_settings"] as const;
/**
* All the features that can be shown in the release announcements.
*/
Expand Down
Loading