From 2004ce76c9b6d01c6661c181cd59bed931067394 Mon Sep 17 00:00:00 2001 From: Gigi Date: Sat, 18 Oct 2025 00:18:13 +0200 Subject: [PATCH] fix: show bookmarks even when they only have IDs (no content yet) Root cause: hasContent() was filtering out bookmarks that didn't have content text yet. When we skip event fetching for large collections (>100 IDs), bookmarks only have IDs as placeholders, causing 511/522 bookmarks to be filtered out. Solution: Updated hasContent() to return true if bookmark has either: - Valid content (original behavior) - OR a valid ID (placeholder until events are fetched) This allows all 522 bookmarks to appear in the sidebar immediately, showing IDs/URLs as placeholders until full event data loads. Removed debug logging from bookmarkUtils as it served its purpose. --- src/utils/bookmarkUtils.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/utils/bookmarkUtils.tsx b/src/utils/bookmarkUtils.tsx index cac45ff1..95981a02 100644 --- a/src/utils/bookmarkUtils.tsx +++ b/src/utils/bookmarkUtils.tsx @@ -128,9 +128,12 @@ export function groupIndividualBookmarks(items: IndividualBookmark[]) { } } -// Simple filter: only exclude bookmarks with empty/whitespace-only content +// Simple filter: show bookmarks that have content OR just an ID (placeholder) export function hasContent(bookmark: IndividualBookmark): boolean { - return !!(bookmark.content && bookmark.content.trim().length > 0) + // Show if has content OR has an ID (placeholder until events are fetched) + const hasValidContent = !!(bookmark.content && bookmark.content.trim().length > 0) + const hasId = !!(bookmark.id && bookmark.id.trim().length > 0) + return hasValidContent || hasId } // Bookmark sets helpers (kind 30003)