From b017564e93a74c8af84fbfd9913e29d7b093a9f6 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 19 Jan 2026 11:03:20 +0000 Subject: [PATCH] feat: hide reply preview when directly replying to root in NIP-10 threads In NIP-10 thread chats, the root event is already displayed prominently at the top, so showing a reply preview when replying directly to the root is redundant. Changes: - Skip reply preview for regular messages when replying to thread root - Skip reply preview for zap messages when zapping the thread root - Root event remains visible at top as reference point This reduces visual clutter and makes the chat feel cleaner when replies are directed at the already-visible root post. --- src/components/ChatViewer.tsx | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/src/components/ChatViewer.tsx b/src/components/ChatViewer.tsx index f4cfe4c..29f6cf5 100644 --- a/src/components/ChatViewer.tsx +++ b/src/components/ChatViewer.tsx @@ -306,10 +306,15 @@ const MessageItem = memo(function MessageItem({ // Only show reply preview if: // 1. The event exists in our store // 2. The event is a chat kind (includes messages, nutzaps, live chat, and zap receipts) + // 3. NOT replying to root in NIP-10 thread (root is already visible at top) + const isReplyingToThreadRoot = + conversation.protocol === "nip-10" && + zapReplyTo === conversation.metadata?.rootEventId; const shouldShowReplyPreview = zapReplyTo && replyEvent && - (CHAT_KINDS as readonly number[]).includes(replyEvent.kind); + (CHAT_KINDS as readonly number[]).includes(replyEvent.kind) && + !isReplyingToThreadRoot; return (
@@ -389,14 +394,18 @@ const MessageItem = memo(function MessageItem({
{message.event ? ( - {message.replyTo && ( - - )} + {message.replyTo && + !( + conversation.protocol === "nip-10" && + message.replyTo === conversation.metadata?.rootEventId + ) && ( + + )} ) : (