diff --git a/src/components/Bookmarks.tsx b/src/components/Bookmarks.tsx index 5833ac66..f2de2976 100644 --- a/src/components/Bookmarks.tsx +++ b/src/components/Bookmarks.tsx @@ -229,7 +229,14 @@ const Bookmarks: React.FC = ({ currentArticle, selectedUrl, readerContent, - onHighlightCreated: (highlight) => setHighlights(prev => [highlight, ...prev]), + onHighlightCreated: (highlight) => setHighlights(prev => { + // Deduplicate by checking if highlight with this ID already exists + const exists = prev.some(h => h.id === highlight.id) + if (exists) { + return prev // Don't add duplicate + } + return [highlight, ...prev] + }), settings }) diff --git a/src/components/HighlightItem.tsx b/src/components/HighlightItem.tsx index 0650be32..0b07bab4 100644 --- a/src/components/HighlightItem.tsx +++ b/src/components/HighlightItem.tsx @@ -310,39 +310,16 @@ export const HighlightItem: React.FC = ({ const isLocalOnly = highlight.isLocalOnly const publishedRelays = highlight.publishedRelays || [] - // Only log when values are meaningful (not undefined/empty) to reduce spam - if (isLocalOnly !== undefined || publishedRelays.length > 0) { - console.log('🎯 [HIGHLIGHT-UI] Rendering highlight relay indicator:', { - highlightId: highlight.id, - isLocalOnly: isLocalOnly, - publishedRelays: publishedRelays, - publishedRelayCount: publishedRelays.length, - willShowAirplaneIcon: isLocalOnly - }) - } - // Show highlighter icon with relay info if available if (highlight.publishedRelays && highlight.publishedRelays.length > 0) { const relayNames = highlight.publishedRelays.map(url => url.replace(/^wss?:\/\//, '').replace(/\/$/, '') ) - const iconInfo = { + return { icon: isLocalOnly ? faPlane : faHighlighter, tooltip: isLocalOnly ? 'Local relays only - will sync when remote relays available' : relayNames.join('\n'), spin: false } - - console.log('🔍 [HIGHLIGHT-UI] Icon decision made:', { - highlightId: highlight.id, - isLocalOnly: isLocalOnly, - iconType: isLocalOnly ? 'airplane' : 'highlighter', - tooltip: iconInfo.tooltip, - actualPublishedRelaysInUI: publishedRelays, - relayNames: relayNames, - conditionResult: isLocalOnly ? 'SHOULD_SHOW_AIRPLANE' : 'SHOULD_SHOW_HIGHLIGHTER' - }) - - return iconInfo } if (highlight.seenOnRelays && highlight.seenOnRelays.length > 0) {