Implement limited replies feature in NostrFeed component
- Introduced a mechanism to track posts that should display limited replies (only the first 2) instead of collapsing them entirely, enhancing user interaction with threaded discussions. - Updated the ThreadedPost component to support toggling between limited and full replies, improving visibility and engagement with nested replies. - Enhanced the FeedService to ensure proper filtering and handling of feed types, contributing to a more organized and user-friendly experience within the NostrFeed module.
This commit is contained in:
parent
872954d5ce
commit
f0a6b2bd1d
4 changed files with 85 additions and 40 deletions
|
|
@ -134,6 +134,8 @@
|
|||
// TODO: Re-enable when push notifications are properly implemented
|
||||
// import NotificationPermission from '@/components/notifications/NotificationPermission.vue'
|
||||
import { ref, computed, watch } from 'vue'
|
||||
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { Filter, Plus, MessageSquare, Car } from 'lucide-vue-next'
|
||||
import PWAInstallPrompt from '@/components/pwa/PWAInstallPrompt.vue'
|
||||
import FeedFilters from '@/modules/nostr-feed/components/FeedFilters.vue'
|
||||
|
|
@ -185,14 +187,19 @@ const isPresetActive = (presetKey: string) => {
|
|||
const feedType = computed(() => {
|
||||
if (selectedFilters.value.length === 0) return 'all'
|
||||
|
||||
// Check if it matches a preset
|
||||
for (const [, presetFilters] of Object.entries(FILTER_PRESETS)) {
|
||||
if (presetFilters.length === selectedFilters.value.length &&
|
||||
presetFilters.every(pf => selectedFilters.value.some(sf => sf.id === pf.id))) {
|
||||
return 'custom' // Always use custom for proper filtering
|
||||
}
|
||||
// Check if it matches the 'all' preset - if so, use 'all' feed type for simple filtering
|
||||
if (selectedFilters.value.length === FILTER_PRESETS.all.length &&
|
||||
FILTER_PRESETS.all.every(pf => selectedFilters.value.some(sf => sf.id === pf.id))) {
|
||||
return 'all'
|
||||
}
|
||||
|
||||
// Check if it matches the announcements preset
|
||||
if (selectedFilters.value.length === FILTER_PRESETS.announcements.length &&
|
||||
FILTER_PRESETS.announcements.every(pf => selectedFilters.value.some(sf => sf.id === pf.id))) {
|
||||
return 'announcements'
|
||||
}
|
||||
|
||||
// For all other cases, use custom
|
||||
return 'custom'
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue