From f4883ac098816c946813c65ba2a6c1a210c73777 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 3 Dec 2024 10:07:31 +0100 Subject: [PATCH 01/16] Update dependency @types/node to v22 (#2695) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 17 +++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index ebaa59ff..2764cf63 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "@types/grecaptcha": "^3.0.9", "@types/jsdom": "^21.1.7", "@types/lodash-es": "^4.17.12", - "@types/node": "^20.0.0", + "@types/node": "^22.0.0", "@types/pako": "^2.0.3", "@types/qrcode": "^1.5.5", "@types/react-dom": "^18.3.0", diff --git a/yarn.lock b/yarn.lock index 5b75ebb0..04aa2706 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3051,12 +3051,12 @@ dependencies: undici-types "~6.19.8" -"@types/node@^20.0.0": - version "20.17.9" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.17.9.tgz#5f141d4b7ee125cdee5faefe28de095398865bab" - integrity sha512-0JOXkRyLanfGPE2QRCwgxhzlBAvaRdCNMcvbd7jFfpmD4eEXll7LRwy5ymJmyeZqk7Nh7eD2LeUyQ68BbndmXw== +"@types/node@^22.0.0": + version "22.10.1" + resolved "https://registry.yarnpkg.com/@types/node/-/node-22.10.1.tgz#41ffeee127b8975a05f8c4f83fb89bcb2987d766" + integrity sha512-qKgsUwfHZV2WCWLAnVP1JqnpE6Im6h3Y0+fYgMTasNQ7V++CBX5OT1as0g0f+OyubbFqhf6XVNIsmN4IIhEgGQ== dependencies: - undici-types "~6.19.2" + undici-types "~6.20.0" "@types/normalize-package-data@^2.4.0": version "2.4.4" @@ -8262,11 +8262,16 @@ underscore.string@~3.3.4: sprintf-js "^1.1.1" util-deprecate "^1.0.2" -undici-types@~6.19.2, undici-types@~6.19.8: +undici-types@~6.19.8: version "6.19.8" resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.19.8.tgz#35111c9d1437ab83a7cdc0abae2f26d88eda0a02" integrity sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw== +undici-types@~6.20.0: + version "6.20.0" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.20.0.tgz#8171bf22c1f588d1554d55bf204bc624af388433" + integrity sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg== + undici@^5.25.4: version "5.28.4" resolved "https://registry.yarnpkg.com/undici/-/undici-5.28.4.tgz#6b280408edb6a1a604a9b20340f45b422e373068" From 97fd1f3696e68a880d3c5ea5092a24f6c5b2f0f6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 3 Dec 2024 10:08:01 +0100 Subject: [PATCH 02/16] Update dependency @vector-im/compound-design-tokens to v2 (#2671) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 12 +++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 2764cf63..71e3f9c9 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "@typescript-eslint/eslint-plugin": "^8.0.0", "@typescript-eslint/parser": "^8.0.0", "@use-gesture/react": "^10.2.11", - "@vector-im/compound-design-tokens": "^1.9.1", + "@vector-im/compound-design-tokens": "^2.0.0", "@vector-im/compound-web": "^7.2.0", "@vitejs/plugin-basic-ssl": "^1.0.1", "@vitejs/plugin-react": "^4.0.1", diff --git a/yarn.lock b/yarn.lock index 04aa2706..e4f81151 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3307,12 +3307,10 @@ dependencies: "@use-gesture/core" "10.3.1" -"@vector-im/compound-design-tokens@^1.9.1": - version "1.9.2" - resolved "https://registry.yarnpkg.com/@vector-im/compound-design-tokens/-/compound-design-tokens-1.9.2.tgz#0b76e5475da3bc36443f7dc87951b937b5013d6f" - integrity sha512-gQmK4dHR2iws3ZskDv8Il6A4/rvQV7TPSmEOXLsahDhBTInWqexXeQnNRSt9Z5DsLPrkxL3/KoCt9lfYu/yiag== - dependencies: - prettier "^3.3.3" +"@vector-im/compound-design-tokens@^2.0.0": + version "2.1.1" + resolved "https://registry.yarnpkg.com/@vector-im/compound-design-tokens/-/compound-design-tokens-2.1.1.tgz#d6175a99fe4b97688464126f255386990f3048d6" + integrity sha512-QnUi2K14D9KTXxcLQKUU3V75cforZLMwhaaJDNftT8F5mG86950hAM+qhgDNEpEU+pkTffQj0/g/5859YmqWzQ== "@vector-im/compound-web@^7.2.0": version "7.4.0" @@ -7007,7 +7005,7 @@ prelude-ls@^1.2.1: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== -prettier@^3.0.0, prettier@^3.3.3: +prettier@^3.0.0: version "3.4.1" resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.4.1.tgz#e211d451d6452db0a291672ca9154bc8c2579f7b" integrity sha512-G+YdqtITVZmOJje6QkXQWzl3fSfMxFwm1tjTyo9exhkmWSqC4Yhd1+lug++IlR2mvRVAxEDDWYkQdeSztajqgg== From cf0bb4676a698dcf92e2120fb883eef204e8ad3c Mon Sep 17 00:00:00 2001 From: fkwp Date: Tue, 3 Dec 2024 16:51:14 +0100 Subject: [PATCH 03/16] add information about MSC4222 state_after --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index a0af77fc..ba845e09 100644 --- a/README.md +++ b/README.md @@ -92,6 +92,9 @@ work: experimental_features: # MSC3266: Room summary API. Used for knocking over federation msc3266_enabled: true + # MSC4422 needed for syncv2 state_after. This allow clients to + # correctly track the state of the room. + msc4222_enabled: true # The maximum allowed duration by which sent events can be delayed, as # per MSC4140. @@ -109,6 +112,10 @@ summary contains the room join rules. We need that to decide if the user gets prompted with the option to knock ("Request to join call"), a cannot join error or the join view. +MSC4422 allow clients to opt-in to a change of the sync v2 API that allows them +to correctly track the state of the room. This is required by Element Call to +track room state reliably. + Element Call requires a Livekit SFU alongside a [Livekit JWT service](https://github.com/element-hq/lk-jwt-service) to work. The url to the Livekit JWT service can either be configured in the config of Element Call From 5e449bd03ffd956bd42c393199b2bcba458a8056 Mon Sep 17 00:00:00 2001 From: fkwp Date: Tue, 3 Dec 2024 16:54:28 +0100 Subject: [PATCH 04/16] typo --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ba845e09..233c4bcd 100644 --- a/README.md +++ b/README.md @@ -92,7 +92,7 @@ work: experimental_features: # MSC3266: Room summary API. Used for knocking over federation msc3266_enabled: true - # MSC4422 needed for syncv2 state_after. This allow clients to + # MSC4222 needed for syncv2 state_after. This allow clients to # correctly track the state of the room. msc4222_enabled: true @@ -112,7 +112,7 @@ summary contains the room join rules. We need that to decide if the user gets prompted with the option to knock ("Request to join call"), a cannot join error or the join view. -MSC4422 allow clients to opt-in to a change of the sync v2 API that allows them +MSC4222 allow clients to opt-in to a change of the sync v2 API that allows them to correctly track the state of the room. This is required by Element Call to track room state reliably. From 44e5d2ea91c8b06aaca0c1f7d81ad977817222e9 Mon Sep 17 00:00:00 2001 From: fkwp Date: Tue, 3 Dec 2024 16:54:37 +0100 Subject: [PATCH 05/16] add MSC4222 --- backend/dev_homeserver.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend/dev_homeserver.yaml b/backend/dev_homeserver.yaml index b41de45b..b1800b59 100644 --- a/backend/dev_homeserver.yaml +++ b/backend/dev_homeserver.yaml @@ -25,6 +25,9 @@ trusted_key_servers: experimental_features: # MSC3266: Room summary API. Used for knocking over federation msc3266_enabled: true + # MSC4222 needed for syncv2 state_after. This allow clients to + # correctly track the state of the room. + msc4222_enabled: true # The maximum allowed duration by which sent events can be delayed, as # per MSC4140. Must be a positive value if set. Defaults to no From 260a1df21ba748bceb7502ea8f8c061395438eec Mon Sep 17 00:00:00 2001 From: fkwp Date: Tue, 3 Dec 2024 16:55:30 +0100 Subject: [PATCH 06/16] linting --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 233c4bcd..25155152 100644 --- a/README.md +++ b/README.md @@ -92,7 +92,7 @@ work: experimental_features: # MSC3266: Room summary API. Used for knocking over federation msc3266_enabled: true - # MSC4222 needed for syncv2 state_after. This allow clients to + # MSC4222 needed for syncv2 state_after. This allow clients to # correctly track the state of the room. msc4222_enabled: true From 3495f5b47269b586d67e019fee615c3681f6bbb3 Mon Sep 17 00:00:00 2001 From: fkwp Date: Tue, 3 Dec 2024 16:57:53 +0100 Subject: [PATCH 07/16] linting --- backend/dev_homeserver.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/dev_homeserver.yaml b/backend/dev_homeserver.yaml index b1800b59..5697c32e 100644 --- a/backend/dev_homeserver.yaml +++ b/backend/dev_homeserver.yaml @@ -25,7 +25,7 @@ trusted_key_servers: experimental_features: # MSC3266: Room summary API. Used for knocking over federation msc3266_enabled: true - # MSC4222 needed for syncv2 state_after. This allow clients to + # MSC4222 needed for syncv2 state_after. This allow clients to # correctly track the state of the room. msc4222_enabled: true From 27620b914879f68fa805d15ef09ab350ce437d28 Mon Sep 17 00:00:00 2001 From: Hugh Nimmo-Smith Date: Wed, 4 Dec 2024 14:51:29 +0000 Subject: [PATCH 08/16] Rename `en-GB` language to `en` (#2866) Fixes https://github.com/element-hq/element-call/issues/2865 If we want to have GB and US specific terms later on we can then add then in as `en-GB` and `en-US`. --- README.md | 4 ++-- i18next-parser.config.ts | 2 +- localazy.json | 9 +++------ locales/{en-GB => en}/app.json | 0 src/@types/i18next.d.ts | 2 +- src/TranslatedError.ts | 2 +- src/initializer.tsx | 6 +++--- src/vitest.setup.ts | 12 ++++++------ 8 files changed, 17 insertions(+), 20 deletions(-) rename locales/{en-GB => en}/app.json (100%) diff --git a/README.md b/README.md index 25155152..ffd73d5e 100644 --- a/README.md +++ b/README.md @@ -220,7 +220,7 @@ To add a new translation key you can do these steps: 1. Add the new key entry to the code where the new key is used: `t("some_new_key")` 1. Run `yarn i18n` to extract the new key and update the translation files. This - will add a skeleton entry to the `locales/en-GB/app.json` file: + will add a skeleton entry to the `locales/en/app.json` file: ```jsonc { ... @@ -228,7 +228,7 @@ To add a new translation key you can do these steps: ... } ``` -1. Update the skeleton entry in the `locales/en-GB/app.json` file with +1. Update the skeleton entry in the `locales/en/app.json` file with the English translation: ```jsonc diff --git a/i18next-parser.config.ts b/i18next-parser.config.ts index 7d71d727..3acf2b5e 100644 --- a/i18next-parser.config.ts +++ b/i18next-parser.config.ts @@ -21,7 +21,7 @@ export default { }, ], }, - locales: ["en-GB"], + locales: ["en"], output: "locales/$LOCALE/$NAMESPACE.json", input: ["src/**/*.{ts,tsx}"], sort: true, diff --git a/localazy.json b/localazy.json index 2b9f713c..823e4a3e 100644 --- a/localazy.json +++ b/localazy.json @@ -7,13 +7,13 @@ "features": ["plural_postfix_us", "filter_untranslated"], "files": [ { - "pattern": "locales/en-GB/*.json", + "pattern": "locales/en/*.json", "lang": "inherited" }, { "group": "existing", "pattern": "locales/*/*.json", - "excludes": ["locales/en-GB/*.json"], + "excludes": ["locales/en/*.json"], "lang": "${autodetectLang}" } ] @@ -25,9 +25,6 @@ "output": "locales/${langLsrDash}/${file}" } ], - "includeSourceLang": "${includeSourceLang|false}", - "langAliases": { - "en": "en_GB" - } + "includeSourceLang": "${includeSourceLang|false}" } } diff --git a/locales/en-GB/app.json b/locales/en/app.json similarity index 100% rename from locales/en-GB/app.json rename to locales/en/app.json diff --git a/src/@types/i18next.d.ts b/src/@types/i18next.d.ts index 4a8830da..3c65e620 100644 --- a/src/@types/i18next.d.ts +++ b/src/@types/i18next.d.ts @@ -7,7 +7,7 @@ Please see LICENSE in the repository root for full details. import "i18next"; // import all namespaces (for the default language, only) -import app from "../../locales/en-GB/app.json"; +import app from "../../locales/en/app.json"; declare module "i18next" { interface CustomTypeOptions { diff --git a/src/TranslatedError.ts b/src/TranslatedError.ts index 0dbe675a..420556be 100644 --- a/src/TranslatedError.ts +++ b/src/TranslatedError.ts @@ -22,7 +22,7 @@ export abstract class TranslatedError extends Error { messageKey: ParseKeys, translationFn: TFunction, ) { - super(translationFn(messageKey, { lng: "en-GB" } as TOptions)); + super(translationFn(messageKey, { lng: "en" } as TOptions)); this.translatedMessage = translationFn(messageKey); } } diff --git a/src/initializer.tsx b/src/initializer.tsx index 47634078..e9290504 100644 --- a/src/initializer.tsx +++ b/src/initializer.tsx @@ -24,7 +24,7 @@ import { platform } from "./Platform"; // This generates a map of locale names to their URL (based on import.meta.url), which looks like this: // { -// "../locales/en-GB/app.json": "/whatever/assets/root/locales/en-aabbcc.json", +// "../locales/en/app.json": "/whatever/assets/root/locales/en-aabbcc.json", // ... // } const locales = import.meta.glob("../locales/*/*.json", { @@ -41,7 +41,7 @@ const getLocaleUrl = ( const supportedLngs = [ ...new Set( Object.keys(locales).map((url) => { - // The URLs are of the form ../locales/en-GB/app.json + // The URLs are of the form ../locales/en/app.json // This extracts the language code from the URL const lang = url.match(/\/([^/]+)\/[^/]+\.json$/)?.[1]; if (!lang) { @@ -133,7 +133,7 @@ export class Initializer { .use(languageDetector) .use(initReactI18next) .init({ - fallbackLng: "en-GB", + fallbackLng: "en", defaultNS: "app", keySeparator: ".", nsSeparator: false, diff --git a/src/vitest.setup.ts b/src/vitest.setup.ts index 38b8704e..46b370a9 100644 --- a/src/vitest.setup.ts +++ b/src/vitest.setup.ts @@ -17,20 +17,20 @@ import "vitest-axe/extend-expect"; import { logger } from "matrix-js-sdk/src/logger"; import "@testing-library/jest-dom/vitest"; -import EN_GB from "../locales/en-GB/app.json"; +import EN from "../locales/en/app.json"; import { Config } from "./config/Config"; // Bare-minimum i18n config i18n .use(initReactI18next) .init({ - lng: "en-GB", - fallbackLng: "en-GB", - supportedLngs: ["en-GB"], + lng: "en", + fallbackLng: "en", + supportedLngs: ["en"], // We embed the translations, so that it never needs to fetch resources: { - "en-GB": { - app: EN_GB, + en: { + app: EN, }, }, interpolation: { From 76ba02584d3cf80ffdca007d7fc7f49977c24952 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 5 Dec 2024 12:10:35 +0100 Subject: [PATCH 09/16] Update dependency vaul to v1.1.1 (#2656) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index e4f81151..ab40c0c0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8414,9 +8414,9 @@ value-or-function@^4.0.0: integrity sha512-aeVK81SIuT6aMJfNo9Vte8Dw0/FZINGBV8BfCraGtqVxIeLAEhJyoWs8SmvRVmXfGss2PmmOwZCuBPbZR+IYWg== vaul@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/vaul/-/vaul-1.1.0.tgz#7da4bc965e0b184ada632f1208096b0f5575d920" - integrity sha512-YhO/bikcauk48hzhMhvIvT+U87cuCbNbKk9fF4Ou5UkI9t2KkBMernmdP37pCzF15hrv55fcny1YhexK8h6GVQ== + version "1.1.1" + resolved "https://registry.yarnpkg.com/vaul/-/vaul-1.1.1.tgz#93aceaad16f7c53aacf28a2609b2dd43b5a91fa0" + integrity sha512-+ejzF6ffQKPcfgS7uOrGn017g39F8SO4yLPXbBhpC7a0H+oPqPna8f1BUfXaz8eU4+pxbQcmjxW+jWBSbxjaFg== dependencies: "@radix-ui/react-dialog" "^1.1.1" From 818abaac0f5b16ebf3d8c6a124dc882f8f1ea8c7 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 5 Dec 2024 11:32:31 +0000 Subject: [PATCH 10/16] Update GitHub Actions --- .github/workflows/docker.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index c85cddf5..8d4233a1 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -42,7 +42,7 @@ jobs: - name: Extract metadata (tags, labels) for Docker id: meta - uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1 + uses: docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96 # v5.6.1 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} tags: ${{ inputs.docker_tags}} @@ -51,7 +51,7 @@ jobs: uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3.7.1 - name: Build and push Docker image - uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6.9.0 + uses: docker/build-push-action@48aba3b46d1b1fec4febb7c5d0c644b249a11355 # v6.10.0 with: context: . platforms: linux/amd64,linux/arm64 From 21b62dbd89aac99d963cea048a90254e88fa9bfd Mon Sep 17 00:00:00 2001 From: Hugh Nimmo-Smith Date: Thu, 5 Dec 2024 13:26:31 +0000 Subject: [PATCH 11/16] Use a consistent background colour for video tiles and avatars (#2868) --- src/index.css | 5 +++++ src/room/VideoPreview.module.css | 5 ++--- src/tile/MediaView.module.css | 4 ++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/index.css b/src/index.css index bf6d1605..aeeccaf4 100644 --- a/src/index.css +++ b/src/index.css @@ -47,6 +47,11 @@ layer(compound); --background-gradient: url("graphics/backgroundGradient.svg"); } +:root, +[class*="cpd-theme-"] { + --video-tile-background: var(--cpd-color-bg-subtle-secondary); +} + .cpd-theme-dark { --cpd-color-border-accent: var(--cpd-color-green-1100); --stopgap-color-on-solid-accent: var(--cpd-color-text-primary); diff --git a/src/room/VideoPreview.module.css b/src/room/VideoPreview.module.css index 573807fe..89422af7 100644 --- a/src/room/VideoPreview.module.css +++ b/src/room/VideoPreview.module.css @@ -18,8 +18,7 @@ Please see LICENSE in the repository root for full details. width: 100%; height: 100%; object-fit: cover; - background-color: black; - background-color: var(--cpd-color-bg-subtle-primary); + background-color: var(--video-tile-background); } video.mirror { @@ -35,7 +34,7 @@ video.mirror { display: flex; justify-content: center; align-items: center; - background-color: var(--cpd-color-bg-subtle-secondary); + background-color: var(--video-tile-background); } .buttonBar { diff --git a/src/tile/MediaView.module.css b/src/tile/MediaView.module.css index 4594c284..47446118 100644 --- a/src/tile/MediaView.module.css +++ b/src/tile/MediaView.module.css @@ -15,7 +15,7 @@ Please see LICENSE in the repository root for full details. inline-size: 100%; block-size: 100%; object-fit: contain; - background-color: var(--cpd-color-bg-subtle-primary); + background-color: var(--video-tile-background); /* This transform is a no-op, but it forces Firefox to use a different rendering path, one that actually clips the corners of