Compare commits

..
Author SHA1 Message Date
renovate[bot] 57d7f58dfc Update dependency posthog-js to v1.455.2 2026-12-01 01:20:50 +00:00
58 changed files with 1678 additions and 1754 deletions
+10 -2
View File
@@ -1,14 +1,22 @@
name: Prevent blocked
on:
pull_request:
# zizmor: ignore[dangerous-triggers]
# Reason: This workflow does not checkout code or use secrets.
# It only reads labels to set a failure status on the PR.
pull_request_target:
types: [opened, labeled, unlabeled, synchronize]
permissions: {}
permissions:
pull-requests: read
# Required to fail the check on the PR
statuses: write
jobs:
prevent-blocked:
name: Prevent blocked
runs-on: ubuntu-24.04
permissions:
pull-requests: read
steps:
- name: Add notice
uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7
+7 -2
View File
@@ -1,10 +1,15 @@
name: PR changelog label
on:
pull_request:
# zizmor: ignore[dangerous-triggers]
# This is safe because we do not use actions/checkout or execute untrusted code.
# Using pull_request_target is necessary to allow status writes for PRs from forks.
pull_request_target:
types: [labeled, unlabeled, opened, synchronize]
permissions: {}
permissions:
pull-requests: read
statuses: write
jobs:
pr-changelog-label:
+1 -4
View File
@@ -14,8 +14,6 @@ jobs:
# Only run on labelling and skip forks.
if: github.event.label.name == 'Claude-Review' && github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-24.04
# The turn limit below is generous, so bound the job by time instead.
timeout-minutes: 30
steps:
- name: Checkout code
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
@@ -100,8 +98,7 @@ jobs:
Use Markdown links for anything that can be navigated to on GitHub such
as files, commits, issues, pull requests, workflow runs, etc.
# Set a generous turn limit. It's bounded by timeout-minutes above.
claude_args: |
--model claude-fable-5-1
--allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(git log:*),Bash(git diff:*),Bash(git show:*)"
--max-turns 150
--max-turns 50
Binary file not shown.
-41
View File
@@ -1,41 +0,0 @@
/*
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.
*/
/**
* The js-sdk for the component: the package's own entry points
* (`lib/index.js`, `lib/browser-index.js`) throw when the host's copy has
* already loaded one, and `browser-index` also writes the host's globals.
* `lib/matrix` is the same API without either. The client this exports
* refuses the few calls that would collide with the host's js-sdk: a sync
* loop, crypto, and the IndexedDB stores both would open by the same name.
*/
import { IndexedDBStore, MatrixClient } from "matrix-js-sdk/lib/matrix";
function refuse<C extends { prototype: object }>(
cls: C,
name: string,
methods: (keyof C["prototype"] & string)[],
): void {
for (const method of methods)
Object.defineProperty(cls.prototype, method, {
value() {
throw new Error(
`${name}.${method} is not available in the Element Call component: the host's client does this`,
);
},
});
}
refuse(MatrixClient, "MatrixClient", [
"startClient",
"initRustCrypto",
"clearStores",
]);
refuse(IndexedDBStore, "IndexedDBStore", ["startup"]);
export * from "matrix-js-sdk/lib/matrix";
+1 -2
View File
@@ -34,8 +34,7 @@
"./style.css": "./dist/element-call.css"
},
"sideEffects": [
"*.css",
"./guestJsSdk.ts"
"*.css"
],
"scripts": {
"prepare": "cd .. && pnpm install --frozen-lockfile && pnpm build:component"
+2 -2
View File
@@ -19,10 +19,10 @@ services:
- ./backend/playwright_homeserver-othersite.yaml:/data/cfg/homeserver.yaml:Z
element-web:
# Pin to a SHA so that upstream cannot break our tests. Renovate handles regular updates.
image: ghcr.io/element-hq/element-web:develop@sha256:a9fba6e7ea9a32f62bc1459fcdad790662476ff1b2bcebc62fe47e5cf51e3932
image: ghcr.io/element-hq/element-web:develop@sha256:9ed1f2140ce855b8e599bf4b16f9be47c3295738989574efbb0b8f0e159c5de7
element-web-1:
# Pin to a SHA so that upstream cannot break our tests. Renovate handles regular updates.
image: ghcr.io/element-hq/element-web:develop@sha256:a9fba6e7ea9a32f62bc1459fcdad790662476ff1b2bcebc62fe47e5cf51e3932
image: ghcr.io/element-hq/element-web:develop@sha256:9ed1f2140ce855b8e599bf4b16f9be47c3295738989574efbb0b8f0e159c5de7
volumes:
# The other site opens the embedded package under test in place of the
# copy its image bundles (the first site opens the dev server's app.
+25 -25
View File
@@ -46,31 +46,31 @@ possible to support encryption.
These parameters are relevant to both [widget](./embedded_standalone.md) and [standalone](./embedded_standalone.md) modes:
| Name | Values | Required for widget | Required for SPA | Description |
| ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ---------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `intent` | `start_call`, `join_existing`, `start_call_voice`, `join_existing_voice`, `start_call_dm`, `join_existing_dm`, `start_call_dm_voice`, `join_existing_dm_voice`, or `video_room`. | No, defaults to `start_call` | No, defaults to `start_call` | The intent is a special url parameter that defines the defaults for all the other parameters. In most cases it should be enough to only set the intent to setup element-call. |
| `allowIceFallback` | `true` or `false` | No, defaults to `false` | No, defaults to `false` | Allows use of fallback STUN servers for ICE if the user's homeserver doesn’t provide any. |
| `posthogUserId` | Posthog analytics ID | No | No | Available only with user's consent for sharing telemetry in Element Web. |
| `confineToRoom` | `true` or `false` | No, defaults to `false` | No, defaults to `false` | Keeps the user confined to the current call/room. |
| `displayName` | | No | No | Display name used for auto-registration. |
| `enableE2EE` (deprecated) | `true` or `false` | No, defaults to `true` | No, defaults to `true` | Legacy flag to enable end-to-end encryption, not used in the `livekit` branch. |
| `fontScale` | A decimal number such as `0.9` | No, defaults to `1.0` | No, defaults to `1.0` | Factor by which to scale the interface's font size. |
| `fonts` | | No | No | Defines the font(s) used by the interface. Multiple font parameters can be specified: `?font=font-one&font=font-two...`. |
| `header` | `none`, `standard` or `app_bar` | No, defaults to `standard` | No, defaults to `standard` | The style of headers to show. `standard` is the default arrangement, `none` hides the header entirely, and `app_bar` produces a header with a back button like you might see in mobile apps. The callback for the back button is `window.controls.onBackButtonPressed`. |
| `hideScreensharing` | `true` or `false` | No, defaults to `false` | No, defaults to `false` | Hides the screen-sharing button. |
| `homeserver` | | Not applicable | No | Homeserver for registering a new (guest) user, configures non-default guest user server when creating a spa link. |
| `lang` | [BCP 47](https://www.rfc-editor.org/info/bcp47) code | No | No | The language the app should use. |
| `password` | | No | No | E2EE password when using a shared secret. (For individual sender keys in embedded mode this is not required.) |
| `controlledAudioDevices` | `true` or `false` | No, defaults to `false` | No, defaults to `false` | Whether the [global JS controls for audio devices](./controls.md#audio-devices) should be enabled, allowing the list of audio devices to be controlled by the app hosting Element Call. |
| `roomId` | [Matrix Room ID](https://spec.matrix.org/v1.12/appendices/#room-ids) | Yes | No | Anything about what room we're pointed to should be from useRoomIdentifier which parses the path and resolves alias with respect to the default server name, however roomId is an exception as we need the room ID in embedded widget mode, and not the room alias (or even the via params because we are not trying to join it). This is also not validated, where it is in `useRoomIdentifier()`. |
| `showControls` | `true` or `false` | No, defaults to `true` | No, defaults to `true` | Displays controls like mute, screen-share, invite, and hangup buttons during a call. |
| `skipLobby` (deprecated: use `intent` instead) | `true` or `false` | No. If `intent` is explicitly `start_call` then defaults to `true`. Otherwise defaults to `false` | No, defaults to `false` | Skips the lobby to join a call directly, can be combined with preload in widget. When `true` the audio and video inputs will be muted by default. (This means there currently is no way to start without muted video if one wants to skip the lobby. Also not in widget mode.) |
| `theme` | One of: `light`, `dark`, `light-high-contrast`, `dark-high-contrast` | No, defaults to `dark` | No, defaults to `dark` | UI theme to use. |
| `background` | One of: `solid`, `gradient` | No, defaults to `gradient` | No, defaults to `gradient` | Visual style of the page background. |
| `viaServers` | Comma separated list of [Matrix Server Names](https://spec.matrix.org/v1.12/appendices/#server-name) | Not applicable | No | Homeserver for joining a room, non-empty value required for rooms not on the user’s default homeserver. |
| `sendNotificationType` | `ring` or `notification` | No | No | Will send a "ring" or "notification" `m.rtc.notification` event if the user is the first one in the call. |
| `autoLeave` | `true` or `false` | No, defaults to `false` | No, defaults to `false` | Whether the app should automatically leave the call when there is no one left in the call. |
| `waitForCallPickup` | `true` or `false` | No, defaults to `false` | No, defaults to `false` | When sending a notification, show UI that the app is awaiting an answer, play a dial tone, and (in widget mode) auto-close the widget once the notification expires. |
| Name | Values | Required for widget | Required for SPA | Description |
| ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------- | ---------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `intent` | `start_call`, `join_existing`, `start_call_voice`, `join_existing_voice`, `start_call_dm`, `join_existing_dm`, `start_call_dm_voice`, or `join_existing_dm_voice`. | No, defaults to `start_call` | No, defaults to `start_call` | The intent is a special url parameter that defines the defaults for all the other parameters. In most cases it should be enough to only set the intent to setup element-call. |
| `allowIceFallback` | `true` or `false` | No, defaults to `false` | No, defaults to `false` | Allows use of fallback STUN servers for ICE if the user's homeserver doesn’t provide any. |
| `posthogUserId` | Posthog analytics ID | No | No | Available only with user's consent for sharing telemetry in Element Web. |
| `confineToRoom` | `true` or `false` | No, defaults to `false` | No, defaults to `false` | Keeps the user confined to the current call/room. |
| `displayName` | | No | No | Display name used for auto-registration. |
| `enableE2EE` (deprecated) | `true` or `false` | No, defaults to `true` | No, defaults to `true` | Legacy flag to enable end-to-end encryption, not used in the `livekit` branch. |
| `fontScale` | A decimal number such as `0.9` | No, defaults to `1.0` | No, defaults to `1.0` | Factor by which to scale the interface's font size. |
| `fonts` | | No | No | Defines the font(s) used by the interface. Multiple font parameters can be specified: `?font=font-one&font=font-two...`. |
| `header` | `none`, `standard` or `app_bar` | No, defaults to `standard` | No, defaults to `standard` | The style of headers to show. `standard` is the default arrangement, `none` hides the header entirely, and `app_bar` produces a header with a back button like you might see in mobile apps. The callback for the back button is `window.controls.onBackButtonPressed`. |
| `hideScreensharing` | `true` or `false` | No, defaults to `false` | No, defaults to `false` | Hides the screen-sharing button. |
| `homeserver` | | Not applicable | No | Homeserver for registering a new (guest) user, configures non-default guest user server when creating a spa link. |
| `lang` | [BCP 47](https://www.rfc-editor.org/info/bcp47) code | No | No | The language the app should use. |
| `password` | | No | No | E2EE password when using a shared secret. (For individual sender keys in embedded mode this is not required.) |
| `controlledAudioDevices` | `true` or `false` | No, defaults to `false` | No, defaults to `false` | Whether the [global JS controls for audio devices](./controls.md#audio-devices) should be enabled, allowing the list of audio devices to be controlled by the app hosting Element Call. |
| `roomId` | [Matrix Room ID](https://spec.matrix.org/v1.12/appendices/#room-ids) | Yes | No | Anything about what room we're pointed to should be from useRoomIdentifier which parses the path and resolves alias with respect to the default server name, however roomId is an exception as we need the room ID in embedded widget mode, and not the room alias (or even the via params because we are not trying to join it). This is also not validated, where it is in `useRoomIdentifier()`. |
| `showControls` | `true` or `false` | No, defaults to `true` | No, defaults to `true` | Displays controls like mute, screen-share, invite, and hangup buttons during a call. |
| `skipLobby` (deprecated: use `intent` instead) | `true` or `false` | No. If `intent` is explicitly `start_call` then defaults to `true`. Otherwise defaults to `false` | No, defaults to `false` | Skips the lobby to join a call directly, can be combined with preload in widget. When `true` the audio and video inputs will be muted by default. (This means there currently is no way to start without muted video if one wants to skip the lobby. Also not in widget mode.) |
| `theme` | One of: `light`, `dark`, `light-high-contrast`, `dark-high-contrast` | No, defaults to `dark` | No, defaults to `dark` | UI theme to use. |
| `background` | One of: `solid`, `gradient` | No, defaults to `gradient` | No, defaults to `gradient` | Visual style of the page background. |
| `viaServers` | Comma separated list of [Matrix Server Names](https://spec.matrix.org/v1.12/appendices/#server-name) | Not applicable | No | Homeserver for joining a room, non-empty value required for rooms not on the user’s default homeserver. |
| `sendNotificationType` | `ring` or `notification` | No | No | Will send a "ring" or "notification" `m.rtc.notification` event if the user is the first one in the call. |
| `autoLeave` | `true` or `false` | No, defaults to `false` | No, defaults to `false` | Whether the app should automatically leave the call when there is no one left in the call. |
| `waitForCallPickup` | `true` or `false` | No, defaults to `false` | No, defaults to `false` | When sending a notification, show UI that the app is awaiting an answer, play a dial tone, and (in widget mode) auto-close the widget once the notification expires. |
### Widget-only parameters
+1 -1
View File
@@ -4,7 +4,6 @@
},
"action": {
"add_background_image": "Add image",
"adjust_view": "Adjust view",
"close": "Close",
"copy_link": "Copy link",
"edit": "Edit",
@@ -159,6 +158,7 @@
},
"layout_grid_label": "Grid",
"layout_spotlight_label": "Spotlight",
"layout_switch_label": "Layout",
"lobby": {
"ask_to_join": "Request to join call",
"join_as_guest": "Join as guest",
+6 -6
View File
@@ -39,8 +39,8 @@
"lint:knip": "knip",
"lint:externals": "node scripts/check-component-externals.mjs",
"lint:types": "tsc",
"i18n": "i18next-cli extract",
"i18n:check": "i18next-cli extract --ci",
"i18n": "npx i18next-cli extract",
"i18n:check": "npx i18next-cli extract --ci",
"test": "vitest",
"test:storybook": "vitest --project=storybook",
"test:unit": "vitest --project=unit",
@@ -91,7 +91,7 @@
"@typescript-eslint/utils": "^8.61.0",
"@use-gesture/react": "^10.2.11",
"@vector-im/compound-design-tokens": "^11.0.0",
"@vector-im/compound-web": "^10.8.0",
"@vector-im/compound-web": "^10.5.0",
"@vitejs/plugin-react": "^6.0.2",
"@vitest/browser-playwright": "^4.1.5",
"@vitest/coverage-v8": "^4.0.18",
@@ -106,7 +106,7 @@
"i18next": "^26.0.0",
"i18next-browser-languagedetector": "^8.0.0",
"i18next-cli": "^1.61.0",
"jsdom": "^31.0.0",
"jsdom": "^26.0.0",
"knip": "^5.86.0",
"livekit-client": "^2.18.1",
"lodash-es": "^4.17.21",
@@ -115,14 +115,14 @@
"matrix-widget-api": "^1.18.0",
"node-stdlib-browser": "^1.3.1",
"normalize.css": "^8.0.1",
"oxfmt": "^0.80.0",
"oxfmt": "^0.79.0",
"oxlint": "^1.70.0",
"oxlint-tsgolint": "^0.25.0",
"pako": "^3.0.3",
"postcss": "^8.4.41",
"postcss-preset-env": "^10.0.0",
"postcss-selector-parser": "^7.1.1",
"posthog-js": "1.408.2",
"posthog-js": "1.455.2",
"qrcode": "^1.5.4",
"react": "19",
"react-dom": "19",
+3 -10
View File
@@ -27,17 +27,10 @@ process.env.NODE_EXTRA_CA_CERTS = join(
"backend/dev_tls_local-ca.crt",
);
const commonDeviceOptions = {
// Disabling motion-based animations helps Playwright position the cursor
// correctly when clicking on menus etc.
reducedMotion: "reduce" as const,
ignoreHTTPSErrors: true,
};
const desktopChrome = {
...devices["Desktop Chrome"],
...commonDeviceOptions,
permissions: ["clipboard-write", "clipboard-read", "microphone", "camera"],
ignoreHTTPSErrors: true,
launchOptions: {
args: [
"--use-fake-ui-for-media-stream",
@@ -123,7 +116,7 @@ export default defineConfig({
testIgnore: ["**/mobile/**", "**/widget/widget-rtc-sdk.spec.ts"],
use: {
...devices["Desktop Firefox"],
...commonDeviceOptions,
ignoreHTTPSErrors: true,
launchOptions: {
firefoxUserPrefs: {
"permissions.default.microphone": 1,
@@ -147,7 +140,7 @@ export default defineConfig({
testMatch: "**/mobile/**",
use: {
...devices["Pixel 7"],
...commonDeviceOptions,
ignoreHTTPSErrors: true,
permissions: [
"clipboard-write",
"clipboard-read",
+6 -4
View File
@@ -62,7 +62,8 @@ test("Sign up a new account, then login, then logout", async ({ browser }) => {
test("As a guest, create a call, share link and other join", async ({
browser,
}) => {
const creatorContext = await browser.newContext();
// Use reduce motion to disable animations that are making the tests a bit flaky
const creatorContext = await browser.newContext({ reducedMotion: "reduce" });
const creatorPage = await creatorContext.newPage();
await creatorPage.goto("/");
@@ -75,8 +76,7 @@ test("As a guest, create a call, share link and other join", async ({
// join
await creatorPage.getByTestId("lobby_joinCall").click();
// Spotlight mode to make checking the test visually clearer
await creatorPage.getByRole("button", { name: "Adjust view" }).click();
await creatorPage.getByRole("menuitemradio", { name: "Spotlight" }).click();
await creatorPage.getByRole("radio", { name: "Spotlight" }).check();
// Get the invite link
const inviteLink = await SpaHelpers.getCallInviteLink(creatorPage);
@@ -84,7 +84,9 @@ test("As a guest, create a call, share link and other join", async ({
// ========
// ACT: The other user use the invite link to join the call as a guest
// ========
const guestInviteeContext = await browser.newContext();
const guestInviteeContext = await browser.newContext({
reducedMotion: "reduce",
});
const guestPage = await guestInviteeContext.newPage();
await SpaHelpers.joinCallFromInviteLink(guestPage, inviteLink);
+4 -4
View File
@@ -50,13 +50,13 @@ test.describe("the quick audio menu", () => {
}) => {
// Two browsers and a real call.
test.slow();
const hostContext = await browser.newContext();
const hostContext = await browser.newContext({ reducedMotion: "reduce" });
const host = await hostContext.newPage();
await installFakeDevices(host, { microphones: 3, speakers: 3 });
await joinACall(host, "Host", "Device switch");
const inviteLink = await SpaHelpers.getCallInviteLink(host);
const guestContext = await browser.newContext();
const guestContext = await browser.newContext({ reducedMotion: "reduce" });
const guest = await guestContext.newPage();
await SpaHelpers.joinCallFromInviteLink(guest, inviteLink, "Guest");
await SpaHelpers.expectVideoTilesCount(guest, 2);
@@ -85,13 +85,13 @@ test.describe("the quick audio menu", () => {
}) => {
// Two browsers and a real call.
test.slow();
const hostContext = await browser.newContext();
const hostContext = await browser.newContext({ reducedMotion: "reduce" });
const host = await hostContext.newPage();
await installFakeDevices(host);
await joinACall(host, "Muted host", "Muted meter");
const inviteLink = await SpaHelpers.getCallInviteLink(host);
const guestContext = await browser.newContext();
const guestContext = await browser.newContext({ reducedMotion: "reduce" });
const guest = await guestContext.newPage();
await SpaHelpers.joinCallFromInviteLink(guest, inviteLink, "Listener");
await SpaHelpers.expectVideoTilesCount(guest, 2);
+11 -3
View File
@@ -30,6 +30,15 @@ import { SpaHelpers } from "../spa-helpers.ts";
// are sized for that, so the tests have to be too
test.describe.configure({ timeout: 180_000 });
/** The settings button, whichever of the two the footer is currently showing. */
function settingsButton(pane: Locator): Locator {
return pane
.getByTestId("settings-bottom-left")
.or(pane.getByTestId("settings-bottom-center"))
.filter({ visible: true })
.first();
}
test("holds a call between two components on one page", async ({ page }) => {
const { username, roomId } = await createUserAndRoom("twocomponents");
const panes = await startHarness(page, username, roomId);
@@ -72,7 +81,7 @@ test("keeps its modals inside the container it was given", async ({ page }) => {
// rather than the container until it was made a containing block. The
// settings dialog spilled over the host's interface; the reaction picker sat
// at 82vh, which put it below the container entirely and so out of sight.
await pane.getByTestId("settings-bottom").click();
await settingsButton(pane).click();
await expectWithin(pane.getByRole("dialog"), container);
await pane.getByTestId("modal_close").click();
@@ -103,8 +112,7 @@ test("keeps the call inside the container, wherever the host put it", async ({
// the container below a header of its own, so a grid offset measured from
// the top of the page instead of from the root would land the tile on top of
// the footer and out of the bottom of the container.
await pane.getByRole("button", { name: "Adjust view" }).click();
await page.getByRole("menuitemradio", { name: "Spotlight" }).click();
await pane.getByRole("radio", { name: "Spotlight" }).check();
const tile = pane.getByTestId("videoTile").first();
await expect(tile).toBeVisible({ timeout: 60_000 });
await expectWithin(tile, container);
+1 -1
View File
@@ -30,7 +30,7 @@ export const mobileTest = test.extend<MobileCreateFixtures>({
async function createCallAndInvite(
browser: Browser,
): Promise<{ page: Page; inviteLink: string }> {
const creatorContext = await browser.newContext();
const creatorContext = await browser.newContext({ reducedMotion: "reduce" });
const creatorPage = await creatorContext.newPage();
await creatorPage.goto("/");
+3 -1
View File
@@ -58,7 +58,9 @@ mobileTest(
// ========
// ACT: The other user use the invite link to join the call as a guest
// ========
const guestInviteeContext = await browser.newContext();
const guestInviteeContext = await browser.newContext({
reducedMotion: "reduce",
});
const guestPage = await guestInviteeContext.newPage();
await guestPage.goto(inviteLink + "&controlledAudioDevices=true");
+11 -9
View File
@@ -12,7 +12,8 @@ test("When creator left, avoid reconnect to the same SFU", async ({
browserName,
}) => {
test.skip(browserName === "firefox", "Browser independent");
const creatorContext = await browser.newContext();
// Use reduce motion to disable animations that are making the tests a bit flaky
const creatorContext = await browser.newContext({ reducedMotion: "reduce" });
const creatorPage = await creatorContext.newPage();
await creatorPage.goto("/");
@@ -30,8 +31,7 @@ test("When creator left, avoid reconnect to the same SFU", async ({
// join
await creatorPage.getByTestId("lobby_joinCall").click();
// Spotlight mode to make checking the test visually clearer
await creatorPage.getByRole("button", { name: "Adjust view" }).click();
await creatorPage.getByRole("menuitemradio", { name: "Spotlight" }).click();
await creatorPage.getByRole("radio", { name: "Spotlight" }).check();
// Get the invite link
await creatorPage.getByRole("button", { name: "Invite" }).click();
@@ -51,7 +51,9 @@ test("When creator left, avoid reconnect to the same SFU", async ({
// ========
// ACT: The other user use the invite link to join the call as a guest
// ========
const guestB = await browser.newContext();
const guestB = await browser.newContext({
reducedMotion: "reduce",
});
const guestBPage = await guestB.newPage();
await guestBPage.goto(inviteLink);
@@ -59,13 +61,14 @@ test("When creator left, avoid reconnect to the same SFU", async ({
await expect(guestBPage.getByTestId("joincall_joincall")).toBeVisible();
await guestBPage.getByTestId("joincall_joincall").click();
await guestBPage.getByTestId("lobby_joinCall").click();
await guestBPage.getByRole("button", { name: "Adjust view" }).click();
await guestBPage.getByRole("menuitemradio", { name: "Spotlight" }).click();
await guestBPage.getByRole("radio", { name: "Spotlight" }).check();
// ========
// ACT: add a third user to the call to reproduce the bug
// ========
const guestC = await browser.newContext();
const guestC = await browser.newContext({
reducedMotion: "reduce",
});
const guestCPage = await guestC.newPage();
// Track WebSocket connections
let wsConnectionCount = 0;
@@ -82,8 +85,7 @@ test("When creator left, avoid reconnect to the same SFU", async ({
await expect(guestCPage.getByTestId("joincall_joincall")).toBeVisible();
await guestCPage.getByTestId("joincall_joincall").click();
await guestCPage.getByTestId("lobby_joinCall").click();
await guestCPage.getByRole("button", { name: "Adjust view" }).click();
await guestCPage.getByRole("menuitemradio", { name: "Spotlight" }).click();
await guestCPage.getByRole("radio", { name: "Spotlight" }).check();
await guestCPage.waitForTimeout(1000);
if (wsConnectionCount === 2) {
+3 -1
View File
@@ -46,7 +46,9 @@ async function setupTwoUserSpaCall(
const inviteLink = await SpaHelpers.getCallInviteLink(page);
// Other
const guestInviteeContext = await browser.newContext();
const guestInviteeContext = await browser.newContext({
reducedMotion: "reduce",
});
const guestPage = await guestInviteeContext.newPage();
await guestPage.goto("/");
+1 -2
View File
@@ -88,8 +88,7 @@ async function joinCallFromInviteLink(
}
await page.getByTestId("lobby_joinCall").click();
await page.getByRole("button", { name: "Adjust view" }).click();
await page.getByRole("menuitemradio", { name: "Spotlight" }).click();
await page.getByRole("radio", { name: "Spotlight" }).check();
}
async function setRtcModeFromSettings(
+6 -6
View File
@@ -105,7 +105,7 @@ for (const { hostShape, guestShape, mode, hostFlows, guestFlows } of cases) {
const inviteLink = await SpaHelpers.getCallInviteLink(page);
// The guest joins.
const guestContext = await browser.newContext();
const guestContext = await browser.newContext({ reducedMotion: "reduce" });
const guestPage = await guestContext.newPage();
await advertiseTransport(guestPage, shapes[guestShape]);
const guestRequests = recordAuthRequests(guestPage);
@@ -178,7 +178,7 @@ test("Falls back to the JWT service for a url+legacy transport when the homeserv
const inviteLink = await SpaHelpers.getCallInviteLink(page);
// The guest joins, and its C-S requests fail as well.
const guestContext = await browser.newContext();
const guestContext = await browser.newContext({ reducedMotion: "reduce" });
const guestPage = await guestContext.newPage();
await advertiseTransport(guestPage, shapes["url+legacy"]);
await rejectCsApiTokens(guestPage);
@@ -224,13 +224,13 @@ test("Group call with all possible transport shapes at once", async ({
const inviteLink = await SpaHelpers.getCallInviteLink(page);
// The guest with a legacy transport joins.
const bobContext = await browser.newContext();
const bobContext = await browser.newContext({ reducedMotion: "reduce" });
const bobPage = await bobContext.newPage();
await advertiseTransport(bobPage, shapes.legacy);
await SpaHelpers.joinCallFromInviteLink(bobPage, inviteLink, "Bob");
// The guest with a url+legacy transport joins.
const carolContext = await browser.newContext();
const carolContext = await browser.newContext({ reducedMotion: "reduce" });
const carolPage = await carolContext.newPage();
await advertiseTransport(carolPage, shapes["url+legacy"]);
await SpaHelpers.joinCallFromInviteLink(carolPage, inviteLink, "Carol");
@@ -265,7 +265,7 @@ for (const { shape, via } of delegationCases) {
const inviteLink = await SpaHelpers.getCallInviteLink(page);
// The guest joins.
const guestContext = await browser.newContext();
const guestContext = await browser.newContext({ reducedMotion: "reduce" });
const guestPage = await guestContext.newPage();
await advertiseTransport(guestPage, shapes[shape]);
const delayedLeave = recordDelayedLeave(guestPage);
@@ -327,7 +327,7 @@ test("Subscribers get tokens for a remote homeserver's SFU over federation", asy
const inviteLink = await SpaHelpers.getCallInviteLink(page);
// The guest lives on the default homeserver and joins over federation.
const guestContext = await browser.newContext();
const guestContext = await browser.newContext({ reducedMotion: "reduce" });
const guestPage = await guestContext.newPage();
await advertiseTransport(guestPage, shapes.url);
const guestRequests = recordAuthRequests(guestPage);
+2 -10
View File
@@ -86,11 +86,7 @@ widgetTest("Sharing screen in group call", async ({ addUser, browserName }) => {
const frame = alice.page
.locator('iframe[title="Element Call"]')
.contentFrame();
await frame.getByRole("button", { name: "Adjust view" }).click();
await expect(
frame.getByRole("menuitemradio", { name: "Grid" }),
).toBeChecked();
await frame.getByRole("menu").press("Escape");
await expect(frame.getByRole("radio", { name: "Grid" })).toBeChecked();
}
// Others should have switched to spotlight
@@ -99,11 +95,7 @@ widgetTest("Sharing screen in group call", async ({ addUser, browserName }) => {
.locator('iframe[title="Element Call"]')
.contentFrame();
await frame.getByRole("button", { name: "Adjust view" }).click();
await expect(
frame.getByRole("menuitemradio", { name: "Spotlight" }),
).toBeChecked();
await frame.getByRole("menu").press("Escape");
await expect(frame.getByRole("radio", { name: "Spotlight" })).toBeChecked();
}
// await alice.page.pause();
// await bob.page.pause();
+3 -1
View File
@@ -123,7 +123,9 @@ export class TestHelpers {
);
// STEP 2: Open browser and login
const userContext = await browser.newContext();
const userContext = await browser.newContext({
reducedMotion: "reduce",
});
const page = await userContext.newPage();
await page.goto(host);
+1052 -924
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -28,8 +28,8 @@ overrides:
# - https://github.com/advisories/GHSA-7r86-cg39-jmmj
# - https://github.com/advisories/GHSA-23c5-xmqv-rm74
"minimatch": "^11.0.0"
# The v8 line is deprecated.
"eslint": "^9.0.0"
# Security fix: https://github.com/element-hq/element-call/security/dependabot/109
"glob": "^10.5.0"
# Security fix: https://github.com/advisories/GHSA-6pq8-jhm2-2vcw
"qs": ">=6.16.1"
# Security fix: https://github.com/advisories/GHSA-2883-xcg3-v3hh
+2 -4
View File
@@ -28,14 +28,12 @@
{
"groupName": "matrix-widget-api",
"matchDepNames": ["matrix-widget-api"],
"extends": ["schedule:weekly"],
"minimumReleaseAge": null
"extends": ["schedule:weekly"]
},
{
"groupName": "Compound",
"matchPackageNames": ["@vector-im/compound-{/,}**"],
"extends": ["schedule:weekly"],
"minimumReleaseAge": null
"extends": ["schedule:weekly"]
},
{
"groupName": "LiveKit client",
+11 -11
View File
@@ -6,18 +6,18 @@ Please see LICENSE in the repository root for full details.
*/
/**
* Checks the component build's output for things we do not want to end up in the
* component target.
* Checks the component build's output for what a host must not be handed.
*
* A library build inlines every asset it needs as a data URL unless the import
* says otherwise: if one adds an import without `no-inline` the
* module grows by the asset (due to encoding a third larger than the original file)
* that every host then downloads and parses before the first call.
* MediaPipe's runtime alone is 11 MB, so it should not be inlined.
* The standalone app's client store worker, which carries a copy of the Matrix SDK
* and its crypto, is also not needed in a package whose host supplies the client:
* the bundler packages if it is imported, even if not used (see src/utils/initClient.ts).
* The script makes sure, the build fails on each of those issues.
* A library build inlines every asset it meets as a data URL unless the import
* says otherwise, and does so silently: one import without `no-inline` and the
* module grows by the asset, encoded a third larger, that every host then
* downloads and parses before the first call. MediaPipe's runtime alone is
* 11 MB. A reference to a file by an absolute path is just as silent and
* breaks at runtime instead, since a host serves the module from wherever it
* likes. And the standalone app's client store worker, which carries a copy of
* the Matrix SDK and its crypto, has no business in a package whose host
* supplies the client: the bundler emits it on loading its import, used or
* not (see src/utils/initClient.ts). This fails the build on each of those.
*/
import { existsSync } from "node:fs";
-21
View File
@@ -41,7 +41,6 @@ export enum UserIntent {
StartNewCallDMVoice = "start_call_dm_voice",
JoinExistingCallDM = "join_existing_dm",
JoinExistingCallDMVoice = "join_existing_dm_voice",
VideoRoom = "video_room",
Unknown = "unknown",
}
@@ -144,18 +143,6 @@ export interface UrlConfiguration {
* Defaults to true.
*/
noiseSuppression?: boolean;
/**
* Whether the user may start with the microphone on, whether or not the
* lobby is shown. Set by the intent, not a URL parameter.
* Defaults to true.
*/
initialAudioEnabled?: boolean;
/**
* Whether the user may start with the camera on, whether or not the lobby is
* shown. Set by the intent, not a URL parameter.
* Defaults to true.
*/
initialVideoEnabled?: boolean;
callIntent?: RTCCallIntent;
}
@@ -235,14 +222,6 @@ export function configurationForIntent(intent: UserIntent): UrlConfiguration {
preset.autoLeaveWhenOthersLeft = true;
preset.callIntent = preset.callIntent ?? RTC_CALL_INTENT_VIDEO;
break;
case UserIntent.VideoRoom:
preset.skipLobby = false;
preset.returnToLobby = true;
preset.callIntent = RTC_CALL_INTENT_VIDEO;
// Opening the room should not turn on the user's microphone or camera.
preset.initialAudioEnabled = false;
preset.initialVideoEnabled = false;
break;
// Non widget usecase defaults
default:
preset = {
-27
View File
@@ -318,20 +318,6 @@ describe("UrlParams", () => {
).toMatchObject(joinExistingCallDefaults("desktop"));
});
it("accepts video_room", () => {
expect(
computeUrlParams(
"?intent=video_room&widgetId=1234&parentUrl=parent.org",
),
).toMatchObject({
...joinExistingCallDefaults("desktop"),
returnToLobby: true,
callIntent: RTC_CALL_INTENT_VIDEO,
initialAudioEnabled: false,
initialVideoEnabled: false,
});
});
it("accepts start_call_voice", () => {
expect(
computeUrlParams(
@@ -422,19 +408,6 @@ describe("UrlParams", () => {
});
});
describe.each(["initialAudioEnabled", "initialVideoEnabled"] as const)(
"%s",
(name) => {
it("is not read from the URL", () => {
expect(
computeUrlParams(
`?${name}=false&intent=join_existing&widgetId=1234&parentUrl=parent.org`,
)[name],
).toBeUndefined();
});
},
);
describe("noiseSuppression", () => {
it("defaults to true", () => {
expect(computeUrlParams().noiseSuppression).toBe(true);
+1 -1
View File
@@ -61,7 +61,7 @@ exports[`the modal renders as a drawer in mobile viewports 1`] = `
/>
<h2
id="radix-_r_a_"
style="position: absolute; border: 0px; width: 1px; height: 1px; padding: 0px; margin: -1px; overflow: hidden; clip: rect(0px, 0px, 0px, 0px); white-space: nowrap; overflow-wrap: normal;"
style="position: absolute; border: 0px; width: 1px; height: 1px; padding: 0px; margin: -1px; overflow: hidden; clip: rect(0px, 0px, 0px, 0px); white-space: nowrap; word-wrap: normal;"
>
My modal
</h2>
+32 -31
View File
@@ -25,14 +25,11 @@ import {
OverflowVerticalIcon,
VolumeOnSolidIcon,
VolumeOffSolidIcon,
SettingsSolidIcon,
GridIcon,
SpotlightViewIcon,
} from "@vector-im/compound-design-tokens/assets/web/icons";
import styles from "./Button.module.css";
import callFooterStyles from "../components/CallFooter.module.css";
import { platform } from "../Platform";
import { type LayoutMode } from "../state/LayoutSwitchViewModel";
interface MicButtonProps extends ComponentPropsWithoutRef<"button"> {
enabled: boolean;
@@ -152,7 +149,6 @@ interface LoudspeakerButtonProps extends ComponentPropsWithoutRef<"button"> {
size?: "md" | "lg";
loudspeakerModeEnabled: boolean;
}
export const LoudspeakerButton: FC<LoudspeakerButtonProps> = ({
loudspeakerModeEnabled,
...props
@@ -175,37 +171,36 @@ export const LoudspeakerButton: FC<LoudspeakerButtonProps> = ({
);
};
interface LayoutSwitchButtonProps extends ComponentPropsWithoutRef<"button"> {
layout: LayoutMode;
function classNamesForScreenWidth(
className?: string,
forScreenWidth?: "wide" | "narrow",
): string {
return classNames(className, {
[callFooterStyles.settingsOnlyShowWide]: forScreenWidth === "wide",
[callFooterStyles.settingsOnlyShowNarrow]: forScreenWidth === "narrow",
});
}
export const LayoutSwitchButton: FC<LayoutSwitchButtonProps> = ({
layout,
interface SettingsIconButtonProps extends ComponentPropsWithoutRef<"button"> {
/** If this buttons should be setup to be used in the app bar */
showForScreenWidth?: "wide" | "narrow";
kind?: "secondary" | "primary";
}
export const SettingsIconButton: FC<SettingsIconButtonProps> = ({
showForScreenWidth,
className,
...props
}) => {
const { t } = useTranslation();
return (
<Tooltip label={t("action.adjust_view")}>
<CpdButton
iconOnly
Icon={layout === "grid" ? GridIcon : SpotlightViewIcon}
kind="secondary"
{...props}
/>
</Tooltip>
);
};
interface SettingsIconButtonProps extends ComponentPropsWithoutRef<"button"> {
kind?: "secondary" | "primary";
}
export const SettingsIconButton: FC<SettingsIconButtonProps> = (props) => {
const { t } = useTranslation();
const Icon =
platform === "android" ? OverflowVerticalIcon : OverflowHorizontalIcon;
return (
<Tooltip label={t("common.settings")}>
<IconButton {...props}>
<SettingsSolidIcon aria-hidden />
<IconButton
className={classNamesForScreenWidth(className, showForScreenWidth)}
{...props}
>
<Icon aria-hidden />
</IconButton>
</Tooltip>
);
@@ -213,13 +208,19 @@ export const SettingsIconButton: FC<SettingsIconButtonProps> = (props) => {
interface SettingsButtonProps extends ComponentPropsWithoutRef<"button"> {
size?: "md" | "lg";
/** If this buttons should be setup to be used in the app bar */
showForScreenWidth?: "wide" | "narrow";
}
export const SettingsButton: FC<SettingsButtonProps> = (props) => {
export const SettingsButton: FC<SettingsButtonProps> = ({
showForScreenWidth,
className,
...props
}) => {
const { t } = useTranslation();
return (
<Tooltip label={t("common.settings")}>
<CpdButton
className={classNamesForScreenWidth(className, showForScreenWidth)}
iconOnly
Icon={
platform === "android" ? OverflowVerticalIcon : OverflowHorizontalIcon
+2
View File
@@ -112,6 +112,7 @@ export const BackgroundEffectGrid: FC<Props> = ({
disabled={disabled}
data-disabled={disabled ? "" : undefined}
label={null}
hideChevron
className={styles.tile}
// Without a handler it isn't one of the menu's items, so the keyboard
// passes over it.
@@ -159,6 +160,7 @@ export const BackgroundEffectGrid: FC<Props> = ({
onAdd === undefined ? null : (
<MenuItem
label={null}
hideChevron
className={styles.tile}
onSelect={(e) => {
e.preventDefault();
+1 -1
View File
@@ -24,7 +24,7 @@ import * as CallFooterStories from "./CallFooter.stories";
<Title> Call Footer </Title>
The footer component contains all main interactions needed for a call.
The footer compoentn contains all main interactions needed for a call.
<Subtitle> Mobile layouts </Subtitle>
+33 -93
View File
@@ -9,10 +9,9 @@ Please see LICENSE in the repository root for full details.
position: sticky;
inset-block-end: 0;
z-index: var(--call-view-header-footer-layer);
pointer-events: none;
display: grid;
grid-template-columns: 1fr auto 1fr;
grid-template-areas: ". buttons .";
grid-template-areas: ". buttons layout";
align-items: center;
gap: var(--cpd-space-3x);
/* Ensure that footer lies within the safe area */
@@ -20,10 +19,6 @@ Please see LICENSE in the repository root for full details.
padding-right: calc(env(safe-area-inset-right) + var(--cpd-space-6x));
padding-block: var(--cpd-space-10x)
calc(env(safe-area-inset-bottom) + var(--cpd-space-10x));
> * {
pointer-events: auto;
}
}
.footer.hidden {
@@ -31,57 +26,21 @@ Please see LICENSE in the repository root for full details.
}
.footer.overlay {
transition: opacity 0.18s;
opacity: 0;
> .buttons {
transition: transform 0.18s;
@media (prefers-reduced-motion: no-preference) {
transform: translateY(var(--slide-distance));
}
}
> * {
animation: none;
}
}
@keyframes enable-pointer-events {
0% {
pointer-events: none;
}
100% {
pointer-events: auto;
}
}
.footer.overlay:not(.hidden) {
/* Note that the footer is still position: sticky in this case so that certain
tiles can move up out of the way of the footer when visible. */
opacity: 1;
> .buttons {
transform: none;
}
> * {
/* Enable pointer events after a short timeout, so that tapping to reveal the
footer won't immediately cause any of the buttons to be pressed. */
animation: enable-pointer-events 1ms;
}
transition: opacity 0.15s;
}
.footer.overlay.hidden {
display: grid;
opacity: 0;
pointer-events: none;
/* Switch to position: absolute so the footer takes up no space in the layout
when hidden. */
position: absolute;
inset-block-end: 0;
inset-inline: 0;
> * {
pointer-events: none;
}
}
/* Keep the footer while it is in use: focus inside it, or a menu opened from
@@ -89,17 +48,10 @@ Please see LICENSE in the repository root for full details.
.footer.overlay:has(:focus-visible),
.footer.overlay:has([aria-expanded="true"]) {
opacity: 1;
> .buttons {
transform: none;
}
> * {
pointer-events: auto;
}
pointer-events: initial;
}
.logoContainer {
.settingsLogoContainer {
display: flex;
align-items: center;
gap: var(--cpd-space-4x);
@@ -118,45 +70,13 @@ Please see LICENSE in the repository root for full details.
.buttons {
grid-area: buttons;
justify-self: center;
background: var(--cpd-color-bg-canvas-default);
border-radius: var(--cpd-radius-pill-effect);
box-shadow: var(--big-drop-shadow);
display: flex;
flex-wrap: nowrap;
gap: var(--cpd-space-3x);
}
:global(.cpd-theme-light),
:global(.cpd-theme-light-hc) {
.buttons {
background: var(--cpd-color-bg-canvas-default);
}
}
/* Dark theme uses a different background color, since the drop shadow doesn't
provide enough contrast */
:global(.cpd-theme-dark),
:global(.cpd-theme-dark-hc) {
.buttons {
background: var(--cpd-color-bg-subtle-primary);
}
}
@media (prefers-color-scheme: dark) {
.buttons {
background: var(--cpd-color-bg-subtle-primary);
}
}
.footer[data-button-size="md"] > .buttons {
padding: var(--cpd-space-3x);
gap: var(--cpd-space-2x);
--slide-distance: var(--cpd-space-2x);
}
.footer[data-button-size="lg"] > .buttons {
padding: var(--cpd-space-4x);
gap: var(--cpd-space-4x);
--slide-distance: var(--cpd-space-4x);
.layout {
grid-area: layout;
justify-self: end;
}
/*First hide the logo*/
@@ -166,16 +86,30 @@ provide enough contrast */
}
}
.settingsOnlyShowNarrow {
display: none;
}
.settingsOnlyShowWide {
display: inherit;
}
/*
With the logo hidden >500px is enough space to show logo and buttons.
Once we exceed 500 we hide the logo.
With the logo hidden >500px is enough space to show overflow, buttons, layout.
Once we exceed 500 we hide everything except the buttons.
*/
@container element-call (max-width: 500px) {
.footer {
grid-template-areas: "buttons buttons buttons";
}
.logoContainer {
.settingsOnlyShowNarrow {
display: inherit;
}
.settingsOnlyShowWide {
display: none;
}
.settingsLogoContainer {
display: none;
}
@@ -222,3 +156,9 @@ Once we exceed 500 we hide the logo.
display: none;
}
}
@container element-call (min-width: 800px) {
.buttons {
gap: var(--cpd-space-4x);
}
}
+8 -13
View File
@@ -5,7 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
Please see LICENSE in the repository root for full details.
*/
import { expect, fn, userEvent, waitFor, within } from "storybook/test";
import { expect, fn, userEvent, within } from "storybook/test";
import { BehaviorSubject } from "rxjs";
import { type JSX, type ReactNode } from "react";
import { Link } from "@vector-im/compound-web";
@@ -172,7 +172,7 @@ export const Default: Story = {
openSettings: fn(),
toggleScreenSharing: fn(),
hangup: fn(),
buttonSize: "md",
buttonSize: "lg",
showFooter: true,
hideControls: false,
asOverlay: false,
@@ -202,11 +202,8 @@ export const StaysWhileAMenuIsOpen: Story = {
const footer = canvasElement.querySelector<HTMLElement>(
'[data-testid="footer-container"]',
)!;
// Open microphone menu once footer becomes interactive
await waitFor(async () =>
userEvent.click(
within(canvasElement).getByRole("button", { name: "Microphone" }),
),
await userEvent.click(
within(canvasElement).getByRole("button", { name: "Microphone" }),
);
await expect(document.body.querySelector('[role="menu"]')).not.toBeNull();
@@ -235,9 +232,8 @@ export const SpotlightMode: Story = {
layout: "spotlight",
},
play: async ({ args, canvasElement }) => {
const canvas = within(canvasElement.parentElement!);
await userEvent.click(canvas.getByRole("button", { name: "Adjust view" }));
await userEvent.click(canvas.getByRole("menuitemradio", { name: "Grid" }));
const canvas = within(canvasElement);
await userEvent.click(canvas.getByRole("radio", { name: "Grid" }));
await expect(args.setLayout).toHaveBeenCalledWith("grid");
await userEvent.click(canvas.getByRole("switch", { name: "Share screen" }));
await expect(args.toggleScreenSharing).toHaveBeenCalled();
@@ -273,11 +269,12 @@ export const Pip: Story = {
...Default,
args: {
...Default.args,
buttonSize: "md",
layout: null,
},
play: async ({ canvasElement }) => {
await expect(
within(canvasElement).queryByRole("button", { name: "Adjust view" }),
within(canvasElement).queryByRole("radio", { name: "Spotlight" }),
).not.toBeInTheDocument();
},
};
@@ -304,7 +301,6 @@ export const MobileLayout: Story = {
args: {
...Default.args,
showLogo: false,
buttonSize: "lg",
audioOutputSwitcher: { targetOutput: "speaker", switch: fn() },
},
@@ -336,7 +332,6 @@ export const LobbyRecentButtonMobile: Story = {
...Default.args,
children: <Link>Back To Recents</Link>,
showLogo: false,
buttonSize: "lg",
layout: null,
toggleScreenSharing: undefined,
},
+28 -24
View File
@@ -16,6 +16,7 @@ import {
SettingsButton,
ReactionToggleButton,
LoudspeakerButton,
SettingsIconButton,
type ReactionData,
} from "../button";
import styles from "./CallFooter.module.css";
@@ -119,6 +120,20 @@ export const CallFooter: FC<FooterProps> = ({
const buttons: JSX.Element[] = [];
if (openSettings !== undefined) {
// Add the settings button to the center group so it's visible on small
// screens. On larger screens the SettingsIconButton with
// showForScreenWidth="wide" in the settingsLogoContainer is used instead.
buttons.push(
<SettingsButton
key="settings"
showForScreenWidth="narrow"
onClick={openSettings}
data-testid="settings-bottom-center"
/>,
);
}
buttons.push(
<MediaMenuButton
key="audio"
@@ -174,28 +189,6 @@ export const CallFooter: FC<FooterProps> = ({
if (audioOutputButton) buttons.push(audioOutputButton);
if (layoutSwitchVm !== null) {
buttons.push(
<LayoutSwitch
key="layout"
vm={layoutSwitchVm}
className={styles.layout}
size={buttonSize}
/>,
);
}
if (openSettings !== undefined) {
buttons.push(
<SettingsButton
size={buttonSize}
key="settings"
onClick={openSettings}
data-testid="settings-bottom"
/>,
);
}
if (hangup)
buttons.push(
<EndCallButton
@@ -228,17 +221,28 @@ export const CallFooter: FC<FooterProps> = ({
<div
ref={ref}
data-testid="footer-container"
data-button-size={buttonSize}
className={classNames(className, styles.footer, {
[styles.overlay]: asOverlay,
[styles.hidden]: !showFooter,
})}
>
<div className={styles.logoContainer}>
<div className={styles.settingsLogoContainer}>
{openSettings !== undefined && (
<SettingsIconButton
key="settings"
kind="secondary"
showForScreenWidth="wide"
onClick={openSettings}
data-testid="settings-bottom-left"
/>
)}
{children}
{(showLogo || debugTileLayout) && logoDebugContainer}
</div>
{!hideControls && <div className={styles.buttons}>{buttons}</div>}
{!hideControls && layoutSwitchVm && (
<LayoutSwitch vm={layoutSwitchVm} className={styles.layout} />
)}
</div>
);
};
+4 -2
View File
@@ -80,7 +80,9 @@ export function createCallFooterViewModel(
hideControls$: constant(!showControls),
showModals$: callModel.showModals$,
asOverlay$: callModel.edgeToEdge$,
buttonSize$: constant(platform === "desktop" ? "md" : "lg"),
buttonSize$: scope.behavior(
isPip$.pipe(map<boolean, "md" | "lg">((pip) => (pip ? "md" : "lg"))),
),
openSettings$: scope.behavior(
combineLatest([
@@ -160,7 +162,7 @@ export function createLobbyFooterViewModel(
hideControls: false,
asOverlay: false,
showModals: true,
buttonSize: platform === "desktop" ? "md" : "lg",
buttonSize: "lg",
openSettings,
hangup,
debugTileLayout: false,
+1 -1
View File
@@ -26,7 +26,7 @@ function MediaMenuButtonStoryWrapper({
...snapshot
}: MediaMenuSnapshot & { kind: "audio" | "video" }): ReactNode {
const vm = useStaticViewModel(snapshot);
return <MediaMenuButton kind={kind} vm={vm} size="md" />;
return <MediaMenuButton kind={kind} vm={vm} size="lg" />;
}
const meta = {
-2
View File
@@ -88,7 +88,6 @@ export const MediaMenuButton: FC<Props> = ({ vm, kind, size }) => {
return kind === "audio" ? (
<MediaMuteAndSwitchButton
size={size}
iconsAndLabels="audio"
enabled={enabled}
busy={busy}
@@ -103,7 +102,6 @@ export const MediaMenuButton: FC<Props> = ({ vm, kind, size }) => {
/>
) : (
<MediaMuteAndSwitchButton
size={size}
iconsAndLabels="video"
enabled={enabled}
busy={busy}
@@ -16,25 +16,13 @@ Please see LICENSE in the repository root for full details.
.containerOpen {
background-color: var(--cpd-color-bg-action-primary-pressed);
}
.menuButton {
background-color: transparent !important;
&[data-size="md"] {
width: var(--cpd-space-8x);
}
&[data-size="lg"] {
width: var(--cpd-space-10x);
}
> svg {
color: var(--cpd-color-icon-secondary);
/* Nudge the icon toward the toggle button to perceptually center it */
margin-inline-start: calc(-1 * var(--cpd-space-1x));
}
}
.menuButton.chevronIconOpen > svg {
.chevronIconOpen > svg {
color: var(--cpd-color-icon-on-solid-primary);
}
.menuButton {
width: 40px;
background-color: transparent !important;
}
.itemIcon {
color: var(--cpd-color-text-secondary);
}
@@ -291,7 +291,7 @@ describe("MediaMuteAndSwitchButton", () => {
// After clicking, plannedSelection="mic2" but selectedOption is still "mic1",
// so mic2 should be in an activating state
screen.getByRole("menuitemradio", {
name: /^Microphone 2\s*Activating…$/,
name: "Microphone 2 Activating…",
checked: false,
});
+2 -4
View File
@@ -57,7 +57,6 @@ export interface MenuOptions {
}
export interface MediaMuteAndSwitchButtonProps {
size?: "md" | "lg";
/** If the Mute button is enabled */
enabled?: boolean;
/** Callback if the mute button is clicked */
@@ -121,7 +120,6 @@ const MENU_MARGIN = 16;
const PREVIEW_GAP = 12;
export const MediaMuteAndSwitchButton: FC<MediaMuteAndSwitchButtonProps> = ({
size,
enabled,
busy,
onMuteClick,
@@ -278,7 +276,6 @@ export const MediaMuteAndSwitchButton: FC<MediaMuteAndSwitchButtonProps> = ({
const MuteButton = audioMeter ? MicButton : VideoButton;
const button = (
<MuteButton
size={size}
enabled={enabled ?? false}
busy={isBusy}
onClick={(e) => {
@@ -368,6 +365,7 @@ export const MediaMuteAndSwitchButton: FC<MediaMuteAndSwitchButtonProps> = ({
<MenuItem
// A radio input may not sit inside a button.
as="div"
hideChevron
disabled={disabled}
label={labelText(label, numbered)}
Icon={
@@ -449,7 +447,7 @@ export const MediaMuteAndSwitchButton: FC<MediaMuteAndSwitchButtonProps> = ({
})}
Icon={menuOpen ? ChevronUpIcon : ChevronDownIcon}
kind={"tertiary"}
size={size}
size="lg"
aria-label={optionsButtonLabel}
/>
}
+11 -14
View File
@@ -137,24 +137,23 @@ beforeEach(() => {
);
});
async function createCallView(
function createCallView(
hostBridge: HostBridge,
joined = true,
options: {
/** Wait for the host to say when to join, rather than joining at once. */
preload?: boolean;
} = {},
): Promise<{
): {
rtcSession: MatrixRTCSession;
getByText: ReturnType<typeof render>["getByText"];
}> {
} {
const client = {
...mockEmitter(),
getUser: () => null,
getUserId: () => localRtcMember.userId,
getDeviceId: () => localRtcMember.deviceId,
getRoom: (rId) => (rId === roomId ? room : null),
doesServerSupportUnstableFeature: vi.fn().mockResolvedValue(true),
} as Partial<MatrixClient> as MatrixClient;
const room = mockMatrixRoom({
relations: {
@@ -204,8 +203,6 @@ async function createCallView(
</HostBridgeProvider>
</BrowserRouter>,
);
// Let the homeserver capability check resolve, which the call waits for
await act(flushPromises);
return {
getByText,
rtcSession: rtcSession.asMockedSession(),
@@ -214,7 +211,7 @@ async function createCallView(
test.skip("CallView plays a leave sound asynchronously in SPA mode", async () => {
const user = userEvent.setup();
const { getByText, rtcSession } = await createCallView(nullHostBridge);
const { getByText, rtcSession } = createCallView(nullHostBridge);
const leaveButton = getByText("Leave");
await user.click(leaveButton);
expect(playSound).toHaveBeenCalledWith("left");
@@ -244,7 +241,7 @@ test.skip("CallView plays a leave sound synchronously in widget mode", async ()
soundDuration: {},
});
const { getByText, rtcSession } = await createCallView(hostBridge);
const { getByText, rtcSession } = createCallView(hostBridge);
const leaveButton = getByText("Leave");
await user.click(leaveButton);
await flushPromises();
@@ -277,7 +274,7 @@ test("Should ask the host to close when all other left and play a sound", async
soundDuration: {},
});
const { getByText } = await createCallView(hostBridge);
const { getByText } = createCallView(hostBridge);
const leaveButton = getByText("SimulateOtherLeft");
await user.click(leaveButton);
await flushPromises();
@@ -294,7 +291,7 @@ test("Waits for the host to say when to join, when preloaded", async () => {
const join$ = new Subject<HostRequest<JoinCallData>>();
const hostBridge: HostBridge = { ...nullHostBridge, join$ };
await createCallView(hostBridge, false, { preload: true });
createCallView(hostBridge, false, { preload: true });
await flushPromises();
// Past the lobby, but not in the call: the host has not asked yet
expect(screen.queryByText("Leave")).toBeNull();
@@ -319,7 +316,7 @@ test("Should not ask the host to close when auto leave due to error", async () =
close,
};
const { getByText } = await createCallView(hostBridge);
const { getByText } = createCallView(hostBridge);
const leaveButton = getByText("SimulateErrorLeft");
await user.click(leaveButton);
await flushPromises();
@@ -342,7 +339,7 @@ test.skip("CallView leaves the session when an error occurs", async () => {
);
});
const user = userEvent.setup();
const { rtcSession } = await createCallView(nullHostBridge);
const { rtcSession } = createCallView(nullHostBridge);
await user.click(screen.getByRole("button", { name: "Panic!" }));
screen.getByText("Something went wrong");
expect(leaveRTCSession).toHaveBeenCalledWith(
@@ -359,7 +356,7 @@ test.skip("CallView shows errors that occur during joining", async () => {
onTestFinished(() => {
enterRTCSession.mockReset();
});
await createCallView(nullHostBridge, false);
createCallView(nullHostBridge, false);
await user.click(screen.getByRole("button", { name: "Join call" }));
screen.getByText("Call is not supported");
});
@@ -381,7 +378,7 @@ test("user can reconnect after losing the connection", async () => {
},
);
const user = userEvent.setup();
await createCallView(nullHostBridge, true);
createCallView(nullHostBridge, true);
await user.click(screen.getByRole("button", { name: "LoseConnection" }));
await screen.findByText("Connection lost");
// Never joined, so there was no call to leave
+2 -40
View File
@@ -13,12 +13,7 @@ import {
useMemo,
useState,
} from "react";
import {
type MatrixClient,
JoinRule,
type Room,
UNSTABLE_MSC4354_STICKY_EVENTS,
} from "matrix-js-sdk";
import { type MatrixClient, JoinRule, type Room } from "matrix-js-sdk";
import {
Room as LivekitRoom,
isE2EESupported as isE2EESupportedBrowser,
@@ -171,35 +166,7 @@ export const CallView: FC<Props> = ({
return (): void => scope.end();
}, [backend, e2eeSystem, externalRtcSession]);
// Known before the call renders, so a join without a lobby picks the right
// Matrix RTC mode
const [stickyEventsSupported, setStickyEventsSupported] = useState<
boolean | null
>(null);
useEffect(() => {
let cancelled = false;
void backend
.doesServerSupportUnstableFeature(UNSTABLE_MSC4354_STICKY_EVENTS)
.catch((e) => {
// This will also fail in embedded mode if the HS does not
// set `Access-Control-Allow-Origin: *`:
// The page is loaded from a file url (origin=null) + widget api does not handle this
// -> a raw http request will be used -> CORS errors due to origin=null
// The conclusion is: matrix 2.0 mode will always fall back in widget mode on mobile.
// This is acceptable as we plan to not extend the widget api for full 2.0 mode support.
logger.warn("Failed to check if sticky events are supported", e);
return false;
})
.then((supported) => {
if (!cancelled) setStickyEventsSupported(supported);
});
return (): void => {
cancelled = true;
};
}, [backend]);
if (muteStates === null || slot === null || stickyEventsSupported === null)
return null;
if (muteStates === null || slot === null) return null;
return (
<LoadedCallView
@@ -213,7 +180,6 @@ export const CallView: FC<Props> = ({
joined={joined}
setJoined={setJoined}
muteStates={muteStates}
stickyEventsSupported={stickyEventsSupported}
/>
);
};
@@ -283,8 +249,6 @@ interface LoadedProps extends Omit<Props, "rtcSession" | "backend"> {
joined: boolean;
setJoined: (value: boolean) => void;
muteStates: MuteStates;
/** Whether the homeserver supports sticky events (MSC4354), which Matrix 2.0 needs. */
stickyEventsSupported: boolean;
}
/**
@@ -317,7 +281,6 @@ const LoadedCallView: FC<LoadedProps> = ({
joined,
setJoined,
muteStates,
stickyEventsSupported,
}) => {
// Used to thread through any errors that occur outside the error boundary
const [externalError, setExternalError] = useState<ElementCallError | null>(
@@ -656,7 +619,6 @@ const LoadedCallView: FC<LoadedProps> = ({
media={media}
muteStates={muteStates}
e2eeSystem={e2eeSystem}
stickyEventsSupported={stickyEventsSupported}
//otelGroupCallMembership={otelGroupCallMembership}
onShareClick={onShareClick}
/>
+17
View File
@@ -14,6 +14,23 @@ Please see LICENSE in the repository root for full details.
overflow-y: auto;
}
/* Normally the footer uses a transparent background to allow our expressive
page gradients to shine through. However, we sometimes need to visually separate
it from the content underneath. If the call layout is overflowing, or if the
spotlight tile is maximised and displaying video, apply a gradient background. */
.overflowing > .footer,
.fixedGrid:has(
> .tile[data-maximised="true"]
.spotlightItem[data-background="transparent"][data-video-enabled="true"][aria-hidden="false"]
)
~ .footer {
background: linear-gradient(
180deg,
rgba(0, 0, 0, 0) 0%,
var(--cpd-color-bg-canvas-default) 100%
);
}
.header {
position: sticky;
flex-shrink: 0;
+2 -37
View File
@@ -7,7 +7,6 @@ Please see LICENSE in the repository root for full details.
*/
import {
afterEach,
beforeEach,
describe,
expect,
@@ -21,10 +20,8 @@ import { BrowserRouter } from "react-router-dom";
import { TooltipProvider } from "@vector-im/compound-web";
import userEvent from "@testing-library/user-event";
import { ActiveCall, InCallView, rtcParticipationOptions } from "./InCallView";
import { getUrlParams } from "../UrlParams";
import { ActiveCall, InCallView } from "./InCallView";
import {
mockConfig,
mockMediaDevices,
mockMuteStates,
mockRtcMembership,
@@ -46,11 +43,7 @@ import { ReactionsSenderProvider } from "../reactions/useReactionsSender";
import { useRoomEncryptionSystem } from "../e2ee/sharedKeyManagement";
import { MemberAudioRenderer } from "../tracks/MemberAudioRenderer";
import type * as MatrixRTCSdk from "@element-hq/matrixrtc-sdk";
import {
constant,
MatrixRTCMode,
type RTCSlot,
} from "@element-hq/matrixrtc-sdk";
import { constant, type RTCSlot } from "@element-hq/matrixrtc-sdk";
import { MediaDevicesContext } from "../MediaDevicesContext";
import { type MediaDevices as ECMediaDevices } from "../state/MediaDevices";
import { AppBar } from "../AppBar";
@@ -253,7 +246,6 @@ function renderActiveCall(slot: RTCSlot): RenderResult {
onShareClick={null}
e2eeSystem={{ kind: E2eeType.NONE }}
media={fakeLocalMedia()}
stickyEventsSupported
onLeft={(): void => {}}
/>
</TooltipProvider>
@@ -263,32 +255,6 @@ function renderActiveCall(slot: RTCSlot): RenderResult {
);
}
describe("rtcParticipationOptions", () => {
const urlParams = getUrlParams("", "");
afterEach(() => vi.restoreAllMocks());
it("joins in Matrix 2.0 mode when the homeserver supports sticky events", () => {
mockConfig({ matrix_rtc_mode: MatrixRTCMode.Matrix_2_0 });
expect(rtcParticipationOptions(urlParams, true).matrixRTCMode).toBe(
MatrixRTCMode.Matrix_2_0,
);
});
it("falls back to compatibility mode when the homeserver lacks sticky events", () => {
mockConfig({ matrix_rtc_mode: MatrixRTCMode.Matrix_2_0 });
expect(rtcParticipationOptions(urlParams, false).matrixRTCMode).toBe(
MatrixRTCMode.Compatibility,
);
});
it("keeps compatibility mode when the homeserver lacks sticky events", () => {
mockConfig({ matrix_rtc_mode: MatrixRTCMode.Compatibility });
expect(rtcParticipationOptions(urlParams, false).matrixRTCMode).toBe(
MatrixRTCMode.Compatibility,
);
});
});
describe("ActiveCall", () => {
it("creates the view models and renders the call", async () => {
const { findByTestId } = renderActiveCall(mockSlot());
@@ -349,7 +315,6 @@ describe("ActiveCall", () => {
onShareClick={null}
e2eeSystem={{ kind: E2eeType.NONE }}
media={fakeLocalMedia()}
stickyEventsSupported
onLeft={(): void => {}}
/>
</TooltipProvider>
+19 -21
View File
@@ -55,7 +55,7 @@ import { SpotlightTile } from "../tile/SpotlightTile";
import {
type EncryptionSystem,
type LocalMedia,
MatrixRTCMode,
type MatrixRTCMode,
} from "@element-hq/matrixrtc-sdk";
import { E2eeType } from "../e2ee/e2eeType";
import { makeGridLayout } from "../grid/GridLayout";
@@ -194,8 +194,6 @@ export interface ActiveCallProps extends Omit<
e2eeSystem: EncryptionSystem;
/** The tracks the lobby opened, for the join to publish. */
media: LocalMedia;
/** Whether the homeserver supports sticky events (MSC4354), which Matrix 2.0 needs. */
stickyEventsSupported: boolean;
// TODO refactor those reasons into an enum
onLeft: (
reason: "user" | "timeout" | "decline" | "allOthersLeft" | "error",
@@ -231,7 +229,7 @@ export const ActiveCall: FC<ActiveCallProps> = (props) => {
const capture = captureSettings();
const rtcParticipation = props.slot.join({
...rtcParticipationOptions(urlParams, props.stickyEventsSupported),
...rtcParticipationOptions(urlParams),
// Without a lobby nothing was captured and the join captures itself
publish:
props.media.requests.length > 0
@@ -292,7 +290,6 @@ export const ActiveCall: FC<ActiveCallProps> = (props) => {
backgroundEffectsState$,
props.client,
props.media,
props.stickyEventsSupported,
rootElement,
]);
@@ -416,6 +413,7 @@ export const InCallView: FC<InCallViewProps> = ({
const screenShareError = useBehavior(vm.screenShareError$);
const layout = useBehavior(vm.layout$);
const edgeToEdge = useBehavior(vm.edgeToEdge$);
const overflowing = useBehavior(vm.overflowing$);
const showNameTags = useBehavior(vm.showNameTags$);
const showHeader = useBehavior(vm.showHeader$);
const showModals = useBehavior(vm.showModals$);
@@ -638,6 +636,7 @@ export const InCallView: FC<InCallViewProps> = ({
showRingingStatus={showRingingStatus}
focusable={!contentObscured}
className={classNames(className, styles.tile)}
itemClassName={styles.spotlightItem}
style={style}
/>
);
@@ -663,6 +662,7 @@ export const InCallView: FC<InCallViewProps> = ({
return (
<SpotlightTile
className={styles.tile}
itemClassName={styles.spotlightItem}
data-maximised
vm={layout.spotlight}
expanded
@@ -753,6 +753,10 @@ export const InCallView: FC<InCallViewProps> = ({
/>,
);
// Only hide the settings button if we have an AppBar header and we are showing the header
const footer = footerVm !== null && (
<CallFooter className={styles.footer} ref={footerRef} vm={footerVm} />
);
const connectedTransports = useBehavior(vm.connectedTransports$);
const localMember = useBehavior(vm.localMember$);
const localTransport = useBehavior(
@@ -764,7 +768,9 @@ export const InCallView: FC<InCallViewProps> = ({
// and the footer is also viewable by moving focus into it, so this is fine.
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
<div
className={styles.inRoom}
className={classNames(styles.inRoom, {
[styles.overflowing]: overflowing,
})}
ref={containerRef}
// Which layout the call has settled on, for tests and for anyone
// wondering why the call looks the way it does at the size it was given
@@ -783,7 +789,7 @@ export const InCallView: FC<InCallViewProps> = ({
{screenShareToast}
{earpieceOverlay}
<ReactionsOverlay vm={vm} />
<CallFooter ref={footerRef} vm={footerVm} />
{footer}
{showModals && (
<>
<RageshakeRequestModal {...rageshakeRequestModalProps} />
@@ -861,24 +867,16 @@ export function captureSettings(): CaptureSettings {
*/
export function rtcParticipationOptions(
urlParams: ReturnType<typeof useUrlParams>,
stickyEventsSupported: boolean,
): Omit<RTCParticipationOptions, "publish"> {
const config = Config.get();
const session = config.matrix_rtc_session;
// matrix_rtc_mode in config.json overrides the user's Developer Settings
// choice. We merely sample the current mode here, so the user would need
// to manually rejoin to switch to a different one.
let matrixRTCMode =
(config.matrix_rtc_mode as MatrixRTCMode | undefined) ??
matrixRTCModeSetting.value$.value;
if (matrixRTCMode === MatrixRTCMode.Matrix_2_0 && !stickyEventsSupported) {
rootLogger.warn(
"Homeserver does not support sticky events (MSC4354), falling back from Matrix 2.0 to compatibility mode",
);
matrixRTCMode = MatrixRTCMode.Compatibility;
}
return {
matrixRTCMode,
// matrix_rtc_mode in config.json overrides the user's Developer Settings
// choice. We merely sample the current mode here, so the user would need
// to manually rejoin to switch to a different one.
matrixRTCMode:
(config.matrix_rtc_mode as MatrixRTCMode | undefined) ??
matrixRTCModeSetting.value$.value,
sendNotificationType: urlParams.sendNotificationType,
callIntent: urlParams.callIntent,
timings: {
+21 -41
View File
@@ -5,60 +5,40 @@ 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 {
type ReactNode,
useState,
type FC,
type ComponentType,
type SVGAttributes,
} from "react";
import { useTranslation } from "react-i18next";
import { Menu, OptionMenuItem } from "@vector-im/compound-web";
import {
GridIcon,
SpotlightViewIcon,
GridIcon,
} from "@vector-im/compound-design-tokens/assets/web/icons";
import {
type LayoutMode,
type LayoutSwitchViewModel,
} from "../state/LayoutSwitchViewModel";
import { type LayoutSwitchViewModel } from "../state/LayoutSwitchViewModel";
import { useBehavior } from "../useBehavior";
import { LayoutSwitchButton } from "../button";
import { useTranslation } from "react-i18next";
import { Switch } from "@vector-im/compound-web";
interface LayoutSwitchProps {
interface Props {
vm: LayoutSwitchViewModel;
className?: string;
size?: "md" | "lg";
}
export const LayoutSwitch: FC<LayoutSwitchProps> = ({ vm, ...props }) => {
export const LayoutSwitch: FC<Props> = ({ vm, className }) => {
const { t } = useTranslation();
const layout = useBehavior(vm.layout$);
const [open, setOpen] = useState(false);
const menuItem = (
value: LayoutMode,
label: string,
Icon: ComponentType<SVGAttributes<SVGElement>>,
): ReactNode => (
<OptionMenuItem
label={label}
Icon={Icon}
checked={layout === value}
onSelect={() => vm.setLayout(value)}
/>
);
const name = useId();
return (
<Menu
title={t("action.adjust_view")}
open={open}
onOpenChange={setOpen}
trigger={<LayoutSwitchButton layout={layout} {...props} />}
>
{menuItem("grid", t("layout_grid_label"), GridIcon)}
{menuItem("spotlight", t("layout_spotlight_label"), SpotlightViewIcon)}
</Menu>
<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}
/>
);
};
+113 -68
View File
@@ -108,6 +108,7 @@ exports[`InCallView > rendering > renders 1`] = `
</div>
<div
class="_fixedGrid_4e7ff8 _grid_b0d1cd"
style="inset-block-start: NaNpx;"
>
<div />
</div>
@@ -167,13 +168,39 @@ exports[`InCallView > rendering > renders 1`] = `
class="_container_8084b5"
/>
<div
class="_footer_20b7b4"
data-button-size="md"
class="_footer_4e7ff8 _footer_20b7b4"
data-testid="footer-container"
>
<div
class="_logoContainer_20b7b4"
class="_settingsLogoContainer_20b7b4"
>
<button
aria-labelledby="_r_b_"
class="_icon-button_1215g_8 _settingsOnlyShowWide_20b7b4"
data-kind="secondary"
data-testid="settings-bottom-left"
role="button"
style="--cpd-icon-button-size: 32px;"
tabindex="0"
>
<div
class="_indicator-icon_j097f_17"
style="--cpd-icon-button-size: 100%;"
>
<svg
aria-hidden="true"
fill="currentColor"
height="1em"
viewBox="0 0 24 24"
width="1em"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M6 14q-.824 0-1.412-.588A1.93 1.93 0 0 1 4 12q0-.825.588-1.412A1.93 1.93 0 0 1 6 10q.824 0 1.412.588Q8 11.175 8 12t-.588 1.412A1.93 1.93 0 0 1 6 14m6 0q-.825 0-1.412-.588A1.93 1.93 0 0 1 10 12q0-.825.588-1.412A1.93 1.93 0 0 1 12 10q.825 0 1.412.588Q14 11.175 14 12t-.588 1.412A1.93 1.93 0 0 1 12 14m6 0q-.824 0-1.413-.588A1.93 1.93 0 0 1 16 12q0-.825.587-1.412A1.93 1.93 0 0 1 18 10q.824 0 1.413.588Q20 11.175 20 12t-.587 1.412A1.93 1.93 0 0 1 18 14"
/>
</svg>
</div>
</button>
<div
class="_logo_20b7b4"
>
@@ -282,14 +309,36 @@ exports[`InCallView > rendering > renders 1`] = `
<div
class="_buttons_20b7b4"
>
<button
aria-labelledby="_r_g_"
class="_button_1nw83_8 _settingsOnlyShowNarrow_20b7b4 _has-icon_1nw83_60 _icon-only_1nw83_53"
data-kind="secondary"
data-size="lg"
data-testid="settings-bottom-center"
role="button"
tabindex="0"
>
<svg
aria-hidden="true"
fill="currentColor"
height="24"
viewBox="0 0 24 24"
width="24"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M6 14q-.824 0-1.412-.588A1.93 1.93 0 0 1 4 12q0-.825.588-1.412A1.93 1.93 0 0 1 6 10q.824 0 1.412.588Q8 11.175 8 12t-.588 1.412A1.93 1.93 0 0 1 6 14m6 0q-.825 0-1.412-.588A1.93 1.93 0 0 1 10 12q0-.825.588-1.412A1.93 1.93 0 0 1 12 10q.825 0 1.412.588Q14 11.175 14 12t-.588 1.412A1.93 1.93 0 0 1 12 14m6 0q-.824 0-1.413-.588A1.93 1.93 0 0 1 16 12q0-.825.587-1.412A1.93 1.93 0 0 1 18 10q.824 0 1.413.588Q20 11.175 20 12t-.587 1.412A1.93 1.93 0 0 1 18 14"
/>
</svg>
</button>
<button
aria-busy="false"
aria-checked="false"
aria-disabled="true"
aria-labelledby="_r_b_"
aria-labelledby="_r_l_"
class="_button_1nw83_8 _has-icon_1nw83_60 _icon-only_1nw83_53"
data-kind="primary"
data-size="md"
data-size="lg"
data-testid="incall_mute"
role="switch"
tabindex="0"
@@ -297,9 +346,9 @@ exports[`InCallView > rendering > renders 1`] = `
<svg
aria-hidden="true"
fill="currentColor"
height="20"
height="24"
viewBox="0 0 24 24"
width="20"
width="24"
xmlns="http://www.w3.org/2000/svg"
>
<path
@@ -311,10 +360,10 @@ exports[`InCallView > rendering > renders 1`] = `
aria-busy="false"
aria-checked="false"
aria-disabled="true"
aria-labelledby="_r_g_"
aria-labelledby="_r_q_"
class="_button_1nw83_8 _has-icon_1nw83_60 _icon-only_1nw83_53"
data-kind="primary"
data-size="md"
data-size="lg"
data-testid="incall_videomute"
role="switch"
tabindex="0"
@@ -322,9 +371,9 @@ exports[`InCallView > rendering > renders 1`] = `
<svg
aria-hidden="true"
fill="currentColor"
height="20"
height="24"
viewBox="0 0 24 24"
width="20"
width="24"
xmlns="http://www.w3.org/2000/svg"
>
<path
@@ -336,19 +385,19 @@ exports[`InCallView > rendering > renders 1`] = `
aria-disabled="false"
aria-expanded="false"
aria-haspopup="true"
aria-labelledby="_r_l_"
aria-labelledby="_r_v_"
class="_button_1nw83_8 _raiseHand_20b7b4 _has-icon_1nw83_60 _icon-only_1nw83_53"
data-kind="secondary"
data-size="md"
data-size="lg"
role="button"
tabindex="0"
>
<svg
aria-hidden="true"
fill="currentColor"
height="20"
height="24"
viewBox="0 0 24 24"
width="20"
width="24"
xmlns="http://www.w3.org/2000/svg"
>
<path
@@ -359,59 +408,10 @@ exports[`InCallView > rendering > renders 1`] = `
</svg>
</button>
<button
aria-disabled="false"
aria-expanded="false"
aria-haspopup="menu"
aria-labelledby="_r_v_"
class="_button_1nw83_8 _layout_20b7b4 _has-icon_1nw83_60 _icon-only_1nw83_53"
data-kind="secondary"
data-size="md"
data-state="closed"
id="radix-_r_t_"
role="button"
tabindex="0"
type="button"
>
<svg
aria-hidden="true"
fill="currentColor"
height="20"
viewBox="0 0 24 24"
width="20"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M4 11a.97.97 0 0 1-.712-.287A.97.97 0 0 1 3 10V4q0-.424.288-.712A.97.97 0 0 1 4 3h6q.424 0 .713.288Q11 3.575 11 4v6q0 .424-.287.713A.97.97 0 0 1 10 11zm5-2V5H5v4zm5 12a.97.97 0 0 1-.713-.288A.97.97 0 0 1 13 20v-6q0-.424.287-.713A.97.97 0 0 1 14 13h6q.424 0 .712.287.288.288.288.713v6q0 .424-.288.712A.97.97 0 0 1 20 21zm5-2v-4h-4v4zM4 21a.97.97 0 0 1-.712-.288A.97.97 0 0 1 3 20v-6q0-.424.288-.713A.97.97 0 0 1 4 13h6q.424 0 .713.287.287.288.287.713v6q0 .424-.287.712A.97.97 0 0 1 10 21zm5-2v-4H5v4zm5-8a.97.97 0 0 1-.713-.287A.97.97 0 0 1 13 10V4q0-.424.287-.712A.97.97 0 0 1 14 3h6q.424 0 .712.288Q21 3.575 21 4v6q0 .424-.288.713A.97.97 0 0 1 20 11zm5-2V5h-4v4z"
/>
</svg>
</button>
<button
aria-labelledby="_r_14_"
class="_button_1nw83_8 _has-icon_1nw83_60 _icon-only_1nw83_53"
data-kind="secondary"
data-size="md"
data-testid="settings-bottom"
role="button"
tabindex="0"
>
<svg
aria-hidden="true"
fill="currentColor"
height="20"
viewBox="0 0 24 24"
width="20"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M6 14q-.824 0-1.412-.588A1.93 1.93 0 0 1 4 12q0-.825.588-1.412A1.93 1.93 0 0 1 6 10q.824 0 1.412.588Q8 11.175 8 12t-.588 1.412A1.93 1.93 0 0 1 6 14m6 0q-.825 0-1.412-.588A1.93 1.93 0 0 1 10 12q0-.825.588-1.412A1.93 1.93 0 0 1 12 10q.825 0 1.412.588Q14 11.175 14 12t-.588 1.412A1.93 1.93 0 0 1 12 14m6 0q-.824 0-1.413-.588A1.93 1.93 0 0 1 16 12q0-.825.587-1.412A1.93 1.93 0 0 1 18 10q.824 0 1.413.588Q20 11.175 20 12t-.587 1.412A1.93 1.93 0 0 1 18 14"
/>
</svg>
</button>
<button
aria-labelledby="_r_19_"
aria-labelledby="_r_17_"
class="_button_1nw83_8 _has-icon_1nw83_60 _icon-only_1nw83_53 _destructive_1nw83_110"
data-kind="primary"
data-size="md"
data-size="lg"
data-testid="incall_leave"
role="button"
tabindex="0"
@@ -419,9 +419,9 @@ exports[`InCallView > rendering > renders 1`] = `
<svg
aria-hidden="true"
fill="currentColor"
height="20"
height="24"
viewBox="0 0 24 24"
width="20"
width="24"
xmlns="http://www.w3.org/2000/svg"
>
<path
@@ -430,6 +430,51 @@ exports[`InCallView > rendering > renders 1`] = `
</svg>
</button>
</div>
<fieldset
aria-label="Layout"
class="_toggle_1kvhc_9 _layout_20b7b4"
data-size="lg"
>
<input
aria-labelledby="_r_1d_"
name="_r_1c_"
type="radio"
value="spotlight"
/>
<svg
aria-hidden="true"
fill="currentColor"
height="1em"
viewBox="0 0 24 24"
width="1em"
xmlns="http://www.w3.org/2000/svg"
>
<path
clip-rule="evenodd"
d="M20 6H4v12h16zM4 4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2z"
fill-rule="evenodd"
/>
</svg>
<input
aria-labelledby="_r_1i_"
checked=""
name="_r_1c_"
type="radio"
value="grid"
/>
<svg
aria-hidden="true"
fill="currentColor"
height="1em"
viewBox="0 0 24 24"
width="1em"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M4 11a.97.97 0 0 1-.712-.287A.97.97 0 0 1 3 10V4q0-.424.288-.712A.97.97 0 0 1 4 3h6q.424 0 .713.288Q11 3.575 11 4v6q0 .424-.287.713A.97.97 0 0 1 10 11zm5-2V5H5v4zm5 12a.97.97 0 0 1-.713-.288A.97.97 0 0 1 13 20v-6q0-.424.287-.713A.97.97 0 0 1 14 13h6q.424 0 .712.287.288.288.288.713v6q0 .424-.288.712A.97.97 0 0 1 20 21zm5-2v-4h-4v4zM4 21a.97.97 0 0 1-.712-.288A.97.97 0 0 1 3 20v-6q0-.424.288-.713A.97.97 0 0 1 4 13h6q.424 0 .713.287.287.288.287.713v6q0 .424-.287.712A.97.97 0 0 1 10 21zm5-2v-4H5v4zm5-8a.97.97 0 0 1-.713-.287A.97.97 0 0 1 13 10V4q0-.424.287-.712A.97.97 0 0 1 14 3h6q.424 0 .712.288Q21 3.575 21 4v6q0 .424-.288.713A.97.97 0 0 1 20 11zm5-2V5h-4v4z"
/>
</svg>
</fieldset>
</div>
</div>
</div>
+165 -85
View File
@@ -7,7 +7,7 @@ exports[`LobbyView > renders with AppBar android 1`] = `
>
<header>
<button
aria-labelledby="_r_2k_"
aria-labelledby="_r_36_"
class="_icon-button_1215g_8 _primaryButton_221541"
data-kind="primary"
role="button"
@@ -96,20 +96,69 @@ exports[`LobbyView > renders with AppBar android 1`] = `
</div>
<div
class="_footer_20b7b4"
data-button-size="lg"
data-testid="footer-container"
>
<div
class="_logoContainer_20b7b4"
/>
class="_settingsLogoContainer_20b7b4"
>
<button
aria-labelledby="_r_3c_"
class="_icon-button_1215g_8 _settingsOnlyShowWide_20b7b4"
data-kind="secondary"
data-testid="settings-bottom-left"
role="button"
style="--cpd-icon-button-size: 32px;"
tabindex="0"
>
<div
class="_indicator-icon_j097f_17"
style="--cpd-icon-button-size: 100%;"
>
<svg
aria-hidden="true"
fill="currentColor"
height="1em"
viewBox="0 0 24 24"
width="1em"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M12 20q-.825 0-1.412-.587A1.93 1.93 0 0 1 10 18q0-.824.588-1.413A1.93 1.93 0 0 1 12 16q.825 0 1.412.587Q14 17.176 14 18t-.588 1.413A1.93 1.93 0 0 1 12 20m0-6q-.825 0-1.412-.588A1.93 1.93 0 0 1 10 12q0-.825.588-1.412A1.93 1.93 0 0 1 12 10q.825 0 1.412.588Q14 11.175 14 12t-.588 1.412A1.93 1.93 0 0 1 12 14m0-6q-.825 0-1.412-.588A1.93 1.93 0 0 1 10 6q0-.824.588-1.412A1.93 1.93 0 0 1 12 4q.825 0 1.412.588Q14 5.175 14 6q0 .824-.588 1.412A1.93 1.93 0 0 1 12 8"
/>
</svg>
</div>
</button>
</div>
<div
class="_buttons_20b7b4"
>
<button
aria-labelledby="_r_3h_"
class="_button_1nw83_8 _settingsOnlyShowNarrow_20b7b4 _has-icon_1nw83_60 _icon-only_1nw83_53"
data-kind="secondary"
data-size="lg"
data-testid="settings-bottom-center"
role="button"
tabindex="0"
>
<svg
aria-hidden="true"
fill="currentColor"
height="24"
viewBox="0 0 24 24"
width="24"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M12 20q-.825 0-1.412-.587A1.93 1.93 0 0 1 10 18q0-.824.588-1.413A1.93 1.93 0 0 1 12 16q.825 0 1.412.587Q14 17.176 14 18t-.588 1.413A1.93 1.93 0 0 1 12 20m0-6q-.825 0-1.412-.588A1.93 1.93 0 0 1 10 12q0-.825.588-1.412A1.93 1.93 0 0 1 12 10q.825 0 1.412.588Q14 11.175 14 12t-.588 1.412A1.93 1.93 0 0 1 12 14m0-6q-.825 0-1.412-.588A1.93 1.93 0 0 1 10 6q0-.824.588-1.412A1.93 1.93 0 0 1 12 4q.825 0 1.412.588Q14 5.175 14 6q0 .824-.588 1.412A1.93 1.93 0 0 1 12 8"
/>
</svg>
</button>
<button
aria-busy="false"
aria-checked="false"
aria-disabled="true"
aria-labelledby="_r_2q_"
aria-labelledby="_r_3m_"
class="_button_1nw83_8 _has-icon_1nw83_60 _icon-only_1nw83_53"
data-kind="primary"
data-size="lg"
@@ -134,7 +183,7 @@ exports[`LobbyView > renders with AppBar android 1`] = `
aria-busy="false"
aria-checked="false"
aria-disabled="true"
aria-labelledby="_r_2v_"
aria-labelledby="_r_3r_"
class="_button_1nw83_8 _has-icon_1nw83_60 _icon-only_1nw83_53"
data-kind="primary"
data-size="lg"
@@ -156,29 +205,7 @@ exports[`LobbyView > renders with AppBar android 1`] = `
</svg>
</button>
<button
aria-labelledby="_r_34_"
class="_button_1nw83_8 _has-icon_1nw83_60 _icon-only_1nw83_53"
data-kind="secondary"
data-size="lg"
data-testid="settings-bottom"
role="button"
tabindex="0"
>
<svg
aria-hidden="true"
fill="currentColor"
height="24"
viewBox="0 0 24 24"
width="24"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M12 20q-.825 0-1.412-.587A1.93 1.93 0 0 1 10 18q0-.824.588-1.413A1.93 1.93 0 0 1 12 16q.825 0 1.412.587Q14 17.176 14 18t-.588 1.413A1.93 1.93 0 0 1 12 20m0-6q-.825 0-1.412-.588A1.93 1.93 0 0 1 10 12q0-.825.588-1.412A1.93 1.93 0 0 1 12 10q.825 0 1.412.588Q14 11.175 14 12t-.588 1.412A1.93 1.93 0 0 1 12 14m0-6q-.825 0-1.412-.588A1.93 1.93 0 0 1 10 6q0-.824.588-1.412A1.93 1.93 0 0 1 12 4q.825 0 1.412.588Q14 5.175 14 6q0 .824-.588 1.412A1.93 1.93 0 0 1 12 8"
/>
</svg>
</button>
<button
aria-labelledby="_r_39_"
aria-labelledby="_r_40_"
class="_button_1nw83_8 _has-icon_1nw83_60 _icon-only_1nw83_53 _destructive_1nw83_110"
data-kind="primary"
data-size="lg"
@@ -212,7 +239,7 @@ exports[`LobbyView > renders with AppBar ios 1`] = `
>
<header>
<button
aria-labelledby="_r_3i_"
aria-labelledby="_r_4a_"
class="_icon-button_1215g_8 _primaryButton_221541"
data-kind="primary"
role="button"
@@ -301,20 +328,69 @@ exports[`LobbyView > renders with AppBar ios 1`] = `
</div>
<div
class="_footer_20b7b4"
data-button-size="lg"
data-testid="footer-container"
>
<div
class="_logoContainer_20b7b4"
/>
class="_settingsLogoContainer_20b7b4"
>
<button
aria-labelledby="_r_4g_"
class="_icon-button_1215g_8 _settingsOnlyShowWide_20b7b4"
data-kind="secondary"
data-testid="settings-bottom-left"
role="button"
style="--cpd-icon-button-size: 32px;"
tabindex="0"
>
<div
class="_indicator-icon_j097f_17"
style="--cpd-icon-button-size: 100%;"
>
<svg
aria-hidden="true"
fill="currentColor"
height="1em"
viewBox="0 0 24 24"
width="1em"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M6 14q-.824 0-1.412-.588A1.93 1.93 0 0 1 4 12q0-.825.588-1.412A1.93 1.93 0 0 1 6 10q.824 0 1.412.588Q8 11.175 8 12t-.588 1.412A1.93 1.93 0 0 1 6 14m6 0q-.825 0-1.412-.588A1.93 1.93 0 0 1 10 12q0-.825.588-1.412A1.93 1.93 0 0 1 12 10q.825 0 1.412.588Q14 11.175 14 12t-.588 1.412A1.93 1.93 0 0 1 12 14m6 0q-.824 0-1.413-.588A1.93 1.93 0 0 1 16 12q0-.825.587-1.412A1.93 1.93 0 0 1 18 10q.824 0 1.413.588Q20 11.175 20 12t-.587 1.412A1.93 1.93 0 0 1 18 14"
/>
</svg>
</div>
</button>
</div>
<div
class="_buttons_20b7b4"
>
<button
aria-labelledby="_r_4l_"
class="_button_1nw83_8 _settingsOnlyShowNarrow_20b7b4 _has-icon_1nw83_60 _icon-only_1nw83_53"
data-kind="secondary"
data-size="lg"
data-testid="settings-bottom-center"
role="button"
tabindex="0"
>
<svg
aria-hidden="true"
fill="currentColor"
height="24"
viewBox="0 0 24 24"
width="24"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M6 14q-.824 0-1.412-.588A1.93 1.93 0 0 1 4 12q0-.825.588-1.412A1.93 1.93 0 0 1 6 10q.824 0 1.412.588Q8 11.175 8 12t-.588 1.412A1.93 1.93 0 0 1 6 14m6 0q-.825 0-1.412-.588A1.93 1.93 0 0 1 10 12q0-.825.588-1.412A1.93 1.93 0 0 1 12 10q.825 0 1.412.588Q14 11.175 14 12t-.588 1.412A1.93 1.93 0 0 1 12 14m6 0q-.824 0-1.413-.588A1.93 1.93 0 0 1 16 12q0-.825.587-1.412A1.93 1.93 0 0 1 18 10q.824 0 1.413.588Q20 11.175 20 12t-.587 1.412A1.93 1.93 0 0 1 18 14"
/>
</svg>
</button>
<button
aria-busy="false"
aria-checked="false"
aria-disabled="true"
aria-labelledby="_r_3o_"
aria-labelledby="_r_4q_"
class="_button_1nw83_8 _has-icon_1nw83_60 _icon-only_1nw83_53"
data-kind="primary"
data-size="lg"
@@ -339,7 +415,7 @@ exports[`LobbyView > renders with AppBar ios 1`] = `
aria-busy="false"
aria-checked="false"
aria-disabled="true"
aria-labelledby="_r_3t_"
aria-labelledby="_r_4v_"
class="_button_1nw83_8 _has-icon_1nw83_60 _icon-only_1nw83_53"
data-kind="primary"
data-size="lg"
@@ -361,29 +437,7 @@ exports[`LobbyView > renders with AppBar ios 1`] = `
</svg>
</button>
<button
aria-labelledby="_r_42_"
class="_button_1nw83_8 _has-icon_1nw83_60 _icon-only_1nw83_53"
data-kind="secondary"
data-size="lg"
data-testid="settings-bottom"
role="button"
tabindex="0"
>
<svg
aria-hidden="true"
fill="currentColor"
height="24"
viewBox="0 0 24 24"
width="24"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M6 14q-.824 0-1.412-.588A1.93 1.93 0 0 1 4 12q0-.825.588-1.412A1.93 1.93 0 0 1 6 10q.824 0 1.412.588Q8 11.175 8 12t-.588 1.412A1.93 1.93 0 0 1 6 14m6 0q-.825 0-1.412-.588A1.93 1.93 0 0 1 10 12q0-.825.588-1.412A1.93 1.93 0 0 1 12 10q.825 0 1.412.588Q14 11.175 14 12t-.588 1.412A1.93 1.93 0 0 1 12 14m6 0q-.824 0-1.413-.588A1.93 1.93 0 0 1 16 12q0-.825.587-1.412A1.93 1.93 0 0 1 18 10q.824 0 1.413.588Q20 11.175 20 12t-.587 1.412A1.93 1.93 0 0 1 18 14"
/>
</svg>
</button>
<button
aria-labelledby="_r_47_"
aria-labelledby="_r_54_"
class="_button_1nw83_8 _has-icon_1nw83_60 _icon-only_1nw83_53 _destructive_1nw83_110"
data-kind="primary"
data-size="lg"
@@ -552,12 +606,38 @@ exports[`LobbyView > renders with header and participant count 1`] = `
</div>
<div
class="_footer_20b7b4"
data-button-size="lg"
data-testid="footer-container"
>
<div
class="_logoContainer_20b7b4"
class="_settingsLogoContainer_20b7b4"
>
<button
aria-labelledby="_r_6_"
class="_icon-button_1215g_8 _settingsOnlyShowWide_20b7b4"
data-kind="secondary"
data-testid="settings-bottom-left"
role="button"
style="--cpd-icon-button-size: 32px;"
tabindex="0"
>
<div
class="_indicator-icon_j097f_17"
style="--cpd-icon-button-size: 100%;"
>
<svg
aria-hidden="true"
fill="currentColor"
height="1em"
viewBox="0 0 24 24"
width="1em"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M12 20q-.825 0-1.412-.587A1.93 1.93 0 0 1 10 18q0-.824.588-1.413A1.93 1.93 0 0 1 12 16q.825 0 1.412.587Q14 17.176 14 18t-.588 1.413A1.93 1.93 0 0 1 12 20m0-6q-.825 0-1.412-.588A1.93 1.93 0 0 1 10 12q0-.825.588-1.412A1.93 1.93 0 0 1 12 10q.825 0 1.412.588Q14 11.175 14 12t-.588 1.412A1.93 1.93 0 0 1 12 14m0-6q-.825 0-1.412-.588A1.93 1.93 0 0 1 10 6q0-.824.588-1.412A1.93 1.93 0 0 1 12 4q.825 0 1.412.588Q14 5.175 14 6q0 .824-.588 1.412A1.93 1.93 0 0 1 12 8"
/>
</svg>
</div>
</button>
<div
class="_logo_20b7b4"
>
@@ -666,11 +746,33 @@ exports[`LobbyView > renders with header and participant count 1`] = `
<div
class="_buttons_20b7b4"
>
<button
aria-labelledby="_r_b_"
class="_button_1nw83_8 _settingsOnlyShowNarrow_20b7b4 _has-icon_1nw83_60 _icon-only_1nw83_53"
data-kind="secondary"
data-size="lg"
data-testid="settings-bottom-center"
role="button"
tabindex="0"
>
<svg
aria-hidden="true"
fill="currentColor"
height="24"
viewBox="0 0 24 24"
width="24"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M12 20q-.825 0-1.412-.587A1.93 1.93 0 0 1 10 18q0-.824.588-1.413A1.93 1.93 0 0 1 12 16q.825 0 1.412.587Q14 17.176 14 18t-.588 1.413A1.93 1.93 0 0 1 12 20m0-6q-.825 0-1.412-.588A1.93 1.93 0 0 1 10 12q0-.825.588-1.412A1.93 1.93 0 0 1 12 10q.825 0 1.412.588Q14 11.175 14 12t-.588 1.412A1.93 1.93 0 0 1 12 14m0-6q-.825 0-1.412-.588A1.93 1.93 0 0 1 10 6q0-.824.588-1.412A1.93 1.93 0 0 1 12 4q.825 0 1.412.588Q14 5.175 14 6q0 .824-.588 1.412A1.93 1.93 0 0 1 12 8"
/>
</svg>
</button>
<button
aria-busy="false"
aria-checked="false"
aria-disabled="true"
aria-labelledby="_r_6_"
aria-labelledby="_r_g_"
class="_button_1nw83_8 _has-icon_1nw83_60 _icon-only_1nw83_53"
data-kind="primary"
data-size="lg"
@@ -695,7 +797,7 @@ exports[`LobbyView > renders with header and participant count 1`] = `
aria-busy="false"
aria-checked="false"
aria-disabled="true"
aria-labelledby="_r_b_"
aria-labelledby="_r_l_"
class="_button_1nw83_8 _has-icon_1nw83_60 _icon-only_1nw83_53"
data-kind="primary"
data-size="lg"
@@ -717,29 +819,7 @@ exports[`LobbyView > renders with header and participant count 1`] = `
</svg>
</button>
<button
aria-labelledby="_r_g_"
class="_button_1nw83_8 _has-icon_1nw83_60 _icon-only_1nw83_53"
data-kind="secondary"
data-size="lg"
data-testid="settings-bottom"
role="button"
tabindex="0"
>
<svg
aria-hidden="true"
fill="currentColor"
height="24"
viewBox="0 0 24 24"
width="24"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M12 20q-.825 0-1.412-.587A1.93 1.93 0 0 1 10 18q0-.824.588-1.413A1.93 1.93 0 0 1 12 16q.825 0 1.412.587Q14 17.176 14 18t-.588 1.413A1.93 1.93 0 0 1 12 20m0-6q-.825 0-1.412-.588A1.93 1.93 0 0 1 10 12q0-.825.588-1.412A1.93 1.93 0 0 1 12 10q.825 0 1.412.588Q14 11.175 14 12t-.588 1.412A1.93 1.93 0 0 1 12 14m0-6q-.825 0-1.412-.588A1.93 1.93 0 0 1 10 6q0-.824.588-1.412A1.93 1.93 0 0 1 12 4q.825 0 1.412.588Q14 5.175 14 6q0 .824-.588 1.412A1.93 1.93 0 0 1 12 8"
/>
</svg>
</button>
<button
aria-labelledby="_r_l_"
aria-labelledby="_r_q_"
class="_button_1nw83_8 _has-icon_1nw83_60 _icon-only_1nw83_53 _destructive_1nw83_110"
data-kind="primary"
data-size="lg"
@@ -422,54 +422,6 @@ describe("DeveloperSettingsTab", () => {
expect(checkedValue).toBeChecked();
},
);
it("shows the compatibility fallback when matrix_2_0 is forced but the homeserver lacks sticky events", async () => {
mockConfig({ matrix_rtc_mode: MatrixRTCMode.Matrix_2_0 });
const client = createMockMatrixClient();
vi.mocked(client.doesServerSupportUnstableFeature).mockResolvedValue(
false,
);
render(
<TooltipProvider>
<DeveloperSettingsTab
client={client}
env={{} as unknown as ImportMetaEnv}
vm={outOfCallDeveloperSettingsTabViewModel}
/>
</TooltipProvider>,
);
expect(
await screen.findByText(/calls fall back to compatibility mode/),
).toBeInTheDocument();
const radios = getModeRadios();
expect(radios.compatibility).toBeChecked();
expect(radios.matrix20).not.toBeChecked();
});
it("shows no fallback when matrix_2_0 is forced and the homeserver has sticky events", async () => {
mockConfig({ matrix_rtc_mode: MatrixRTCMode.Matrix_2_0 });
const client = createMockMatrixClient();
render(
<TooltipProvider>
<DeveloperSettingsTab
client={client}
env={{} as unknown as ImportMetaEnv}
vm={outOfCallDeveloperSettingsTabViewModel}
/>
</TooltipProvider>,
);
await waitFor(() =>
expect(client.doesServerSupportUnstableFeature).toHaveBeenCalled(),
);
expect(
screen.queryByText(/calls fall back to compatibility mode/),
).toBeNull();
expect(getModeRadios().matrix20).toBeChecked();
});
});
describe("KeyRotationStatus", () => {
+3 -20
View File
@@ -146,10 +146,7 @@ export const DeveloperSettingsTab: FC<Props> = ({
debugTileLayoutSetting,
);
// null until the homeserver has answered
const [stickyEventsSupported, setStickyEventsSupported] = useState<
boolean | null
>(null);
const [stickyEventsSupported, setStickyEventsSupported] = useState(false);
useEffect(() => {
client
.doesServerSupportUnstableFeature(UNSTABLE_MSC4354_STICKY_EVENTS)
@@ -158,8 +155,6 @@ export const DeveloperSettingsTab: FC<Props> = ({
})
.catch((ex) => {
logger.warn("Failed to check if sticky events are supported", ex);
// As the call does
setStickyEventsSupported(false);
});
}, [client]);
@@ -175,13 +170,7 @@ export const DeveloperSettingsTab: FC<Props> = ({
| MatrixRTCMode
| undefined;
const matrixRTCModeForced = configMatrixRTCMode !== undefined;
// The call joins in compatibility mode instead, see `rtcParticipationOptions`
const stickyFallback =
configMatrixRTCMode === MatrixRTCMode.Matrix_2_0 &&
stickyEventsSupported === false;
const effectiveMatrixRTCMode = stickyFallback
? MatrixRTCMode.Compatibility
: (configMatrixRTCMode ?? matrixRTCMode);
const effectiveMatrixRTCMode = configMatrixRTCMode ?? matrixRTCMode;
const [showConnectionStats, setShowConnectionStats] = useSetting(
showConnectionStatsSetting,
@@ -580,12 +569,6 @@ export const DeveloperSettingsTab: FC<Props> = ({
{t("developer_mode.matrixRTCMode.title")}
</Heading>
{matrixRTCModeForced && <p>Your deployment overrides the mode.</p>}
{stickyFallback && (
<p>
Your homeserver does not support sticky events (MSC4354), so calls
fall back to compatibility mode.
</p>
)}
<Form>
<InlineField
name={matrixRTCModeRadioGroup}
@@ -609,7 +592,7 @@ export const DeveloperSettingsTab: FC<Props> = ({
<RadioControl
checked={effectiveMatrixRTCMode === MatrixRTCMode.Matrix_2_0}
value={MatrixRTCMode.Matrix_2_0}
disabled={matrixRTCModeForced || stickyEventsSupported !== true}
disabled={matrixRTCModeForced || !stickyEventsSupported}
onChange={onMatrixRTCModeChange}
/>
}
+14 -2
View File
@@ -304,6 +304,7 @@ const showFooterMs = 4000;
interface LayoutScanState {
layout: Layout | null;
overflowing: boolean;
tiles: TileStore;
}
@@ -456,6 +457,10 @@ export interface CallViewModel {
* and header as overlays.
*/
edgeToEdge$: Behavior<boolean>;
/**
* Whether the call layout is overflowing the interface (causing it to scroll).
*/
overflowing$: Behavior<boolean>;
/**
* Whether modals such as settings and reactions should be accessible at all.
@@ -1336,6 +1341,7 @@ export function createCallViewModel$(
let layout: Layout;
let newTiles: TileStore;
let pip: GridTileViewModel | undefined;
let overflowing = false;
switch (media.type) {
case "grid":
case "spotlight-landscape":
@@ -1347,6 +1353,7 @@ export function createCallViewModel$(
setVisibleTiles,
prevTiles,
);
overflowing = newTiles.gridTiles.length > visibleTiles;
break;
case "spotlight-expanded":
[layout, newTiles] = spotlightExpandedLayout(
@@ -1380,9 +1387,9 @@ export function createCallViewModel$(
tile.setShowOutline(tile === pip);
}
return { layout, tiles: newTiles };
return { layout, overflowing, tiles: newTiles };
},
{ layout: null, tiles: TileStore.empty() },
{ layout: null, overflowing: false, tiles: TileStore.empty() },
),
),
);
@@ -1398,6 +1405,10 @@ export function createCallViewModel$(
),
);
const overflowing$ = scope.behavior<boolean>(
layoutInternals$.pipe(map(({ overflowing }) => overflowing)),
);
/**
* The current generation of the tile store, exposed for debugging purposes.
*/
@@ -1641,6 +1652,7 @@ export function createCallViewModel$(
settingsOpen$: settingsOpen$,
setSettingsOpen$: setSettingsOpen$,
edgeToEdge$,
overflowing$,
earpieceMode$: earpieceMode$,
audioOutputSwitcher$: audioOutputSwitcher$,
reconnecting$,
-28
View File
@@ -31,8 +31,6 @@ test.each<{
false,
callIntent,
allowJoinUnmutedViaIntent,
true,
true,
);
expect(audioEnabled).toBe(true);
expect(videoEnabled).toBe(callIntent !== RTC_CALL_INTENT_AUDIO);
@@ -52,8 +50,6 @@ test.each<{
true,
callIntent,
false,
true,
true,
);
expect(audioEnabled).toBe(false);
expect(videoEnabled).toBe(false);
@@ -73,32 +69,8 @@ test.each<{
true,
callIntent,
true,
true,
true,
);
expect(audioEnabled).toBe(true);
expect(videoEnabled).toBe(callIntent !== RTC_CALL_INTENT_AUDIO);
},
);
test.each<{
initialAudioEnabled: boolean;
initialVideoEnabled: boolean;
}>([
{ initialAudioEnabled: false, initialVideoEnabled: true },
{ initialAudioEnabled: true, initialVideoEnabled: false },
{ initialAudioEnabled: false, initialVideoEnabled: false },
])(
"Should start the devices the intent disables muted, even if allowed unmuted (initialAudioEnabled: $initialAudioEnabled, initialVideoEnabled: $initialVideoEnabled)",
({ initialAudioEnabled, initialVideoEnabled }) => {
const { audioEnabled, videoEnabled } = calculateInitialMuteState(
false,
RTC_CALL_INTENT_VIDEO,
true,
initialAudioEnabled,
initialVideoEnabled,
);
expect(audioEnabled).toBe(initialAudioEnabled);
expect(videoEnabled).toBe(initialVideoEnabled);
},
);
+4 -10
View File
@@ -21,20 +21,14 @@ import {
* @param allowJoinUnmutedViaIntent Whether the host vouches for the intent
* enough to start the user unmuted without a lobby (see
* `HostBridge.allowJoinUnmutedViaIntent`).
* @param initialAudioEnabled Whether the intent lets the microphone start on
* (see `UrlConfiguration.initialAudioEnabled`). Only ever turns it off.
* @param initialVideoEnabled Whether the intent lets the camera start on (see
* `UrlConfiguration.initialVideoEnabled`). Only ever turns it off.
*/
export function calculateInitialMuteState(
skipLobby: boolean,
callIntent: RTCCallIntent | undefined,
allowJoinUnmutedViaIntent: boolean,
initialAudioEnabled: boolean,
initialVideoEnabled: boolean,
): { audioEnabled: boolean; videoEnabled: boolean } {
logger.debug(
`calculateInitialMuteState: skipLobby=${skipLobby}, callIntent=${callIntent} allowJoinUnmutedViaIntent=${allowJoinUnmutedViaIntent} initialAudioEnabled=${initialAudioEnabled} initialVideoEnabled=${initialVideoEnabled}`,
`calculateInitialMuteState: skipLobby=${skipLobby}, callIntent=${callIntent} allowJoinUnmutedViaIntent=${allowJoinUnmutedViaIntent}`,
);
if (skipLobby && !allowJoinUnmutedViaIntent) {
@@ -50,9 +44,9 @@ export function calculateInitialMuteState(
// A host that vouches for the intent is a trusted environment, so it allows
// unmuted by default. Same for when showing a lobby, as users can adjust
// their settings there. Additionally, if the call intent is "m.audio", we
// disable video by default. The intent can still start either off.
// disable video by default.
return {
audioEnabled: initialAudioEnabled,
videoEnabled: initialVideoEnabled && callIntent != RTC_CALL_INTENT_AUDIO,
audioEnabled: true,
videoEnabled: callIntent != RTC_CALL_INTENT_AUDIO,
};
}
-2
View File
@@ -40,8 +40,6 @@ export function useMuteStates(): MuteStates | null {
urlParams.skipLobby,
urlParams.callIntent,
hostBridge.allowJoinUnmutedViaIntent,
urlParams.initialAudioEnabled ?? true,
urlParams.initialVideoEnabled ?? true,
),
hostBridge,
),
+7
View File
@@ -359,6 +359,7 @@ const ScreenShareVolumeButton: FC<ScreenShareVolumeButtonProps> = ({ vm }) => {
className={styles.volumeMenuItem}
onSelect={null}
label={null}
hideChevron={true}
>
<button className={styles.menuMuteButton} onClick={onMuteButtonClick}>
<VolumeIcon aria-hidden width={24} height={24} />
@@ -391,6 +392,10 @@ interface Props {
showRingingStatus: boolean;
focusable: boolean;
className?: string;
/**
* CSS class of the individual spotlight items.
*/
itemClassName?: string;
style?: ComponentProps<typeof animated.div>["style"];
}
@@ -406,6 +411,7 @@ export const SpotlightTile: FC<Props> = ({
showRingingStatus,
focusable = true,
className,
itemClassName,
style,
}) => {
const { t } = useTranslation();
@@ -529,6 +535,7 @@ export const SpotlightTile: FC<Props> = ({
// remove all scroll snap points except for just the one media
// that we want to bring into view
snap={scrollToId === null || scrollToId === vm.id}
className={itemClassName}
aria-hidden={(scrollToId ?? visibleId) !== vm.id}
/>
))}
-7
View File
@@ -53,13 +53,6 @@ window.matchMedia = global.matchMedia = (): MediaQueryList =>
removeEventListener: () => {},
}) as Partial<MediaQueryList> as MediaQueryList;
// Disable animations. jsdom computes `animation-name` from our stylesheets but
// never runs an animation, so anything that waits for `animationend` before
// unmounting (Radix dialogs, for one) would stay mounted forever.
const noAnimations = document.createElement("style");
noAnimations.textContent = "* { animation: none !important; }";
document.head.appendChild(noAnimations);
// jsdom does no layout and has no ResizeObserver. The call view observes the
// size of its root element; this one reports nothing, so that element stays at
// whatever size jsdom says it is unless a test says otherwise.
+8 -15
View File
@@ -5,9 +5,8 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
Please see LICENSE in the repository root for full details.
*/
import { defineConfig, mergeConfig } from "vite";
import { defineConfig } from "vite";
import { posix } from "node:path";
import { fileURLToPath } from "node:url";
import { vitePluginsConfig, withoutMatrixCrypto } from "./vite.config.ts";
import { scopeStylesToRoot } from "./component/build/scopeStylesToRoot.ts";
@@ -22,23 +21,17 @@ export default defineConfig(({ mode }) => {
return {
...base,
plugins: [...(base.plugins ?? []), withoutMatrixCrypto()],
// mergeConfig appends to the base's aliases, whatever form they are in
resolve: mergeConfig(base.resolve ?? {}, {
alias: [
resolve: {
...base.resolve,
alias: {
...base.resolve?.alias,
// react-i18next depends on the CommonJS `use-sync-external-store/shim`, whose
// `require("react")` cannot be bundled against an external React: rolldown leaves a
// `require` shim that throws in the browser. React 18+ provides `useSyncExternalStore`
// itself, so point the shim at React.
{ find: "use-sync-external-store/shim", replacement: "react" },
// Only the bare name, not its subpaths: see component/guestJsSdk.ts
{
find: /^matrix-js-sdk$/,
replacement: fileURLToPath(
new URL("./component/guestJsSdk.ts", import.meta.url),
),
},
],
}),
"use-sync-external-store/shim": "react",
},
},
// A library has no public directory to serve. Without this the build copies
// whatever is in `public` — including the developer's own config.json, which
// is not in the repository — into the output we would publish.