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

@ -1,12 +1,13 @@
import { computed, ref, onMounted, onUnmounted } from 'vue'
import { injectService, SERVICE_TOKENS } from '@/core/di-container'
import type { FeedService, FeedConfig } from '../services/FeedService'
import type { FeedService, FeedConfig, ContentFilter } from '../services/FeedService'
export interface UseFeedConfig {
feedType: 'announcements' | 'general' | 'mentions' | 'events' | 'all'
feedType: 'announcements' | 'general' | 'mentions' | 'events' | 'all' | 'custom'
maxPosts?: number
refreshInterval?: number
adminPubkeys?: string[]
contentFilters?: ContentFilter[]
}
export function useFeed(config: UseFeedConfig) {
@ -23,7 +24,8 @@ export function useFeed(config: UseFeedConfig) {
const feedConfig: FeedConfig = {
feedType: config.feedType,
maxPosts: config.maxPosts,
adminPubkeys: config.adminPubkeys
adminPubkeys: config.adminPubkeys,
contentFilters: config.contentFilters
}
const filteredPosts = computed(() => {