diff --git a/src/components/ContentPanel.tsx b/src/components/ContentPanel.tsx index 4bca4d43..8ccd1b36 100644 --- a/src/components/ContentPanel.tsx +++ b/src/components/ContentPanel.tsx @@ -155,6 +155,8 @@ const ContentPanel: React.FC = ({ const isTextContent = useMemo(() => { if (loading) return false if (!markdown && !html) return false + // Don't track internal sentinel URLs (nostr-event: is not a real Nostr URI per NIP-21) + if (selectedUrl?.startsWith('nostr-event:')) return false if (selectedUrl?.includes('youtube') || selectedUrl?.includes('vimeo')) return false if (!shouldTrackReadingProgress(html, markdown)) return false diff --git a/src/components/Me.tsx b/src/components/Me.tsx index 4edbae51..ef254667 100644 --- a/src/components/Me.tsx +++ b/src/components/Me.tsx @@ -394,22 +394,8 @@ const Me: React.FC = ({ } const getReadItemUrl = (item: ReadItem) => { - // Handle nostr-event: URLs specially - route to /e/ path - const urlToCheck = item.url || item.id - if (urlToCheck?.startsWith('nostr-event:')) { - const eventId = urlToCheck.replace('nostr-event:', '') - return `/e/${eventId}` - } - - if (item.type === 'article') { - // Check if ID is actually an naddr - if (item.id.startsWith('naddr1')) { - return `/a/${item.id}` - } - // Fallback: if it has a URL, use /r/ path - if (item.url) { - return `/r/${encodeURIComponent(item.url)}` - } + if (item.type === 'article' && item.id.startsWith('naddr1')) { + return `/a/${item.id}` } else if (item.url) { return `/r/${encodeURIComponent(item.url)}` } @@ -450,27 +436,17 @@ const Me: React.FC = ({ } const handleSelectUrl = (url: string, bookmark?: { id: string; kind: number; tags: string[][]; pubkey: string }) => { - // Handle nostr-event: URLs specially - route to /e/ path - if (url?.startsWith('nostr-event:')) { - const eventId = url.replace('nostr-event:', '') - navigate(`/e/${eventId}`) - return - } - if (bookmark && bookmark.kind === 30023) { - // For kind:30023 articles, navigate to the article route const dTag = bookmark.tags.find(t => t[0] === 'd')?.[1] || '' if (dTag && bookmark.pubkey) { - const pointer = { - identifier: dTag, + const naddr = nip19.naddrEncode({ kind: 30023, pubkey: bookmark.pubkey, - } - const naddr = nip19.naddrEncode(pointer) + identifier: dTag + }) navigate(`/a/${naddr}`) } } else if (url) { - // For regular URLs, navigate to the reader route navigate(`/r/${encodeURIComponent(url)}`) } }