Add developer mode option to show RTC connection statistics (#2904)

* Add developer mode option to show RTC connection statistics

* Add note about localization

* Add titles to help explain what the numbers are

* Workaround horizontal scrolling

* Use modal to show detailed stats instead of alert

* Changed styling and fixed fps = 0 (#2916)

(React rendered 0 instead of <Text /> for fps && <Text>{fps}</text>)

---------

Co-authored-by: Timo <16718859+toger5@users.noreply.github.com>
This commit is contained in:
Hugh Nimmo-Smith
2025-01-06 09:47:39 +00:00
committed by GitHub
parent f521e260b6
commit 2c33d65824
8 changed files with 287 additions and 28 deletions

View File

@@ -14,6 +14,7 @@ import {
duplicateTiles as duplicateTilesSetting,
debugTileLayout as debugTileLayoutSetting,
showNonMemberTiles as showNonMemberTilesSetting,
showConnectionStats as showConnectionStatsSetting,
} from "./settings";
import type { MatrixClient } from "matrix-js-sdk/src/client";
@@ -31,6 +32,10 @@ export const DeveloperSettingsTab: FC<Props> = ({ client }) => {
showNonMemberTilesSetting,
);
const [showConnectionStats, setShowConnectionStats] = useSetting(
showConnectionStatsSetting,
);
return (
<>
<p>
@@ -103,6 +108,20 @@ export const DeveloperSettingsTab: FC<Props> = ({ client }) => {
)}
/>
</FieldRow>
<FieldRow>
<InputField
id="showConnectionStats"
type="checkbox"
label={t("developer_mode.show_connection_stats")}
checked={!!showConnectionStats}
onChange={useCallback(
(event: ChangeEvent<HTMLInputElement>): void => {
setShowConnectionStats(event.target.checked);
},
[setShowConnectionStats],
)}
/>
</FieldRow>
</>
);
};

View File

@@ -78,6 +78,11 @@ export const showNonMemberTiles = new Setting<boolean>(
);
export const debugTileLayout = new Setting("debug-tile-layout", false);
export const showConnectionStats = new Setting<boolean>(
"show-connection-stats",
false,
);
export const audioInput = new Setting<string | undefined>(
"audio-input",
undefined,