From 2c3365a4012178b18d7f9d538f8f7b20a87e6169 Mon Sep 17 00:00:00 2001 From: Timo K Date: Mon, 19 Jan 2026 12:11:32 +0100 Subject: [PATCH] remove deprecated widget layout actions --- src/room/InCallView.tsx | 43 +---------------------------------------- src/widget.ts | 4 ---- 2 files changed, 1 insertion(+), 46 deletions(-) diff --git a/src/room/InCallView.tsx b/src/room/InCallView.tsx index 5ceb30f5..135745eb 100644 --- a/src/room/InCallView.tsx +++ b/src/room/InCallView.tsx @@ -33,7 +33,6 @@ import { useTranslation } from "react-i18next"; import LogoMark from "../icons/LogoMark.svg?react"; import LogoType from "../icons/LogoType.svg?react"; -import type { IWidgetApiRequest } from "matrix-widget-api"; import { EndCallButton, MicButton, @@ -45,7 +44,7 @@ import { import { Header, LeftNav, RightNav, RoomHeaderInfo } from "../Header"; import { type HeaderStyle, useUrlParams } from "../UrlParams"; import { useCallViewKeyboardShortcuts } from "../useCallViewKeyboardShortcuts"; -import { ElementWidgetActions, widget } from "../widget"; +import { widget } from "../widget"; import styles from "./InCallView.module.css"; import { GridTile } from "../tile/GridTile"; import { SettingsModal, defaultSettingsTab } from "../settings/SettingsModal"; @@ -435,46 +434,6 @@ export const InCallView: FC = ({ [vm], ); - useEffect(() => { - widget?.api.transport - .send( - gridMode === "grid" - ? ElementWidgetActions.TileLayout - : ElementWidgetActions.SpotlightLayout, - {}, - ) - .catch((e) => { - logger.error("Failed to send layout change to widget API", e); - }); - }, [gridMode]); - - useEffect(() => { - if (widget) { - const onTileLayout = (ev: CustomEvent): void => { - setGridMode("grid"); - widget!.api.transport.reply(ev.detail, {}); - }; - const onSpotlightLayout = (ev: CustomEvent): void => { - setGridMode("spotlight"); - widget!.api.transport.reply(ev.detail, {}); - }; - - widget.lazyActions.on(ElementWidgetActions.TileLayout, onTileLayout); - widget.lazyActions.on( - ElementWidgetActions.SpotlightLayout, - onSpotlightLayout, - ); - - return (): void => { - widget!.lazyActions.off(ElementWidgetActions.TileLayout, onTileLayout); - widget!.lazyActions.off( - ElementWidgetActions.SpotlightLayout, - onSpotlightLayout, - ); - }; - } - }, [setGridMode]); - useAppBarSecondaryButton( useMemo(() => { if (audioOutputSwitcher === null) return null; diff --git a/src/widget.ts b/src/widget.ts index 7862df33..7b8201ed 100644 --- a/src/widget.ts +++ b/src/widget.ts @@ -25,8 +25,6 @@ export enum ElementWidgetActions { JoinCall = "io.element.join", HangupCall = "im.vector.hangup", Close = "io.element.close", - TileLayout = "io.element.tile_layout", - SpotlightLayout = "io.element.spotlight_layout", // This can be sent as from or to widget // fromWidget: updates the client about the current device mute state // toWidget: the client requests a specific device mute configuration @@ -83,8 +81,6 @@ export const widget = ((): WidgetHelpers | null => { WidgetApiToWidgetAction.ThemeChange, ElementWidgetActions.JoinCall, ElementWidgetActions.HangupCall, - ElementWidgetActions.TileLayout, - ElementWidgetActions.SpotlightLayout, ElementWidgetActions.DeviceMute, ].forEach((action) => { api.on(`action:${action}`, (ev: CustomEvent) => {