From 0d55331303375b7b5d2638a3f5b13639fa34306e Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 19 Jan 2026 20:31:39 +0000 Subject: [PATCH] fix: hide reply button and menu for NIP-10 root message In NIP-10 thread chats, the root message now cannot be replied to directly, as all messages in the thread are implicitly replies to the root. Changes: - Added isRootMessage prop to MessageItem component - Hide reply button when message is the root message - Remove reply option from context menu for root message - Root message check: protocol === "nip-10" && message ID matches rootEventId --- src/components/ChatViewer.tsx | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/components/ChatViewer.tsx b/src/components/ChatViewer.tsx index b62d872..af29920 100644 --- a/src/components/ChatViewer.tsx +++ b/src/components/ChatViewer.tsx @@ -262,6 +262,7 @@ const MessageItem = memo(function MessageItem({ onReply, canReply, onScrollToMessage, + isRootMessage, }: { message: Message; adapter: ChatProtocolAdapter; @@ -269,6 +270,7 @@ const MessageItem = memo(function MessageItem({ onReply?: (messageId: string) => void; canReply: boolean; onScrollToMessage?: (messageId: string) => void; + isRootMessage?: boolean; }) { // Get relays for this conversation (memoized to prevent unnecessary re-subscriptions) const relays = useMemo( @@ -377,7 +379,7 @@ const MessageItem = memo(function MessageItem({ {/* Reactions display - inline after timestamp */} - {canReply && onReply && ( + {canReply && onReply && !isRootMessage && (