From 9ff713c537a223d951a6a07aaf71ba326b9a3164 Mon Sep 17 00:00:00 2001 From: Jannis Mattheis Date: Sat, 20 Sep 2025 13:20:52 +0200 Subject: [PATCH] fix: message overflow state preservation from previous messages Using index is bad practice: https://react.dev/learn/rendering-lists#rules-of-keys We don't recalculate the overflow state once the message is overflown. When using the index as key, then when a new message is added at the top of the array at index 0. The overflow state from the previous message at index 0 is kept. The overflow state shouldn't be reused. --- ui/src/message/Messages.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/src/message/Messages.tsx b/ui/src/message/Messages.tsx index 6dde14a..187caf4 100644 --- a/ui/src/message/Messages.tsx +++ b/ui/src/message/Messages.tsx @@ -33,9 +33,9 @@ const Messages = observer(() => { } }, [appId]); - const renderMessage = (index: number, message: IMessage) => ( + const renderMessage = (_index: number, message: IMessage) => ( (expandedState.current[message.id] = expanded)} title={message.title}