From 6265af74f2f4bee4ba61e874dadf8ce6be7a18f3 Mon Sep 17 00:00:00 2001 From: Gigi Date: Sun, 5 Oct 2025 08:24:05 +0100 Subject: [PATCH] docs: clarify why we extract image tag directly in BookmarkItem Add comment explaining that we extract the image tag directly from bookmark.tags since we don't have the full NostrEvent here. When we do have full events (like in articleService), we use getArticleImage() helper from applesauce-core as intended. --- src/components/BookmarkItem.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/BookmarkItem.tsx b/src/components/BookmarkItem.tsx index 375bec84..a1744100 100644 --- a/src/components/BookmarkItem.tsx +++ b/src/components/BookmarkItem.tsx @@ -30,7 +30,9 @@ export const BookmarkItem: React.FC = ({ bookmark, index, onS const firstUrl = hasUrls ? extractedUrls[0] : null const firstUrlClassification = firstUrl ? classifyUrl(firstUrl) : null - // For kind:30023 articles, get the image from tags + // For kind:30023 articles, extract image tag (per NIP-23) + // Note: We extract directly from tags here since we don't have the full event. + // When we have full events, we use getArticleImage() helper (see articleService.ts) const isArticle = bookmark.kind === 30023 const articleImage = isArticle ? bookmark.tags.find(t => t[0] === 'image')?.[1] : undefined