Hide connection quality indicators behind a developer setting

Calls are an environment with high cognitive load, so it's important that we keep extra UI elements like these to a minimum and stick to what's been explicitly designed. I assume that this was here as a developer feature to diagnose reliability of the back end components, which is perfectly fine, so I've kept it behind a developer setting rather than fully removing it.
This commit is contained in:
Robin Townsend 2023-06-16 10:59:57 -04:00
parent 4342f4b027
commit a96d70eefb
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

@ -54,7 +54,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";
@ -189,6 +192,7 @@ export function InCallView({
); );
const [showInspector] = useShowInspector(); const [showInspector] = useShowInspector();
const [showConnectionStats] = useShowConnectionStats();
const { hideScreensharing } = useUrlParams(); const { hideScreensharing } = useUrlParams();
@ -290,6 +294,7 @@ export function InCallView({
key={maximisedParticipant.id} key={maximisedParticipant.id}
data={maximisedParticipant.data} data={maximisedParticipant.data}
showSpeakingIndicator={false} showSpeakingIndicator={false}
showConnectionStats={showConnectionStats}
/> />
); );
} }
@ -303,6 +308,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

@ -34,6 +34,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();
@ -233,6 +236,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>
{showConnectionStats && (
<ConnectionQualityIndicator participant={sfuParticipant} /> <ConnectionQualityIndicator participant={sfuParticipant} />
)}
</div> </div>
)} )}
<VideoTrack <VideoTrack