diff --git a/locales/en/app.json b/locales/en/app.json index 2b9eae5a..55394718 100644 --- a/locales/en/app.json +++ b/locales/en/app.json @@ -73,6 +73,7 @@ "livekit_sfu": "LiveKit SFU: {{url}}", "matrix_id": "Matrix ID: {{id}}", "matrixRTCMode": { + "title": "MatrixRTC mode", "Comptibility": { "description": "Compatible with homeservers that do not support sticky events (but all other EC clients are v0.17.0 or later)", "label": "Compatibility: state events & multi SFU" diff --git a/src/settings/DeveloperSettingsTab.tsx b/src/settings/DeveloperSettingsTab.tsx index a8f485b6..60d9028d 100644 --- a/src/settings/DeveloperSettingsTab.tsx +++ b/src/settings/DeveloperSettingsTab.tsx @@ -12,6 +12,7 @@ import { useEffect, useMemo, useState, + useId, } from "react"; import { useTranslation } from "react-i18next"; import { @@ -19,6 +20,14 @@ import { type MatrixClient, } from "matrix-js-sdk"; import { logger } from "matrix-js-sdk/lib/logger"; +import { + Root as Form, + Heading, + HelpMessage, + InlineField, + Label, + RadioControl, +} from "@vector-im/compound-web"; import { FieldRow, InputField } from "../input/Input"; import { @@ -60,6 +69,13 @@ export const DeveloperSettingsTab: FC = ({ client, livekitRooms }) => { }, [client]); const [matrixRTCMode, setMatrixRTCMode] = useSetting(matrixRTCModeSetting); + const matrixRTCModeRadioGroup = useId(); + const onMatrixRTCModeChange = useCallback( + (e: ChangeEvent) => { + setMatrixRTCMode(e.target.value as MatrixRTCMode); + }, + [setMatrixRTCMode], + ); const [showConnectionStats, setShowConnectionStats] = useSetting( showConnectionStatsSetting, @@ -85,7 +101,7 @@ export const DeveloperSettingsTab: FC = ({ client, livekitRooms }) => { }, [livekitRooms]); return ( - <> +

{t("developer_mode.hostname", { hostname: window.location.hostname || "unknown", @@ -142,52 +158,6 @@ export const DeveloperSettingsTab: FC = ({ client, livekitRooms }) => { } /> - - ) => { - if (event.target.checked) setMatrixRTCMode(MatrixRTCMode.Legacy); - }, - [setMatrixRTCMode], - )} - /> - ) => { - if (event.target.checked) - setMatrixRTCMode(MatrixRTCMode.Compatibil); - }, - [setMatrixRTCMode], - )} - /> - ) => { - if (event.target.checked) - setMatrixRTCMode(MatrixRTCMode.Matrix_2_0); - }, - [setMatrixRTCMode], - )} - /> - = ({ client, livekitRooms }) => { )} />{" "} + + {t("developer_mode.matrixRTCMode.title")} + + + } + > + + + {t("developer_mode.matrixRTCMode.Legacy.description")} + + + + } + > + + + {t("developer_mode.matrixRTCMode.Comptibility.description")} + + + + } + > + + + {t("developer_mode.matrixRTCMode.Matrix_2_0.description")} + + {livekitRooms?.map((livekitRoom) => ( <>

@@ -254,6 +273,6 @@ export const DeveloperSettingsTab: FC = ({ client, livekitRooms }) => {
{JSON.stringify(import.meta.env, null, 2)}

{t("developer_mode.url_params")}

{JSON.stringify(urlParams, null, 2)}
- + ); };