From bf94a5dcaf18f7d7fc6601fcc917b303c04ec2d6 Mon Sep 17 00:00:00 2001 From: Robin Townsend Date: Mon, 24 Oct 2022 10:17:12 -0400 Subject: [PATCH 1/4] Make more of the lobby translateable --- public/locales/en-GB/app.json | 2 +- src/room/LobbyView.tsx | 40 ++++++++++++++++++----------------- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/public/locales/en-GB/app.json b/public/locales/en-GB/app.json index 44e3c2fc..2b1facc8 100644 --- a/public/locales/en-GB/app.json +++ b/public/locales/en-GB/app.json @@ -8,6 +8,7 @@ "{{roomName}} - Walkie-talkie call": "{{roomName}} - Walkie-talkie call", "<0>Already have an account?<1><0>Log in Or <2>Access as a guest": "<0>Already have an account?<1><0>Log in Or <2>Access as a guest", "<0>Create an account Or <2>Access as a guest": "<0>Create an account Or <2>Access as a guest", + "<0>Join call now<1>Or<2>Copy call link and join later": "<0>Join call now<1>Or<2>Copy call link and join later", "<0>Oops, something's gone wrong.<1>Submitting debug logs will help us track down the problem.": "<0>Oops, something's gone wrong.<1>Submitting debug logs will help us track down the problem.", "<0>Why not finish by setting up a password to keep your account?<1>You'll be able to keep your name and set an avatar for use on future calls": "<0>Why not finish by setting up a password to keep your account?<1>You'll be able to keep your name and set an avatar for use on future calls", "Accept camera/microphone permissions to join the call.": "Accept camera/microphone permissions to join the call.", @@ -28,7 +29,6 @@ "Connection lost": "Connection lost", "Copied!": "Copied!", "Copy and share this call link": "Copy and share this call link", - "Copy call link and join later": "Copy call link and join later", "Create account": "Create account", "Debug log": "Debug log", "Debug log request": "Debug log request", diff --git a/src/room/LobbyView.tsx b/src/room/LobbyView.tsx index b246d0c0..aae3f243 100644 --- a/src/room/LobbyView.tsx +++ b/src/room/LobbyView.tsx @@ -19,7 +19,7 @@ import { GroupCall, GroupCallState } from "matrix-js-sdk/src/webrtc/groupCall"; import { MatrixClient } from "matrix-js-sdk/src/client"; import { PressEvent } from "@react-types/shared"; import { CallFeed } from "matrix-js-sdk/src/webrtc/callFeed"; -import { useTranslation } from "react-i18next"; +import { Trans, useTranslation } from "react-i18next"; import styles from "./LobbyView.module.css"; import { Button, CopyButton } from "../button"; @@ -130,24 +130,26 @@ export function LobbyView({ audioOutput={audioOutput} /> )} - - Or - - {t("Copy call link and join later")} - + + + Or + + Copy call link and join later + + {!isEmbedded && ( From 7ad84de9c2b279746f1fe63a0b76eb346ac09ab8 Mon Sep 17 00:00:00 2001 From: Robin Townsend Date: Mon, 24 Oct 2022 10:22:51 -0400 Subject: [PATCH 2/4] Re-enable focusing tiles in 1:1 calls --- src/video-grid/VideoGrid.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/video-grid/VideoGrid.tsx b/src/video-grid/VideoGrid.tsx index d9b2123b..e92df59d 100644 --- a/src/video-grid/VideoGrid.tsx +++ b/src/video-grid/VideoGrid.tsx @@ -120,7 +120,7 @@ function getTilePositions( layout: Layout ): TilePosition[] { if (layout === "freedom") { - if (tileCount === 2 && !hasPresenter) { + if (tileCount === 2 && !hasPresenter && focusedTileCount === 0) { return getOneOnOneLayoutTilePositions( gridWidth, gridHeight, @@ -657,7 +657,7 @@ function reorderTiles(tiles: Tile[], layout: Layout) { if ( layout === "freedom" && tiles.length === 2 && - !tiles.some((t) => t.presenter) + !tiles.some((t) => t.presenter || t.focused) ) { // 1:1 layout tiles.forEach((tile) => (tile.order = tile.item.isLocal ? 0 : 1)); @@ -999,7 +999,7 @@ export function VideoGrid({ let newTiles = tiles; - if (tiles.length === 2 && !tiles.some((t) => t.presenter)) { + if (tiles.length === 2 && !tiles.some((t) => t.presenter || t.focused)) { // We're in 1:1 mode, so only the local tile should be draggable if (!dragTile.item.isLocal) return; From fbf7b5d0226750733c0035b07a766b7c1dff81ef Mon Sep 17 00:00:00 2001 From: Robin Townsend Date: Mon, 24 Oct 2022 10:53:55 -0400 Subject: [PATCH 3/4] Add i18n CI --- .github/workflows/lint.yaml | 2 ++ package.json | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 60e67039..22411656 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -16,6 +16,8 @@ jobs: run: "yarn install" - name: Prettier run: "yarn run prettier:check" + - name: i18n + run: "yarn run i18n:check" - name: ESLint run: "yarn run lint:js" - name: Type check diff --git a/package.json b/package.json index 00c79bba..ba298dd3 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,8 @@ "lint": "yarn lint:types && yarn lint:js", "lint:js": "eslint --max-warnings 0 src", "lint:types": "tsc", - "i18n": "node_modules/i18next-parser/bin/cli.js" + "i18n": "node_modules/i18next-parser/bin/cli.js", + "i18n:check": "node_modules/i18next-parser/bin/cli.js --fail-on-warnings --fail-on-update" }, "dependencies": { "@juggle/resize-observer": "^3.3.1", From efe9e6c2b306153944dacec08d940d91552699f3 Mon Sep 17 00:00:00 2001 From: Robin Townsend Date: Mon, 24 Oct 2022 13:17:29 -0400 Subject: [PATCH 4/4] Fix avatars of remote participants in matryoshka mode RoomWidgetClient doesn't do lazy loading, so it only has the state event data to work with and not the lazy loaded user object. Previously avatars of remote participants were all replaced by fallback avatars. --- src/Facepile.tsx | 4 ++-- src/room/InCallView.tsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Facepile.tsx b/src/Facepile.tsx index c3f5b290..86c5c6f5 100644 --- a/src/Facepile.tsx +++ b/src/Facepile.tsx @@ -72,12 +72,12 @@ export function Facepile({ {...rest} > {participants.slice(0, max).map((member, i) => { - const avatarUrl = member.user?.avatarUrl; + const avatarUrl = member.getMxcAvatarUrl(); return ( { - const avatarUrl = roomMember.user?.avatarUrl; + const avatarUrl = roomMember.getMxcAvatarUrl(); const size = Math.round(Math.min(width, height) / 2); return (