From 96d5e9731872b9cc75defe988d8c23c6017802e2 Mon Sep 17 00:00:00 2001 From: ayumi-signal <143036029+ayumi-signal@users.noreply.github.com> Date: Mon, 11 Dec 2023 07:10:31 -0800 Subject: [PATCH] Click grid raised hand participant to open queue --- stylesheets/_modules.scss | 6 ++ ts/components/CallScreen.tsx | 61 ++++++++++++------- ts/components/GroupCallOverflowArea.tsx | 3 + ts/components/GroupCallRemoteParticipant.tsx | 41 ++++++++++--- ts/components/GroupCallRemoteParticipants.tsx | 4 ++ 5 files changed, 82 insertions(+), 33 deletions(-) diff --git a/stylesheets/_modules.scss b/stylesheets/_modules.scss index 77f2f2932e3b..7bb440a1d08b 100644 --- a/stylesheets/_modules.scss +++ b/stylesheets/_modules.scss @@ -3969,6 +3969,7 @@ button.module-image__border-overlay:focus { transition-duration: 300ms; transition-delay: 1000ms; transition-timing-function: ease-in-out; + pointer-events: none; } &--speaking:after { border-width: 3px; @@ -4038,8 +4039,13 @@ button.module-image__border-overlay:focus { overflow: hidden; text-overflow: ellipsis; visibility: hidden; + direction: inherit; white-space: nowrap; } + + &--clickable { + @include button-reset; + } } &--hand-raised &__footer { diff --git a/ts/components/CallScreen.tsx b/ts/components/CallScreen.tsx index 4cc91073bd7e..b4f7d1eafece 100644 --- a/ts/components/CallScreen.tsx +++ b/ts/components/CallScreen.tsx @@ -335,7 +335,6 @@ export function CallScreen({ let hasCallStarted: boolean; let isConnected: boolean; let participantCount: number; - let remoteParticipantsElement: ReactNode; let conversationsByDemuxId: ConversationsByDemuxIdType; let localDemuxId: number | undefined; @@ -348,17 +347,6 @@ export function CallScreen({ isConnected = activeCall.callState === CallState.Accepted; participantCount = isConnected ? 2 : 0; conversationsByDemuxId = new Map(); - remoteParticipantsElement = hasCallStarted ? ( - - ) : ( -
- ); break; } case CallMode.Group: @@ -373,17 +361,6 @@ export function CallScreen({ isConnected = activeCall.connectionState === GroupCallConnectionState.Connected; - remoteParticipantsElement = ( - - ); break; default: throw missingCaseError(activeCall); @@ -627,6 +604,44 @@ export function CallScreen({ toggleParticipants, ]); + let remoteParticipantsElement: ReactNode; + switch (activeCall.callMode) { + case CallMode.Direct: { + remoteParticipantsElement = hasCallStarted ? ( + + ) : ( +
+ ); + break; + } + case CallMode.Group: + remoteParticipantsElement = ( + 0 + ? () => setShowRaisedHandsList(true) + : undefined + } + /> + ); + break; + default: + throw missingCaseError(activeCall); + } + return (
VideoFrameSource; i18n: LocalizerType; isCallReconnecting: boolean; + onClickRaisedHand?: () => void; onParticipantVisibilityChanged: ( demuxId: number, isVisible: boolean @@ -34,6 +35,7 @@ export function GroupCallOverflowArea({ getGroupCallVideoFrameSource, i18n, isCallReconnecting, + onClickRaisedHand, onParticipantVisibilityChanged, overflowedParticipants, remoteAudioLevels, @@ -121,6 +123,7 @@ export function GroupCallOverflowArea({ getGroupCallVideoFrameSource={getGroupCallVideoFrameSource} i18n={i18n} audioLevel={remoteAudioLevels.get(remoteParticipant.demuxId) ?? 0} + onClickRaisedHand={onClickRaisedHand} onVisibilityChanged={onParticipantVisibilityChanged} width={OVERFLOW_PARTICIPANT_WIDTH} height={Math.floor( diff --git a/ts/components/GroupCallRemoteParticipant.tsx b/ts/components/GroupCallRemoteParticipant.tsx index 6fc8e5520b76..9a1ef614e3ef 100644 --- a/ts/components/GroupCallRemoteParticipant.tsx +++ b/ts/components/GroupCallRemoteParticipant.tsx @@ -1,7 +1,7 @@ // Copyright 2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only -import type { CSSProperties } from 'react'; +import type { CSSProperties, ReactNode } from 'react'; import React, { useState, useRef, @@ -37,6 +37,7 @@ type BasePropsType = { i18n: LocalizerType; isActiveSpeakerInSpeakerView: boolean; isCallReconnecting: boolean; + onClickRaisedHand?: () => void; onVisibilityChanged?: (demuxId: number, isVisible: boolean) => unknown; remoteParticipant: GroupCallRemoteParticipantType; remoteParticipantsCount: number; @@ -67,6 +68,7 @@ export const GroupCallRemoteParticipant: React.FC = React.memo( getFrameBuffer, getGroupCallVideoFrameSource, i18n, + onClickRaisedHand, onVisibilityChanged, remoteParticipantsCount, isActiveSpeakerInSpeakerView, @@ -238,6 +240,7 @@ export const GroupCallRemoteParticipant: React.FC = React.memo( } let avatarSize: number; + let footerInfoElement: ReactNode; if (props.isInPip) { containerStyles = canvasStyles; @@ -262,6 +265,32 @@ export const GroupCallRemoteParticipant: React.FC = React.memo( containerStyles.insetInlineStart = `${props.left}px`; containerStyles.top = `${props.top}px`; } + + const nameElement = ( + + ); + + if (isHandRaised) { + footerInfoElement = ( + + ); + } else { + footerInfoElement = ( +
+ {nameElement} +
+ ); + } } return ( @@ -311,15 +340,7 @@ export const GroupCallRemoteParticipant: React.FC = React.memo( shouldShowSpeaking={isSpeaking} />
-
- {isHandRaised && ( -
- )} - -
+ {footerInfoElement}
)} diff --git a/ts/components/GroupCallRemoteParticipants.tsx b/ts/components/GroupCallRemoteParticipants.tsx index 70a00d04b444..22d07ba93057 100644 --- a/ts/components/GroupCallRemoteParticipants.tsx +++ b/ts/components/GroupCallRemoteParticipants.tsx @@ -67,6 +67,7 @@ type PropsType = { speakerHeight: number ) => void; remoteAudioLevels: Map; + onClickRaisedHand?: () => void; }; enum VideoRequestMode { @@ -114,6 +115,7 @@ export function GroupCallRemoteParticipants({ remoteParticipants, setGroupCallVideoRequest, remoteAudioLevels, + onClickRaisedHand, }: PropsType): JSX.Element { const [gridDimensions, setGridDimensions] = useState({ width: 0, @@ -342,6 +344,7 @@ export function GroupCallRemoteParticipants({ key={tile.demuxId} getFrameBuffer={getFrameBuffer} getGroupCallVideoFrameSource={getGroupCallVideoFrameSource} + onClickRaisedHand={onClickRaisedHand} height={gridParticipantHeight} i18n={i18n} audioLevel={remoteAudioLevels.get(tile.demuxId) ?? 0} @@ -509,6 +512,7 @@ export function GroupCallRemoteParticipants({ getGroupCallVideoFrameSource={getGroupCallVideoFrameSource} i18n={i18n} isCallReconnecting={isCallReconnecting} + onClickRaisedHand={onClickRaisedHand} onParticipantVisibilityChanged={onParticipantVisibilityChanged} overflowedParticipants={overflowedParticipants} remoteAudioLevels={remoteAudioLevels}