From acb583b14f5d40472054ce76c8168fc0c3579ff0 Mon Sep 17 00:00:00 2001 From: lebaudantoine Date: Mon, 13 Jul 2026 20:11:17 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=EF=B8=8F(frontend)=20narrow=20chat=20?= =?UTF-8?q?participant=20list=20update=20events?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reduce the set of events that trigger an update of the participant list in the chat, keeping only those relevant to display: attribute and name changes. This avoids unnecessary re-renders when other, unrelated participant events fire. --- src/frontend/src/features/rooms/livekit/prefabs/Chat.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/frontend/src/features/rooms/livekit/prefabs/Chat.tsx b/src/frontend/src/features/rooms/livekit/prefabs/Chat.tsx index aa593b5e..3ff261e1 100644 --- a/src/frontend/src/features/rooms/livekit/prefabs/Chat.tsx +++ b/src/frontend/src/features/rooms/livekit/prefabs/Chat.tsx @@ -76,7 +76,13 @@ export function Chat({ ...props }: ChatProps) { }) // Use useParticipants hook to trigger a re-render when the participant list changes. - const participants = useParticipants() + const participants = useParticipants({ + updateOnlyOn: [ + RoomEvent.ParticipantAttributesChanged, + RoomEvent.ParticipantNameChanged, + RoomEvent.ParticipantMetadataChanged, + ], + }) const lastReadMsgAt = React.useRef(0) const previousMessageCount = React.useRef(0)