From a40c76bc4d3df6dc57370806a77d59d6489ec07f Mon Sep 17 00:00:00 2001 From: Cyril Date: Wed, 11 Feb 2026 09:20:56 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8(perf)=20hide=20main=20layout=20when?= =?UTF-8?q?=20pip=20is=20open?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit avoid rendering main video tiles while pip is active --- .../rooms/livekit/prefabs/VideoConference.tsx | 58 +++++++++++-------- 1 file changed, 33 insertions(+), 25 deletions(-) diff --git a/src/frontend/src/features/rooms/livekit/prefabs/VideoConference.tsx b/src/frontend/src/features/rooms/livekit/prefabs/VideoConference.tsx index 3d7d7890..63636dd1 100644 --- a/src/frontend/src/features/rooms/livekit/prefabs/VideoConference.tsx +++ b/src/frontend/src/features/rooms/livekit/prefabs/VideoConference.tsx @@ -35,6 +35,7 @@ import { useVideoResolutionSubscription } from '../hooks/useVideoResolutionSubsc import { SettingsDialogProvider } from '@/features/settings/components/SettingsDialogProvider' import { IsIdleDisconnectModal } from '../components/IsIdleDisconnectModal' import { RoomPiP } from '@/features/pip/components/RoomPiP' +import { useRoomPiP } from '@/features/pip/hooks/useRoomPiP' import { getParticipantName } from '@/features/rooms/utils/getParticipantName' import { useScreenReaderAnnounce } from '@/hooks/useScreenReaderAnnounce' import { ReactionPortals } from '@/features/reactions/components/ReactionPortals' @@ -228,6 +229,9 @@ export function VideoConference({ ...props }: VideoConferenceProps) { ]) /* eslint-enable react-hooks/exhaustive-deps */ + const { isOpen: isPiPOpen } = useRoomPiP() + const shouldRenderMainLayout = !isPiPOpen + const [isShareErrorVisible, setIsShareErrorVisible] = useState(false) return ( @@ -249,32 +253,36 @@ export function VideoConference({ ...props }: VideoConferenceProps) { /> - {!focusTrack ? ( -
- - - -
- ) : ( -
- - + {!focusTrack ? ( +
- - - {focusTrack && } - -
+ + + +
+ ) : ( +
+ + + + + {focusTrack && } + +
+ )} + )}