From 237443bc8918c1322152722a7cd9ed079e9588df Mon Sep 17 00:00:00 2001 From: liviaUeno Date: Tue, 20 Oct 2026 10:36:41 -0300 Subject: [PATCH 1/5] fix: apply ESLint auto-fixes --- apps/web/src/components/structures/HomePage.tsx | 2 +- apps/web/src/components/views/rooms/RoomTile.tsx | 3 +-- .../tabs/room/BusinessVisibilitySection.tsx | 2 +- .../tabs/room/SecurityRoomSettingsTab.tsx | 16 ++++++++-------- .../settings/tabs/user/PromoteAdminSection.tsx | 3 ++- .../components/views/spaces/SpaceCreateMenu.tsx | 2 +- .../components/views/vods_drawer/VodsDrawer.tsx | 2 +- apps/web/src/hooks/useIsAdmin.ts | 1 + apps/web/src/utils/admin/roomBusiness.ts | 3 ++- apps/web/src/utils/live/liveWidget.ts | 2 +- 10 files changed, 19 insertions(+), 17 deletions(-) diff --git a/apps/web/src/components/structures/HomePage.tsx b/apps/web/src/components/structures/HomePage.tsx index 866d44d3514..91ef49efd0d 100644 --- a/apps/web/src/components/structures/HomePage.tsx +++ b/apps/web/src/components/structures/HomePage.tsx @@ -10,6 +10,7 @@ import React, { type JSX } from "react"; import { useContext, useState } from "react"; import { ChatSolidIcon, ExploreIcon, GroupIcon } from "@vector-im/compound-design-tokens/assets/web/icons"; import { AutoHideScrollbar } from "@element-hq/web-shared-components"; +import classNames from "classnames"; import { getHomePageUrl } from "../../utils/pages"; import { _t, _tDom } from "../../languageHandler"; @@ -26,7 +27,6 @@ import MiniAvatarUploader, { AVATAR_SIZE } from "../views/elements/MiniAvatarUpl import PosthogTrackers from "../../PosthogTrackers"; import EmbeddedPage from "./EmbeddedPage"; import { useIsAdmin } from "../../hooks/useIsAdmin"; -import classNames from "classnames"; const onClickSendDm = (ev: ButtonEvent): void => { PosthogTrackers.trackInteraction("WebHomeCreateChatButton", ev); diff --git a/apps/web/src/components/views/rooms/RoomTile.tsx b/apps/web/src/components/views/rooms/RoomTile.tsx index fd7c83896ee..58bb6430369 100644 --- a/apps/web/src/components/views/rooms/RoomTile.tsx +++ b/apps/web/src/components/views/rooms/RoomTile.tsx @@ -8,7 +8,7 @@ Please see LICENSE files in the repository root for full details. */ import React, { createRef } from "react"; -import { type Room, RoomEvent } from "matrix-js-sdk/src/matrix"; +import { type Room, RoomEvent, RoomStateEvent, type MatrixEvent } from "matrix-js-sdk/src/matrix"; import { KnownMembership } from "matrix-js-sdk/src/types"; import classNames from "classnames"; import { OverflowHorizontalIcon } from "@vector-im/compound-design-tokens/assets/web/icons"; @@ -47,7 +47,6 @@ import { isKnockDenied } from "../../../utils/membership"; import SettingsStore from "../../../settings/SettingsStore"; import { getNotificationIcon } from "../dialogs/spotlight/RoomResultContextMenus.tsx"; import { getLiveWidget } from "../../../utils/live/liveWidget"; -import { RoomStateEvent, type MatrixEvent } from "matrix-js-sdk/src/matrix"; interface Props { room: Room; diff --git a/apps/web/src/components/views/settings/tabs/room/BusinessVisibilitySection.tsx b/apps/web/src/components/views/settings/tabs/room/BusinessVisibilitySection.tsx index b39ddc503ec..6f87a31faa5 100644 --- a/apps/web/src/components/views/settings/tabs/room/BusinessVisibilitySection.tsx +++ b/apps/web/src/components/views/settings/tabs/room/BusinessVisibilitySection.tsx @@ -1,5 +1,5 @@ import React, { useCallback, useEffect, useState } from "react"; -import { EventType, JoinRule, MatrixEvent, RoomStateEvent, type Room } from "matrix-js-sdk/src/matrix"; +import { EventType, JoinRule, type MatrixEvent, RoomStateEvent, type Room } from "matrix-js-sdk/src/matrix"; import { SettingsToggleInput } from "@vector-im/compound-web"; import Modal from "../../../../../Modal"; diff --git a/apps/web/src/components/views/settings/tabs/room/SecurityRoomSettingsTab.tsx b/apps/web/src/components/views/settings/tabs/room/SecurityRoomSettingsTab.tsx index 696f6462c19..6fc56e487d6 100644 --- a/apps/web/src/components/views/settings/tabs/room/SecurityRoomSettingsTab.tsx +++ b/apps/web/src/components/views/settings/tabs/room/SecurityRoomSettingsTab.tsx @@ -685,8 +685,8 @@ export default class SecurityRoomSettingsTab extends React.Component - {"Salvar"} + Salvar ); const streamSection = this.state.roomFeatures["live"] && ( - {"Salvar"} + Salvar {/* controle de iniciar/encerrar — só faz sentido se já tem URL salva */} @@ -747,8 +747,8 @@ export default class SecurityRoomSettingsTab extends React.Component {ROOM_FEATURES.map(({ key, label }) => (
{ /> {feedback && ( -
diff --git a/apps/web/src/components/views/spaces/SpaceCreateMenu.tsx b/apps/web/src/components/views/spaces/SpaceCreateMenu.tsx index 27219629594..428ddf3973f 100644 --- a/apps/web/src/components/views/spaces/SpaceCreateMenu.tsx +++ b/apps/web/src/components/views/spaces/SpaceCreateMenu.tsx @@ -212,7 +212,7 @@ export const SpaceCreateForm: React.FC = ({ )} - {showEvents && effectiveTab === "eventos" && } + {showEvents && effectiveTab === "eventos" && }
); diff --git a/apps/web/src/hooks/useIsAdmin.ts b/apps/web/src/hooks/useIsAdmin.ts index 86dd23bf705..b3e3c651d73 100644 --- a/apps/web/src/hooks/useIsAdmin.ts +++ b/apps/web/src/hooks/useIsAdmin.ts @@ -1,6 +1,7 @@ // hooks/useIsGlobalAdmin.ts import { useEffect, useState } from "react"; + import { isGlobalAdmin } from "../utils/admin/isGlobalAdmin"; export function useIsAdmin() { diff --git a/apps/web/src/utils/admin/roomBusiness.ts b/apps/web/src/utils/admin/roomBusiness.ts index 44d97c55645..55ca65cb852 100644 --- a/apps/web/src/utils/admin/roomBusiness.ts +++ b/apps/web/src/utils/admin/roomBusiness.ts @@ -1,6 +1,7 @@ -import { MatrixClientPeg } from "../../MatrixClientPeg"; import { type MatrixClient } from "matrix-js-sdk/src/matrix"; +import { MatrixClientPeg } from "../../MatrixClientPeg"; + export interface SpaceChildRoom { roomId: string; name?: string; diff --git a/apps/web/src/utils/live/liveWidget.ts b/apps/web/src/utils/live/liveWidget.ts index 6a46cf67196..83d652cc614 100644 --- a/apps/web/src/utils/live/liveWidget.ts +++ b/apps/web/src/utils/live/liveWidget.ts @@ -1,5 +1,5 @@ import { useEffect, useState } from "react"; -import { type Room, type MatrixClient, RoomStateEvent, MatrixEvent } from "matrix-js-sdk/src/matrix"; +import { type Room, type MatrixClient, RoomStateEvent, type MatrixEvent } from "matrix-js-sdk/src/matrix"; const LIVE_WIDGET_TYPE = "im.vector.modular.widgets"; const LIVE_WIDGET_STATE_KEY = "live_widget"; From bef475a2edce152a57639b849aa61c1c5e7342d6 Mon Sep 17 00:00:00 2001 From: liviaUeno Date: Tue, 20 Oct 2026 11:51:29 -0300 Subject: [PATCH 2/5] fix: remove unused import and add explicit return type --- .../components/views/settings/tabs/room/DeleteRoomSection.tsx | 1 - apps/web/src/hooks/useIsAdmin.ts | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/web/src/components/views/settings/tabs/room/DeleteRoomSection.tsx b/apps/web/src/components/views/settings/tabs/room/DeleteRoomSection.tsx index 7aca215581f..4d57193a2a1 100644 --- a/apps/web/src/components/views/settings/tabs/room/DeleteRoomSection.tsx +++ b/apps/web/src/components/views/settings/tabs/room/DeleteRoomSection.tsx @@ -1,6 +1,5 @@ import React, { useState } from "react"; -import { _t } from "../../../../../languageHandler"; import AccessibleButton from "../../../elements/AccessibleButton"; import { SettingsSubsection } from "../../shared/SettingsSubsection"; import { useIsAdmin } from "../../../../../hooks/useIsAdmin"; diff --git a/apps/web/src/hooks/useIsAdmin.ts b/apps/web/src/hooks/useIsAdmin.ts index b3e3c651d73..3266bdf5334 100644 --- a/apps/web/src/hooks/useIsAdmin.ts +++ b/apps/web/src/hooks/useIsAdmin.ts @@ -4,7 +4,7 @@ import { useEffect, useState } from "react"; import { isGlobalAdmin } from "../utils/admin/isGlobalAdmin"; -export function useIsAdmin() { +export function useIsAdmin(): boolean { const [isAdmin, setIsAdmin] = useState(false); useEffect(() => { From 071159f0bb1454a6a6831405c649eaf471bb7da2 Mon Sep 17 00:00:00 2001 From: liviaUeno Date: Tue, 20 Oct 2026 12:01:21 -0300 Subject: [PATCH 3/5] fix: read window size from UIStore --- apps/web/src/components/views/rooms/LiveStreamWidget.tsx | 7 ++++--- apps/web/src/components/views/vods_drawer/VodsDrawer.tsx | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/apps/web/src/components/views/rooms/LiveStreamWidget.tsx b/apps/web/src/components/views/rooms/LiveStreamWidget.tsx index 9fc8cbabdc3..21cdacdf187 100644 --- a/apps/web/src/components/views/rooms/LiveStreamWidget.tsx +++ b/apps/web/src/components/views/rooms/LiveStreamWidget.tsx @@ -8,6 +8,7 @@ import QuestionDialog from "../dialogs/QuestionDialog"; import ErrorDialog from "../dialogs/ErrorDialog"; import { getLiveWidget, stopLive } from "../../../utils/live/liveWidget"; import { useMatrixClientContext } from "../../../contexts/MatrixClientContext"; +import UIStore from "../../../stores/UIStore"; interface IProps { room: Room; @@ -69,8 +70,8 @@ const LiveStreamWidget: React.FC = ({ room, canManage }) => { const dx = e.clientX - dragState.current.startX; const dy = e.clientY - dragState.current.startY; - const maxX = window.innerWidth - width - MARGIN; - const maxY = window.innerHeight - height - MARGIN; + const maxX = UIStore.instance.windowWidth - width - MARGIN; + const maxY = UIStore.instance.windowHeight - height - MARGIN; setPosition({ x: Math.min(Math.max(dragState.current.origX + dx, MARGIN), Math.max(maxX, MARGIN)), @@ -94,7 +95,7 @@ const LiveStreamWidget: React.FC = ({ room, canManage }) => { const onResizeMove = (e: React.PointerEvent): void => { if (!resizeState.current) return; const dx = e.clientX - resizeState.current.startX; - const maxWidth = window.innerWidth * MAX_WIDTH_RATIO; + const maxWidth = UIStore.instance.windowWidth * MAX_WIDTH_RATIO; setWidth(Math.min(Math.max(resizeState.current.origWidth + dx, MIN_WIDTH), maxWidth)); }; diff --git a/apps/web/src/components/views/vods_drawer/VodsDrawer.tsx b/apps/web/src/components/views/vods_drawer/VodsDrawer.tsx index 837ed20d264..dca4e721015 100644 --- a/apps/web/src/components/views/vods_drawer/VodsDrawer.tsx +++ b/apps/web/src/components/views/vods_drawer/VodsDrawer.tsx @@ -4,6 +4,7 @@ import { VodsGrid } from "./VodsGrid"; import { EventsTable } from "./EventsTable"; import { VodWatchView } from "./VodWatchView"; import { type LiveShow } from "../../../vods/vodsData"; +import UIStore from "../../../stores/UIStore"; /** * Height of the closed drawer "peek" strip. Exported so RoomView can add a @@ -29,8 +30,8 @@ interface VodsDrawerProps { export function VodsDrawer({ roomId, showVods, showEvents, open, onOpenChange }: VodsDrawerProps): JSX.Element { const rootRef = useRef(null); const [containerSize, setContainerSize] = useState({ - width: window.innerWidth, - height: window.innerHeight, + width: UIStore.instance.windowWidth, + height: UIStore.instance.windowHeight, }); const [selectedTab, setSelectedTab] = useState<"rolou" | "eventos">("rolou"); const [watchingVod, setWatchingVod] = useState(null); From b87c5c1bba40e4ded9e9cedf5882655952503e8a Mon Sep 17 00:00:00 2001 From: liviaUeno Date: Tue, 20 Oct 2026 12:27:56 -0300 Subject: [PATCH 4/5] fix: satisfy exhaustive-deps in LiveStreamWidget player effect --- apps/web/src/components/views/rooms/LiveStreamWidget.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/web/src/components/views/rooms/LiveStreamWidget.tsx b/apps/web/src/components/views/rooms/LiveStreamWidget.tsx index 21cdacdf187..8f9929a3b8d 100644 --- a/apps/web/src/components/views/rooms/LiveStreamWidget.tsx +++ b/apps/web/src/components/views/rooms/LiveStreamWidget.tsx @@ -104,24 +104,25 @@ const LiveStreamWidget: React.FC = ({ room, canManage }) => { }; // --------- player HLS --------- + const liveUrl = live?.url; useEffect(() => { - if (!live || !videoRef.current) return; + if (!liveUrl || !videoRef.current) return; const video = videoRef.current; if (Hls.isSupported()) { const hls = new Hls(); - hls.loadSource(live.url); + hls.loadSource(liveUrl); hls.attachMedia(video); hlsRef.current = hls; } else if (video.canPlayType("application/vnd.apple.mpegurl")) { - video.src = live.url; + video.src = liveUrl; } return () => { hlsRef.current?.destroy(); hlsRef.current = null; }; - }, [live?.url]); + }, [liveUrl]); const onStop = useCallback((): void => { Modal.createDialog(QuestionDialog, { From 72b65780a7431f80895b8c219be0d71e0e31be02 Mon Sep 17 00:00:00 2001 From: liviaUeno Date: Tue, 20 Oct 2026 12:52:30 -0300 Subject: [PATCH 5/5] fix: rename destructured playback_url to camelCase --- .../views/settings/tabs/room/SecurityRoomSettingsTab.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/web/src/components/views/settings/tabs/room/SecurityRoomSettingsTab.tsx b/apps/web/src/components/views/settings/tabs/room/SecurityRoomSettingsTab.tsx index 6fc56e487d6..1ea1a507fc2 100644 --- a/apps/web/src/components/views/settings/tabs/room/SecurityRoomSettingsTab.tsx +++ b/apps/web/src/components/views/settings/tabs/room/SecurityRoomSettingsTab.tsx @@ -194,10 +194,10 @@ export default class SecurityRoomSettingsTab extends React.Component => { try { - const { playback_url } = await getStream(this.props.room.roomId); + const { playback_url: playbackUrl } = await getStream(this.props.room.roomId); this.setState({ - streamPlaybackUrl: playback_url ?? "", - streamInput: playback_url ?? "", + streamPlaybackUrl: playbackUrl ?? "", + streamInput: playbackUrl ?? "", }); } catch (e) { logger.error("Falha ao carregar canal de transmissão:", e);