Compare commits

..
Author SHA1 Message Date
Robin 9d400323d0 Clarify why certain tests disable the React Compiler 2026-08-05 10:54:49 +02:00
Robin 608695fc95 Performance: Enable React Compiler
With the React Compiler, our component code is transformed at build time to automatically apply various forms of memoization. This changes the runtime semantics of our code a little bit and therefore could surface new bugs in the next release cycle in case any components fail to follow the rules of React. See https://react.dev/learn/react-compiler for more information.

This results in a small bundle size increase and modest performance gains, but I think it's worth it given the potential for larger performance gains once we tune the component structure a bit more.
2026-08-04 17:57:23 +02:00
Robin a08a577e18 Merge pull request #4138 from element-hq/renovate/all-minor-patch
Update all non-major dependencies
2026-08-04 17:19:28 +02:00
Robin 55b2d2b130 Remove possibility for CI Playwright version to get out of sync 2026-08-04 17:04:07 +02:00
renovate[bot]andRobin 5b84b2c04d Update ghcr.io/element-hq/element-web:develop Docker digest to 3daefff (#4116)
* Update ghcr.io/element-hq/element-web:develop Docker digest to 0183c0a

* Update end-to-end tests to work with auto-collapsing room list

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Robin <robin@robin.town>
2026-08-04 12:35:18 +00:00
Robin 3af0744324 Merge branch 'livekit' into renovate/all-minor-patch 2026-08-04 14:20:13 +02:00
Robin 07567ed31d Merge pull request #4118 from element-hq/renovate/livekit-components
Update LiveKit components
2026-08-04 14:05:47 +02:00
Robin d6e097476e Address linter finding 2026-08-04 13:51:56 +02:00
Robin 540eb306f4 Fix unit tests 2026-08-04 13:48:52 +02:00
Robin f62428ba0d Update code formatting 2026-08-04 13:43:38 +02:00
renovate[bot] d579169d54 Update all non-major dependencies 2026-08-04 11:39:13 +00:00
Robin 8daaa649eb Merge pull request #4147 from element-hq/renovate/npm-postcss-vulnerability
Update dependency postcss to v8.5.23 [SECURITY]
2026-08-04 13:36:56 +02:00
Robin 2d5a4eefec Merge pull request #4139 from element-hq/renovate/posthog
Update dependency posthog-js to v1.408.2
2026-08-04 13:26:18 +02:00
renovate[bot] d550430c8a Update dependency postcss to v8.5.23 [SECURITY] 2026-08-04 11:11:52 +00:00
Robin 78724acfcf Merge pull request #4140 from element-hq/renovate/compound
Update dependency @vector-im/compound-web to v9.9.0
2026-08-04 13:10:48 +02:00
Robin 20c7112812 Merge pull request #4141 from element-hq/renovate/matrix-widget-api
Update dependency matrix-widget-api to v1.18.0
2026-08-04 13:09:58 +02:00
renovate[bot] a7c996f3ea Update dependency posthog-js to v1.408.2 2026-08-04 11:07:26 +00:00
Valere Fedronic 4fbcbb4849 Merge pull request #4136 from element-hq/valere/fix_4132
fix: FF mirrored self video lose rounding
2026-08-03 13:53:04 +02:00
Robin 74102ac6c2 Merge pull request #3075 from hughns/defaut-server-config
Remove default server config as it is not likely to be correct
2026-08-03 10:49:49 +02:00
Robin 11a6fa9b45 Fix tests 2026-08-03 10:32:52 +02:00
Robin 507a6f29a5 Merge branch 'livekit' into defaut-server-config 2026-08-03 10:29:41 +02:00
renovate[bot] e725bc5de3 Update dependency matrix-widget-api to v1.18.0 2026-08-03 03:03:18 +00:00
renovate[bot] c15d4c50a1 Update dependency @vector-im/compound-web to v9.9.0 2026-08-03 03:02:53 +00:00
Valere e1bc4a096b fix: FF mirrored self video lose rounding 2026-07-31 12:20:32 +02:00
renovate[bot] b524de9298 Update LiveKit components 2026-07-30 20:51:22 +00:00
Robin bfb5fb922f Merge pull request #4134 from element-hq/renovate/npm-postcss-vulnerability
Update dependency postcss to v8.5.18 [SECURITY]
2026-07-30 11:01:41 +02:00
renovate[bot] 3f4d55343a Update dependency postcss to v8.5.18 [SECURITY] 2026-07-30 08:45:15 +00:00
Robin 73d8d2c2c3 Merge pull request #4120 from element-hq/johannes/i18n-download-fixes
Apply correct GH label and fix ordering issue in i18n download
2026-07-30 10:45:09 +02:00
Robin fcfe73c50d Merge pull request #4117 from element-hq/renovate/livekit-client
Update dependency livekit-client to v2.21.0
2026-07-30 10:43:24 +02:00
renovate[bot] 5564015a8b Update dependency livekit-client to v2.21.0 2026-07-28 18:56:05 +00:00
Robin 62eeb10d38 Merge pull request #4130 from element-hq/landscape-default-grid
Only show layout switch when it has an effect on the layout
2026-07-28 15:28:06 +02:00
Robin 2de7fdde10 Fix layout switches not showing their state on the combined docs page
On the combined Storybook docs page for the call footer, the layout switches would not show the correct state until you hovered over them because they all shared the same input name and thus were interpreted as belonging to the same radio group.
2026-07-28 15:06:15 +02:00
Robin 5a96d1769e Only show layout switch when it has an effect on the layout 2026-07-28 15:06:15 +02:00
Robin a443a55bec Factor out a layout switch view + view model
So it can easily be shown and hidden wholesale.
2026-07-28 15:06:15 +02:00
Robin 9b2d9fdd1f Merge pull request #4129 from element-hq/landscape-default-grid
Prefer grid mode in landscape on mobile
2026-07-28 14:29:30 +02:00
Robin 05ad9b2475 Merge pull request #4128 from element-hq/landscape-default-grid
Use a proper one-on-one layout for landscape mobile calls
2026-07-28 14:08:48 +02:00
Robin 7962d02be5 Prefer grid mode in landscape on mobile 2026-07-28 11:56:01 +02:00
Robin 5c35288162 Turn the local video tile landscape in landscape mobile one-on-one calls 2026-07-28 11:53:26 +02:00
Robin aa6732da19 Use an actual one-on-one layout in landscape on mobile 2026-07-28 11:53:26 +02:00
Valere Fedronic 65ac11e952 Merge pull request #4125 from element-hq/valere/bug_poster_safari
fix: Safari preview tile no video is 16px wide only
2026-07-28 10:55:01 +02:00
Robin 0b21cff020 Rename one-on-one layouts to be orientation-agnostic 2026-07-27 18:28:52 +02:00
Robin 062e0a00fb Remove unused variables from CallViewModel tests 2026-07-27 18:13:51 +02:00
Valere 53ae78c609 break ratio when tile bigger than screen 2026-07-27 17:25:56 +02:00
Valere b046c4b569 fix: Safari preview tile no video is 16px wide only 2026-07-27 15:43:35 +02:00
Johannes Marbach 46cb89b232 Apply correct GH label and fix ordering issue in i18n download 2026-07-20 17:38:14 +02:00
ElementRobot e20abb19fb Merge pull request #4119 from element-hq/actions/localazy-download
Localazy Download
2026-07-20 16:23:58 +01:00
Johannes Marbach bf76f47357 delint 2026-07-20 17:03:55 +02:00
Johennes 9c2d3d067d Translations updates 2026-07-20 14:58:37 +00:00
Robin ae7ede3201 Merge pull request #4113 from element-hq/vulnerable-dependencies
Resolve most existing Dependbot warnings
2026-07-16 09:28:13 +02:00
Robin e5ff431b7a Merge pull request #4112 from element-hq/disable-poster
Hide the browser's default placeholder image for videos
2026-07-16 09:21:27 +02:00
Robin 66a676f2f5 Resolve most existing Dependbot warnings 2026-07-15 18:05:06 +02:00
renovate[bot]andRobin 1f2837f86a Update ghcr.io/element-hq/element-web:develop Docker digest to 07ccf47 (#4111)
* Update ghcr.io/element-hq/element-web:develop Docker digest to d184182

* Target the toast 'Join' button specifically in end-to-end tests

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Robin <robin@robin.town>
2026-07-15 14:34:34 +00:00
Timo 2a3271b8b3 Merge branch 'livekit' into defaut-server-config 2025-04-04 23:27:45 +02:00
Hugh Nimmo-Smith f45aa85aef Remove default server config as it is not likely to be correct 2025-03-10 18:14:25 +00:00
44 changed files with 2752 additions and 2777 deletions
+24 -6
View File
@@ -7,10 +7,6 @@ jobs:
vitest: vitest:
name: Run unit tests name: Run unit tests
runs-on: ubuntu-latest runs-on: ubuntu-latest
container:
# Make sure to grab the latest version of the Playwright image
# https://playwright.dev/docs/docker#pull-the-image
image: mcr.microsoft.com/playwright:v1.61.1-noble
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
@@ -26,6 +22,18 @@ jobs:
- name: Install dependencies - name: Install dependencies
# ignore-pnpmfile should never be commited. Make CI crash if it happened (`pnpmfileChecksum` is present) # ignore-pnpmfile should never be commited. Make CI crash if it happened (`pnpmfileChecksum` is present)
run: "pnpm install --frozen-lockfile --ignore-pnpmfile" run: "pnpm install --frozen-lockfile --ignore-pnpmfile"
- name: Get Playwright version
run: echo "PLAYWRIGHT_VERSION=$(pnpm list @playwright/test --depth=0 --json | jq -r '.[0].devDependencies["@playwright/test"].version')" >> $GITHUB_ENV
- name: Cache Playwright binaries
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
id: playwright-cache
with:
path: |
~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}
- name: Install Playwright binaries
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: pnpm playwright install --with-deps
- name: Vitest - name: Vitest
run: "pnpm run test:coverage" run: "pnpm run test:coverage"
- name: Upload to codecov - name: Upload to codecov
@@ -52,8 +60,18 @@ jobs:
- name: Install dependencies - name: Install dependencies
# ignore-pnpmfile should never be commited. Make CI crash if it happened (`pnpmfileChecksum` is present) # ignore-pnpmfile should never be commited. Make CI crash if it happened (`pnpmfileChecksum` is present)
run: pnpm install --frozen-lockfile --ignore-pnpmfile run: pnpm install --frozen-lockfile --ignore-pnpmfile
- name: Install Playwright Browsers - name: Get Playwright version
run: pnpm exec playwright install --with-deps run: echo "PLAYWRIGHT_VERSION=$(pnpm list @playwright/test --depth=0 --json | jq -r '.[0].devDependencies["@playwright/test"].version')" >> $GITHUB_ENV
- name: Cache Playwright binaries
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
id: playwright-cache
with:
path: |
~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}
- name: Install Playwright binaries
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: pnpm playwright install --with-deps
- name: Run backend components - name: Run backend components
run: | run: |
docker compose -f docker-compose-dev.yml -f docker-compose-playwright.yml pull docker compose -f docker-compose-dev.yml -f docker-compose-playwright.yml pull
+6 -1
View File
@@ -40,6 +40,11 @@ jobs:
- name: Fix the owner of the downloaded files - name: Fix the owner of the downloaded files
run: "sudo chown runner:docker -R locales" run: "sudo chown runner:docker -R locales"
# Localazy doesn't write file contents in the same order that i18next-cli's
# extractor uses. We re-run the extractor after downloading to fix the order.
- name: i18n
run: pnpm i18n
- name: Formatting - name: Formatting
run: pnpm format run: pnpm format
@@ -53,7 +58,7 @@ jobs:
title: Localazy Download title: Localazy Download
commit-message: Translations updates commit-message: Translations updates
labels: | labels: |
T-Task PR-Task
- name: Enable automerge - name: Enable automerge
run: gh pr merge --merge --auto "$PR_NUMBER" run: gh pr merge --merge --auto "$PR_NUMBER"
+2 -2
View File
@@ -47,7 +47,7 @@ services:
- ecbackend - ecbackend
livekit: livekit:
image: livekit/livekit-server:v1.10.1 image: livekit/livekit-server:v1.13.4
pull_policy: always pull_policy: always
hostname: livekit-sfu hostname: livekit-sfu
command: --dev --config /etc/livekit.yaml command: --dev --config /etc/livekit.yaml
@@ -70,7 +70,7 @@ services:
- ecbackend - ecbackend
livekit-1: livekit-1:
image: livekit/livekit-server:v1.10.1 image: livekit/livekit-server:v1.13.4
pull_policy: always pull_policy: always
hostname: livekit-sfu-1 hostname: livekit-sfu-1
command: --dev --config /etc/livekit.yaml command: --dev --config /etc/livekit.yaml
+2 -2
View File
@@ -13,7 +13,7 @@ services:
- ./backend/playwright_homeserver-othersite.yaml:/data/cfg/homeserver.yaml:Z - ./backend/playwright_homeserver-othersite.yaml:/data/cfg/homeserver.yaml:Z
element-web: element-web:
# Pin to a SHA so that upstream cannot break our tests. Renovate handles regular updates. # Pin to a SHA so that upstream cannot break our tests. Renovate handles regular updates.
image: ghcr.io/element-hq/element-web:develop@sha256:365eca844f0782676f2406e5107e2f74fae2ecdb1725cc42060a91681aeee4c4 image: ghcr.io/element-hq/element-web:develop@sha256:0183c0a7f4292252349ddcff2de92a83a4571b283da49cc54adb9efbf3d20695
element-web-1: element-web-1:
# Pin to a SHA so that upstream cannot break our tests. Renovate handles regular updates. # Pin to a SHA so that upstream cannot break our tests. Renovate handles regular updates.
image: ghcr.io/element-hq/element-web:develop@sha256:365eca844f0782676f2406e5107e2f74fae2ecdb1725cc42060a91681aeee4c4 image: ghcr.io/element-hq/element-web:develop@sha256:0183c0a7f4292252349ddcff2de92a83a4571b283da49cc54adb9efbf3d20695
+4 -3
View File
@@ -86,10 +86,11 @@ to implement
In the context of MatrixRTC, we suggest using a single hostname for backend In the context of MatrixRTC, we suggest using a single hostname for backend
communication by implementing endpoint routing within a reverse proxy setup. For communication by implementing endpoint routing within a reverse proxy setup. For
the example above, this results in: the example above, this results in:
| Service | Endpoint | Example |
| -------- | ------- | ------- | | Service | Endpoint | Example |
| --------------------------------------------------------------------------------- | -------------- | ------------------------------------ |
| [Livekit SFU](https://github.com/livekit/livekit) WebSocket signalling connection | `/livekit/sfu` | `matrix-rtc.example.com/livekit/sfu` | | [Livekit SFU](https://github.com/livekit/livekit) WebSocket signalling connection | `/livekit/sfu` | `matrix-rtc.example.com/livekit/sfu` |
| [MatrixRTC Authorization Service](https://github.com/element-hq/lk-jwt-service) | `/livekit/jwt` | `matrix-rtc.example.com/livekit/jwt` | | [MatrixRTC Authorization Service](https://github.com/element-hq/lk-jwt-service) | `/livekit/jwt` | `matrix-rtc.example.com/livekit/jwt` |
Using Nginx, you can achieve this by: Using Nginx, you can achieve this by:
+8
View File
@@ -102,11 +102,15 @@
"connection_lost_description": "Hovor byl přerušen.", "connection_lost_description": "Hovor byl přerušen.",
"e2ee_unsupported": "Nekompatibilní prohlížeč", "e2ee_unsupported": "Nekompatibilní prohlížeč",
"e2ee_unsupported_description": "Váš webový prohlížeč nepodporuje šifrované hovory. Mezi podporované prohlížeče patří Chrome, Safari a Firefox 117+.", "e2ee_unsupported_description": "Váš webový prohlížeč nepodporuje šifrované hovory. Mezi podporované prohlížeče patří Chrome, Safari a Firefox 117+.",
"failed_to_start_livekit": "Nepodařilo se navázat připojení k Livekitu",
"generic": "Něco se pokazilo.", "generic": "Něco se pokazilo.",
"generic_description": "Odeslání protokolů ladění nám pomůže vystopovat problém.", "generic_description": "Odeslání protokolů ladění nám pomůže vystopovat problém.",
"insufficient_capacity": "Nedostatečná kapacita", "insufficient_capacity": "Nedostatečná kapacita",
"insufficient_capacity_description": "Server dosáhl své maximální kapacity a v tuto chvíli se nemůžete připojit k hovoru. Zkuste to později nebo se obraťte na správce serveru, pokud problém přetrvává.", "insufficient_capacity_description": "Server dosáhl své maximální kapacity a v tuto chvíli se nemůžete připojit k hovoru. Zkuste to později nebo se obraťte na správce serveru, pokud problém přetrvává.",
"matrix_rtc_transport_missing": "Server není nakonfigurován pro práci s {{brand}}. Obraťte se na správce serveru (Doména: {{domain}}, Kód chyby: {{ errorCode }}).", "matrix_rtc_transport_missing": "Server není nakonfigurován pro práci s {{brand}}. Obraťte se na správce serveru (Doména: {{domain}}, Kód chyby: {{ errorCode }}).",
"membership_manager": "Chyba Správce členství",
"membership_manager_description": "Správce členství musel být ukončen. To je způsobeno mnoha po sobě jdoucími neúspěšnými síťovými požadavky.",
"no_matrix_2_authorization_service": "Autorizační služba vašeho mediálního serveru (SFU) je zastaralá.",
"open_elsewhere": "Otevřeno na jiné kartě", "open_elsewhere": "Otevřeno na jiné kartě",
"open_elsewhere_description": "{{brand}} byl otevřen v jiné záložce. Pokud to nezní správně, zkuste stránku znovu načíst.", "open_elsewhere_description": "{{brand}} byl otevřen v jiné záložce. Pokud to nezní správně, zkuste stránku znovu načíst.",
"room_creation_restricted": "Nepodařilo se vytvořit hovor", "room_creation_restricted": "Nepodařilo se vytvořit hovor",
@@ -141,6 +145,7 @@
}, },
"layout_grid_label": "Mřížka", "layout_grid_label": "Mřížka",
"layout_spotlight_label": "Soustředěný mód", "layout_spotlight_label": "Soustředěný mód",
"layout_switch_label": "Rozvržení",
"lobby": { "lobby": {
"ask_to_join": "Žádost o připojení k hovoru", "ask_to_join": "Žádost o připojení k hovoru",
"join_as_guest": "Připojte se jako host", "join_as_guest": "Připojte se jako host",
@@ -241,11 +246,14 @@
"version": "{{productName}}verze: {{version}}", "version": "{{productName}}verze: {{version}}",
"video_tile": { "video_tile": {
"always_show": "Vždy zobrazit", "always_show": "Vždy zobrazit",
"call_ended": "Hovor ukončen",
"calling": "Volání…",
"camera_starting": "Načítání videa...", "camera_starting": "Načítání videa...",
"collapse": "Sbalit", "collapse": "Sbalit",
"expand": "Rozbalit", "expand": "Rozbalit",
"mute_for_me": "Pro mě ztlumit", "mute_for_me": "Pro mě ztlumit",
"muted_for_me": "Pro mě ztlumené", "muted_for_me": "Pro mě ztlumené",
"screen_share_volume": "Hlasitost sdílení obrazovky",
"volume": "Hlasitost", "volume": "Hlasitost",
"waiting_for_media": "Čekání na média..." "waiting_for_media": "Čekání na média..."
} }
+27 -1
View File
@@ -3,6 +3,7 @@
"user_menu": "Kasutajamenüü" "user_menu": "Kasutajamenüü"
}, },
"action": { "action": {
"blur_background": "Hägusta tausta",
"close": "Sulge", "close": "Sulge",
"copy_link": "Kopeeri link", "copy_link": "Kopeeri link",
"edit": "Muuda", "edit": "Muuda",
@@ -72,8 +73,20 @@
"environment_variables": "Keskkonnamuutujad", "environment_variables": "Keskkonnamuutujad",
"hostname": "Hosti nimi: {{hostname}}", "hostname": "Hosti nimi: {{hostname}}",
"livekit_server_info": "LiveKiti serveri teave", "livekit_server_info": "LiveKiti serveri teave",
"livekit_sfu": "LiveKit SFU: {{url}}", "livekit_sfu": "LiveKiti meediaedastusserver (SFU): {{url}}",
"matrixRTCMode": { "matrixRTCMode": {
"Comptibility": {
"description": "Ühildub koduserveritega, mis ei toeta määratud kestusega sündmuseid (kuid kõik teised EC kliendid on v0.17.0 või hilisemad)",
"label": "Ühilduvus: olekusündmused ja mitu meediaedastusserverit (SFU)"
},
"Legacy": {
"description": "Ühildub EC vanemate versioonidega, millel puudub mitme meediaedastusserveri (SFU) tugi",
"label": "Vana lahendus: oleku üritused ja vanim meediaedastusserver (SFU)"
},
"Matrix_2_0": {
"description": "Ühildub ainult määratud kestusega sündmuseid toetavate koduserveritega ja kõigi EC-klientidega alates versioonist 0.17.0",
"label": "Matrix 2.0: määratud kestusega sündmused ja mitu meediaedastusserverit (SFU)"
},
"title": "MatrixRTC režiim" "title": "MatrixRTC režiim"
}, },
"matrix_id": "Matrixi kasutajatunnus: {{id}}", "matrix_id": "Matrixi kasutajatunnus: {{id}}",
@@ -95,13 +108,20 @@
"generic_description": "Silumis- ja vealogide saatmine võib aidata meid vea põhjuseni jõuda.", "generic_description": "Silumis- ja vealogide saatmine võib aidata meid vea põhjuseni jõuda.",
"insufficient_capacity": "Mittepiisav jõudlus", "insufficient_capacity": "Mittepiisav jõudlus",
"insufficient_capacity_description": "Serveri jõudluse ülempiir on hetkel ületatud ja sa ei saa hetkel selle kõnega liituda. Proovi hiljem uuesti või kui probleem kestab kauem, siis võta ühendust serveri haldajaga.", "insufficient_capacity_description": "Serveri jõudluse ülempiir on hetkel ületatud ja sa ei saa hetkel selle kõnega liituda. Proovi hiljem uuesti või kui probleem kestab kauem, siis võta ühendust serveri haldajaga.",
"livekit_connection_error": "Livekiti serveriga ühendamine ei õnnestunud",
"livekit_connection_error_description": "Livekiti serveriga ühendamisel tekkis viga (<1>Põhjus: </1> <2>{{ reason }}</2>).",
"matrix_rtc_transport_missing": "See server pole seadistatud töötama rakendusega {{brand}}. Palun võta ühendust serveri halduriga (domeen: {{domain}}, veakood: {{ errorCode }}).", "matrix_rtc_transport_missing": "See server pole seadistatud töötama rakendusega {{brand}}. Palun võta ühendust serveri halduriga (domeen: {{domain}}, veakood: {{ errorCode }}).",
"membership_manager": "Viga liikmelisuse haldamisel", "membership_manager": "Viga liikmelisuse haldamisel",
"membership_manager_description": "Liikmelisuse haldur pidi oma töö lõpetama. Selle põhjuseks olid paljud järjestikused ebaõnnestunud võrgupäringud.", "membership_manager_description": "Liikmelisuse haldur pidi oma töö lõpetama. Selle põhjuseks olid paljud järjestikused ebaõnnestunud võrgupäringud.",
"no_matrix_2_authorization_service": "Sinu meediaedastusserveri (SFU) autoriseerimisteenus on aegunud.",
"open_elsewhere": "Avatud teisel vahekaardil", "open_elsewhere": "Avatud teisel vahekaardil",
"open_elsewhere_description": "{{brand}} on avatud teisel vahekaardil. Kui see ei tundu olema õige, proovi selle lehe uuesti laadimist.", "open_elsewhere_description": "{{brand}} on avatud teisel vahekaardil. Kui see ei tundu olema õige, proovi selle lehe uuesti laadimist.",
"peer_connection_timeout": "Ühendus aegus",
"peer_connection_timeout_description": "Meediaserveriga ühenduspäring aegus. Proovi kasutada muud võrku või keelata VPN-i kasutamine. Kui probleem püsib, vaata meie <0> veaotsingu juhendit</0> või võta ühendust oma serveri peakasutajaga.",
"room_creation_restricted": "Kõne loomine ei õnnestunud", "room_creation_restricted": "Kõne loomine ei õnnestunud",
"room_creation_restricted_description": "Kõne loomine võib olla lubatud ainult volitatud kasutajatele. Proovi hiljem uuesti või probleemi püsimisel võta ühendust oma serveri haldajaga.", "room_creation_restricted_description": "Kõne loomine võib olla lubatud ainult volitatud kasutajatele. Proovi hiljem uuesti või probleemi püsimisel võta ühendust oma serveri haldajaga.",
"sticky_events_required": "Koduserver ei toeta Matrix 2.0 kõnesid",
"sticky_events_required_description": "See server on seadistatud kasutama Matrix 2.0 kõnerežiimi, kuid koduserver ei teata, et tal selleks vajalike sündmuste (MSC4354) tugi. Palu serveri peakasutajal see uuendada või kasuta koduserveris ühilduvat režiimi.",
"unexpected_ec_error": "Tekkis ootamatu viga (<0>Veakood:</0> <1>{{ errorCode }}</1>). Palun võta ühendust serveri haldajaga." "unexpected_ec_error": "Tekkis ootamatu viga (<0>Veakood:</0> <1>{{ errorCode }}</1>). Palun võta ühendust serveri haldajaga."
}, },
"group_call_loader": { "group_call_loader": {
@@ -132,6 +152,7 @@
}, },
"layout_grid_label": "Ruudustik", "layout_grid_label": "Ruudustik",
"layout_spotlight_label": "Rambivalgus", "layout_spotlight_label": "Rambivalgus",
"layout_switch_label": "Paigutus",
"lobby": { "lobby": {
"ask_to_join": "Küsi võimalust liituda kõnega", "ask_to_join": "Küsi võimalust liituda kõnega",
"join_as_guest": "Liitu külalisena", "join_as_guest": "Liitu külalisena",
@@ -184,6 +205,7 @@
"blur_not_supported_by_browser": "(Tausta hägustamine pole selles seadmes toetatud.)", "blur_not_supported_by_browser": "(Tausta hägustamine pole selles seadmes toetatud.)",
"developer_tab_title": "Arendaja", "developer_tab_title": "Arendaja",
"devices": { "devices": {
"activating": "Aktiveerin…",
"camera": "Kaamera", "camera": "Kaamera",
"camera_numbered": "Kaamera {{n}}", "camera_numbered": "Kaamera {{n}}",
"change_device_button": "Muuda heliseadet", "change_device_button": "Muuda heliseadet",
@@ -223,6 +245,7 @@
"stop_video_button_label": "Peata videovoog", "stop_video_button_label": "Peata videovoog",
"submitting": "Saadan…", "submitting": "Saadan…",
"switch_camera": "Vaheta kaamerat", "switch_camera": "Vaheta kaamerat",
"technical_details": "Tehnilised üksikasjad",
"unauthenticated_view_body": "Sa pole veel registreerunud? <2>Loo kasutajakonto</2>", "unauthenticated_view_body": "Sa pole veel registreerunud? <2>Loo kasutajakonto</2>",
"unauthenticated_view_login_button": "Logi oma kontosse sisse", "unauthenticated_view_login_button": "Logi oma kontosse sisse",
"unauthenticated_view_ssla_caption": "Klõpsides „Jätka“ nõustud sa meie <2>Tarkvara ja teenuste litsentseerimise lepinguga (Software and Services License Agreement - SSLA)</2>", "unauthenticated_view_ssla_caption": "Klõpsides „Jätka“ nõustud sa meie <2>Tarkvara ja teenuste litsentseerimise lepinguga (Software and Services License Agreement - SSLA)</2>",
@@ -230,11 +253,14 @@
"version": "{{productName}}, versioon: {{version}}", "version": "{{productName}}, versioon: {{version}}",
"video_tile": { "video_tile": {
"always_show": "Näita alati", "always_show": "Näita alati",
"call_ended": "Kõne lõppes",
"calling": "Helistan…",
"camera_starting": "Video on laadimisel...", "camera_starting": "Video on laadimisel...",
"collapse": "Näita vähem", "collapse": "Näita vähem",
"expand": "Näita rohkem", "expand": "Näita rohkem",
"mute_for_me": "Summuta minu jaoks", "mute_for_me": "Summuta minu jaoks",
"muted_for_me": "Minule summutatud", "muted_for_me": "Minule summutatud",
"screen_share_volume": "Helivaljus ekraanijagaamisel",
"volume": "Helivaljus", "volume": "Helivaljus",
"waiting_for_media": "Ootame kuni meedia on olemas..." "waiting_for_media": "Ootame kuni meedia on olemas..."
} }
+10
View File
@@ -3,6 +3,7 @@
"user_menu": "Käyttäjävalikko" "user_menu": "Käyttäjävalikko"
}, },
"action": { "action": {
"blur_background": "Sumenna tausta",
"close": "Sulje", "close": "Sulje",
"copy_link": "Kopioi linkki", "copy_link": "Kopioi linkki",
"edit": "Muokkaa", "edit": "Muokkaa",
@@ -107,14 +108,20 @@
"generic_description": "Vianmäärityslokien lähettäminen auttaa meitä jäljittämään ongelman.", "generic_description": "Vianmäärityslokien lähettäminen auttaa meitä jäljittämään ongelman.",
"insufficient_capacity": "Riittämätön kapasiteetti", "insufficient_capacity": "Riittämätön kapasiteetti",
"insufficient_capacity_description": "Palvelin on saavuttanut maksimikapasiteettinsa, etkä voi liittyä puheluun tällä hetkellä. Yritä myöhemmin uudelleen tai ota yhteyttä palvelimen ylläpitäjään, jos ongelma jatkuu.", "insufficient_capacity_description": "Palvelin on saavuttanut maksimikapasiteettinsa, etkä voi liittyä puheluun tällä hetkellä. Yritä myöhemmin uudelleen tai ota yhteyttä palvelimen ylläpitäjään, jos ongelma jatkuu.",
"livekit_connection_error": "Yhteyden muodostaminen Livekit-palvelimeen epäonnistui",
"livekit_connection_error_description": "Livekit-palvelimeen yhteyden muodostamisessa tapahtui virhe (<1>Syy: </1> <2>{{ reason }}</2>).",
"matrix_rtc_transport_missing": "Palvelinta ei ole määritetty toimimaan {{brand}} -sovelluksen kanssa. Ota yhteyttä palvelimen ylläpitäjään (Verkkotunnus: {{domain}}, Virhekoodi: {{ errorCode }}).", "matrix_rtc_transport_missing": "Palvelinta ei ole määritetty toimimaan {{brand}} -sovelluksen kanssa. Ota yhteyttä palvelimen ylläpitäjään (Verkkotunnus: {{domain}}, Virhekoodi: {{ errorCode }}).",
"membership_manager": "Jäsenyydenhallinnan virhe", "membership_manager": "Jäsenyydenhallinnan virhe",
"membership_manager_description": "Jäsenyyshallinta jouduttiin sulkemaan. Tämä johtui useista peräkkäisistä epäonnistuneista verkkopyynnöistä.", "membership_manager_description": "Jäsenyyshallinta jouduttiin sulkemaan. Tämä johtui useista peräkkäisistä epäonnistuneista verkkopyynnöistä.",
"no_matrix_2_authorization_service": "Mediapalvelimesi (SFU) valtuutuspalvelu on vanhentunut.", "no_matrix_2_authorization_service": "Mediapalvelimesi (SFU) valtuutuspalvelu on vanhentunut.",
"open_elsewhere": "Avattu toisessa välilehdessä", "open_elsewhere": "Avattu toisessa välilehdessä",
"open_elsewhere_description": "{{brand}} on avattu toisessa välilehdessä. Jos tämä ei kuulosta oikealta, yritä ladata sivu uudelleen.", "open_elsewhere_description": "{{brand}} on avattu toisessa välilehdessä. Jos tämä ei kuulosta oikealta, yritä ladata sivu uudelleen.",
"peer_connection_timeout": "Yhteyden aikakatkaisu",
"peer_connection_timeout_description": "Yhteys mediapalvelimeen aikakatkaistiin. Kokeile vaihtaa verkkoa tai poistaa VPN käytöstä. Jos ongelma jatkuu, katso <0>vianetsintäoppaamme</0> tai ota yhteyttä palvelimesi ylläpitäjään.",
"room_creation_restricted": "Puhelun luominen epäonnistui", "room_creation_restricted": "Puhelun luominen epäonnistui",
"room_creation_restricted_description": "Puheluiden luominen saattaa olla rajoitettu vain valtuutetuille käyttäjille. Yritä myöhemmin uudelleen tai ota yhteyttä palvelimen ylläpitäjään, jos ongelma jatkuu.", "room_creation_restricted_description": "Puheluiden luominen saattaa olla rajoitettu vain valtuutetuille käyttäjille. Yritä myöhemmin uudelleen tai ota yhteyttä palvelimen ylläpitäjään, jos ongelma jatkuu.",
"sticky_events_required": "Kotipalvelin ei tue Matrix 2.0 -puheluita",
"sticky_events_required_description": "Tämä asennus on määritetty käyttämään Matrix 2.0 -puhelutilaa, mutta kotipalvelin ei mainosta tukea tarttuville tapahtumille (MSC4354). Pyydä palvelimen järjestelmänvalvojaa päivittämään tai vaihtamaan asennus yhteensopivaan tilaan.",
"unexpected_ec_error": "Tapahtui odottamaton virhe (<0>Virhekoodi:</0> <1>{{ errorCode }}</1>). Ota yhteyttä palvelimen ylläpitäjään." "unexpected_ec_error": "Tapahtui odottamaton virhe (<0>Virhekoodi:</0> <1>{{ errorCode }}</1>). Ota yhteyttä palvelimen ylläpitäjään."
}, },
"group_call_loader": { "group_call_loader": {
@@ -145,6 +152,7 @@
}, },
"layout_grid_label": "Ruudukko", "layout_grid_label": "Ruudukko",
"layout_spotlight_label": "Valokeila", "layout_spotlight_label": "Valokeila",
"layout_switch_label": "Asettelu",
"lobby": { "lobby": {
"ask_to_join": "Pyydä liittymistä puheluun", "ask_to_join": "Pyydä liittymistä puheluun",
"join_as_guest": "Liity vieraana", "join_as_guest": "Liity vieraana",
@@ -197,6 +205,7 @@
"blur_not_supported_by_browser": "(Tämä laite ei tue taustan sumennusta.)", "blur_not_supported_by_browser": "(Tämä laite ei tue taustan sumennusta.)",
"developer_tab_title": "Kehittäjä", "developer_tab_title": "Kehittäjä",
"devices": { "devices": {
"activating": "Aktivoidaan…",
"camera": "Kamera", "camera": "Kamera",
"camera_numbered": "Kamera {{n}}", "camera_numbered": "Kamera {{n}}",
"change_device_button": "Vaihda äänilaite", "change_device_button": "Vaihda äänilaite",
@@ -236,6 +245,7 @@
"stop_video_button_label": "Lopeta video", "stop_video_button_label": "Lopeta video",
"submitting": "Lähetetään…", "submitting": "Lähetetään…",
"switch_camera": "Vaihda kameraa", "switch_camera": "Vaihda kameraa",
"technical_details": "Tekniset tiedot",
"unauthenticated_view_body": "Etkö ole vielä rekisteröitynyt? <2>Luo tili</2>", "unauthenticated_view_body": "Etkö ole vielä rekisteröitynyt? <2>Luo tili</2>",
"unauthenticated_view_login_button": "Kirjaudu tilillesi", "unauthenticated_view_login_button": "Kirjaudu tilillesi",
"unauthenticated_view_ssla_caption": "Klikkaamalla \"Siirry\" hyväksyt <2>ohjelmisto- ja palvelulisenssisopimuksen (SSLA)</2>", "unauthenticated_view_ssla_caption": "Klikkaamalla \"Siirry\" hyväksyt <2>ohjelmisto- ja palvelulisenssisopimuksen (SSLA)</2>",
+57 -15
View File
@@ -3,6 +3,7 @@
"user_menu": "Menu użytkownika" "user_menu": "Menu użytkownika"
}, },
"action": { "action": {
"blur_background": "Rozmycie tła",
"close": "Zamknij", "close": "Zamknij",
"copy_link": "Kopiuj link", "copy_link": "Kopiuj link",
"edit": "Edytuj", "edit": "Edytuj",
@@ -21,7 +22,7 @@
"submit": "Wyślij", "submit": "Wyślij",
"upload_file": "Prześlij plik" "upload_file": "Prześlij plik"
}, },
"analytics_notice": "Uczestnicząc w tej becie, upoważniasz nas do zbierania anonimowych danych, które wykorzystamy do ulepszenia produktu. Dowiedz się więcej na temat danych, które zbieramy w naszej <2>Polityce prywatności</2> i <5>Polityce ciasteczek</5>.", "analytics_notice": "Biorąc udział w wersji beta, wyrażasz zgodę na gromadzenie anonimowych danych, które wykorzystujemy w celu ulepszenia naszego produktu. Więcej informacji na temat danych, które śledzimy, znajdziesz w naszej <2>Polityce prywatności</2> dla i <6>Polityce ciasteczek</6>.",
"call_ended_view": { "call_ended_view": {
"create_account_button": "Utwórz konto", "create_account_button": "Utwórz konto",
"create_account_prompt": "<0>Może zechcesz ustawić hasło, aby zachować swoje konto?</0><1>Będziesz w stanie utrzymać swoją nazwę i ustawić awatar do wyświetlania podczas połączeń w przyszłości</1>", "create_account_prompt": "<0>Może zechcesz ustawić hasło, aby zachować swoje konto?</0><1>Będziesz w stanie utrzymać swoją nazwę i ustawić awatar do wyświetlania podczas połączeń w przyszłości</1>",
@@ -41,7 +42,7 @@
"display_name": "Nazwa wyświetlana", "display_name": "Nazwa wyświetlana",
"encrypted": "Szyfrowane", "encrypted": "Szyfrowane",
"home": "Strona domowa", "home": "Strona domowa",
"loading": "Ładowanie…", "loading": "Wczytywanie…",
"next": "Dalej", "next": "Dalej",
"options": "Opcje", "options": "Opcje",
"password": "Hasło", "password": "Hasło",
@@ -58,6 +59,14 @@
"developer_mode": { "developer_mode": {
"always_show_iphone_earpiece": "Pokaż opcję słuchawki iPhone na wszystkich platformach", "always_show_iphone_earpiece": "Pokaż opcję słuchawki iPhone na wszystkich platformach",
"crypto_version": "Wersja krypto: {{version}}", "crypto_version": "Wersja krypto: {{version}}",
"custom_livekit_url": {
"current_url": "Aktualnie ustawione na: ",
"from_config": "Aktualnie nie nadpisano ustawienia. Używany jest adres URL z dobrego źródła lub konfiguracji.",
"label": "Własny Livekit-url",
"reset": "Zresetuj nadpisanie",
"save": "Zapisz",
"saving": "Zapisuję..."
},
"debug_tile_layout_label": "Układ kafelków Debug", "debug_tile_layout_label": "Układ kafelków Debug",
"device_id": "ID urządzenia: {{id}}", "device_id": "ID urządzenia: {{id}}",
"duplicate_tiles_label": "Liczba dodatkowych kopii kafelków na uczestnika", "duplicate_tiles_label": "Liczba dodatkowych kopii kafelków na uczestnika",
@@ -65,6 +74,21 @@
"hostname": "Nazwa hosta: {{hostname}}", "hostname": "Nazwa hosta: {{hostname}}",
"livekit_server_info": "Informacje serwera LiveKit", "livekit_server_info": "Informacje serwera LiveKit",
"livekit_sfu": "LiveKit SFU: {{url}}", "livekit_sfu": "LiveKit SFU: {{url}}",
"matrixRTCMode": {
"Comptibility": {
"description": "Kompatybilny z serwerami domowymi, które nie obsługują sticky events (ale wszyscy inni klienci EC mają wersję v0.17.0 lub nowszą)",
"label": "Kompatybilność: state events & multi SFU"
},
"Legacy": {
"description": "Kompatybilny ze starszymi wersjami EC, które nie wspierają multi SFU",
"label": "Przestarzałe: state events & oldest membership SFU"
},
"Matrix_2_0": {
"description": "Kompatybilny tylko z serwerami domowymi obsługującymi sticky events i wszystkimi klientami EC w wersji v0.17.0 lub nowszej",
"label": "Matrix 2.0: sticky events & multi SFU"
},
"title": "Tryb MatrixRTC"
},
"matrix_id": "ID Matrix: {{id}}", "matrix_id": "ID Matrix: {{id}}",
"mute_all_audio": "Wycisz cały dźwięk (uczestnicy, reakcje, dźwięki dołączenia)", "mute_all_audio": "Wycisz cały dźwięk (uczestnicy, reakcje, dźwięki dołączenia)",
"show_connection_stats": "Pokaż statystyki połączenia", "show_connection_stats": "Pokaż statystyki połączenia",
@@ -74,25 +98,36 @@
"error": { "error": {
"call_is_not_supported": "Połączenie nie jest obsługiwane", "call_is_not_supported": "Połączenie nie jest obsługiwane",
"call_not_found": "Nie znaleziono połączenia", "call_not_found": "Nie znaleziono połączenia",
"call_not_found_description": "<0>Wygląda na to, że ten link nie należy do żadnego istniejącego połączenia. Sprawdź, czy posiadasz prawidłowy link lub <1>utwórz nowy</1>.</0>", "call_not_found_description": "<0>Wygląda na to, że ten link nie należy do żadnego istniejącego połączenia. Sprawdź, czy masz prawidłowy link lub <2> utwórz nowy</2>.</0>",
"connection_lost": "Utracono połączenie", "connection_lost": "Utracono połączenie",
"connection_lost_description": "Zostałeś rozłączony z rozmowy.", "connection_lost_description": "Zostałeś rozłączony z rozmowy.",
"e2ee_unsupported": "Niekompatybilna przeglądarka", "e2ee_unsupported": "Niekompatybilna przeglądarka",
"e2ee_unsupported_description": "Twoja przeglądarka nie wspiera szyfrowanych połączeń. Obsługiwane przeglądarki obejmują Chrome, Safari i Firefox 117+.", "e2ee_unsupported_description": "Twoja przeglądarka nie wspiera szyfrowanych połączeń. Obsługiwane przeglądarki obejmują Chrome, Safari i Firefox 117+.",
"failed_to_start_livekit": "Nie udało się uruchomić połączenia Livekit",
"generic": "Coś poszło nie tak", "generic": "Coś poszło nie tak",
"generic_description": "Wysłanie dziennika debug, pozwoli nam namierzyć problem.", "generic_description": "Wysłanie dziennika debug, pozwoli nam namierzyć problem.",
"insufficient_capacity": "Za mało miejsca", "insufficient_capacity": "Za mało miejsca",
"insufficient_capacity_description": "Serwer osiągnął maksymalną pojemność, przez co nie możesz dołączyć do połączenia. Spróbuj ponownie później lub skontaktuj się z administratorem serwera, jeśli problem nie zniknie.", "insufficient_capacity_description": "Serwer osiągnął maksymalną pojemność, przez co nie możesz dołączyć do połączenia. Spróbuj ponownie później lub skontaktuj się z administratorem serwera, jeśli problem nie zniknie.",
"livekit_connection_error": "Nie udało się połączyć z serwerem Livekit",
"livekit_connection_error_description": "Wystąpił błąd podczas łączenia się z serwerem Livekit (<1>Przyczyna:</1> <2>{{ reason }}</2>).",
"matrix_rtc_transport_missing": "Serwer nie jest skonfigurowany do pracy z {{brand}}. Prosimy o kontakt z administratorem serwera (Domena: {{domain}}, Kod błędu: {{ errorCode }}).",
"membership_manager": "Błąd menedżera członkostwa",
"membership_manager_description": "Menedżer członkostwa został zamknięty przez zbyt wiele powtarzających się błędów połączenia.",
"no_matrix_2_authorization_service": "Usługa autoryzacji dla serwera multimediów (SFU) jest nieaktualna.",
"open_elsewhere": "Otwarto w innej karcie", "open_elsewhere": "Otwarto w innej karcie",
"open_elsewhere_description": "{{brand}} został otwarty w innej karcie. Jeśli tak nie jest, spróbuj odświeżyć stronę.", "open_elsewhere_description": "{{brand}} został otwarty w innej karcie. Jeśli tak nie jest, spróbuj odświeżyć stronę.",
"peer_connection_timeout": "Upłynął limit czasu połączenia",
"peer_connection_timeout_description": "Upłynął czas oczekiwania na połączenie z serwerem multimediów. Spróbuj połączyć się z inną siecią lub wyłączyć VPN. Jeśli problem nadal występuje, zapoznaj się z naszym <0>poradnikiem rozwiązywania problemów</0> lub skontaktuj się z administratorem serwera.",
"room_creation_restricted": "Nie udało się utworzyć połączenia", "room_creation_restricted": "Nie udało się utworzyć połączenia",
"room_creation_restricted_description": "Tworzenie połączeń mogło zostać ograniczone tylko do autoryzowanych użytkowników. Spróbuj ponownie później lub skontaktuj się z administratorem serwera, jeśli problem nie minie.", "room_creation_restricted_description": "Tworzenie połączeń mogło zostać ograniczone tylko do autoryzowanych użytkowników. Spróbuj ponownie później lub skontaktuj się z administratorem serwera, jeśli problem nie minie.",
"sticky_events_required": "Serwer domowy nie wspiera połączeń Matrix 2.0",
"sticky_events_required_description": "Wybrana konfiguracja została ustawiona na korzystanie z połączeń Matrix 2.0, lecz serwer domowy nie wspiera ogłaszania sticky events (MSC4354). Poproś administratora serwera o aktualizację lub zmień konfigurację.",
"unexpected_ec_error": "Wystąpił nieoczekiwany błąd (<0>Kod błędu:</0> <1>{{ errorCode }}</1>). Skontaktuj się z administratorem serwera." "unexpected_ec_error": "Wystąpił nieoczekiwany błąd (<0>Kod błędu:</0> <1>{{ errorCode }}</1>). Skontaktuj się z administratorem serwera."
}, },
"group_call_loader": { "group_call_loader": {
"banned_body": "Zostałeś zbanowany z pokoju.", "banned_body": "Zostałeś zbanowany z pokoju.",
"banned_heading": "Zbanowany", "banned_heading": "Zbanowany",
"call_ended_body": "Zostałeś usunięty z rozmowy.", "call_ended_body": "Zostałeś usunięty z połączenia.",
"call_ended_heading": "Połączenie zakończone", "call_ended_heading": "Połączenie zakończone",
"knock_reject_body": "Członkowie pokoju odrzucili Twoją prośbę o dołączenie.", "knock_reject_body": "Członkowie pokoju odrzucili Twoją prośbę o dołączenie.",
"knock_reject_heading": "Nie możesz dołączyć", "knock_reject_heading": "Nie możesz dołączyć",
@@ -112,17 +147,18 @@
}, },
"join_existing_call_modal": { "join_existing_call_modal": {
"join_button": "Tak, dołącz do połączenia", "join_button": "Tak, dołącz do połączenia",
"text": "Te połączenie już istnieje, czy chcesz do niego dołączyć?", "text": "Połączenie już istnieje, czy chcesz do niej dołączyć?",
"title": "Dołączyć do istniejącego połączenia?" "title": "Dołączyć do istniejącego połączenia?"
}, },
"layout_grid_label": "Siatka", "layout_grid_label": "Siatka",
"layout_spotlight_label": "Centrum uwagi", "layout_spotlight_label": "Centrum uwagi",
"layout_switch_label": "Układ",
"lobby": { "lobby": {
"ask_to_join": "Poproś o dołączenie do rozmowy", "ask_to_join": "Poproś o dołączenie do połączenia",
"join_as_guest": "Dołącz jako gość", "join_as_guest": "Dołącz jako gość",
"join_button": "Dołącz do połączenia", "join_button": "Dołącz do połączenia",
"leave_button": "Wróć do ostatnie", "leave_button": "Wróć do ostatnie",
"waiting_for_invite": "Żądanie wysłane" "waiting_for_invite": "Prośba wysłana! Oczekiwanie na zatwierdzenie…"
}, },
"log_in": "Zaloguj", "log_in": "Zaloguj",
"logging_in": "Logowanie…", "logging_in": "Logowanie…",
@@ -162,14 +198,15 @@
"screenshare_button_label": "Udostępnij ekran", "screenshare_button_label": "Udostępnij ekran",
"settings": { "settings": {
"audio_tab": { "audio_tab": {
"effect_volume_description": "Dostosuj głośność, z jaką odtwarzane są efekty reakcji i podniesionej ręki", "effect_volume_description": "Dostosuj głośność efektów reakcji i podniesienia ręki.",
"effect_volume_label": "Głośność efektu dźwiękowego" "effect_volume_label": "Głośność efektów dźwiękowych"
}, },
"background_blur_header": "Tło", "background_blur_header": "Tło",
"background_blur_label": "Rozmycie tła wideo", "background_blur_label": "Rozmycie tła wideo",
"blur_not_supported_by_browser": "(Rozmycie tła nie jest wspierane przez to urządzenie.)", "blur_not_supported_by_browser": "(Rozmycie tła nie jest wspierane przez to urządzenie.)",
"developer_tab_title": "Programista", "developer_tab_title": "Programista",
"devices": { "devices": {
"activating": "Aktywuję…",
"camera": "Kamera", "camera": "Kamera",
"camera_numbered": "Kamera {{n}}", "camera_numbered": "Kamera {{n}}",
"change_device_button": "Zmień urządzenie audio", "change_device_button": "Zmień urządzenie audio",
@@ -192,7 +229,7 @@
"preferences_tab": { "preferences_tab": {
"developer_mode_label": "Tryb programisty", "developer_mode_label": "Tryb programisty",
"developer_mode_label_description": "Włącz tryb programisty i wyświetl kartę ustawień programisty.", "developer_mode_label_description": "Włącz tryb programisty i wyświetl kartę ustawień programisty.",
"introduction": "Tutaj możesz skonfigurować dodatkowe opcje dla lepszych doświadczeń.", "introduction": "Tutaj możesz skonfigurować dodatkowe opcje dla lepszego komfortu użytkowania.",
"reactions_play_sound_description": "Odtwórz efekt dźwiękowy, gdy ktoś wyślę reakcję w trakcie połączenia.", "reactions_play_sound_description": "Odtwórz efekt dźwiękowy, gdy ktoś wyślę reakcję w trakcie połączenia.",
"reactions_play_sound_label": "Odtwórz dźwięki reakcji", "reactions_play_sound_label": "Odtwórz dźwięki reakcji",
"reactions_show_description": "Odtwórz animację, gdy ktoś wyślę reakcję.", "reactions_show_description": "Odtwórz animację, gdy ktoś wyślę reakcję.",
@@ -201,26 +238,31 @@
"show_hand_raised_timer_label": "Pokaż czas po podniesieniu ręki" "show_hand_raised_timer_label": "Pokaż czas po podniesieniu ręki"
} }
}, },
"star_rating_input_label_one": "{{count}} gwiazdki", "star_rating_input_label_one": "{{count}} gwiazdka",
"star_rating_input_label_other": "{{count}} gwiazdki", "star_rating_input_label_few": "{{count}} gwiazdki",
"star_rating_input_label_many": "{{count}} gwiazdek",
"start_new_call": "Rozpocznij nowe połączenie", "start_new_call": "Rozpocznij nowe połączenie",
"start_video_button_label": "Rozpocznij wideo", "start_video_button_label": "Rozpocznij wideo",
"stop_screenshare_button_label": "Udostępnianie ekranu", "stop_screenshare_button_label": "Udostępnianie ekranu",
"stop_video_button_label": "Zakończ wideo", "stop_video_button_label": "Zakończ wideo",
"submitting": "Wysyłanie…", "submitting": "Wysyłanie…",
"switch_camera": "Przełącz kamerę", "switch_camera": "Przełącz kamerę",
"technical_details": "Szczegóły techniczne",
"unauthenticated_view_body": "Nie masz konta? <2>Utwórz je</2>", "unauthenticated_view_body": "Nie masz konta? <2>Utwórz je</2>",
"unauthenticated_view_login_button": "Zaloguj się do swojego konta", "unauthenticated_view_login_button": "Zaloguj się na swoje konto",
"unauthenticated_view_ssla_caption": "Klikając \"Przejdź\", wyrażasz zgodę na naszą <2>Umowę licencyjną oprogramowania i usług (SSLA)</2>", "unauthenticated_view_ssla_caption": "Klikając \"Przejdź\", wyrażasz zgodę na naszą <2>Umowę licencyjną oprogramowania i usług (SSLA)</2>",
"unmute_microphone_button_label": "Odcisz mikrofon", "unmute_microphone_button_label": "Wyłącz wyciszenie mikrofonu",
"version": "Wersja: {{version}}", "version": "{{productName}} wersja: {{version}}",
"video_tile": { "video_tile": {
"always_show": "Zawsze pokazuj", "always_show": "Zawsze pokazuj",
"call_ended": "Połączenie zakończone",
"calling": "Łączenie...",
"camera_starting": "Wczytywanie wideo...", "camera_starting": "Wczytywanie wideo...",
"collapse": "Zwiń", "collapse": "Zwiń",
"expand": "Rozwiń", "expand": "Rozwiń",
"mute_for_me": "Wycisz dla mnie", "mute_for_me": "Wycisz dla mnie",
"muted_for_me": "Wyciszone dla mnie", "muted_for_me": "Wyciszone dla mnie",
"screen_share_volume": "Głośność udostępniania ekranu",
"volume": "Głośność", "volume": "Głośność",
"waiting_for_media": "Oczekiwanie na media..." "waiting_for_media": "Oczekiwanie na media..."
} }
+6 -4
View File
@@ -54,6 +54,7 @@
"@radix-ui/react-slider": "^1.1.2", "@radix-ui/react-slider": "^1.1.2",
"@radix-ui/react-visually-hidden": "^1.0.3", "@radix-ui/react-visually-hidden": "^1.0.3",
"@react-spring/web": "^10.0.0", "@react-spring/web": "^10.0.0",
"@rolldown/plugin-babel": "^0.2.3",
"@sentry/react": "^8.0.0", "@sentry/react": "^8.0.0",
"@sentry/vite-plugin": "^3.0.0", "@sentry/vite-plugin": "^3.0.0",
"@storybook/addon-docs": "^10.3.6", "@storybook/addon-docs": "^10.3.6",
@@ -80,7 +81,8 @@
"@vitejs/plugin-react": "^6.0.2", "@vitejs/plugin-react": "^6.0.2",
"@vitest/browser-playwright": "^4.1.5", "@vitest/browser-playwright": "^4.1.5",
"@vitest/coverage-v8": "^4.0.18", "@vitest/coverage-v8": "^4.0.18",
"@vitest/ui": "4.1.9", "@vitest/ui": "4.1.10",
"babel-plugin-react-compiler": "^1.0.0",
"classnames": "^2.3.1", "classnames": "^2.3.1",
"copy-to-clipboard": "^3.3.3", "copy-to-clipboard": "^3.3.3",
"eslint-plugin-element-call": "link:eslint", "eslint-plugin-element-call": "link:eslint",
@@ -99,13 +101,13 @@
"node-stdlib-browser": "^1.3.1", "node-stdlib-browser": "^1.3.1",
"normalize.css": "^8.0.1", "normalize.css": "^8.0.1",
"observable-hooks": "^4.2.3", "observable-hooks": "^4.2.3",
"oxfmt": "^0.56.0", "oxfmt": "^0.61.0",
"oxlint": "^1.70.0", "oxlint": "^1.70.0",
"oxlint-tsgolint": "^0.23.0", "oxlint-tsgolint": "^0.25.0",
"pako": "^2.0.4", "pako": "^2.0.4",
"postcss": "^8.4.41", "postcss": "^8.4.41",
"postcss-preset-env": "^10.0.0", "postcss-preset-env": "^10.0.0",
"posthog-js": "1.374.0", "posthog-js": "1.408.2",
"qrcode": "^1.5.4", "qrcode": "^1.5.4",
"react": "19", "react": "19",
"react-dom": "19", "react-dom": "19",
@@ -36,6 +36,7 @@ widgetTest("Footer interaction in PiP", async ({ addUser, browserName }) => {
await valere.page.waitForTimeout(600); await valere.page.waitForTimeout(600);
// Switch to the other room, the call should go to PIP // Switch to the other room, the call should go to PIP
await TestHelpers.expandRoomList(valere.page);
await TestHelpers.switchToRoomNamed(valere.page, "OtherRoom"); await TestHelpers.switchToRoomNamed(valere.page, "OtherRoom");
// We should see the PIP overlay // We should see the PIP overlay
+1
View File
@@ -53,6 +53,7 @@ widgetTest("Put call in PIP", async ({ addUser, browserName }) => {
}); });
// Switch to the other room, the call should go to PIP // Switch to the other room, the call should go to PIP
await TestHelpers.expandRoomList(valere.page);
await TestHelpers.switchToRoomNamed(valere.page, "DoubleTask"); await TestHelpers.switchToRoomNamed(valere.page, "DoubleTask");
// We should see the PIP overlay // We should see the PIP overlay
+9 -4
View File
@@ -73,9 +73,6 @@ export class TestHelpers {
audioOnly: boolean = false, audioOnly: boolean = false,
isDM: boolean = false, isDM: boolean = false,
): Promise<void> { ): Promise<void> {
// XXX This using the notification toast to join the room.
// Not the button in the header
await page.waitForTimeout(3000); await page.waitForTimeout(3000);
const label = isDM const label = isDM
? audioOnly ? audioOnly
@@ -85,7 +82,9 @@ export class TestHelpers {
await expect(page.getByText(label)).toBeVisible({ await expect(page.getByText(label)).toBeVisible({
timeout: 10000, timeout: 10000,
}); });
await page.getByRole("button", { name: "Join" }).click({ // XXX This using the notification toast to join the room.
// Not the buttons in the header or timeline
await page.getByRole("alert").getByRole("button", { name: "Join" }).click({
timeout: 5000, timeout: 5000,
}); });
} }
@@ -347,6 +346,12 @@ export class TestHelpers {
} }
} }
public static async expandRoomList(page: Page): Promise<void> {
await page
.getByRole("separator", { name: "Click or drag to expand" })
.click();
}
/** /**
* Switches to a room in the room list by its name. * Switches to a room in the room list by its name.
* @param page - The EW page * @param page - The EW page
+8 -2
View File
@@ -39,7 +39,10 @@ widgetTest(
).toBeVisible(); ).toBeVisible();
await expect(whistler.page.getByText("Incoming voice call")).toBeVisible(); await expect(whistler.page.getByText("Incoming voice call")).toBeVisible();
await whistler.page.getByRole("button", { name: "Join" }).click(); await whistler.page
.getByRole("alert")
.getByRole("button", { name: "Join" })
.click();
await expect( await expect(
whistler.page.locator('iframe[title="Element Call"]'), whistler.page.locator('iframe[title="Element Call"]'),
@@ -129,7 +132,10 @@ widgetTest(
).toBeVisible(); ).toBeVisible();
await expect(whistler.page.getByText("Incoming video call")).toBeVisible(); await expect(whistler.page.getByText("Incoming video call")).toBeVisible();
await whistler.page.getByRole("button", { name: "Join" }).click(); await whistler.page
.getByRole("alert")
.getByRole("button", { name: "Join" })
.click();
await expect( await expect(
whistler.page.locator('iframe[title="Element Call"]'), whistler.page.locator('iframe[title="Element Call"]'),
+2018 -2330
View File
File diff suppressed because it is too large Load Diff
+23 -5
View File
@@ -29,12 +29,30 @@ overrides:
# Security fixes: # Security fixes:
# - https://github.com/element-hq/element-call/security/dependabot/110 # - https://github.com/element-hq/element-call/security/dependabot/110
# - https://github.com/element-hq/element-call/security/dependabot/122 # - https://github.com/element-hq/element-call/security/dependabot/122
"qs": "^6.14.1" # - https://github.com/element-hq/element-call/security/dependabot/179
# Security fix: https://github.com/element-hq/element-call/security/dependabot/106 "qs": "^6.15.2"
"js-yaml": "^4.1.1" # Security fixes:
# - https://github.com/element-hq/element-call/security/dependabot/106
# - https://github.com/element-hq/element-call/security/dependabot/203
"js-yaml": "^4.2.0"
# Storybook declares support for 0.27.0 only but empirically works fine with 0.28.0. # Storybook declares support for 0.27.0 only but empirically works fine with 0.28.0.
"esbuild": "^0.28.0" "esbuild": "^0.28.0"
# Multiple security fixes: https://github.com/nodejs/undici/releases/tag/v6.24.0 # Security fixes:
"undici": "^6.24.0" # - https://github.com/nodejs/undici/releases/tag/v6.24.0
# - https://github.com/element-hq/element-call/security/dependabot/201
# - https://github.com/element-hq/element-call/security/dependabot/199
"undici": "^6.27.0"
# Security fix: https://github.com/advisories/GHSA-rf6f-7fwh-wjgh # Security fix: https://github.com/advisories/GHSA-rf6f-7fwh-wjgh
"flatted": "^3.4.2" "flatted": "^3.4.2"
# Security fix: https://github.com/element-hq/element-call/security/dependabot/184
"ws": "^8.21.0"
# Security fixes:
# - https://github.com/element-hq/element-call/security/dependabot/191
# - https://github.com/element-hq/element-call/security/dependabot/190
# - https://github.com/element-hq/element-call/security/dependabot/192
# - https://github.com/element-hq/element-call/security/dependabot/194
# - https://github.com/element-hq/element-call/security/dependabot/198
# - https://github.com/element-hq/element-call/security/dependabot/196
# - https://github.com/element-hq/element-call/security/dependabot/195
# - https://github.com/element-hq/element-call/security/dependabot/193
"dompurify": "^3.4.11"
+3
View File
@@ -16,12 +16,15 @@ import {
HeaderStyle, HeaderStyle,
getUrlParams, getUrlParams,
} from "../src/UrlParams"; } from "../src/UrlParams";
import { mockConfig } from "./utils/test";
const ROOM_NAME = "roomNameHere"; const ROOM_NAME = "roomNameHere";
const ROOM_ID = "!d45f138fsd"; const ROOM_ID = "!d45f138fsd";
const ORIGIN = "https://call.element.io"; const ORIGIN = "https://call.element.io";
const HOMESERVER = "localhost"; const HOMESERVER = "localhost";
mockConfig();
describe("UrlParams", () => { describe("UrlParams", () => {
describe("handles URL with /room/", () => { describe("handles URL with /room/", () => {
it("and nothing else", () => { it("and nothing else", () => {
+52 -43
View File
@@ -16,10 +16,12 @@ import inCallViewStyles from "../room/InCallView.module.css";
import { useStaticViewModel } from "../state/ViewModel"; import { useStaticViewModel } from "../state/ViewModel";
import { ReactionsSenderContext } from "../reactions/useReactionsSender"; import { ReactionsSenderContext } from "../reactions/useReactionsSender";
import { type ReactionOption } from "../reactions"; import { type ReactionOption } from "../reactions";
import { type GridMode } from "../state/CallViewModel/CallViewModel";
import { MediaDevicesContext } from "../MediaDevicesContext"; import { MediaDevicesContext } from "../MediaDevicesContext";
import { MediaDevices } from "../state/MediaDevices"; import { MediaDevices } from "../state/MediaDevices";
import { globalScope } from "../state/ObservableScope"; import { globalScope } from "../state/ObservableScope";
import { constant } from "../state/Behavior";
import { type LayoutMode } from "../state/LayoutSwitchViewModel";
// consts for tests // consts for tests
const reactionIdentifier = "@user:example.com:DEVICE"; const reactionIdentifier = "@user:example.com:DEVICE";
const reactionData = { const reactionData = {
@@ -32,6 +34,7 @@ const mediaDevices = new MediaDevices(globalScope);
/** /**
* A wrapper component that is used for: * A wrapper component that is used for:
* - exposing the snapshot via props so the storybook documents the snapshot properties (basically unpack them form the vm) * - exposing the snapshot via props so the storybook documents the snapshot properties (basically unpack them form the vm)
* - constructing the layout switch view model
* - Add additional react context * - Add additional react context
* The paraeters are all params from the FooterSnapshot, * The paraeters are all params from the FooterSnapshot,
* the Snapshot of the vm, the wrapper will create a mocked vm from it and pass it to the CallFooter. * the Snapshot of the vm, the wrapper will create a mocked vm from it and pass it to the CallFooter.
@@ -40,11 +43,18 @@ const mediaDevices = new MediaDevices(globalScope);
*/ */
function CallFooterStoryWrapper({ function CallFooterStoryWrapper({
children, children,
layout,
setLayout,
...vmSnapshot ...vmSnapshot
}: FooterSnapshot & { }: Omit<FooterSnapshot, "layoutSwitchVm"> & {
children?: false | JSX.Element | JSX.Element[] | undefined; children?: false | JSX.Element | JSX.Element[] | undefined;
layout: LayoutMode | null;
setLayout: (value: LayoutMode) => void;
}): ReactNode { }): ReactNode {
const vm = useStaticViewModel(vmSnapshot); const vm = useStaticViewModel({
...vmSnapshot,
layoutSwitchVm: layout && { layout$: constant(layout), setLayout },
});
return ( return (
<MediaDevicesContext value={mediaDevices}> <MediaDevicesContext value={mediaDevices}>
<div className={inCallViewStyles.inRoom}> <div className={inCallViewStyles.inRoom}>
@@ -62,28 +72,50 @@ function CallFooterStoryWrapper({
); );
} }
const meta = {
component: CallFooterStoryWrapper,
} satisfies Meta<typeof CallFooterStoryWrapper>;
export default meta;
type Story = StoryObj<typeof meta>;
const fnArgType = { const fnArgType = {
control: { type: "select" as const }, control: { type: "select" as const },
options: ["MockedCallback", "undefined"], options: ["MockedCallback", "undefined"],
mapping: { MockedCallback: fn(), undefined: undefined }, mapping: { MockedCallback: fn(), undefined: undefined },
}; };
const meta = {
component: CallFooterStoryWrapper,
argTypes: {
layout: {
control: "radio",
options: ["grid", "spotlight"] satisfies LayoutMode[],
},
audioOutputSwitcher: {
control: "select",
options: ["NoOutputCallback", "speaker", "earpiece"],
table: { defaultValue: { summary: "NoOutputCallback" } },
mapping: {
NoOutputCallback: undefined,
// This is inverersed (speaker<->earpice) because the switcher object stores the target output, not the current one.
speaker: { targetOutput: "earpiece", switch: fn() },
earpiece: { targetOutput: "speaker", switch: fn() },
},
},
toggleScreenSharing: fnArgType,
openSettings: fnArgType,
toggleAudio: fnArgType,
toggleVideo: fnArgType,
hangup: fnArgType,
},
} satisfies Meta<typeof CallFooterStoryWrapper>;
export default meta;
type Story = StoryObj<typeof meta>;
export const Default: Story = { export const Default: Story = {
args: { args: {
showLogo: false, showLogo: false,
layoutMode: "grid", layout: "grid",
setLayout: fn(),
audioEnabled: true, audioEnabled: true,
audioBusy: false, audioBusy: false,
videoEnabled: true, videoEnabled: true,
videoBusy: false, videoBusy: false,
setLayoutMode: fn(),
openSettings: fn(), openSettings: fn(),
toggleAudio: fn(), toggleAudio: fn(),
toggleVideo: fn(), toggleVideo: fn(),
@@ -111,29 +143,6 @@ export const Default: Story = {
parameters: { parameters: {
layout: "fullscreen", layout: "fullscreen",
}, },
argTypes: {
layoutMode: {
control: "radio",
options: ["grid", "spotlight"] satisfies GridMode[],
},
audioOutputSwitcher: {
control: "select",
options: ["NoOutputCallback", "speaker", "earpiece"],
table: { defaultValue: { summary: "NoOutputCallback" } },
mapping: {
NoOutputCallback: undefined,
// This is inverersed (speaker<->earpice) because the switcher object stores the target output, not the current one.
speaker: { targetOutput: "earpiece", switch: fn() },
earpiece: { targetOutput: "speaker", switch: fn() },
},
},
toggleScreenSharing: fnArgType,
setLayoutMode: fnArgType,
openSettings: fnArgType,
toggleAudio: fnArgType,
toggleVideo: fnArgType,
hangup: fnArgType,
},
}; };
export const WithAudioAndVideoOptions: Story = { export const WithAudioAndVideoOptions: Story = {
@@ -194,7 +203,7 @@ export const AudioVideoEnabled: Story = {
const spotlightRadio = canvas.getByRole("radio", { name: "Spotlight" }); const spotlightRadio = canvas.getByRole("radio", { name: "Spotlight" });
await userEvent.click(spotlightRadio); await userEvent.click(spotlightRadio);
await expect(args.setLayoutMode).toHaveBeenCalledWith("spotlight"); await expect(args.setLayout).toHaveBeenCalledWith("spotlight");
const micButtonMute = canvas.getByRole("switch", { const micButtonMute = canvas.getByRole("switch", {
name: "Mute microphone", name: "Mute microphone",
@@ -225,14 +234,14 @@ export const SpotlightMode: Story = {
...Default, ...Default,
args: { args: {
...Default.args, ...Default.args,
layoutMode: "spotlight", layout: "spotlight",
}, },
play: async ({ args, canvasElement }) => { play: async ({ args, canvasElement }) => {
const canvas = within(canvasElement); const canvas = within(canvasElement);
const spotlightRadio = canvas.getByRole("radio", { name: "Grid" }); const spotlightRadio = canvas.getByRole("radio", { name: "Grid" });
await userEvent.click(spotlightRadio); await userEvent.click(spotlightRadio);
await expect(args.setLayoutMode).toHaveBeenCalledWith("grid"); await expect(args.setLayout).toHaveBeenCalledWith("grid");
}, },
}; };
@@ -264,7 +273,7 @@ export const Pip: Story = {
args: { args: {
...Default.args, ...Default.args,
buttonSize: "md", buttonSize: "md",
layoutMode: undefined, layout: null,
}, },
play: async ({ args, canvasElement }) => { play: async ({ args, canvasElement }) => {
const canvas = within(canvasElement); const canvas = within(canvasElement);
@@ -348,7 +357,7 @@ export const Lobby: Story = {
...Default.args, ...Default.args,
showLogo: false, showLogo: false,
openSettings: undefined, openSettings: undefined,
setLayoutMode: undefined, layout: null,
toggleScreenSharing: undefined, toggleScreenSharing: undefined,
}, },
parameters: { parameters: {
@@ -362,7 +371,7 @@ export const LobbyMobile: Story = {
...Default.args, ...Default.args,
showLogo: false, showLogo: false,
setLayoutMode: undefined, layout: null,
toggleScreenSharing: undefined, toggleScreenSharing: undefined,
}, },
globals: { globals: {
@@ -379,7 +388,7 @@ export const LobbyRecentButton: Story = {
...Default.args, ...Default.args,
children: <Link>Back To Recents</Link>, children: <Link>Back To Recents</Link>,
showLogo: false, showLogo: false,
setLayoutMode: undefined, layout: null,
toggleScreenSharing: undefined, toggleScreenSharing: undefined,
}, },
parameters: { parameters: {
@@ -393,7 +402,7 @@ export const LobbyRecentButtonMobile: Story = {
...Default.args, ...Default.args,
children: <Link>Back To Recents</Link>, children: <Link>Back To Recents</Link>,
showLogo: false, showLogo: false,
setLayoutMode: undefined, layout: null,
toggleScreenSharing: undefined, toggleScreenSharing: undefined,
}, },
globals: { globals: {
+7 -26
View File
@@ -7,12 +7,6 @@ Please see LICENSE in the repository root for full details.
import { type FC, type JSX, type Ref, useMemo } from "react"; import { type FC, type JSX, type Ref, useMemo } from "react";
import classNames from "classnames"; import classNames from "classnames";
import {
SpotlightViewIcon,
GridIcon,
} from "@vector-im/compound-design-tokens/assets/web/icons";
import { Switch } from "@vector-im/compound-web";
import { t } from "i18next";
import LogoMark from "../icons/LogoMark.svg?react"; import LogoMark from "../icons/LogoMark.svg?react";
import LogoType from "../icons/LogoType.svg?react"; import LogoType from "../icons/LogoType.svg?react";
@@ -28,13 +22,14 @@ import {
type ReactionData, type ReactionData,
} from "../button"; } from "../button";
import styles from "./CallFooter.module.css"; import styles from "./CallFooter.module.css";
import { type GridMode } from "../state/CallViewModel/CallViewModel";
import { import {
MediaMuteAndSwitchButton, MediaMuteAndSwitchButton,
type MenuOptions, type MenuOptions,
} from "./MediaMuteAndSwitchButton"; } from "./MediaMuteAndSwitchButton";
import { type ViewModel } from "../state/ViewModel"; import { type ViewModel } from "../state/ViewModel";
import { useBehavior } from "../useBehavior"; import { useBehavior } from "../useBehavior";
import { type LayoutSwitchViewModel } from "../state/LayoutSwitchViewModel";
import { LayoutSwitch } from "../room/LayoutSwitch";
export interface AudioOutputSwitcher { export interface AudioOutputSwitcher {
targetOutput: string; targetOutput: string;
@@ -61,8 +56,6 @@ export interface FooterActions {
/** Also controls if the videoMute button is disabled */ /** Also controls if the videoMute button is disabled */
toggleVideo: (() => void) | undefined; toggleVideo: (() => void) | undefined;
toggleBlur: (() => void) | undefined; toggleBlur: (() => void) | undefined;
/** Also controls if the layout button is visible */
setLayoutMode: ((mode: GridMode) => void) | undefined;
toggleScreenSharing: (() => void) | undefined; toggleScreenSharing: (() => void) | undefined;
/** Also controls if the settings button is visible */ /** Also controls if the settings button is visible */
openSettings: (() => void) | undefined; openSettings: (() => void) | undefined;
@@ -87,7 +80,8 @@ export interface FooterState {
buttonSize: "md" | "lg"; buttonSize: "md" | "lg";
showLogo: boolean; showLogo: boolean;
layoutMode: GridMode | undefined; /** Also controls if the layout switch is visible */
layoutSwitchVm: LayoutSwitchViewModel | null;
sharingScreen: boolean; sharingScreen: boolean;
@@ -126,8 +120,7 @@ export const CallFooter: FC<FooterProps> = ({
const asOverlay = useBehavior(vm.asOverlay$); const asOverlay = useBehavior(vm.asOverlay$);
const showFooter = useBehavior(vm.showFooter$); const showFooter = useBehavior(vm.showFooter$);
const hideControls = useBehavior(vm.hideControls$); const hideControls = useBehavior(vm.hideControls$);
const layoutMode = useBehavior(vm.layoutMode$); const layoutSwitchVm = useBehavior(vm.layoutSwitchVm$);
const setLayoutMode = useBehavior(vm.setLayoutMode$);
const openSettings = useBehavior(vm.openSettings$); const openSettings = useBehavior(vm.openSettings$);
const audioEnabled = useBehavior(vm.audioEnabled$); const audioEnabled = useBehavior(vm.audioEnabled$);
const audioBusy = useBehavior(vm.audioBusy$); const audioBusy = useBehavior(vm.audioBusy$);
@@ -317,20 +310,8 @@ export const CallFooter: FC<FooterProps> = ({
{(showLogo || debugTileLayout) && logoDebugContainer} {(showLogo || debugTileLayout) && logoDebugContainer}
</div> </div>
{!hideControls && <div className={styles.buttons}>{buttons}</div>} {!hideControls && <div className={styles.buttons}>{buttons}</div>}
{!hideControls && setLayoutMode && layoutMode && ( {!hideControls && layoutSwitchVm && (
<Switch<"spotlight", "grid"> <LayoutSwitch vm={layoutSwitchVm} className={styles.layout} />
name="layoutMode"
aria-label={t("layout_switch_label")}
leftLabel={t("layout_spotlight_label")}
leftValue="spotlight"
leftIcon={SpotlightViewIcon}
rightLabel={t("layout_grid_label")}
rightValue="grid"
rightIcon={GridIcon}
className={styles.layout}
value={layoutMode}
onChange={setLayoutMode}
/>
)} )}
</div> </div>
); );
+2 -11
View File
@@ -182,14 +182,7 @@ export function createCallFooterViewModel(
showLogo$: scope.behavior(isPip$.pipe(map((isPip) => showLogo && !isPip))), showLogo$: scope.behavior(isPip$.pipe(map((isPip) => showLogo && !isPip))),
layoutMode$: callModel.gridMode$, layoutSwitchVm$: callModel.layoutSwitchVm$,
setLayoutMode$: scope.behavior(
isPip$.pipe(
map((isPip) =>
!isPip && showControls ? callModel.setGridMode : undefined,
),
),
),
sharingScreen$: callModel.sharingScreen$, sharingScreen$: callModel.sharingScreen$,
toggleScreenSharing$: constant(callModel.toggleScreenSharing ?? undefined), toggleScreenSharing$: constant(callModel.toggleScreenSharing ?? undefined),
@@ -247,20 +240,18 @@ export function createLobbyFooterViewModel(
hideControls: false, hideControls: false,
asOverlay: false, asOverlay: false,
buttonSize: "lg", buttonSize: "lg",
showLayoutSwitcher: false,
openSettings, openSettings,
hangup, hangup,
debugTileLayout: false, debugTileLayout: false,
showFooter: true, showFooter: true,
toggleAudio: undefined, toggleAudio: undefined,
toggleVideo: undefined, toggleVideo: undefined,
setLayoutMode: undefined,
toggleScreenSharing: undefined, toggleScreenSharing: undefined,
audioEnabled: undefined, audioEnabled: undefined,
audioBusy: false, audioBusy: false,
videoEnabled: undefined, videoEnabled: undefined,
videoBusy: false, videoBusy: false,
layoutMode: undefined, layoutSwitchVm: null,
sharingScreen: false, sharingScreen: false,
audioOutputSwitcher: undefined, audioOutputSwitcher: undefined,
reactionIdentifier: undefined, reactionIdentifier: undefined,
-12
View File
@@ -183,12 +183,6 @@ export interface ConfigOptions {
// Overrides members from ConfigOptions that are always provided by the // Overrides members from ConfigOptions that are always provided by the
// default config and are therefore non-optional. // default config and are therefore non-optional.
export interface ResolvedConfigOptions extends ConfigOptions { export interface ResolvedConfigOptions extends ConfigOptions {
default_server_config: {
["m.homeserver"]: {
base_url: string;
server_name: string;
};
};
sync_disconnect_grace_period_ms: number; sync_disconnect_grace_period_ms: number;
ssla: string; ssla: string;
matrix_rtc_session: { matrix_rtc_session: {
@@ -202,12 +196,6 @@ export interface ResolvedConfigOptions extends ConfigOptions {
} }
export const DEFAULT_CONFIG: ResolvedConfigOptions = { export const DEFAULT_CONFIG: ResolvedConfigOptions = {
default_server_config: {
["m.homeserver"]: {
base_url: "http://localhost:8008",
server_name: "localhost",
},
},
features: { features: {
feature_use_device_session_member_events: true, feature_use_device_session_member_events: true,
}, },
@@ -10,28 +10,28 @@ import { type ReactNode, useCallback, useMemo } from "react";
import { useObservableEagerState } from "observable-hooks"; import { useObservableEagerState } from "observable-hooks";
import classNames from "classnames"; import classNames from "classnames";
import { type OneOnOneLandscapeLayout as OneOnOneLandscapeLayoutModel } from "../state/layout-types.ts"; import { type OneOnOneDesktopLayout as OneOnOneDesktopLayoutModel } from "../state/layout-types.ts";
import { type CallLayout, arrangeTiles } from "./CallLayout"; import { type CallLayout, arrangeTiles } from "./CallLayout";
import styles from "./OneOnOneLandscapeLayout.module.css"; import styles from "./OneOnOneDesktopLayout.module.css";
import { type DragCallback, useUpdateLayout } from "./Grid"; import { type DragCallback, useUpdateLayout } from "./Grid";
import { useBehavior } from "../useBehavior"; import { useBehavior } from "../useBehavior";
/** /**
* An implementation of the "one-on-one" layout for landscape screens, in which * An implementation of the "one-on-one" layout for desktop platforms, in which
* the remote participant is shown at maximum size, overlaid by a small view of * the remote participant is shown at maximum size, overlaid by a small view of
* the local participant. * the local participant.
*/ */
export const makeOneOnOneLandscapeLayout: CallLayout< export const makeOneOnOneDesktopLayout: CallLayout<
OneOnOneLandscapeLayoutModel OneOnOneDesktopLayoutModel
> = ({ minBounds$ }) => ({ > = ({ minBounds$ }) => ({
foreground: "fixed", foreground: "fixed",
fixed: function OneOnOneLandscapeLayoutFixed({ ref }): ReactNode { fixed: function OneOnOneDesktopLayoutFixed({ ref }): ReactNode {
useUpdateLayout(); useUpdateLayout();
return <div ref={ref} />; return <div ref={ref} />;
}, },
scrolling: function OneOnOneLandscapeLayoutScrolling({ scrolling: function OneOnOneDesktopLayoutScrolling({
ref, ref,
model, model,
Slot, Slot,
@@ -19,14 +19,28 @@ Please see LICENSE in the repository root for full details.
inset: var(--cpd-space-4x); inset: var(--cpd-space-4x);
} }
/* Give the PiP a landscape aspect ratio */
.pip[data-size="sm"] { .pip[data-size="sm"] {
inline-size: 88px; inline-size: 132px;
block-size: 132px; block-size: 88px;
} }
.pip[data-size="lg"] { .pip[data-size="lg"] {
inline-size: 140px; inline-size: 210px;
block-size: 210px; block-size: 140px;
}
@media (max-width: 600px) {
/* Give the PiP a portrait aspect ratio */
.pip[data-size="sm"] {
inline-size: 88px;
block-size: 132px;
}
.pip[data-size="lg"] {
inline-size: 140px;
block-size: 210px;
}
} }
.pip[data-block-alignment="start"] { .pip[data-block-alignment="start"] {
@@ -9,23 +9,23 @@ Please see LICENSE in the repository root for full details.
import { type ReactNode, useCallback } from "react"; import { type ReactNode, useCallback } from "react";
import classNames from "classnames"; import classNames from "classnames";
import { type OneOnOnePortraitLayout as OneOnOnePortraitLayoutModel } from "../state/layout-types.ts"; import { type OneOnOneMobileLayout as OneOnOneMobileLayoutModel } from "../state/layout-types.ts";
import { type CallLayout } from "./CallLayout"; import { type CallLayout } from "./CallLayout";
import styles from "./OneOnOnePortraitLayout.module.css"; import styles from "./OneOnOneMobileLayout.module.css";
import { type DragCallback, useUpdateLayout } from "./Grid"; import { type DragCallback, useUpdateLayout } from "./Grid";
import { useBehavior } from "../useBehavior"; import { useBehavior } from "../useBehavior";
/** /**
* An implementation of the "one-on-one" layout for portrait screens, in which * An implementation of the "one-on-one" layout for mobile platforms, in which
* the remote participant is shown at maximum size, overlaid by a small view of * the remote participant is shown at maximum size, overlaid by a small view of
* the local participant. * the local participant.
*/ */
export const makeOneOnOnePortraitLayout: CallLayout< export const makeOneOnOneMobileLayout: CallLayout<
OneOnOnePortraitLayoutModel OneOnOneMobileLayoutModel
> = () => ({ > = () => ({
foreground: "scrolling", foreground: "scrolling",
fixed: function OneOnOnePortraitLayoutFixed({ ref, model, Slot }): ReactNode { fixed: function OneOnOneMobileLayoutFixed({ ref, model, Slot }): ReactNode {
useUpdateLayout(); useUpdateLayout();
return ( return (
<div ref={ref} className={styles.layer}> <div ref={ref} className={styles.layer}>
@@ -38,7 +38,7 @@ export const makeOneOnOnePortraitLayout: CallLayout<
); );
}, },
scrolling: function OneOnOnePortraitLayoutScrolling({ scrolling: function OneOnOneMobileLayoutScrolling({
ref, ref,
model, model,
Slot, Slot,
+1 -2
View File
@@ -15,8 +15,7 @@ Please see LICENSE in the repository root for full details.
@import url("@fontsource/inconsolata/700.css"); @import url("@fontsource/inconsolata/700.css");
@import url("normalize.css/normalize.css") layer(normalize); @import url("normalize.css/normalize.css") layer(normalize);
@import url("@vector-im/compound-design-tokens/assets/web/css/compound-design-tokens.css") @import url("@vector-im/compound-design-tokens/assets/web/css/compound-design-tokens.css") layer(compound);
layer(compound);
@import url("@vector-im/compound-web/dist/style.css") layer(compound.components); @import url("@vector-im/compound-web/dist/style.css") layer(compound.components);
:root { :root {
+1 -1
View File
@@ -99,7 +99,7 @@ function renderTestComponent(
), ),
} as unknown as Room; } as unknown as Room;
if (explicitTracks?.length ?? 0 > 0) { if ((explicitTracks?.length ?? 0) > 0) {
tracks = explicitTracks!.map(({ participantId, source, kind }) => { tracks = explicitTracks!.map(({ participantId, source, kind }) => {
const participant = const participant =
liveKitParticipants.find((p) => p.identity === participantId) ?? liveKitParticipants.find((p) => p.identity === participantId) ??
+4 -4
View File
@@ -49,8 +49,8 @@ import { type EncryptionSystem } from "../e2ee/sharedKeyManagement";
import { E2eeType } from "../e2ee/e2eeType"; import { E2eeType } from "../e2ee/e2eeType";
import { makeGridLayout } from "../grid/GridLayout"; import { makeGridLayout } from "../grid/GridLayout";
import { type CallLayoutOutputs } from "../grid/CallLayout"; import { type CallLayoutOutputs } from "../grid/CallLayout";
import { makeOneOnOneLandscapeLayout } from "../grid/OneOnOneLandscapeLayout"; import { makeOneOnOneDesktopLayout } from "../grid/OneOnOneDesktopLayout";
import { makeOneOnOnePortraitLayout } from "../grid/OneOnOnePortraitLayout"; import { makeOneOnOneMobileLayout } from "../grid/OneOnOneMobileLayout";
import { makeSpotlightExpandedLayout } from "../grid/SpotlightExpandedLayout"; import { makeSpotlightExpandedLayout } from "../grid/SpotlightExpandedLayout";
import { makeSpotlightLandscapeLayout } from "../grid/SpotlightLandscapeLayout"; import { makeSpotlightLandscapeLayout } from "../grid/SpotlightLandscapeLayout";
import { makeSpotlightPortraitLayout } from "../grid/SpotlightPortraitLayout"; import { makeSpotlightPortraitLayout } from "../grid/SpotlightPortraitLayout";
@@ -483,8 +483,8 @@ export const InCallView: FC<InCallViewProps> = ({
"spotlight-landscape": makeSpotlightLandscapeLayout(inputs), "spotlight-landscape": makeSpotlightLandscapeLayout(inputs),
"spotlight-portrait": makeSpotlightPortraitLayout(inputs), "spotlight-portrait": makeSpotlightPortraitLayout(inputs),
"spotlight-expanded": makeSpotlightExpandedLayout(inputs), "spotlight-expanded": makeSpotlightExpandedLayout(inputs),
"one-on-one-landscape": makeOneOnOneLandscapeLayout(inputs), "one-on-one-desktop": makeOneOnOneDesktopLayout(inputs),
"one-on-one-portrait": makeOneOnOnePortraitLayout(inputs), "one-on-one-mobile": makeOneOnOneMobileLayout(inputs),
}; };
}, [gridBoundsObservable$]); }, [gridBoundsObservable$]);
+44
View File
@@ -0,0 +1,44 @@
/*
Copyright 2026 Element Creations Ltd.
SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
Please see LICENSE in the repository root for full details.
*/
import { useId, type FC } from "react";
import {
SpotlightViewIcon,
GridIcon,
} from "@vector-im/compound-design-tokens/assets/web/icons";
import { type LayoutSwitchViewModel } from "../state/LayoutSwitchViewModel";
import { useBehavior } from "../useBehavior";
import { useTranslation } from "react-i18next";
import { Switch } from "@vector-im/compound-web";
interface Props {
vm: LayoutSwitchViewModel;
className?: string;
}
export const LayoutSwitch: FC<Props> = ({ vm, className }) => {
const { t } = useTranslation();
const layout = useBehavior(vm.layout$);
const name = useId();
return (
<Switch<"spotlight", "grid">
name={name}
aria-label={t("layout_switch_label")}
leftLabel={t("layout_spotlight_label")}
leftValue="spotlight"
leftIcon={SpotlightViewIcon}
rightLabel={t("layout_grid_label")}
rightValue="grid"
rightIcon={GridIcon}
className={className}
value={layout}
onChange={vm.setLayout}
/>
);
};
+2 -6
View File
@@ -10,6 +10,8 @@ Please see LICENSE in the repository root for full details.
margin-right: var(--content-inset-right); margin-right: var(--content-inset-right);
min-block-size: 0; min-block-size: 0;
block-size: 50vh; block-size: 50vh;
aspect-ratio: 16 / 9;
max-width: 100%;
border-radius: var(--cpd-space-4x); border-radius: var(--cpd-space-4x);
position: relative; position: relative;
overflow: hidden; overflow: hidden;
@@ -66,12 +68,6 @@ video.mirror {
); );
} }
@media (min-aspect-ratio: 1 / 1) {
.preview > video {
aspect-ratio: 16 / 9;
}
}
@media (max-width: 550px) { @media (max-width: 550px) {
.preview { .preview {
margin-inline: 0; margin-inline: 0;
@@ -87,14 +87,14 @@ exports[`InCallView > rendering > renders 1`] = `
class="_scrollingGrid_4e7ff8 _grid_b0d1cd" class="_scrollingGrid_4e7ff8 _grid_b0d1cd"
> >
<div <div
class="_layer_b00c5f" class="_layer_185815"
> >
<div <div
class="_container_b00c5f _slot_b0d1cd" class="_container_185815 _slot_b0d1cd"
data-id="1" data-id="1"
> >
<div <div
class="_slot_b00c5f _local_b00c5f _slot_b0d1cd" class="_slot_185815 _local_185815 _slot_b0d1cd"
data-block-alignment="start" data-block-alignment="start"
data-id="0" data-id="0"
data-inline-alignment="end" data-inline-alignment="end"
@@ -432,8 +432,8 @@ exports[`InCallView > rendering > renders 1`] = `
data-size="lg" data-size="lg"
> >
<input <input
aria-labelledby="_r_19_" aria-labelledby="_r_1a_"
name="layoutMode" name="_r_19_"
type="radio" type="radio"
value="spotlight" value="spotlight"
/> />
@@ -452,9 +452,9 @@ exports[`InCallView > rendering > renders 1`] = `
/> />
</svg> </svg>
<input <input
aria-labelledby="_r_1e_" aria-labelledby="_r_1f_"
checked="" checked=""
name="layoutMode" name="_r_19_"
type="radio" type="radio"
value="grid" value="grid"
/> />
+101 -34
View File
@@ -144,13 +144,13 @@ export interface SpotlightExpandedLayoutSummary {
} }
export interface OneOnOneLandscapeLayoutSummary { export interface OneOnOneLandscapeLayoutSummary {
type: "one-on-one-landscape"; type: "one-on-one-desktop";
spotlight: string; spotlight: string;
pip: string; pip: string;
} }
export interface OneOnOnePortraitLayoutSummary { export interface OneOnOnePortraitLayoutSummary {
type: "one-on-one-portrait"; type: "one-on-one-mobile";
spotlight: string[]; spotlight: string[];
pip?: string; pip?: string;
pipSize: "sm" | "lg"; pipSize: "sm" | "lg";
@@ -205,7 +205,7 @@ function summarizeLayout$(l$: Observable<Layout>): Observable<LayoutSummary> {
pip: pip?.id, pip: pip?.id,
}), }),
); );
case "one-on-one-landscape": case "one-on-one-desktop":
return combineLatest( return combineLatest(
[l.spotlight.media$, l.pip.media$], [l.spotlight.media$, l.pip.media$],
(spotlight, pip) => ({ (spotlight, pip) => ({
@@ -214,7 +214,7 @@ function summarizeLayout$(l$: Observable<Layout>): Observable<LayoutSummary> {
pip: pip.id, pip: pip.id,
}), }),
); );
case "one-on-one-portrait": case "one-on-one-mobile":
return combineLatest( return combineLatest(
[ [
l.spotlight.media$, l.spotlight.media$,
@@ -327,8 +327,8 @@ describe.each([
}, },
(vm) => { (vm) => {
schedule(modeInputMarbles, { schedule(modeInputMarbles, {
s: () => vm.setGridMode("spotlight"), s: () => vm.layoutSwitchVm$.value!.setLayout("spotlight"),
g: () => vm.setGridMode("grid"), g: () => vm.layoutSwitchVm$.value!.setLayout("grid"),
}); });
expectObservable(summarizeLayout$(vm.layout$)).toBe( expectObservable(summarizeLayout$(vm.layout$)).toBe(
@@ -437,7 +437,7 @@ describe.each([
expectedLayoutMarbles, expectedLayoutMarbles,
{ {
a: { a: {
type: "one-on-one-landscape", type: "one-on-one-desktop",
pip: `${localId}:0`, pip: `${localId}:0`,
spotlight: `${aliceId}:0`, spotlight: `${aliceId}:0`,
}, },
@@ -453,7 +453,7 @@ describe.each([
}); });
}); });
test("one-on-one portrait layout shows local tile when video is enabled", () => { test("one-on-one mobile layout shows local tile when video is enabled", () => {
withTestScheduler(({ behavior, schedule, expectObservable }) => { withTestScheduler(({ behavior, schedule, expectObservable }) => {
// Local participant enables their video, then disables it // Local participant enables their video, then disables it
const videoInputMarbles = " ny--n"; const videoInputMarbles = " ny--n";
@@ -480,19 +480,19 @@ describe.each([
expectedLayoutMarbles, expectedLayoutMarbles,
{ {
a: { a: {
type: "one-on-one-portrait", type: "one-on-one-mobile",
spotlight: [`${aliceId}:0`], spotlight: [`${aliceId}:0`],
pip: undefined, pip: undefined,
pipSize: "lg", pipSize: "lg",
}, },
b: { b: {
type: "one-on-one-portrait", type: "one-on-one-mobile",
spotlight: [`${aliceId}:0`], spotlight: [`${aliceId}:0`],
pip: `${localId}:0`, pip: `${localId}:0`,
pipSize: "lg", pipSize: "lg",
}, },
c: { c: {
type: "one-on-one-portrait", type: "one-on-one-mobile",
spotlight: [`${aliceId}:0`], spotlight: [`${aliceId}:0`],
pip: `${localId}:0`, pip: `${localId}:0`,
pipSize: "sm", pipSize: "sm",
@@ -504,21 +504,21 @@ describe.each([
}); });
}); });
test("one-on-one portrait layout shows name tags in room with 3 members", () => { test("one-on-one mobile layout shows name tags in room with 3 members", () => {
withTestScheduler(({ behavior, schedule, expectObservable }) => { withTestScheduler(({ expectObservable }) => {
withCallViewModel( withCallViewModel(
{ {
remoteParticipants$: constant([aliceParticipant]), remoteParticipants$: constant([aliceParticipant]),
// Both Alice and Bob are with us in the room // Both Alice and Bob are with us in the room
roomMembers: [local, alice, bob], roomMembers: [local, alice, bob],
rtcMembers$: constant([localRtcMember, aliceRtcMember]), rtcMembers$: constant([localRtcMember, aliceRtcMember]),
windowSize$: constant({ width: 380, height: 700 }), // Mobile phone in portrait windowSize$: constant({ width: 380, height: 700 }), // Mobile phone
}, },
(vm) => { (vm) => {
// Uses one-on-one portrait layout // Uses one-on-one mobile layout
expectObservable(summarizeLayout$(vm.layout$)).toBe("a", { expectObservable(summarizeLayout$(vm.layout$)).toBe("a", {
a: { a: {
type: "one-on-one-portrait", type: "one-on-one-mobile",
spotlight: [`${aliceId}:0`], spotlight: [`${aliceId}:0`],
pip: undefined, pip: undefined,
pipSize: "lg", pipSize: "lg",
@@ -532,6 +532,65 @@ describe.each([
}); });
}); });
test("landscape mobile layouts show screen shares and group call participants", () => {
withTestScheduler(({ behavior, expectObservable }) => {
// Starts as a one-on-one call, then Alice shares her screen, then Bob
// joins, and finally Alice stops sharing her screen
const participantInputMarbles = " a--b";
const aliceSharingInputMarbles = " ny-n";
// Starts in one-on-one mobile layout, then goes to spotlight layout for
// the screen sharing and group call cases
const expectedLayoutMarbles = " ab-c";
// Whether the layout switch is visible. It should be hidden while in
// one-on-one layout.
const expectedLayoutSwitchMarbles = "ny--";
withCallViewModel(
{
remoteParticipants$: behavior(participantInputMarbles, {
a: [aliceParticipant],
b: [aliceParticipant, bobParticipant],
}),
roomMembers: [local, alice, bob],
rtcMembers$: behavior(participantInputMarbles, {
a: [localRtcMember, aliceRtcMember],
b: [localRtcMember, aliceRtcMember, bobRtcMember],
}),
sharingScreen: new Map([
[aliceParticipant, behavior(aliceSharingInputMarbles, yesNo)],
]),
windowSize$: constant({ width: 700, height: 380 }), // Mobile phone in landscape
},
(vm) => {
expectObservable(summarizeLayout$(vm.layout$)).toBe(
expectedLayoutMarbles,
{
a: {
type: "one-on-one-mobile",
spotlight: [`${aliceId}:0`],
pip: undefined,
pipSize: "sm",
},
b: {
type: "spotlight-landscape",
spotlight: [`${aliceId}:0:screen-share`],
grid: [`${localId}:0`, `${aliceId}:0`],
},
c: {
type: "spotlight-landscape",
spotlight: [`${aliceId}:0`],
grid: [`${localId}:0`, `${bobId}:0`],
},
},
);
expectObservable(
vm.layoutSwitchVm$.pipe(map((vm) => vm !== null)),
).toBe(expectedLayoutSwitchMarbles, yesNo);
},
);
});
});
test("participants stay in the same order unless to appear/disappear", () => { test("participants stay in the same order unless to appear/disappear", () => {
withTestScheduler(({ behavior, schedule, expectObservable }) => { withTestScheduler(({ behavior, schedule, expectObservable }) => {
const visibilityInputMarbles = "a"; const visibilityInputMarbles = "a";
@@ -706,14 +765,14 @@ describe.each([
{ {
a: { a: {
// This is the expected one-on-one layout for a narrow window // This is the expected one-on-one layout for a narrow window
type: "one-on-one-portrait", type: "one-on-one-mobile",
spotlight: [`${aliceId}:0`], spotlight: [`${aliceId}:0`],
pip: undefined, pip: undefined,
pipSize: "lg", pipSize: "lg",
}, },
b: { b: {
// In a larger window, expect the normal one-on-one layout // In a larger window, expect the one-on-one desktop layout
type: "one-on-one-landscape", type: "one-on-one-desktop",
pip: `${localId}:0`, pip: `${localId}:0`,
spotlight: `${aliceId}:0`, spotlight: `${aliceId}:0`,
}, },
@@ -763,7 +822,9 @@ describe.each([
]), ]),
}, },
(vm) => { (vm) => {
schedule(modeInputMarbles, { s: () => vm.setGridMode("spotlight") }); schedule(modeInputMarbles, {
s: () => vm.layoutSwitchVm$.value!.setLayout("spotlight"),
});
expectObservable(summarizeLayout$(vm.layout$)).toBe( expectObservable(summarizeLayout$(vm.layout$)).toBe(
expectedLayoutMarbles, expectedLayoutMarbles,
@@ -969,7 +1030,7 @@ describe.each([
}, },
(vm) => { (vm) => {
schedule(modeInputMarbles, { schedule(modeInputMarbles, {
s: () => vm.setGridMode("spotlight"), s: () => vm.layoutSwitchVm$.value!.setLayout("spotlight"),
}); });
schedule(expandInputMarbles, { schedule(expandInputMarbles, {
a: () => vm.toggleSpotlightExpanded$.value!(), a: () => vm.toggleSpotlightExpanded$.value!(),
@@ -1039,7 +1100,7 @@ describe.each([
}, },
(vm) => { (vm) => {
schedule(modeInputMarbles, { schedule(modeInputMarbles, {
s: () => vm.setGridMode("spotlight"), s: () => vm.layoutSwitchVm$.value!.setLayout("spotlight"),
}); });
schedule(expandInputMarbles, { schedule(expandInputMarbles, {
a: () => vm.toggleSpotlightExpanded$.value!(), a: () => vm.toggleSpotlightExpanded$.value!(),
@@ -1066,7 +1127,7 @@ describe.each([
}); });
test("expanded spotlight layout hides PiP tile in one-on-one voice call", () => { test("expanded spotlight layout hides PiP tile in one-on-one voice call", () => {
withTestScheduler(({ behavior, schedule, expectObservable }) => { withTestScheduler(({ schedule, expectObservable }) => {
withCallViewModel( withCallViewModel(
{ {
remoteParticipants$: constant([aliceParticipant]), remoteParticipants$: constant([aliceParticipant]),
@@ -1076,9 +1137,15 @@ describe.each([
[localParticipant, constant(false)], [localParticipant, constant(false)],
[aliceParticipant, constant(false)], [aliceParticipant, constant(false)],
]), ]),
windowSize$: constant({ width: 700, height: 380 }), // Mobile phone in landscape
}, },
(vm) => { (vm) => {
schedule("s", {
s: () => vm.layoutSwitchVm$.value!.setLayout("spotlight"),
});
schedule("a", {
a: () => vm.toggleSpotlightExpanded$.value!(),
});
// Layout should show remote tile only // Layout should show remote tile only
expectObservable(summarizeLayout$(vm.layout$)).toBe("a", { expectObservable(summarizeLayout$(vm.layout$)).toBe("a", {
a: { a: {
@@ -1110,8 +1177,8 @@ describe.each([
}, },
(vm) => { (vm) => {
schedule(modeInputMarbles, { schedule(modeInputMarbles, {
s: () => vm.setGridMode("spotlight"), s: () => vm.layoutSwitchVm$.value!.setLayout("spotlight"),
g: () => vm.setGridMode("grid"), g: () => vm.layoutSwitchVm$.value!.setLayout("grid"),
}); });
schedule(expandInputMarbles, { schedule(expandInputMarbles, {
a: () => vm.toggleSpotlightExpanded$.value!(), a: () => vm.toggleSpotlightExpanded$.value!(),
@@ -1177,7 +1244,7 @@ describe.each([
]), ]),
}, },
(vm) => { (vm) => {
vm.setGridMode("grid"); vm.layoutSwitchVm$.value!.setLayout("grid");
expectObservable(summarizeLayout$(vm.layout$)).toBe( expectObservable(summarizeLayout$(vm.layout$)).toBe(
expectedLayoutMarbles, expectedLayoutMarbles,
{ {
@@ -1187,7 +1254,7 @@ describe.each([
grid: [`${localId}:0`], grid: [`${localId}:0`],
}, },
b: { b: {
type: "one-on-one-landscape", type: "one-on-one-desktop",
pip: `${localId}:0`, pip: `${localId}:0`,
spotlight: `${aliceId}:0`, spotlight: `${aliceId}:0`,
}, },
@@ -1220,7 +1287,7 @@ describe.each([
}), }),
}, },
(vm) => { (vm) => {
vm.setGridMode("grid"); vm.layoutSwitchVm$.value!.setLayout("grid");
expectObservable(summarizeLayout$(vm.layout$)).toBe( expectObservable(summarizeLayout$(vm.layout$)).toBe(
expectedLayoutMarbles, expectedLayoutMarbles,
{ {
@@ -1230,7 +1297,7 @@ describe.each([
grid: [`${localId}:0`], grid: [`${localId}:0`],
}, },
b: { b: {
type: "one-on-one-landscape", type: "one-on-one-desktop",
pip: `${localId}:0`, pip: `${localId}:0`,
spotlight: `${aliceId}:0`, spotlight: `${aliceId}:0`,
}, },
@@ -1240,7 +1307,7 @@ describe.each([
grid: [`${localId}:0`, `${aliceId}:0`, `${daveId}:0`], grid: [`${localId}:0`, `${aliceId}:0`, `${daveId}:0`],
}, },
d: { d: {
type: "one-on-one-landscape", type: "one-on-one-desktop",
pip: `${localId}:0`, pip: `${localId}:0`,
spotlight: `${daveId}:0`, spotlight: `${daveId}:0`,
}, },
@@ -1464,7 +1531,7 @@ describe.each([
// ringing the entire time (even once timed out) // ringing the entire time (even once timed out)
expectObservable(summarizeLayout$(vm.layout$)).toBe("a", { expectObservable(summarizeLayout$(vm.layout$)).toBe("a", {
a: { a: {
type: "one-on-one-landscape", type: "one-on-one-desktop",
spotlight: `${localId}:0`, spotlight: `${localId}:0`,
pip: `ringing:${aliceUserId}`, pip: `ringing:${aliceUserId}`,
}, },
@@ -1510,12 +1577,12 @@ describe.each([
// ringing the entire time // ringing the entire time
expectObservable(summarizeLayout$(vm.layout$)).toBe("a 20ms b", { expectObservable(summarizeLayout$(vm.layout$)).toBe("a 20ms b", {
a: { a: {
type: "one-on-one-landscape", type: "one-on-one-desktop",
spotlight: `${localId}:0`, spotlight: `${localId}:0`,
pip: `ringing:${aliceUserId}`, pip: `ringing:${aliceUserId}`,
}, },
b: { b: {
type: "one-on-one-landscape", type: "one-on-one-desktop",
spotlight: `${aliceId}:0`, spotlight: `${aliceId}:0`,
pip: `${localId}:0`, pip: `${localId}:0`,
}, },
+96 -69
View File
@@ -70,8 +70,8 @@ import { setPipEnabled$ } from "../../controls";
import { TileStore } from "../TileStore"; import { TileStore } from "../TileStore";
import { gridLikeLayout } from "../GridLikeLayout"; import { gridLikeLayout } from "../GridLikeLayout";
import { spotlightExpandedLayout } from "../SpotlightExpandedLayout"; import { spotlightExpandedLayout } from "../SpotlightExpandedLayout";
import { oneOnOneLandscapeLayout } from "../OneOnOneLandscapeLayout"; import { oneOnOneDesktopLayout } from "../OneOnOneDesktopLayout";
import { oneOnOnePortraitLayout } from "../OneOnOnePortraitLayout"; import { oneOnOneMobileLayout } from "../OneOnOneMobileLayout";
import { pipLayout } from "../PipLayout"; import { pipLayout } from "../PipLayout";
import { type EncryptionSystem } from "../../e2ee/sharedKeyManagement"; import { type EncryptionSystem } from "../../e2ee/sharedKeyManagement";
import { import {
@@ -93,8 +93,8 @@ import {
type GridLayoutMedia, type GridLayoutMedia,
type Layout, type Layout,
type LayoutMedia, type LayoutMedia,
type OneOnOneLandscapeLayoutMedia, type OneOnOneDesktopLayoutMedia,
type OneOnOnePortraitLayoutMedia, type OneOnOneMobileLayoutMedia,
type SpotlightExpandedLayoutMedia, type SpotlightExpandedLayoutMedia,
type SpotlightLandscapeLayoutMedia, type SpotlightLandscapeLayoutMedia,
type SpotlightPortraitLayoutMedia, type SpotlightPortraitLayoutMedia,
@@ -141,7 +141,10 @@ import {
} from "./remoteMembers/MatrixMemberMetadata.ts"; } from "./remoteMembers/MatrixMemberMetadata.ts";
import { Publisher } from "./localMember/Publisher.ts"; import { Publisher } from "./localMember/Publisher.ts";
import { type Connection } from "./remoteMembers/Connection.ts"; import { type Connection } from "./remoteMembers/Connection.ts";
import { createLayoutModeSwitch } from "./LayoutSwitch.ts"; import {
type LayoutSwitchViewModel,
createLayoutSwitchViewModel,
} from "../LayoutSwitchViewModel.ts";
import { import {
createWrappedUserMedia, createWrappedUserMedia,
type WrappedUserMediaViewModel, type WrappedUserMediaViewModel,
@@ -201,8 +204,6 @@ const smallMobileCallThreshold = 3;
// with the interface // with the interface
const showFooterMs = 4000; const showFooterMs = 4000;
export type GridMode = "grid" | "spotlight";
export type WindowMode = "normal" | "narrow" | "flat" | "pip"; export type WindowMode = "normal" | "narrow" | "flat" | "pip";
interface LayoutScanState { interface LayoutScanState {
@@ -349,8 +350,7 @@ export interface CallViewModel {
showNameTags$: Behavior<boolean>; showNameTags$: Behavior<boolean>;
spotlightExpanded$: Behavior<boolean>; spotlightExpanded$: Behavior<boolean>;
toggleSpotlightExpanded$: Behavior<(() => void) | null>; toggleSpotlightExpanded$: Behavior<(() => void) | null>;
gridMode$: Behavior<GridMode>; layoutSwitchVm$: Behavior<LayoutSwitchViewModel | null>;
setGridMode: (value: GridMode) => void;
// header/footer visibility // header/footer visibility
showHeader$: Behavior<boolean>; showHeader$: Behavior<boolean>;
@@ -1056,7 +1056,7 @@ export function createCallViewModel$(
spotlightExpandedToggle$, spotlightExpandedToggle$,
); );
const { setGridMode, gridMode$ } = createLayoutModeSwitch( const layoutSwitchVm = createLayoutSwitchViewModel(
scope, scope,
windowMode$, windowMode$,
hasRemoteScreenShares$, hasRemoteScreenShares$,
@@ -1108,56 +1108,60 @@ export function createCallViewModel$(
), ),
); );
const oneOnOneLayoutMedia$: Observable<{ const oneOnOneLayoutMedia$: Behavior<{
local: LocalUserMediaViewModel; local: LocalUserMediaViewModel;
remote: UserMediaViewModel | RingingMediaViewModel; remote: UserMediaViewModel | RingingMediaViewModel;
} | null> = combineLatest([userMedia$, screenShares$]).pipe( } | null> = scope.behavior(
switchMap(([userMedia, screenShares]) => { combineLatest([userMedia$, screenShares$]).pipe(
// One-on-one layout only supports 2 user media, no screen shares switchMap(([userMedia, screenShares]) => {
if (userMedia.length <= 2 && screenShares.length === 0) { // One-on-one layout only supports 2 user media, no screen shares
const local = userMedia.find( if (userMedia.length <= 2 && screenShares.length === 0) {
(vm): vm is WrappedUserMediaViewModel & LocalUserMediaViewModel => const local = userMedia.find(
vm.type === "user" && vm.local, (vm): vm is WrappedUserMediaViewModel & LocalUserMediaViewModel =>
); vm.type === "user" && vm.local,
if (local !== undefined) {
const remote = userMedia.find(
(vm): vm is WrappedUserMediaViewModel & RemoteUserMediaViewModel =>
vm.type === "user" && !vm.local,
); );
if (remote !== undefined) return of({ local, remote }); if (local !== undefined) {
const remote = userMedia.find(
// If there's no other user media in the call (could still happen in (
// this branch due to the duplicate tiles option), we could possibly vm,
// show ringing media instead ): vm is WrappedUserMediaViewModel & RemoteUserMediaViewModel =>
if (userMedia.length === 1) vm.type === "user" && !vm.local,
return ringingMedia$.pipe(
map(
(ringingMedia) =>
ringingMedia && { local, remote: ringingMedia },
),
); );
}
}
return of(null); if (remote !== undefined) return of({ local, remote });
}),
// If there's no other user media in the call (could still happen in
// this branch due to the duplicate tiles option), we could possibly
// show ringing media instead
if (userMedia.length === 1)
return ringingMedia$.pipe(
map(
(ringingMedia) =>
ringingMedia && { local, remote: ringingMedia },
),
);
}
}
return of(null);
}),
),
); );
const oneOnOneLandscapeLayoutMedia$: Observable<OneOnOneLandscapeLayoutMedia | null> = const oneOnOneDesktopLayoutMedia$: Observable<OneOnOneDesktopLayoutMedia | null> =
oneOnOneLayoutMedia$.pipe( oneOnOneLayoutMedia$.pipe(
map((media) => { map((media) => {
if (media === null) return null; if (media === null) return null;
return media.remote.type === "ringing" return media.remote.type === "ringing"
? { ? {
type: "one-on-one-landscape" as const, type: "one-on-one-desktop" as const,
edgeToEdge: false, edgeToEdge: false,
spotlight: media.local, spotlight: media.local,
pip: media.remote, pip: media.remote,
} }
: { : {
type: "one-on-one-landscape" as const, type: "one-on-one-desktop" as const,
edgeToEdge: false, edgeToEdge: false,
spotlight: media.remote, spotlight: media.remote,
pip: media.local, pip: media.local,
@@ -1165,13 +1169,13 @@ export function createCallViewModel$(
}), }),
); );
const oneOnOnePortraitLayoutMedia$: Observable<OneOnOnePortraitLayoutMedia | null> = const oneOnOneMobileLayoutMedia$: Observable<OneOnOneMobileLayoutMedia | null> =
oneOnOneLayoutMedia$.pipe( oneOnOneLayoutMedia$.pipe(
switchMap((media) => { switchMap((media) => {
if (media === null) return of(null); if (media === null) return of(null);
return media.local.videoEnabled$.pipe( return media.local.videoEnabled$.pipe(
map((videoEnabled) => ({ map((videoEnabled) => ({
type: "one-on-one-portrait" as const, type: "one-on-one-mobile" as const,
edgeToEdge: true as const, edgeToEdge: true as const,
spotlight: media.remote, spotlight: media.remote,
pip: videoEnabled ? media.local : undefined, pip: videoEnabled ? media.local : undefined,
@@ -1223,11 +1227,11 @@ export function createCallViewModel$(
switchMap((windowMode) => { switchMap((windowMode) => {
switch (windowMode) { switch (windowMode) {
case "normal": case "normal":
return gridMode$.pipe( return layoutSwitchVm.layout$.pipe(
switchMap((gridMode) => { switchMap((layout) => {
switch (gridMode) { switch (layout) {
case "grid": case "grid":
return oneOnOneLandscapeLayoutMedia$.pipe( return oneOnOneDesktopLayoutMedia$.pipe(
switchMap((oneOnOne) => switchMap((oneOnOne) =>
oneOnOne === null ? gridLayoutMedia$ : of(oneOnOne), oneOnOne === null ? gridLayoutMedia$ : of(oneOnOne),
), ),
@@ -1244,7 +1248,7 @@ export function createCallViewModel$(
}), }),
); );
case "narrow": case "narrow":
return oneOnOnePortraitLayoutMedia$.pipe( return oneOnOneMobileLayoutMedia$.pipe(
switchMap((oneOnOne) => switchMap((oneOnOne) =>
oneOnOne === null oneOnOne === null
? combineLatest([grid$, spotlight$], (grid, spotlight) => ? combineLatest([grid$, spotlight$], (grid, spotlight) =>
@@ -1257,17 +1261,23 @@ export function createCallViewModel$(
), ),
); );
case "flat": case "flat":
return gridMode$.pipe( return oneOnOneMobileLayoutMedia$.pipe(
switchMap((gridMode) => { switchMap((oneOnOne) =>
switch (gridMode) { oneOnOne === null
case "grid": ? layoutSwitchVm.layout$.pipe(
// Yes, grid mode actually gets you a "spotlight" layout in switchMap((layout) => {
// this window mode. switch (layout) {
return spotlightLandscapeLayoutMedia$(true); case "grid":
case "spotlight": // Yes, grid mode actually gets you a "spotlight" layout in
return spotlightExpandedLayoutMedia$(true); // this window mode.
} return spotlightLandscapeLayoutMedia$(true);
}), case "spotlight":
return spotlightExpandedLayoutMedia$(true);
}
}),
)
: of(oneOnOne),
),
); );
case "pip": case "pip":
return pipLayoutMedia$; return pipLayoutMedia$;
@@ -1295,8 +1305,8 @@ export function createCallViewModel$(
// indicators. And in one-on-one layout there's no question as to who is // indicators. And in one-on-one layout there's no question as to who is
// speaking. // speaking.
case "spotlight-expanded": case "spotlight-expanded":
case "one-on-one-landscape": case "one-on-one-desktop":
case "one-on-one-portrait": case "one-on-one-mobile":
return false; return false;
default: default:
return true; return true;
@@ -1308,7 +1318,7 @@ export function createCallViewModel$(
const showNameTags$ = scope.behavior<boolean>( const showNameTags$ = scope.behavior<boolean>(
layoutMedia$.pipe( layoutMedia$.pipe(
switchMap((l) => switchMap((l) =>
l.type === "pip" || l.type === "one-on-one-portrait" l.type === "pip" || l.type === "one-on-one-mobile"
? matrixRoomMembers$.pipe( ? matrixRoomMembers$.pipe(
map( map(
(members) => (members) =>
@@ -1352,6 +1362,22 @@ export function createCallViewModel$(
layoutMedia$.pipe(map(({ edgeToEdge }) => edgeToEdge)), layoutMedia$.pipe(map(({ edgeToEdge }) => edgeToEdge)),
); );
// Only show the layout switch in cases where it has an effect on the layout
const showLayoutSwitch$ = windowMode$.pipe(
switchMap((windowMode) => {
switch (windowMode) {
case "normal":
return of(true);
case "flat":
return oneOnOneLayoutMedia$.pipe(
map((oneOnOne) => oneOnOne === null),
);
default:
return of(false);
}
}),
);
const screenTap$ = new Subject<void>(); const screenTap$ = new Subject<void>();
const controlsTap$ = new Subject<void>(); const controlsTap$ = new Subject<void>();
const screenHover$ = new Subject<void>(); const screenHover$ = new Subject<void>();
@@ -1513,16 +1539,16 @@ export function createCallViewModel$(
prevTiles, prevTiles,
); );
break; break;
case "one-on-one-landscape": case "one-on-one-desktop":
[layout, newTiles] = oneOnOneLandscapeLayout( [layout, newTiles] = oneOnOneDesktopLayout(
media, media,
landscapePipAlignment$, landscapePipAlignment$,
prevTiles, prevTiles,
); );
pip = layout.pip; pip = layout.pip;
break; break;
case "one-on-one-portrait": case "one-on-one-mobile":
[layout, newTiles] = oneOnOnePortraitLayout( [layout, newTiles] = oneOnOneMobileLayout(
media, media,
portraitPipSize$, portraitPipSize$,
portraitPipAlignment$, portraitPipAlignment$,
@@ -1769,8 +1795,9 @@ export function createCallViewModel$(
spotlightExpanded$: spotlightExpanded$, spotlightExpanded$: spotlightExpanded$,
toggleSpotlightExpanded$: toggleSpotlightExpanded$, toggleSpotlightExpanded$: toggleSpotlightExpanded$,
gridMode$: gridMode$, layoutSwitchVm$: scope.behavior(
setGridMode: setGridMode, showLayoutSwitch$.pipe(map((show) => (show ? layoutSwitchVm : null))),
),
layout$: layout$, layout$: layout$,
localMatrixLivekitMember$, localMatrixLivekitMember$,
remoteMatrixLivekitMembers$: scope.behavior( remoteMatrixLivekitMembers$: scope.behavior(
-93
View File
@@ -1,93 +0,0 @@
/*
Copyright 2025 Element Creations Ltd.
SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
Please see LICENSE in the repository root for full details.
*/
import {
combineLatest,
map,
Subject,
startWith,
skipWhile,
switchMap,
} from "rxjs";
import { type GridMode, type WindowMode } from "./CallViewModel.ts";
import { constant, type Behavior } from "../Behavior.ts";
import { type ObservableScope } from "../ObservableScope.ts";
/**
* Creates a layout mode switch that allows switching between grid and spotlight modes.
* The actual layout mode might switch automatically to spotlight if there is a
* remote screen share active or if the window mode is flat.
*
* @param scope - The observable scope to manage subscriptions.
* @param windowMode$ - The current window mode.
* @param hasRemoteScreenShares$ - A behavior indicating if there are remote screen shares active.
*/
export function createLayoutModeSwitch(
scope: ObservableScope,
windowMode$: Behavior<WindowMode>,
hasRemoteScreenShares$: Behavior<boolean>,
): {
gridMode$: Behavior<GridMode>;
setGridMode: (value: GridMode) => void;
} {
const userSelection$ = new Subject<GridMode>();
// Callback to set the grid mode desired by the user.
// Notice that this is only a preference, the actual grid mode can be overridden
// if there is a remote screen share active.
const setGridMode = (value: GridMode): void => userSelection$.next(value);
/**
* The natural grid mode - the mode that the grid would prefer to be in,
* not accounting for the user's manual selections.
*/
const naturalGridMode$ = scope.behavior<GridMode>(
combineLatest(
[hasRemoteScreenShares$, windowMode$],
(hasRemoteScreenShares, windowMode) =>
// When there are screen shares or the window is flat (as with a phone
// in landscape orientation), spotlight is a better experience.
// We want screen shares to be big and readable, and we want flipping
// your phone into landscape to be a quick way of maximising the
// spotlight tile.
hasRemoteScreenShares || windowMode === "flat" ? "spotlight" : "grid",
),
);
/**
* The layout mode of the media tile grid.
*/
const gridMode$ = scope.behavior<GridMode>(
// Whenever the user makes a selection, we enter a new mode of behavior:
userSelection$.pipe(
map((selection) => {
if (selection === "grid")
// The user has selected grid mode. Start by respecting their choice,
// but then follow the natural mode again as soon as it matches.
return naturalGridMode$.pipe(
skipWhile((naturalMode) => naturalMode !== selection),
startWith(selection),
);
// The user has selected spotlight mode. If this matches the natural
// mode, then follow the natural mode going forward.
return selection === naturalGridMode$.value
? naturalGridMode$
: constant(selection);
}),
// Initially the mode of behavior is to just follow the natural grid mode.
startWith(naturalGridMode$),
// Switch between each mode of behavior.
switchMap((mode$) => mode$),
),
);
return {
gridMode$,
setGridMode,
};
}
@@ -7,31 +7,31 @@ Please see LICENSE in the repository root for full details.
import { describe, test } from "vitest"; import { describe, test } from "vitest";
import { createLayoutModeSwitch } from "./LayoutSwitch"; import { createLayoutSwitchViewModel } from "./LayoutSwitchViewModel";
import { testScope, withTestScheduler } from "../../utils/test"; import { testScope, withTestScheduler } from "../utils/test";
function testLayoutSwitch({ function testLayoutSwitch({
windowMode = "n", windowMode = "n",
hasScreenShares = "n", hasScreenShares = "n",
userSelection = "", userSelection = "",
expectedGridMode, expectedLayout,
}: { }: {
windowMode?: string; windowMode?: string;
hasScreenShares?: string; hasScreenShares?: string;
userSelection?: string; userSelection?: string;
expectedGridMode: string; expectedLayout: string;
}): void { }): void {
withTestScheduler(({ behavior, schedule, expectObservable }) => { withTestScheduler(({ behavior, schedule, expectObservable }) => {
const { gridMode$, setGridMode } = createLayoutModeSwitch( const { layout$, setLayout } = createLayoutSwitchViewModel(
testScope(), testScope(),
behavior(windowMode, { n: "normal", N: "narrow", f: "flat" }), behavior(windowMode, { n: "normal", N: "narrow", f: "flat" }),
behavior(hasScreenShares, { y: true, n: false }), behavior(hasScreenShares, { y: true, n: false }),
); );
schedule(userSelection, { schedule(userSelection, {
g: () => setGridMode("grid"), g: () => setLayout("grid"),
s: () => setGridMode("spotlight"), s: () => setLayout("spotlight"),
}); });
expectObservable(gridMode$).toBe(expectedGridMode, { expectObservable(layout$).toBe(expectedLayout, {
g: "grid", g: "grid",
s: "spotlight", s: "spotlight",
}); });
@@ -39,94 +39,88 @@ function testLayoutSwitch({
} }
describe("default mode", () => { describe("default mode", () => {
test("uses grid layout by default", () => test("uses grid layout in normal window", () =>
testLayoutSwitch({ testLayoutSwitch({
expectedGridMode: "g", windowMode: " n",
expectedLayout: "g",
})); }));
test("uses spotlight mode when window mode is flat", () => test("uses grid layout in flat window", () =>
testLayoutSwitch({ testLayoutSwitch({
windowMode: " f", windowMode: " f",
expectedGridMode: "s", expectedLayout: "g",
})); }));
}); });
test("allows switching modes manually", () => test("allows switching modes manually", () =>
testLayoutSwitch({ testLayoutSwitch({
userSelection: " --sgs", userSelection: " --sgs",
expectedGridMode: "g-sgs", expectedLayout: "g-sgs",
})); }));
test("switches to spotlight mode when there is a remote screen share", () => test("switches to spotlight mode when there is a remote screen share", () =>
testLayoutSwitch({ testLayoutSwitch({
hasScreenShares: " n--y", hasScreenShares: "n--y",
expectedGridMode: "g--s", expectedLayout: " g--s",
})); }));
test("can manually switch to grid when there is a screenshare", () => test("can manually switch to grid when there is a screenshare", () =>
testLayoutSwitch({ testLayoutSwitch({
hasScreenShares: " n-y", hasScreenShares: "n-y",
userSelection: " ---g", userSelection: " ---g",
expectedGridMode: "g-sg", expectedLayout: " g-sg",
})); }));
test("auto-switches after manually selecting grid", () => test("auto-switches after manually selecting grid", () =>
testLayoutSwitch({ testLayoutSwitch({
// Two screenshares will happen in sequence. There is a screen share that // Two screenshares will happen in sequence. There is a screen share that
// forces spotlight, then the user manually switches back to grid. // forces spotlight, then the user manually switches back to grid.
hasScreenShares: " n-y-ny", hasScreenShares: "n-y-ny",
userSelection: " ---g", userSelection: " ---g",
expectedGridMode: "g-sg-s", expectedLayout: " g-sg-s",
// If we did want to respect manual selection, the expectation would be: g-sg // If we did want to respect manual selection, the expectation would be: g-sg
})); }));
test("switches back to grid mode when the remote screen share ends", () => test("switches back to grid mode when the remote screen share ends", () =>
testLayoutSwitch({ testLayoutSwitch({
hasScreenShares: " n--y--n", hasScreenShares: "n--y--n",
expectedGridMode: "g--s--g", expectedLayout: " g--s--g",
})); }));
test("auto-switches to spotlight again after first screen share ends", () => test("auto-switches to spotlight again after first screen share ends", () =>
testLayoutSwitch({ testLayoutSwitch({
hasScreenShares: " nyny", hasScreenShares: "nyny",
expectedGridMode: "gsgs", expectedLayout: " gsgs",
})); }));
test("switches manually to grid after screen share while manually in spotlight", () => test("switches manually to grid after screen share while manually in spotlight", () =>
testLayoutSwitch({ testLayoutSwitch({
// Initially, no one is sharing. Then the user manually switches to spotlight. // Initially, no one is sharing. Then the user manually switches to spotlight.
// After a screen share starts, the user manually switches to grid. // After a screen share starts, the user manually switches to grid.
hasScreenShares: " n-y", hasScreenShares: "n-y",
userSelection: " -s-g", userSelection: " -s-g",
expectedGridMode: "gs-g", expectedLayout: " gs-g",
}));
test("auto-switches to spotlight when in flat window mode", () =>
testLayoutSwitch({
// First normal, then narrow, then flat.
windowMode: " nNf",
expectedGridMode: "g-s",
})); }));
test("allows switching modes manually when in flat window mode", () => test("allows switching modes manually when in flat window mode", () =>
testLayoutSwitch({ testLayoutSwitch({
// Window becomes flat, then user switches to grid and back. // Window becomes flat, then user switches to spotlight and back.
// Finally the window returns to a normal shape. // Finally the window returns to a normal shape.
windowMode: " nf--n", windowMode: " nf--n",
userSelection: " --gs", userSelection: " --sg",
expectedGridMode: "gsgsg", expectedLayout: "g-sg",
})); }));
test("stays in spotlight while there are screen shares even when window mode changes", () => test("switches to grid when in flat window mode even when there are screen shares", () =>
testLayoutSwitch({ testLayoutSwitch({
windowMode: " nfn", windowMode: " nf",
hasScreenShares: " y", hasScreenShares: "y",
expectedGridMode: "s", expectedLayout: " sg",
})); }));
test("ignores end of screen share until window mode returns to normal", () => test("ignores screen share until window mode returns to normal", () =>
testLayoutSwitch({ testLayoutSwitch({
windowMode: " nf-n", windowMode: " f-n",
hasScreenShares: " y-n", hasScreenShares: "ny-n",
expectedGridMode: "s--g", expectedLayout: " g-sg",
})); }));
+99
View File
@@ -0,0 +1,99 @@
/*
Copyright 2025 Element Creations Ltd.
SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
Please see LICENSE in the repository root for full details.
*/
import {
combineLatest,
map,
Subject,
startWith,
skipWhile,
switchAll,
} from "rxjs";
import { type WindowMode } from "./CallViewModel/CallViewModel.ts";
import { constant, type Behavior } from "./Behavior.ts";
import { type ObservableScope } from "./ObservableScope.ts";
export type LayoutMode = "spotlight" | "grid";
export interface LayoutSwitchViewModel {
/**
* The layout mode of the call's media tiles.
*/
layout$: Behavior<LayoutMode>;
setLayout: (value: LayoutMode) => void;
}
/**
* Creates a layout mode switch that allows switching between grid and spotlight layouts.
* The actual layout mode might switch automatically to spotlight if there is a
* remote screen share active or if the window mode is flat.
*
* @param scope - The observable scope to manage subscriptions.
* @param windowMode$ - The current window mode.
* @param hasRemoteScreenShares$ - A behavior indicating if there are remote screen shares active.
*/
export function createLayoutSwitchViewModel(
scope: ObservableScope,
windowMode$: Behavior<WindowMode>,
hasRemoteScreenShares$: Behavior<boolean>,
): LayoutSwitchViewModel {
const userSelection$ = new Subject<LayoutMode>();
// Callback to set the layout desired by the user.
// Notice that this is only a preference, the actual layout can be overridden
// if there is a remote screen share active.
const setLayout = (value: LayoutMode): void => userSelection$.next(value);
/**
* The natural layout - the layout that the interface would prefer to be in,
* not accounting for the user's manual selections.
*/
const naturalLayout$ = scope.behavior<LayoutMode>(
combineLatest(
[hasRemoteScreenShares$, windowMode$],
(hasRemoteScreenShares, windowMode) => {
// When the window is flat (as with a phone in landscape orientation),
// grid is preferable as there's usually more than enough horizontal
// space to fit in some grid tiles on the side.
if (windowMode === "flat") return "grid";
// When there are screen shares, spotlight is a better experience. We
// want them to be big and readable.
return hasRemoteScreenShares ? "spotlight" : "grid";
},
),
);
/**
* The layout mode of the call's media tiles.
*/
const layout$ = scope.behavior<LayoutMode>(
// Whenever the user makes a selection, we enter a new mode of behavior:
userSelection$.pipe(
map((selection) => {
if (selection === "grid")
// The user has selected grid. Start by respecting their choice, but
// then follow the natural mode again as soon as it matches.
return naturalLayout$.pipe(
skipWhile((naturalMode) => naturalMode !== selection),
startWith(selection),
);
// The user has selected spotlight. If this matches the natural layout,
// then follow the natural layout going forward.
return selection === naturalLayout$.value
? naturalLayout$
: constant(selection);
}),
// Initially the mode of behavior is to just follow the natural layout.
startWith(naturalLayout$),
// Switch between each mode of behavior.
switchAll(),
),
);
return { layout$, setLayout };
}
@@ -10,19 +10,19 @@ import { type BehaviorSubject } from "rxjs";
import { import {
type Alignment, type Alignment,
type OneOnOneLandscapeLayout, type OneOnOneDesktopLayout,
type OneOnOneLandscapeLayoutMedia, type OneOnOneDesktopLayoutMedia,
} from "./layout-types"; } from "./layout-types";
import { type TileStore } from "./TileStore"; import { type TileStore } from "./TileStore";
/** /**
* Produces a one-on-one landscape layout with the given media. * Produces a one-on-one desktop layout with the given media.
*/ */
export function oneOnOneLandscapeLayout( export function oneOnOneDesktopLayout(
media: OneOnOneLandscapeLayoutMedia, media: OneOnOneDesktopLayoutMedia,
pipAlignment$: BehaviorSubject<Alignment>, pipAlignment$: BehaviorSubject<Alignment>,
prevTiles: TileStore, prevTiles: TileStore,
): [OneOnOneLandscapeLayout, TileStore] { ): [OneOnOneDesktopLayout, TileStore] {
const update = prevTiles.from(2); const update = prevTiles.from(2);
update.registerGridTile(media.pip); update.registerGridTile(media.pip);
update.registerGridTile(media.spotlight); update.registerGridTile(media.spotlight);
@@ -10,21 +10,21 @@ import { type BehaviorSubject } from "rxjs";
import { import {
type Alignment, type Alignment,
type OneOnOnePortraitLayout, type OneOnOneMobileLayout,
type OneOnOnePortraitLayoutMedia, type OneOnOneMobileLayoutMedia,
} from "./layout-types"; } from "./layout-types";
import { type TileStore } from "./TileStore"; import { type TileStore } from "./TileStore";
import { type Behavior } from "./Behavior"; import { type Behavior } from "./Behavior";
/** /**
* Produces a one-on-one portrait layout with the given media. * Produces a one-on-one mobile layout with the given media.
*/ */
export function oneOnOnePortraitLayout( export function oneOnOneMobileLayout(
media: OneOnOnePortraitLayoutMedia, media: OneOnOneMobileLayoutMedia,
pipSize$: Behavior<"sm" | "lg">, pipSize$: Behavior<"sm" | "lg">,
pipAlignment$: BehaviorSubject<Alignment>, pipAlignment$: BehaviorSubject<Alignment>,
prevTiles: TileStore, prevTiles: TileStore,
): [OneOnOnePortraitLayout, TileStore] { ): [OneOnOneMobileLayout, TileStore] {
const update = prevTiles.from(media.pip === undefined ? 0 : 1); const update = prevTiles.from(media.pip === undefined ? 0 : 1);
update.registerSpotlight([media.spotlight], true, "transparent"); update.registerSpotlight([media.spotlight], true, "transparent");
if (media.pip !== undefined) update.registerGridTile(media.pip); if (media.pip !== undefined) update.registerGridTile(media.pip);
+12 -12
View File
@@ -45,15 +45,15 @@ export interface SpotlightExpandedLayoutMedia {
pip?: UserMediaViewModel; pip?: UserMediaViewModel;
} }
export interface OneOnOneLandscapeLayoutMedia { export interface OneOnOneDesktopLayoutMedia {
type: "one-on-one-landscape"; type: "one-on-one-desktop";
edgeToEdge: false; edgeToEdge: false;
spotlight: UserMediaViewModel; spotlight: UserMediaViewModel;
pip: LocalUserMediaViewModel | RingingMediaViewModel; pip: LocalUserMediaViewModel | RingingMediaViewModel;
} }
export interface OneOnOnePortraitLayoutMedia { export interface OneOnOneMobileLayoutMedia {
type: "one-on-one-portrait"; type: "one-on-one-mobile";
edgeToEdge: true; edgeToEdge: true;
spotlight: UserMediaViewModel | RingingMediaViewModel; spotlight: UserMediaViewModel | RingingMediaViewModel;
pip?: LocalUserMediaViewModel; pip?: LocalUserMediaViewModel;
@@ -70,8 +70,8 @@ export type LayoutMedia =
| SpotlightLandscapeLayoutMedia | SpotlightLandscapeLayoutMedia
| SpotlightPortraitLayoutMedia | SpotlightPortraitLayoutMedia
| SpotlightExpandedLayoutMedia | SpotlightExpandedLayoutMedia
| OneOnOneLandscapeLayoutMedia | OneOnOneDesktopLayoutMedia
| OneOnOnePortraitLayoutMedia | OneOnOneMobileLayoutMedia
| PipLayoutMedia; | PipLayoutMedia;
export interface Alignment { export interface Alignment {
@@ -108,15 +108,15 @@ export interface SpotlightExpandedLayout {
pipAlignment$: BehaviorSubject<Alignment>; pipAlignment$: BehaviorSubject<Alignment>;
} }
export interface OneOnOneLandscapeLayout { export interface OneOnOneDesktopLayout {
type: "one-on-one-landscape"; type: "one-on-one-desktop";
spotlight: GridTileViewModel; spotlight: GridTileViewModel;
pip: GridTileViewModel; pip: GridTileViewModel;
pipAlignment$: BehaviorSubject<Alignment>; pipAlignment$: BehaviorSubject<Alignment>;
} }
export interface OneOnOnePortraitLayout { export interface OneOnOneMobileLayout {
type: "one-on-one-portrait"; type: "one-on-one-mobile";
spotlight: SpotlightTileViewModel; spotlight: SpotlightTileViewModel;
pip?: GridTileViewModel; pip?: GridTileViewModel;
pipSize$: Behavior<"sm" | "lg">; pipSize$: Behavior<"sm" | "lg">;
@@ -137,6 +137,6 @@ export type Layout =
| SpotlightLandscapeLayout | SpotlightLandscapeLayout
| SpotlightPortraitLayout | SpotlightPortraitLayout
| SpotlightExpandedLayout | SpotlightExpandedLayout
| OneOnOneLandscapeLayout | OneOnOneDesktopLayout
| OneOnOnePortraitLayout | OneOnOneMobileLayout
| PipLayout; | PipLayout;
+3
View File
@@ -33,6 +33,9 @@ Please see LICENSE in the repository root for full details.
.media.mirror video { .media.mirror video {
transform: scaleX(-1); transform: scaleX(-1);
/* In FF if you add a transform: scale/translate/matrix filter on an element,
it'll ignore the parents' border-radius, so force back the radius to avoid UI glitch*/
border-radius: inherit;
} }
.media[data-video-fit="cover"] video { .media[data-video-fit="cover"] video {
+1
View File
@@ -32,6 +32,7 @@ import {
global.IntersectionObserver = class MockIntersectionObserver { global.IntersectionObserver = class MockIntersectionObserver {
public observe(): void {} public observe(): void {}
public unobserve(): void {} public unobserve(): void {}
public disconnect(): void {}
} as unknown as typeof IntersectionObserver; } as unknown as typeof IntersectionObserver;
test("SpotlightTile is accessible", async () => { test("SpotlightTile is accessible", async () => {
+12
View File
@@ -28,6 +28,10 @@ test("useTypedEventEmitterState reacts to events", async () => {
const emitter = new TestEmitter(); const emitter = new TestEmitter();
const Test: FC = () => { const Test: FC = () => {
// Disable the React Compiler to work around the following bug:
// https://github.com/react/react/issues/34901
"use no memo";
const value = useTypedEventEmitterState( const value = useTypedEventEmitterState(
emitter, emitter,
"change", "change",
@@ -51,6 +55,10 @@ test("useTypedEventEmitterState reacts to changes made by an effect mounted on t
const emitter = new TestEmitter(); const emitter = new TestEmitter();
const Test: FC = () => { const Test: FC = () => {
// Disable the React Compiler to work around the following bug:
// https://github.com/react/react/issues/34901
"use no memo";
useEffect(() => emitter.setState(2), []); useEffect(() => emitter.setState(2), []);
const value = useTypedEventEmitterState( const value = useTypedEventEmitterState(
emitter, emitter,
@@ -69,6 +77,10 @@ test("useTypedEventEmitterState reacts to changes in getState", async () => {
const emitter = new TestEmitter(); const emitter = new TestEmitter();
const Test: FC = () => { const Test: FC = () => {
// Disable the React Compiler to work around the following bug:
// https://github.com/react/react/issues/34901
"use no memo";
const [fn, setFn] = useState(() => emitter.getState); const [fn, setFn] = useState(() => emitter.getState);
const value = useTypedEventEmitterState(emitter, "change", fn); const value = useTypedEventEmitterState(emitter, "change", fn);
return ( return (
+6
View File
@@ -439,6 +439,12 @@ export function mockConfig(
const spy = vi.spyOn(Config, "get").mockReturnValue({ const spy = vi.spyOn(Config, "get").mockReturnValue({
...DEFAULT_CONFIG, ...DEFAULT_CONFIG,
...config, ...config,
default_server_config: {
["m.homeserver"]: {
base_url: "http://localhost:8008",
server_name: "localhost",
},
},
}); });
// simulate loading the config // simulate loading the config
vi.spyOn(Config, "init").mockResolvedValue(void 0); vi.spyOn(Config, "init").mockResolvedValue(void 0);
+6 -3
View File
@@ -7,7 +7,7 @@ Please see LICENSE in the repository root for full details.
import { import {
loadEnv, loadEnv,
PluginOption, type PluginOption,
searchForWorkspaceRoot, searchForWorkspaceRoot,
type ConfigEnv, type ConfigEnv,
type UserConfig, type UserConfig,
@@ -19,8 +19,8 @@ import { codecovVitePlugin } from "@codecov/vite-plugin";
import { sentryVitePlugin } from "@sentry/vite-plugin"; import { sentryVitePlugin } from "@sentry/vite-plugin";
import { nodePolyfills } from "vite-plugin-node-polyfills"; import { nodePolyfills } from "vite-plugin-node-polyfills";
import wasm from "vite-plugin-wasm"; import wasm from "vite-plugin-wasm";
import babel from "@rolldown/plugin-babel";
import react from "@vitejs/plugin-react"; import react, { reactCompilerPreset } from "@vitejs/plugin-react";
import { realpathSync } from "fs"; import { realpathSync } from "fs";
import * as fs from "node:fs"; import * as fs from "node:fs";
@@ -29,6 +29,9 @@ export const vitePluginsConfig = ({
}: Pick<ConfigEnv, "mode">): UserConfig => { }: Pick<ConfigEnv, "mode">): UserConfig => {
const env = loadEnv(mode, process.cwd()); const env = loadEnv(mode, process.cwd());
const plugins: PluginOption[] = [ const plugins: PluginOption[] = [
babel({
presets: [reactCompilerPreset()],
}),
react(), react(),
wasm(), wasm(),
nodePolyfills({ nodePolyfills({