From 619914a9bec703196bfbaeb9d1d901677f9aa6e4 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 20 Feb 2026 08:25:34 +0000 Subject: [PATCH] Use QuotedEvent for event/address assertion subjects Replace opaque hex IDs and kind:pubkey:d-tag strings with inline QuotedEvent rendering for event assertions (30383) and address assertions (30384). Feed renderer uses depth=2 (collapsible) and detail renderer uses depth=1 (inline expanded). https://claude.ai/code/session_01L4Kwg3Ad4C2S1cvkvwACH1 --- .../kinds/TrustedAssertionDetailRenderer.tsx | 32 +++++-------------- .../nostr/kinds/TrustedAssertionRenderer.tsx | 31 +++++------------- 2 files changed, 16 insertions(+), 47 deletions(-) diff --git a/src/components/nostr/kinds/TrustedAssertionDetailRenderer.tsx b/src/components/nostr/kinds/TrustedAssertionDetailRenderer.tsx index 1d3c890..472eb99 100644 --- a/src/components/nostr/kinds/TrustedAssertionDetailRenderer.tsx +++ b/src/components/nostr/kinds/TrustedAssertionDetailRenderer.tsx @@ -1,5 +1,6 @@ import { NostrEvent } from "@/types/nostr"; import { UserName } from "../UserName"; +import { QuotedEvent } from "../QuotedEvent"; import { ExternalIdentifierBlock } from "../ExternalIdentifierDisplay"; import { getAssertionSubject, @@ -11,12 +12,13 @@ import { ASSERTION_KIND_LABELS, ASSERTION_TAG_LABELS, } from "@/lib/nip85-helpers"; +import { parseReplaceableAddress } from "applesauce-core/helpers/pointers"; import { getExternalIdentifierIcon, getExternalTypeLabel, } from "@/lib/nip73-helpers"; import { formatTimestamp } from "@/hooks/useLocale"; -import { ShieldCheck, User, FileText, Hash } from "lucide-react"; +import { ShieldCheck, User, Hash } from "lucide-react"; import { Progress } from "@/components/ui/progress"; import { cn } from "@/lib/utils"; @@ -119,32 +121,14 @@ function SubjectHeader({ ); } - // Kind 30384: addressable event (kind:pubkey:d-tag) + // Kind 30384: addressable event — quote the referenced event if (event.kind === 30384) { - const parts = subject.split(":"); - if (parts.length >= 3) { - return ( -
- - - Kind {parts[0]} by{" "} - - {parts[2] && ( - / {parts[2]} - )} - -
- ); - } + const pointer = parseReplaceableAddress(subject); + if (pointer) return ; } - // Kind 30383: event ID - return ( -
- - {subject} -
- ); + // Kind 30383: event ID — quote the referenced event + return ; } /** diff --git a/src/components/nostr/kinds/TrustedAssertionRenderer.tsx b/src/components/nostr/kinds/TrustedAssertionRenderer.tsx index c61a8ab..2f70c86 100644 --- a/src/components/nostr/kinds/TrustedAssertionRenderer.tsx +++ b/src/components/nostr/kinds/TrustedAssertionRenderer.tsx @@ -5,6 +5,7 @@ import { } from "./BaseEventRenderer"; import { Label } from "@/components/ui/label"; import { UserName } from "../UserName"; +import { QuotedEvent } from "../QuotedEvent"; import { ExternalIdentifierInline } from "../ExternalIdentifierDisplay"; import { getAssertionSubject, @@ -16,6 +17,7 @@ import { ASSERTION_KIND_LABELS, ASSERTION_TAG_LABELS, } from "@/lib/nip85-helpers"; +import { parseReplaceableAddress } from "applesauce-core/helpers/pointers"; import { Progress } from "@/components/ui/progress"; import { cn } from "@/lib/utils"; @@ -47,7 +49,7 @@ function RankBar({ rank }: { rank: number }) { } /** - * Subject as the visual anchor — rendered as ClickableEventTitle + * Subject as the visual anchor — rendered as ClickableEventTitle or QuotedEvent */ function SubjectTitle({ event, @@ -83,31 +85,14 @@ function SubjectTitle({ ); } + // Kind 30384: addressable event — quote inline if (event.kind === 30384) { - const parts = subject.split(":"); - const display = - parts.length >= 3 - ? `${parts[0]}:${parts[1].slice(0, 8)}...:${parts[2] || "*"}` - : subject; - return ( - - {display} - - ); + const pointer = parseReplaceableAddress(subject); + if (pointer) return ; } - // Event ID (30383) - return ( - - {subject.slice(0, 16)}... - - ); + // Kind 30383: event ID — quote inline + return ; } /**