From c35e734310033873ba90b27abaf504cf89f46b1e Mon Sep 17 00:00:00 2001 From: Jure <44338+hoornet@users.noreply.github.com> Date: Tue, 31 Mar 2026 07:07:52 +0200 Subject: [PATCH] Fix reply-to label showing root author instead of immediate parent --- src/components/feed/NoteCard.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/feed/NoteCard.tsx b/src/components/feed/NoteCard.tsx index 63d6156..c894f1c 100644 --- a/src/components/feed/NoteCard.tsx +++ b/src/components/feed/NoteCard.tsx @@ -38,7 +38,10 @@ export function NoteCard({ event, focused, onReplyInThread }: NoteCardProps) { const { openProfile, openThread, currentView } = useUIStore(); const parentEventId = getParentEventId(event); - const parentAuthorPubkey = event.tags.find((t) => t[0] === "p")?.[1] ?? null; + // The immediate parent author is typically the last p tag (NIP-10 ordering mirrors e tags). + // First p tag is usually the root author, not who this note directly replies to. + const pTags = event.tags.filter((t) => t[0] === "p"); + const parentAuthorPubkey = pTags.length > 0 ? pTags[pTags.length - 1][1] : null; const cardRef = useRef(null); useEffect(() => {