From b02a8c9edeb7f0dd18db632923bef37ccbcede03 Mon Sep 17 00:00:00 2001 From: kmanisk Date: Mon, 26 Oct 2026 14:57:04 +0530 Subject: [PATCH 1/2] feat: polish room stage voice and invite UX --- apps/client/package.json | 3 +- apps/client/src/ActiveSpeakers.tsx | 24 ++++- apps/client/src/ChatPanel.tsx | 8 +- apps/client/src/Player.tsx | 7 +- apps/client/src/RoomView.tsx | 33 ++++-- apps/client/src/SoloInviteCard.tsx | 62 +++++++++++ apps/client/src/SyncStatusline.tsx | 11 +- apps/client/src/polish4.css | 158 +++++++++++++++++++++++++++++ package-lock.json | 9 +- 9 files changed, 296 insertions(+), 19 deletions(-) create mode 100644 apps/client/src/SoloInviteCard.tsx diff --git a/apps/client/package.json b/apps/client/package.json index dc26882..5f4e257 100644 --- a/apps/client/package.json +++ b/apps/client/package.json @@ -14,7 +14,8 @@ "lucide-react": "^1.61.0", "react": "^19.0.0", "react-dom": "^19.0.0", - "socket.io-client": "^4.8.0" + "socket.io-client": "^4.8.0", + "uqr": "^0.1.3" }, "devDependencies": { "@types/react": "^19.0.0", diff --git a/apps/client/src/ActiveSpeakers.tsx b/apps/client/src/ActiveSpeakers.tsx index 0917f6b..5f82f22 100644 --- a/apps/client/src/ActiveSpeakers.tsx +++ b/apps/client/src/ActiveSpeakers.tsx @@ -2,7 +2,29 @@ import { useEffect, useRef, useState } from "react"; import { activeSpeakerIds } from "@watchparty/shared"; import { Avatar } from "./Avatar.js"; import type { AudioLevels } from "./AudioLevels.js"; + export interface Speaker { id: string; name: string; speaking: boolean } + +function SpeakerWave({ id, levels, speaking }: { id: string; levels: AudioLevels; speaking: boolean }) { + const ref = useRef(null); + useEffect(() => levels.subscribe(id, (value) => { + const node = ref.current; + if (!node) return; + const level = speaking ? value : 0; + node.style.setProperty("--wave-a", String(0.35 + level * 0.75)); + node.style.setProperty("--wave-b", String(0.45 + level * 1.15)); + node.style.setProperty("--wave-c", String(0.3 + level * 0.9)); + }), [id, levels, speaking]); + useEffect(() => { + if (!speaking && ref.current) { + ref.current.style.setProperty("--wave-a", "0.35"); + ref.current.style.setProperty("--wave-b", "0.45"); + ref.current.style.setProperty("--wave-c", "0.3"); + } + }, [speaking]); + return ; +} + export function ActiveSpeakers({ people, levels }: { people: Speaker[]; levels: AudioLevels }) { const [visible, setVisible] = useState([]); const shown = useRef([]); @@ -27,6 +49,6 @@ export function ActiveSpeakers({ people, levels }: { people: Speaker[]; levels: useEffect(() => () => { for (const timer of timers.current.values()) clearTimeout(timer); timers.current.clear(); }, []); return
{visible.map((id) => { const person = people.find((value) => value.id === id); - return person &&
{person.name}
; + return person &&
{person.name}
; })}
; } diff --git a/apps/client/src/ChatPanel.tsx b/apps/client/src/ChatPanel.tsx index 4c9794d..2f4f099 100644 --- a/apps/client/src/ChatPanel.tsx +++ b/apps/client/src/ChatPanel.tsx @@ -9,6 +9,7 @@ import { SmilePlus, } from "lucide-react"; import { Button, IconButton } from "./ui/index.js"; +import { SoloInviteCard } from "./SoloInviteCard.js"; const GifPicker = lazy(() => import("./GifPicker.js").then((module) => ({ default: module.GifPicker })), ); @@ -39,10 +40,14 @@ export function ChatPanel({ visible, selfId, onCopyInvite, + participantCount, + roomCode, }: { visible: boolean; selfId?: string; onCopyInvite: () => void; + participantCount: number; + roomCode: string; messages: Message[]; connected: boolean; inputRef: React.RefObject; @@ -184,6 +189,7 @@ export function ChatPanel({ } }} > + {!messages.length && (
@@ -449,7 +455,7 @@ const ChatMessageRow = memo( {message.name} diff --git a/apps/client/src/Player.tsx b/apps/client/src/Player.tsx index a0c88cf..040a62e 100644 --- a/apps/client/src/Player.tsx +++ b/apps/client/src/Player.tsx @@ -9,7 +9,7 @@ import { import { clockSync, syncStore, subscribeResync } from "./lib/syncRuntime.js"; import { ActiveSpeakers, type Speaker } from "./ActiveSpeakers.js"; import type { AudioLevels } from "./AudioLevels.js"; -import { useEffect, useRef, useState } from "react"; +import { useEffect, useRef, useState, type CSSProperties } from "react"; import { ReactionOverlay } from "./ReactionOverlay.js"; import { useDucking } from "./useDucking.js"; import type { VisibleReaction } from "./useReactions.js"; @@ -692,11 +692,11 @@ export function Player({ <> - {muted ? ( + {muted || volume.baseVolume <= 0.001 ? (
- mic(true)} > - {localVoice.joined && !localVoice.muted ? ( - + {micLabel} + {localVoice.joined && !localVoice.muted &&