Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Release video rooms as a beta feature #8431

Merged
merged 28 commits into from
Jun 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
ddcbbfd
Remove blank header from video room view frame
robintown Apr 27, 2022
bd066a6
Add a beta card for video rooms
robintown Apr 27, 2022
7b07716
Rename the 'disclaimer' on beta cards to 'FAQ'
robintown Apr 27, 2022
fb7b486
Add beta pills to video room creation buttons
robintown Apr 27, 2022
c99792d
Remove duplicate tooltips from face piles
robintown Apr 27, 2022
7f44269
Merge branch 'develop' into video-rooms-beta
robintown May 2, 2022
50bd2cd
Add beta pill to headers of video rooms
robintown May 2, 2022
59703c0
Factor RoomInfoLine out of SpaceRoomView
robintown May 2, 2022
08db726
Factor RoomPreviewCard out of SpaceRoomView
robintown May 2, 2022
c3079e1
Adapt RoomPreviewCard for video rooms
robintown May 2, 2022
45d48e8
Merge branch 'develop' into video-rooms-beta
robintown May 2, 2022
fe83642
"New video room" → "Video room"
robintown May 2, 2022
d44b85a
Merge branch 'develop' into video-rooms-beta
robintown May 3, 2022
3c17f22
Add comment about unused cases in RoomPreviewCard
robintown May 3, 2022
7db10bc
Add types
robintown May 3, 2022
6ee692c
Clarify !important comments
robintown May 3, 2022
c4ace54
Add a reload warning
robintown May 3, 2022
78ecca0
Fix the reload warning being the wrong way around
robintown May 3, 2022
a5476ab
Fix lints
robintown May 3, 2022
0a71a80
Merge branch 'develop' into video-rooms-beta
robintown May 4, 2022
d294866
Make widgets in video rooms mutable again to de-risk future upgrades
robintown May 4, 2022
9e914c1
Ensure that the video channel exists when mounting VideoRoomView
robintown May 4, 2022
4dc7c06
Fix lint
robintown May 4, 2022
2190ffd
Iterate beta reload warning
robintown May 4, 2022
315ed63
Merge branch 'develop' into video-rooms-beta
robintown May 4, 2022
6dc1afd
Merge branch 'develop' into video-rooms-beta
robintown May 6, 2022
ca262d0
Merge branch 'develop' into video-rooms-beta
robintown May 6, 2022
5fcbf71
Merge branch 'develop' into video-rooms-beta
robintown Jun 9, 2022
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
17 changes: 11 additions & 6 deletions res/css/views/beta/_BetaCard.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ limitations under the License.
background-color: $system;
border-radius: 8px;
box-sizing: border-box;
color: $secondary-content;

.mx_BetaCard_columns {
display: flex;
Expand All @@ -45,14 +46,13 @@ limitations under the License.
.mx_BetaCard_caption {
font-size: $font-15px;
line-height: $font-20px;
color: $secondary-content;
}

.mx_BetaCard_buttons {
display: flex;
flex-wrap: wrap-reverse;
gap: 12px;
margin: 20px auto;
gap: $spacing-12;
margin: $spacing-20 auto 0;

.mx_AccessibleButton {
padding: 7px 40px;
Expand All @@ -66,10 +66,16 @@ limitations under the License.
}
}

.mx_BetaCard_disclaimer {
.mx_BetaCard_refreshWarning {
margin-top: $spacing-8;
font-size: $font-10px;
text-align: center;
}

.mx_BetaCard_faq {
margin-top: $spacing-20;
font-size: $font-12px;
line-height: $font-15px;
color: $secondary-content;

> h4 {
margin: 12px 0 0;
Expand Down Expand Up @@ -105,7 +111,6 @@ limitations under the License.
margin-top: 4px;
font-size: $font-12px;
line-height: $font-15px;
color: $secondary-content;
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions res/css/views/rooms/_RoomHeader.scss
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ limitations under the License.
.mx_InviteOnlyIcon_large {
margin: 0;
}

.mx_BetaCard_betaPill {
margin-right: $spacing-8;
}
}

.mx_RoomHeader_spinner {
Expand Down
7 changes: 7 additions & 0 deletions res/css/views/rooms/_RoomPreviewCard.scss
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,13 @@ limitations under the License.
mask-image: url('$(res)/img/element-icons/call/video-call.svg');
}
}

// XXX Remove this when video rooms leave beta
.mx_BetaCard_betaPill {
position: absolute;
right: $spacing-24;
top: $spacing-32;
}
}

h1.mx_RoomPreviewCard_name {
Expand Down
Binary file added res/img/betas/video_rooms.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 18 additions & 14 deletions src/components/structures/SpaceRoomView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ const SpaceLandingAddButton = ({ space }) => {
{ canCreateRoom && <>
<IconizedContextMenuOption
label={_t("New room")}
iconClassName="mx_RoomList_iconPlus"
iconClassName="mx_RoomList_iconNewRoom"
onClick={async (e) => {
e.preventDefault();
e.stopPropagation();
Expand All @@ -135,19 +135,23 @@ const SpaceLandingAddButton = ({ space }) => {
}
}}
/>
{ videoRoomsEnabled && <IconizedContextMenuOption
label={_t("New video room")}
iconClassName="mx_RoomList_iconNewVideoRoom"
onClick={async (e) => {
e.preventDefault();
e.stopPropagation();
closeMenu();

if (await showCreateNewRoom(space, RoomType.ElementVideo)) {
defaultDispatcher.fire(Action.UpdateSpaceHierarchy);
}
}}
/> }
{ videoRoomsEnabled && (
<IconizedContextMenuOption
label={_t("New video room")}
iconClassName="mx_RoomList_iconNewVideoRoom"
onClick={async (e) => {
e.preventDefault();
e.stopPropagation();
closeMenu();

if (await showCreateNewRoom(space, RoomType.ElementVideo)) {
defaultDispatcher.fire(Action.UpdateSpaceHierarchy);
}
}}
>
<BetaPill />
</IconizedContextMenuOption>
) }
</> }
<IconizedContextMenuOption
label={_t("Add existing room")}
Expand Down
17 changes: 14 additions & 3 deletions src/components/views/beta/BetaCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const BetaCard = ({ title: titleOverride, featureId }: IProps) => {
const {
title,
caption,
disclaimer,
faq,
image,
feedbackLabel,
feedbackSubheading,
Expand All @@ -99,6 +99,14 @@ const BetaCard = ({ title: titleOverride, featureId }: IProps) => {
</AccessibleButton>;
}

let refreshWarning: string;
if (requiresRefresh) {
robintown marked this conversation as resolved.
Show resolved Hide resolved
const brand = SdkConfig.get().brand;
refreshWarning = value
? _t("Leaving the beta will reload %(brand)s.", { brand })
: _t("Joining the beta will reload %(brand)s.", { brand });
}

let content: ReactNode;
if (busy) {
content = <InlineSpinner />;
Expand Down Expand Up @@ -137,8 +145,11 @@ const BetaCard = ({ title: titleOverride, featureId }: IProps) => {
{ content }
</AccessibleButton>
</div>
{ disclaimer && <div className="mx_BetaCard_disclaimer">
{ disclaimer(value) }
{ refreshWarning && <div className="mx_BetaCard_refreshWarning">
{ refreshWarning }
</div> }
{ faq && <div className="mx_BetaCard_faq">
{ faq(value) }
</div> }
</div>
<div className="mx_BetaCard_columns_image_wrapper">
Expand Down
4 changes: 3 additions & 1 deletion src/components/views/context_menus/SpaceContextMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,9 @@ const SpaceContextMenu = ({ space, hideHeader, onFinished, ...props }: IProps) =
iconClassName="mx_SpacePanel_iconPlus"
label={_t("Video room")}
onClick={onNewVideoRoomClick}
/>
>
<BetaPill />
</IconizedContextMenuOption>
}
{ canAddSubSpaces &&
<IconizedContextMenuOption
Expand Down
14 changes: 14 additions & 0 deletions src/components/views/rooms/RoomHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ import { CallType } from "matrix-js-sdk/src/webrtc/call";

import { _t } from '../../../languageHandler';
import { MatrixClientPeg } from '../../../MatrixClientPeg';
import defaultDispatcher from "../../../dispatcher/dispatcher";
import { Action } from "../../../dispatcher/actions";
import { UserTab } from "../dialogs/UserTab";
import SettingsStore from "../../../settings/SettingsStore";
import RoomHeaderButtons from '../right_panel/RoomHeaderButtons';
import E2EIcon from './E2EIcon';
Expand All @@ -41,6 +44,7 @@ import { RightPanelPhases } from '../../../stores/right-panel/RightPanelStorePha
import { NotificationStateEvents } from '../../../stores/notifications/NotificationState';
import RoomContext from "../../../contexts/RoomContext";
import RoomLiveShareWarning from '../beacon/RoomLiveShareWarning';
import { BetaPill } from "../beta/BetaCard";

export interface ISearchInfo {
searchTerm: string;
Expand Down Expand Up @@ -272,6 +276,15 @@ export default class RoomHeader extends React.Component<IProps, IState> {

const e2eIcon = this.props.e2eStatus ? <E2EIcon status={this.props.e2eStatus} /> : undefined;

const isVideoRoom = SettingsStore.getValue("feature_video_rooms") && this.props.room.isElementVideoRoom();
const viewLabs = () => defaultDispatcher.dispatch({
action: Action.ViewUserSettings,
initialTabId: UserTab.Labs,
});
const betaPill = isVideoRoom ? (
<BetaPill onClick={viewLabs} tooltipTitle={_t("Video rooms are a beta feature")} />
) : null;

return (
<div className="mx_RoomHeader light-panel">
<div className="mx_RoomHeader_wrapper" aria-owns="mx_RightPanel">
Expand All @@ -280,6 +293,7 @@ export default class RoomHeader extends React.Component<IProps, IState> {
{ name }
{ searchStatus }
{ topicElement }
{ betaPill }
{ rightRow }
<RoomHeaderButtons room={this.props.room} excludedRightPanelPhaseButtons={this.props.excludedRightPanelPhaseButtons} />
</div>
Expand Down
61 changes: 35 additions & 26 deletions src/components/views/rooms/RoomList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import IconizedContextMenu, {
IconizedContextMenuOptionList,
} from "../context_menus/IconizedContextMenu";
import AccessibleButton, { ButtonEvent } from "../elements/AccessibleButton";
import { BetaPill } from "../beta/BetaCard";
import SpaceStore from "../../../stores/spaces/SpaceStore";
import {
isMetaSpace,
Expand Down Expand Up @@ -238,19 +239,23 @@ const UntaggedAuxButton = ({ tabIndex }: IAuxButtonProps) => {
tooltip={canAddRooms ? undefined
: _t("You do not have permissions to create new rooms in this space")}
/>
{ SettingsStore.getValue("feature_video_rooms") && <IconizedContextMenuOption
label={_t("New video room")}
iconClassName="mx_RoomList_iconNewVideoRoom"
onClick={(e) => {
e.preventDefault();
e.stopPropagation();
closeMenu();
showCreateNewRoom(activeSpace, RoomType.ElementVideo);
}}
disabled={!canAddRooms}
tooltip={canAddRooms ? undefined
: _t("You do not have permissions to create new rooms in this space")}
/> }
{ SettingsStore.getValue("feature_video_rooms") && (
<IconizedContextMenuOption
label={_t("New video room")}
iconClassName="mx_RoomList_iconNewVideoRoom"
onClick={(e) => {
e.preventDefault();
e.stopPropagation();
closeMenu();
showCreateNewRoom(activeSpace, RoomType.ElementVideo);
}}
disabled={!canAddRooms}
tooltip={canAddRooms ? undefined
: _t("You do not have permissions to create new rooms in this space")}
>
<BetaPill />
</IconizedContextMenuOption>
) }
<IconizedContextMenuOption
label={_t("Add existing room")}
iconClassName="mx_RoomList_iconAddExistingRoom"
Expand Down Expand Up @@ -282,19 +287,23 @@ const UntaggedAuxButton = ({ tabIndex }: IAuxButtonProps) => {
PosthogTrackers.trackInteraction("WebRoomListRoomsSublistPlusMenuCreateRoomItem", e);
}}
/>
{ SettingsStore.getValue("feature_video_rooms") && <IconizedContextMenuOption
label={_t("New video room")}
iconClassName="mx_RoomList_iconNewVideoRoom"
onClick={(e) => {
e.preventDefault();
e.stopPropagation();
closeMenu();
defaultDispatcher.dispatch({
action: "view_create_room",
type: RoomType.ElementVideo,
});
}}
/> }
{ SettingsStore.getValue("feature_video_rooms") && (
<IconizedContextMenuOption
label={_t("New video room")}
iconClassName="mx_RoomList_iconNewVideoRoom"
onClick={(e) => {
e.preventDefault();
e.stopPropagation();
closeMenu();
defaultDispatcher.dispatch({
action: "view_create_room",
type: RoomType.ElementVideo,
});
}}
>
<BetaPill />
</IconizedContextMenuOption>
) }
</> }
<IconizedContextMenuOption
label={_t("Explore public rooms")}
Expand Down
54 changes: 31 additions & 23 deletions src/components/views/rooms/RoomListHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -220,16 +220,20 @@ const RoomListHeader = ({ onVisibilityChange }: IProps) => {
closePlusMenu();
}}
/>
{ videoRoomsEnabled && <IconizedContextMenuOption
iconClassName="mx_RoomListHeader_iconNewVideoRoom"
label={_t("New video room")}
onClick={(e) => {
e.preventDefault();
e.stopPropagation();
showCreateNewRoom(activeSpace, RoomType.ElementVideo);
closePlusMenu();
}}
/> }
{ videoRoomsEnabled && (
<IconizedContextMenuOption
iconClassName="mx_RoomListHeader_iconNewVideoRoom"
label={_t("New video room")}
onClick={(e) => {
e.preventDefault();
e.stopPropagation();
showCreateNewRoom(activeSpace, RoomType.ElementVideo);
closePlusMenu();
}}
>
<BetaPill />
</IconizedContextMenuOption>
) }
</>;
}

Expand Down Expand Up @@ -312,19 +316,23 @@ const RoomListHeader = ({ onVisibilityChange }: IProps) => {
closePlusMenu();
}}
/>
{ videoRoomsEnabled && <IconizedContextMenuOption
label={_t("New video room")}
iconClassName="mx_RoomListHeader_iconNewVideoRoom"
onClick={(e) => {
e.preventDefault();
e.stopPropagation();
defaultDispatcher.dispatch({
action: "view_create_room",
type: RoomType.ElementVideo,
});
closePlusMenu();
}}
/> }
{ videoRoomsEnabled && (
<IconizedContextMenuOption
label={_t("New video room")}
iconClassName="mx_RoomListHeader_iconNewVideoRoom"
onClick={(e) => {
e.preventDefault();
e.stopPropagation();
defaultDispatcher.dispatch({
action: "view_create_room",
type: RoomType.ElementVideo,
});
closePlusMenu();
}}
>
<BetaPill />
</IconizedContextMenuOption>
) }
</>;
}
if (canExploreRooms) {
Expand Down
2 changes: 2 additions & 0 deletions src/components/views/rooms/RoomPreviewCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import RoomTopic from "../elements/RoomTopic";
import RoomFacePile from "../elements/RoomFacePile";
import RoomAvatar from "../avatars/RoomAvatar";
import MemberAvatar from "../avatars/MemberAvatar";
import { BetaPill } from "../beta/BetaCard";
import RoomInfoLine from "./RoomInfoLine";

interface IProps {
Expand Down Expand Up @@ -151,6 +152,7 @@ const RoomPreviewCard: FC<IProps> = ({ room, onJoinButtonClicked, onRejectButton
avatarRow = <>
<RoomAvatar room={room} height={50} width={50} viewAvatarOnClick />
<div className="mx_RoomPreviewCard_video" />
<BetaPill onClick={viewLabs} tooltipTitle={_t("Video rooms are a beta feature")} />
</>;
} else if (room.isSpaceRoom()) {
avatarRow = <RoomAvatar room={room} height={80} width={80} viewAvatarOnClick />;
Expand Down
Loading