From 1db189ace2ed3b364d5934892cf42f086ffded87 Mon Sep 17 00:00:00 2001 From: lebaudantoine Date: Fri, 1 Aug 2025 12:04:55 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=B8(frontend)=20sort=20raised=20hand?= =?UTF-8?q?=20by=20order=20of=20arrival?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously, the participant list was sorted alphabetically by name. This unintentionally affected the raised hands list, which inherited the same sorting behavior. Users requested that raised hands be sorted by order of arrival. This simple change improves the UX by ensuring that raised hands are displayed in the correct order. --- .../controls/Participants/ParticipantsList.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/frontend/src/features/rooms/livekit/components/controls/Participants/ParticipantsList.tsx b/src/frontend/src/features/rooms/livekit/components/controls/Participants/ParticipantsList.tsx index c34c171e..8aa63f60 100644 --- a/src/frontend/src/features/rooms/livekit/components/controls/Participants/ParticipantsList.tsx +++ b/src/frontend/src/features/rooms/livekit/components/controls/Participants/ParticipantsList.tsx @@ -34,9 +34,15 @@ export const ParticipantsList = () => { ...sortedRemoteParticipants, ] - const raisedHandParticipants = participants.filter((participant) => { - return !!participant.attributes.handRaisedAt - }) + const raisedHandParticipants = participants + .filter((participant) => !!participant.attributes.handRaisedAt) + .sort((a, b) => { + const dateA = new Date(a.attributes.handRaisedAt) + const dateB = new Date(b.attributes.handRaisedAt) + const timeA = isNaN(dateA.getTime()) ? 0 : dateA.getTime() + const timeB = isNaN(dateB.getTime()) ? 0 : dateB.getTime() + return timeA - timeB + }) const { waitingParticipants, handleParticipantEntry } = useWaitingParticipants()