diff --git a/src/components/Me.tsx b/src/components/Me.tsx index 45876095..e1cf6de0 100644 --- a/src/components/Me.tsx +++ b/src/components/Me.tsx @@ -24,6 +24,7 @@ import { getCachedMeData, setCachedMeData, updateCachedHighlights } from '../ser import { faBooks } from '../icons/customIcons' import { usePullToRefresh } from 'use-pull-to-refresh' import RefreshIndicator from './RefreshIndicator' +import { groupIndividualBookmarks } from '../utils/bookmarkUtils' interface MeProps { relayPool: RelayPool @@ -189,7 +190,13 @@ const Me: React.FC = ({ relayPool, activeTab: propActiveTab, pubkey: pr // Merge and flatten all individual bookmarks (same logic as BookmarkList) const allIndividualBookmarks = bookmarks.flatMap(b => b.individualBookmarks || []) .filter(hasContentOrUrl) - .sort((a, b) => ((b.added_at || 0) - (a.added_at || 0)) || ((b.created_at || 0) - (a.created_at || 0))) + const groups = groupIndividualBookmarks(allIndividualBookmarks) + const sections: Array<{ key: string; title: string; items: IndividualBookmark[] }> = [ + { key: 'private', title: `Private bookmarks (${groups.privateItems.length})`, items: groups.privateItems }, + { key: 'public', title: `Public bookmarks (${groups.publicItems.length})`, items: groups.publicItems }, + { key: 'web', title: `Web bookmarks (${groups.web.length})`, items: groups.web }, + { key: 'amethyst', title: `Amethyst-style bookmarks (${groups.amethyst.length})`, items: groups.amethyst } + ] // Show content progressively - no blocking error screens const hasData = highlights.length > 0 || bookmarks.length > 0 || readArticles.length > 0 || writings.length > 0 @@ -246,17 +253,22 @@ const Me: React.FC = ({ relayPool, activeTab: propActiveTab, pubkey: pr ) : (
-
- {allIndividualBookmarks.map((individualBookmark, index) => ( - - ))} -
+ {sections.filter(s => s.items.length > 0).map(section => ( +
+

{section.title}

+
+ {section.items.map((individualBookmark, index) => ( + + ))} +
+
+ ))}