From 80d9f80ce6e8996c55e6b69174b3c69b35ffaf3f Mon Sep 17 00:00:00 2001 From: codex Date: Fri, 12 Jun 2026 23:42:13 +0200 Subject: [PATCH] List participants in session summary --- public/app.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/public/app.js b/public/app.js index 84ec8f1..18c8740 100644 --- a/public/app.js +++ b/public/app.js @@ -155,7 +155,11 @@ function setSessionSummary() { return; } const suffix = remoteParticipantCount === 1 ? "participant" : "participants"; - setStatus(`You are ${displayName}. ${remoteParticipantCount} other ${suffix}.`); + const participantNames = [...peers.entries()] + .map(([id, peer]) => participantDisplayName(peer.name, `Participant ${id.slice(0, 4)}`)) + .sort((first, second) => first.localeCompare(second)); + const names = participantNames.length > 0 ? `: ${participantNames.join(", ")}` : ""; + setStatus(`You are ${displayName}. ${remoteParticipantCount} other ${suffix}${names}.`); } function setActivity(name, action) { @@ -1103,8 +1107,15 @@ function rebuildRemoteAudio(peerId) { } function updateRemoteLabel(id, name) { + if (name && !name.endsWith("'s screen")) { + const peer = peers.get(id); + if (peer) { + peer.name = name; + } + } const label = document.querySelector(`[data-peer-id="${id}"] .tile-name`); if (label) label.textContent = name || `Participant ${id.slice(0, 4)}`; + setSessionSummary(); } function createRemoteTile(peer) { @@ -1254,6 +1265,7 @@ function createPeerConnection(remotePeer) { audio, volumeInput }); + setSessionSummary(); return connection; } @@ -1301,10 +1313,9 @@ async function handleSignal(message) { } if (message.type === "peer-joined") { - updateRemoteLabel(message.peerId, message.name); announceParticipantJoined(message.name); remoteParticipantCount += 1; - setSessionSummary(); + updateRemoteLabel(message.peerId, message.name); setActivity(message.name, "joined."); return; }