Add collapsible components and feed filter functionality

- Introduced Collapsible, CollapsibleContent, and CollapsibleTrigger components for improved UI interactions.
- Added FeedFilters component to allow users to customize content visibility in the NostrFeed.
- Updated NostrFeed and Home components to integrate new filtering capabilities, enhancing user experience with customizable content display.
- Implemented content filter logic in FeedService to support dynamic filtering based on user selections.

These changes enhance the modularity and interactivity of the feed system, providing users with greater control over the content they see.
This commit is contained in:
padreug 2025-09-16 21:58:24 +02:00
parent a5e6c301e1
commit e90c4992da
10 changed files with 574 additions and 24 deletions

View file

@ -8,20 +8,24 @@ import { formatDistanceToNow } from 'date-fns'
import { Megaphone, RefreshCw, AlertCircle } from 'lucide-vue-next'
import { useFeed } from '../composables/useFeed'
import appConfig from '@/app.config'
import type { ContentFilter } from '../services/FeedService'
const props = defineProps<{
relays?: string[]
feedType?: 'all' | 'announcements' | 'events' | 'general'
feedType?: 'all' | 'announcements' | 'events' | 'general' | 'custom'
contentFilters?: ContentFilter[]
adminPubkeys?: string[]
}>()
// Get admin/moderator pubkeys from app config
const adminPubkeys = appConfig.modules['nostr-feed'].config.adminPubkeys
// Get admin/moderator pubkeys from props or app config
const adminPubkeys = props.adminPubkeys || appConfig.modules['nostr-feed']?.config?.adminPubkeys || []
// Use centralized feed service - this handles all subscription management and deduplication
const { posts: notes, isLoading, error, refreshFeed } = useFeed({
feedType: props.feedType || 'all',
maxPosts: 100,
adminPubkeys
adminPubkeys,
contentFilters: props.contentFilters
})
// Check if we have admin pubkeys configured