Compare commits

..
Author SHA1 Message Date
8b1b34db6a Merge pull request '(feat): various workflow improvements, mobile sidebar improvements' (#2) from dev into main
All checks were successful
/ build-web (push) Successful in 1m9s
/ build-desktop (push) Successful in 11m24s
/ build-mobile (push) Successful in 15m56s
/ release (push) Successful in 22s
Reviewed-on: #2
2026-05-14 15:24:51 +02:00
3 changed files with 22 additions and 20 deletions

View file

@ -18,12 +18,10 @@ export default function ScreenshareButton({
className, className,
iconSize, iconSize,
tooltip, tooltip,
defaultPortal,
}: { }: {
className?: string; className?: string;
iconSize?: number; iconSize?: number;
tooltip?: string; tooltip?: string;
defaultPortal?: boolean;
}) { }) {
const isScreensharing = useCall((state) => state.screenShareEnabled); const isScreensharing = useCall((state) => state.screenShareEnabled);
const screenRef = useCall((state) => state.screenRef); const screenRef = useCall((state) => state.screenRef);
@ -32,9 +30,8 @@ export default function ScreenshareButton({
const [menuOpen, setMenuOpen] = useState(false); const [menuOpen, setMenuOpen] = useState(false);
useEffect(() => { useEffect(() => {
if (defaultPortal) return;
setPortalContainer(screenRef?.current ?? undefined); setPortalContainer(screenRef?.current ?? undefined);
}, [screenRef, defaultPortal]); }, [screenRef]);
async function startWebShare() { async function startWebShare() {
try { try {
@ -113,9 +110,7 @@ export default function ScreenshareButton({
/> />
<PopoverContent <PopoverContent
className="flex w-40 flex-col gap-2" className="flex w-40 flex-col gap-2"
portalProps={{ portalProps={{ container: portalContainer }}
container: defaultPortal ? undefined : portalContainer,
}}
> >
<Button <Button
disabled={isScreensharing} disabled={isScreensharing}
@ -146,11 +141,7 @@ export default function ScreenshareButton({
</PopoverContent> </PopoverContent>
</Popover> </Popover>
{tooltip && ( {tooltip && (
<TooltipContent <TooltipContent portalProps={{ container: portalContainer }}>
portalProps={{
container: defaultPortal ? undefined : portalContainer,
}}
>
{tooltip} {tooltip}
</TooltipContent> </TooltipContent>
)} )}

View file

@ -20,18 +20,24 @@ import LeaveButton from "./buttons/leave";
export default function SidebarBox() { export default function SidebarBox() {
const state = useCall((store) => store.state); const state = useCall((store) => store.state);
const screenRef = useCall((store) => store.screenRef);
const isMobile = useIsMobile(); const isMobile = useIsMobile();
const [portalContainer, setPortalContainer] = useState<HTMLElement>();
useEffect(() => {
setPortalContainer(screenRef?.current ?? undefined);
}, [screenRef]);
return state === "closed" ? null : ( return state === "closed" ? null : (
<Card className="p-1.5 gap-2" hidden={isMobile}> <Card className="p-1.5 gap-2" hidden={isMobile}>
<CardHeader className="p-0! pb-2! border-b-2"> <CardHeader className="p-0! pb-2! border-b-2">
<ConnectionBar /> <ConnectionBar portalContainer={portalContainer} />
</CardHeader> </CardHeader>
<CardContent className="p-0! flex flex-col gap-1"> <CardContent className="p-0! flex flex-col gap-1">
<div className="flex justify-start gap-1"> <div className="flex justify-start gap-1">
<MuteButton className="w-9 h-9" /> <MuteButton className="w-9 h-9" />
<DeafButton className="w-9 h-9" /> <DeafButton className="w-9 h-9" />
<ScreenshareButton className="w-9 h-9" defaultPortal /> <ScreenshareButton className="w-9 h-9" />
<LeaveButton className="w-9 h-9" /> <LeaveButton className="w-9 h-9" />
</div> </div>
</CardContent> </CardContent>
@ -39,7 +45,7 @@ export default function SidebarBox() {
); );
} }
function ConnectionBar() { function ConnectionBar({ portalContainer }: { portalContainer?: HTMLElement }) {
const state = useCall((store) => store.state); const state = useCall((store) => store.state);
const isEncrypted = useCall((store) => store.isEncrypted); const isEncrypted = useCall((store) => store.isEncrypted);
const callId = useCall((store) => store.callId); const callId = useCall((store) => store.callId);
@ -62,7 +68,7 @@ function ConnectionBar() {
{state === "closed" && "Closed"} {state === "closed" && "Closed"}
{state === "closing" && "Closing"} {state === "closing" && "Closing"}
<TinyPingGraph /> <TinyPingGraph portalContainer={portalContainer} />
{isEncrypted ? ( {isEncrypted ? (
<Lock color="var(--primary-foreground-alt)" /> <Lock color="var(--primary-foreground-alt)" />
@ -72,12 +78,18 @@ function ConnectionBar() {
</Button> </Button>
} }
/> />
<TooltipContent>Click to open call page</TooltipContent> <TooltipContent portalProps={{ container: portalContainer }}>
Click to open call page
</TooltipContent>
</Tooltip> </Tooltip>
); );
} }
export function TinyPingGraph() { export function TinyPingGraph({
portalContainer,
}: {
portalContainer?: HTMLElement;
}) {
const room = useCall((store) => store.room); const room = useCall((store) => store.room);
const [mapData, setMapData] = useState<Map<number, number>>(() => new Map()); const [mapData, setMapData] = useState<Map<number, number>>(() => new Map());
@ -164,7 +176,7 @@ export function TinyPingGraph() {
</div> </div>
} }
/> />
<TooltipContent> <TooltipContent portalProps={{ container: portalContainer }}>
{data.length > 0 ? `${data.at(-1)?.ping} ms` : "Measuring ping..."} {data.length > 0 ? `${data.at(-1)?.ping} ms` : "Measuring ping..."}
</TooltipContent> </TooltipContent>
</Tooltip> </Tooltip>

View file

@ -11,4 +11,3 @@
- Disconnect - Disconnect
- Desktop-App screenshares - Desktop-App screenshares
- Context menus - Context menus
- Popout Window