From ce7b2478cd13d4cf0e1baad3a2c125885917fe80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20G=C3=B3mez?= Date: Mon, 16 Mar 2026 16:29:37 +0100 Subject: [PATCH] fix: show only chat kinds as replies --- src/components/ChatViewer.tsx | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/components/ChatViewer.tsx b/src/components/ChatViewer.tsx index 643e807..4785403 100644 --- a/src/components/ChatViewer.tsx +++ b/src/components/ChatViewer.tsx @@ -336,6 +336,22 @@ const MessageItem = memo(function MessageItem({ [conversation], ); + // Determine if the reply target is a chat message (not a reaction, repost, etc.) + // Extract event ID from reply pointer + const replyEventId = + message.replyTo && "id" in message.replyTo ? message.replyTo.id : undefined; + const replyEvent = use$( + () => (replyEventId ? eventStore.event(replyEventId) : undefined), + [replyEventId], + ); + + // Chat message kinds per protocol - only show reply preview for these + const isChatKindReply = + !message.replyTo || + !replyEvent || + (CHAT_KINDS as readonly number[]).includes(replyEvent.kind) || + (conversation.protocol === "nip-10" && replyEvent.kind === 1); + // System messages (join/leave) have special styling if (message.type === "system") { return ( @@ -459,7 +475,7 @@ const MessageItem = memo(function MessageItem({
{message.event ? ( - {message.replyTo && ( + {message.replyTo && isChatKindReply && (