From 6840e04118138215d299635d1b0d03778414ad40 Mon Sep 17 00:00:00 2001 From: Alois Date: Sat, 9 May 2026 20:50:28 +0200 Subject: [PATCH] (feat): add ability to hide users in focused call view (feat): add small avatars with tooltips instead of usernames in the top bar in calls (fix): a lot of layout issues (qol): update todo --- packages/call/src/components/actions.tsx | 109 ++++++++++++-- packages/call/src/components/modals/base.tsx | 9 +- packages/call/src/components/sidebarBox.tsx | 28 +++- packages/call/src/components/top.tsx | 57 ++++++-- packages/call/src/components/videoViewer.tsx | 4 +- packages/call/src/store.tsx | 16 +++ packages/call/src/views/main/focused.tsx | 84 ++++++----- packages/call/src/views/main/layout.tsx | 144 ++++++++++++++++++- packages/call/todo.md | 2 +- 9 files changed, 382 insertions(+), 71 deletions(-) diff --git a/packages/call/src/components/actions.tsx b/packages/call/src/components/actions.tsx index 0002e2f..6ff4661 100644 --- a/packages/call/src/components/actions.tsx +++ b/packages/call/src/components/actions.tsx @@ -6,18 +6,22 @@ import { TooltipContent, TooltipTrigger, } from "@tensamin/ui"; +import { useEffect, useState } from "react"; import MuteButton from "./buttons/mute"; import DeafButton from "./buttons/deaf"; import ScreenshareButton from "./buttons/screenshare"; import LeaveButton from "./buttons/leave"; import { setCallIsPopout, + setUsersInFocusedViewHidden, stopWatchingFocusedStream, triggerCallLayoutCalculation, useCall, } from "../store"; import InviteButton from "./buttons/invite"; import { + ChevronDown, + ChevronUp, Maximize, Minimize, SquareArrowOutDownLeft, @@ -37,9 +41,15 @@ export default function Actions() { focusedParticipantId != null && watchedStreamParticipantIds.includes(focusedParticipantId); + // Fullscreen stuff const callIsPopout = useCall((state) => state.callIsPopout); const callIsFullscreen = useCall((state) => state.callIsFullscreen); const screenRef = useCall((state) => state.screenRef); + const [portalContainer, setPortalContainer] = useState(); + + useEffect(() => { + setPortalContainer(screenRef?.current ?? undefined); + }, [screenRef]); const toggleFullscreen = async () => { if (callIsFullscreen) { @@ -51,18 +61,93 @@ export default function Actions() { triggerCallLayoutCalculation(); }; + // Hide users in focused view + const usersInFocusedViewHidden = useCall( + (state) => state.usersInFocusedViewHidden, + ); + return (
-
+
+ {view === "focused" && ( + + + setUsersInFocusedViewHidden(!usersInFocusedViewHidden) + } + variant="link" + className="w-11 h-11 p-0! ml-3 text-foreground" + > + {usersInFocusedViewHidden ? ( + + ) : ( + + )} + + } + /> + + Hide users + + + )} +
- - - - + + + } + /> + + Mute + + + + + } + /> + + Deafen + + + + + } + /> + + Screenshare + + + + + } + /> + + Invite + + {isWatchingFocusedStream ? (
diff --git a/packages/call/src/components/modals/base.tsx b/packages/call/src/components/modals/base.tsx index 03327d9..b75c129 100644 --- a/packages/call/src/components/modals/base.tsx +++ b/packages/call/src/components/modals/base.tsx @@ -90,10 +90,12 @@ function Overlay({ export default function Base({ participant, type, + fill = false, flush = false, }: { participant: Participant | undefined; type: "user" | "stream"; + fill?: boolean; flush?: boolean; }) { const { get } = useUser(); @@ -170,9 +172,9 @@ export default function Base({ render={
<> @@ -219,6 +221,7 @@ export default function Base({ {type === "stream" && (showStream ? ( store.state); + const screenRef = useCall((store) => store.screenRef); const isMobile = useIsMobile(); + const [portalContainer, setPortalContainer] = useState(); + + useEffect(() => { + setPortalContainer(screenRef?.current ?? undefined); + }, [screenRef]); return state === "closed" ? null : (