Compare commits

...

7 Commits

Author SHA1 Message Date
Robin
a6a02778a1 Performance: Avoid re-rendering entire spotlight layout so often
This removes a lot of unnecessary jank in spotlight layout when swapping individual speakers in and out of the spotlight tile.
2026-08-10 11:16:35 +02:00
renovate[bot]
978ffee183 Update ghcr.io/element-hq/element-web:develop Docker digest to a23cced (#4155)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-08-07 09:28:35 +02:00
renovate[bot]
2d64cf4b30 Update ghcr.io/element-hq/element-web:develop Docker digest to 6fb12e1 (#4154)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-08-06 09:38:48 +02:00
Robin
eb65a28a75 Merge pull request #4146 from element-hq/performance
Performance: Enable React Compiler
2026-08-05 11:10:40 +02:00
renovate[bot]
6d7d3093b3 Update ghcr.io/element-hq/element-web:develop Docker digest to b4e2d2d (#4149)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-08-05 10:16:05 +02:00
Robin
2b07e9e822 Merge pull request #4148 from element-hq/renovate/i18next-26.x
Update dependency i18next to v26
2026-08-04 22:49:21 +02:00
renovate[bot]
7ae1fc6cd8 Update dependency i18next to v26 2026-08-04 17:21:53 +00:00
4 changed files with 30 additions and 30 deletions

View File

@@ -13,7 +13,7 @@ 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:0183c0a7f4292252349ddcff2de92a83a4571b283da49cc54adb9efbf3d20695
image: ghcr.io/element-hq/element-web:develop@sha256:a23cced80588306c66bc7cfa859c591be03ece31f25d0a6a2e1e935943a35c92
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:0183c0a7f4292252349ddcff2de92a83a4571b283da49cc54adb9efbf3d20695
image: ghcr.io/element-hq/element-web:develop@sha256:a23cced80588306c66bc7cfa859c591be03ece31f25d0a6a2e1e935943a35c92

View File

@@ -88,7 +88,7 @@
"eslint-plugin-element-call": "link:eslint",
"eslint-plugin-storybook": "^10.3.6",
"fetch-mock": "11.1.5",
"i18next": "^25.0.0",
"i18next": "^26.0.0",
"i18next-browser-languagedetector": "^8.0.0",
"i18next-cli": "^1.61.0",
"jsdom": "^26.0.0",

24
pnpm-lock.yaml generated
View File

@@ -167,8 +167,8 @@ importers:
specifier: 11.1.5
version: 11.1.5
i18next:
specifier: ^25.0.0
version: 25.10.10(typescript@5.9.3)
specifier: ^26.0.0
version: 26.3.6(typescript@5.9.3)
i18next-browser-languagedetector:
specifier: ^8.0.0
version: 8.2.1
@@ -237,7 +237,7 @@ importers:
version: 19.2.8(react@19.2.8)
react-i18next:
specifier: ^16.0.0 <16.7.0
version: 16.6.6(i18next@25.10.10(typescript@5.9.3))(react-dom@19.2.8(react@19.2.8))(react@19.2.8)(typescript@5.9.3)
version: 16.6.6(i18next@26.3.6(typescript@5.9.3))(react-dom@19.2.8(react@19.2.8))(react@19.2.8)(typescript@5.9.3)
react-router-dom:
specifier: ^7.0.0
version: 7.18.2(react-dom@19.2.8(react@19.2.8))(react@19.2.8)
@@ -4278,14 +4278,6 @@ packages:
resolution: {integrity: sha512-n5UexwEVt0OoIAhG2MWpSnAVJW1U8mQrQTmXyxc5DMAx+NLhcLZhSMJo/FnUsA5JQ3obTYqTgB7YIuZKWpDgow==}
hasBin: true
i18next@25.10.10:
resolution: {integrity: sha512-cqUW2Z3EkRx7NqSyywjkgCLK7KLCL6IFVFcONG7nVYIJ3ekZ1/N5jUsihHV6Bq37NfhgtczxJcxduELtjTwkuQ==}
peerDependencies:
typescript: ^5 || ^6
peerDependenciesMeta:
typescript:
optional: true
i18next@26.3.6:
resolution: {integrity: sha512-Bu5Z2nAXgfVyM8xvW3jk9EKRIuX37PudsrBViThNFx7CR7aaYTpP01cxNB/E4c4UUzTDiAZRstEhsRfPOL/8xA==}
peerDependencies:
@@ -9931,12 +9923,6 @@ snapshots:
transitivePeerDependencies:
- '@swc/helpers'
i18next@25.10.10(typescript@5.9.3):
dependencies:
'@babel/runtime': 7.29.2
optionalDependencies:
typescript: 5.9.3
i18next@26.3.6(typescript@5.9.3):
optionalDependencies:
typescript: 5.9.3
@@ -11094,11 +11080,11 @@ snapshots:
react: 19.2.8
scheduler: 0.27.0
react-i18next@16.6.6(i18next@25.10.10(typescript@5.9.3))(react-dom@19.2.8(react@19.2.8))(react@19.2.8)(typescript@5.9.3):
react-i18next@16.6.6(i18next@26.3.6(typescript@5.9.3))(react-dom@19.2.8(react@19.2.8))(react@19.2.8)(typescript@5.9.3):
dependencies:
'@babel/runtime': 7.29.2
html-parse-stringify: 3.0.1
i18next: 25.10.10(typescript@5.9.3)
i18next: 26.3.6(typescript@5.9.3)
react: 19.2.8
use-sync-external-store: 1.6.0(react@19.2.8)
optionalDependencies:

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 { type ReactNode } from "react";
import { type FC, type ReactNode } from "react";
import { useObservableEagerState } from "observable-hooks";
import classNames from "classnames";
@@ -13,6 +13,9 @@ import { type CallLayout } from "./CallLayout";
import { type SpotlightLandscapeLayout as SpotlightLandscapeLayoutModel } from "../state/layout-types.ts";
import styles from "./SpotlightLandscapeLayout.module.css";
import { useUpdateLayout, useVisibleTiles } from "./Grid";
import { type MediaViewModel } from "../state/media/MediaViewModel.ts";
import { type Behavior } from "../state/Behavior.ts";
import { useBehavior } from "../useBehavior.ts";
/**
* An implementation of the "spotlight landscape" layout, in which the spotlight
@@ -54,16 +57,10 @@ export const makeSpotlightLandscapeLayout: CallLayout<
useUpdateLayout();
useVisibleTiles(model.setVisibleTiles);
useObservableEagerState(minBounds$);
const withIndicators =
useObservableEagerState(model.spotlight.media$).length > 1;
return (
<div ref={ref} className={styles.layer}>
<div
className={classNames(styles.spotlight, {
[styles.withIndicators]: withIndicators,
})}
/>
<SpotlightSlot media$={model.spotlight.media$} />
<div className={styles.grid}>
{model.grid.map((m) => (
<Slot key={m.id} className={styles.slot} id={m.id} model={m} />
@@ -73,3 +70,20 @@ export const makeSpotlightLandscapeLayout: CallLayout<
);
},
});
interface SpotlightSlotProps {
media$: Behavior<MediaViewModel[]>;
}
// This component isolates the subscription to the spotlight media so that it
// can change without causing the whole layout to re-render
const SpotlightSlot: FC<SpotlightSlotProps> = ({ media$ }) => {
const withIndicators = useBehavior(media$).length > 1;
return (
<div
className={classNames(styles.spotlight, {
[styles.withIndicators]: withIndicators,
})}
/>
);
};