Merge pull request #1123 from robintown/connection-indicators

Hide connection quality indicators behind a developer setting
This commit is contained in:
Robin 2023-06-16 12:56:36 -04:00 committed by GitHub
commit 4fd1264d12
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 31 additions and 2 deletions

View file

@ -86,6 +86,7 @@
"Settings": "Settings", "Settings": "Settings",
"Share screen": "Share screen", "Share screen": "Share screen",
"Show call inspector": "Show call inspector", "Show call inspector": "Show call inspector",
"Show connection stats": "Show connection stats",
"Sign in": "Sign in", "Sign in": "Sign in",
"Sign out": "Sign out", "Sign out": "Sign out",
"Speaker": "Speaker", "Speaker": "Speaker",

View file

@ -53,7 +53,10 @@ import {
useVideoGridLayout, useVideoGridLayout,
TileDescriptor, TileDescriptor,
} from "../video-grid/VideoGrid"; } from "../video-grid/VideoGrid";
import { useShowInspector } from "../settings/useSetting"; import {
useShowInspector,
useShowConnectionStats,
} from "../settings/useSetting";
import { useModalTriggerState } from "../Modal"; import { useModalTriggerState } from "../Modal";
import { PosthogAnalytics } from "../analytics/PosthogAnalytics"; import { PosthogAnalytics } from "../analytics/PosthogAnalytics";
import { useUrlParams } from "../UrlParams"; import { useUrlParams } from "../UrlParams";
@ -152,6 +155,7 @@ export function InCallView({
); );
const [showInspector] = useShowInspector(); const [showInspector] = useShowInspector();
const [showConnectionStats] = useShowConnectionStats();
const { hideScreensharing } = useUrlParams(); const { hideScreensharing } = useUrlParams();
@ -255,6 +259,7 @@ export function InCallView({
key={maximisedParticipant.id} key={maximisedParticipant.id}
data={maximisedParticipant.data} data={maximisedParticipant.data}
showSpeakingIndicator={false} showSpeakingIndicator={false}
showConnectionStats={showConnectionStats}
/> />
); );
} }
@ -268,6 +273,7 @@ export function InCallView({
{(props) => ( {(props) => (
<VideoTile <VideoTile
showSpeakingIndicator={items.length > 2} showSpeakingIndicator={items.length > 2}
showConnectionStats={showConnectionStats}
{...props} {...props}
ref={props.ref as Ref<HTMLDivElement>} ref={props.ref as Ref<HTMLDivElement>}
/> />

View file

@ -33,6 +33,7 @@ import {
useShowInspector, useShowInspector,
useOptInAnalytics, useOptInAnalytics,
useDeveloperSettingsTab, useDeveloperSettingsTab,
useShowConnectionStats,
} from "./useSetting"; } from "./useSetting";
import { FieldRow, InputField } from "../input/Input"; import { FieldRow, InputField } from "../input/Input";
import { Button } from "../button"; import { Button } from "../button";
@ -59,6 +60,8 @@ export const SettingsModal = (props: Props) => {
const [optInAnalytics, setOptInAnalytics] = useOptInAnalytics(); const [optInAnalytics, setOptInAnalytics] = useOptInAnalytics();
const [developerSettingsTab, setDeveloperSettingsTab] = const [developerSettingsTab, setDeveloperSettingsTab] =
useDeveloperSettingsTab(); useDeveloperSettingsTab();
const [showConnectionStats, setShowConnectionStats] =
useShowConnectionStats();
const downloadDebugLog = useDownloadDebugLog(); const downloadDebugLog = useDownloadDebugLog();
@ -232,6 +235,18 @@ export const SettingsModal = (props: Props) => {
} }
/> />
</FieldRow> </FieldRow>
<FieldRow>
<InputField
id="showConnectionStats"
name="connection-stats"
label={t("Show connection stats")}
type="checkbox"
checked={showConnectionStats}
onChange={(e: React.ChangeEvent<HTMLInputElement>) =>
setShowConnectionStats(e.target.checked)
}
/>
</FieldRow>
<FieldRow> <FieldRow>
<Button onPress={downloadDebugLog}> <Button onPress={downloadDebugLog}>
{t("Download debug logs")} {t("Download debug logs")}

View file

@ -101,6 +101,9 @@ export const useOptInAnalytics = (): DisableableSetting<boolean | null> => {
export const useDeveloperSettingsTab = () => export const useDeveloperSettingsTab = () =>
useSetting("developer-settings-tab", false); useSetting("developer-settings-tab", false);
export const useShowConnectionStats = () =>
useSetting("show-connection-stats", false);
export const useDefaultDevices = () => export const useDefaultDevices = () =>
useSetting("defaultDevices", { useSetting("defaultDevices", {
audioinput: "", audioinput: "",

View file

@ -54,6 +54,7 @@ interface Props {
className?: string; className?: string;
style?: React.ComponentProps<typeof animated.div>["style"]; style?: React.ComponentProps<typeof animated.div>["style"];
showSpeakingIndicator: boolean; showSpeakingIndicator: boolean;
showConnectionStats: boolean;
} }
export const VideoTile = React.forwardRef<HTMLDivElement, Props>( export const VideoTile = React.forwardRef<HTMLDivElement, Props>(
@ -65,6 +66,7 @@ export const VideoTile = React.forwardRef<HTMLDivElement, Props>(
targetWidth, targetWidth,
targetHeight, targetHeight,
showSpeakingIndicator, showSpeakingIndicator,
showConnectionStats,
}, },
tileRef tileRef
) => { ) => {
@ -138,7 +140,9 @@ export const VideoTile = React.forwardRef<HTMLDivElement, Props>(
<div className={classNames(styles.infoBubble, styles.memberName)}> <div className={classNames(styles.infoBubble, styles.memberName)}>
{microphoneMuted ? <MicMutedIcon /> : <MicIcon />} {microphoneMuted ? <MicMutedIcon /> : <MicIcon />}
<span title={displayName}>{displayName}</span> <span title={displayName}>{displayName}</span>
<ConnectionQualityIndicator participant={sfuParticipant} /> {showConnectionStats && (
<ConnectionQualityIndicator participant={sfuParticipant} />
)}
</div> </div>
)} )}
<VideoTrack <VideoTrack