From d5e847e515442c5cc1323866217fdd16571a8b87 Mon Sep 17 00:00:00 2001 From: Gigi Date: Sun, 5 Oct 2025 08:17:34 +0100 Subject: [PATCH] feat: show article titles for kind:30023 bookmarks - Update hydrateItems to detect long-form articles (kind:30023) - Extract and display article title using getArticleTitle helper - Article titles now appear as bookmark content in lists - Provides better context for bookmarked articles --- dist/index.html | 2 +- src/services/bookmarkHelpers.ts | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/dist/index.html b/dist/index.html index c9f411ee..fd9b3399 100644 --- a/dist/index.html +++ b/dist/index.html @@ -5,7 +5,7 @@ Boris - Nostr Bookmarks - + diff --git a/src/services/bookmarkHelpers.ts b/src/services/bookmarkHelpers.ts index f53b9cee..ecc01a70 100644 --- a/src/services/bookmarkHelpers.ts +++ b/src/services/bookmarkHelpers.ts @@ -1,4 +1,5 @@ import { getParsedContent } from 'applesauce-content/text' +import { getArticleTitle } from 'applesauce-core/helpers' import { ActiveAccount, IndividualBookmark, ParsedContent } from '../types/bookmarks' import type { NostrEvent } from './bookmarkEvents' @@ -94,14 +95,24 @@ export function hydrateItems( return items.map(item => { const ev = idToEvent.get(item.id) if (!ev) return item + + // For long-form articles (kind:30023), use the article title as content + let content = ev.content || item.content || '' + if (ev.kind === 30023) { + const articleTitle = getArticleTitle(ev) + if (articleTitle) { + content = articleTitle + } + } + return { ...item, pubkey: ev.pubkey || item.pubkey, - content: ev.content || item.content || '', + content, created_at: ev.created_at || item.created_at, kind: ev.kind || item.kind, tags: ev.tags || item.tags, - parsedContent: ev.content ? (getParsedContent(ev.content) as ParsedContent) : item.parsedContent + parsedContent: ev.content ? (getParsedContent(content) as ParsedContent) : item.parsedContent } }) }