From ecb3f41d845a364f3b4e77716d2004df6a21a712 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 19 Jan 2026 16:37:24 +0000 Subject: [PATCH] feat: add chat/comments action to all event types in menu The event menu now shows a chat action for all event types: - Kind 1 notes: Opens NIP-10 thread chat (labeled "Chat") - All other events: Opens NIP-22 comments (labeled "Comments") For addressable events (articles, live activities, etc.), uses address pointer. For regular events, uses event pointer with relay hints. --- .../nostr/kinds/BaseEventRenderer.tsx | 53 +++++++++++++++---- 1 file changed, 42 insertions(+), 11 deletions(-) diff --git a/src/components/nostr/kinds/BaseEventRenderer.tsx b/src/components/nostr/kinds/BaseEventRenderer.tsx index d9b59fc..a49a6b3 100644 --- a/src/components/nostr/kinds/BaseEventRenderer.tsx +++ b/src/components/nostr/kinds/BaseEventRenderer.tsx @@ -193,12 +193,11 @@ export function EventMenu({ event }: { event: NostrEvent }) { }; const openChatWindow = () => { - // Only kind 1 notes support NIP-10 thread chat - if (event.kind === 1) { - const seenRelaysSet = getSeenRelays(event); - const relays = seenRelaysSet ? Array.from(seenRelaysSet) : []; + const seenRelaysSet = getSeenRelays(event); + const relays = seenRelaysSet ? Array.from(seenRelaysSet) : []; - // Open chat with NIP-10 thread protocol + // Kind 1 notes use NIP-10 thread protocol + if (event.kind === 1) { addWindow("chat", { protocol: "nip-10", identifier: { @@ -212,6 +211,40 @@ export function EventMenu({ event }: { event: NostrEvent }) { relays, }, }); + return; + } + + // All other events use NIP-22 comment protocol + if (isAddressableKind(event.kind)) { + // Addressable events use address pointer + const dTag = getTagValue(event, "d") || ""; + addWindow("chat", { + protocol: "nip-22", + identifier: { + type: "comment", + value: { + kind: event.kind, + pubkey: event.pubkey, + identifier: dTag, + }, + relays, + }, + }); + } else { + // Regular events use event pointer + addWindow("chat", { + protocol: "nip-22", + identifier: { + type: "comment", + value: { + id: event.id, + relays, + author: event.pubkey, + kind: event.kind, + }, + relays, + }, + }); } }; @@ -243,12 +276,10 @@ export function EventMenu({ event }: { event: NostrEvent }) { Zap - {event.kind === 1 && ( - - - Chat - - )} + + + {event.kind === 1 ? "Chat" : "Comments"} + {copied ? (