diff --git a/src/pages/primary/DiscussionsPage/ThreadCard.tsx b/src/pages/primary/DiscussionsPage/ThreadCard.tsx
index e06e420..5c549c4 100644
--- a/src/pages/primary/DiscussionsPage/ThreadCard.tsx
+++ b/src/pages/primary/DiscussionsPage/ThreadCard.tsx
@@ -22,9 +22,12 @@ interface ThreadCardProps {
className?: string
subtopics?: string[] // Available subtopics for this thread
primaryTopic?: string // The categorized primary topic (e.g., 'general', 'tech', etc.)
+ commentCount?: number
+ lastCommentTime?: number
+ lastVoteTime?: number
}
-export default function ThreadCard({ thread, onThreadClick, className, subtopics = [], primaryTopic }: ThreadCardProps) {
+export default function ThreadCard({ thread, onThreadClick, className, subtopics = [], primaryTopic, commentCount = 0, lastCommentTime = 0, lastVoteTime = 0 }: ThreadCardProps) {
const { t } = useTranslation()
const { isSmallScreen } = useScreenSize()
@@ -55,6 +58,15 @@ export default function ThreadCard({ thread, onThreadClick, className, subtopics
// Format creation time
const createdAt = new Date(thread.created_at * 1000)
const timeAgo = formatDistanceToNow(createdAt, { addSuffix: true })
+
+ // Format last activity times
+ const formatLastActivity = (timestamp: number) => {
+ if (timestamp === 0) return null
+ return formatDistanceToNow(new Date(timestamp * 1000), { addSuffix: true })
+ }
+
+ const lastCommentAgo = formatLastActivity(lastCommentTime)
+ const lastVoteAgo = formatLastActivity(lastVoteTime)
// Get topic display info from centralized DISCUSSION_TOPICS
const getTopicInfo = (topicId: string) => {
@@ -156,6 +168,21 @@ export default function ThreadCard({ thread, onThreadClick, className, subtopics
{timeAgo}
+ {commentCount > 0 && (
+
+ {commentCount} {commentCount === 1 ? t('comment') : t('comments')}
+
+ )}
+ {lastCommentAgo && (
+
+ {t('last commented')}: {lastCommentAgo}
+
+ )}
+ {lastVoteAgo && (
+
+ {t('last voted')}: {lastVoteAgo}
+
+ )}
@@ -190,6 +217,21 @@ export default function ThreadCard({ thread, onThreadClick, className, subtopics
{timeAgo}
+ {commentCount > 0 && (
+
+ {commentCount} {commentCount === 1 ? t('comment') : t('comments')}
+
+ )}
+ {lastCommentAgo && (
+
+ {t('last commented')}: {lastCommentAgo}
+
+ )}
+ {lastVoteAgo && (
+
+ {t('last voted')}: {lastVoteAgo}
+
+ )}
{isReadingGroup && (authorTag || subjectTag) && (
diff --git a/src/pages/primary/DiscussionsPage/index.tsx b/src/pages/primary/DiscussionsPage/index.tsx
index a69b44b..cf07d33 100644
--- a/src/pages/primary/DiscussionsPage/index.tsx
+++ b/src/pages/primary/DiscussionsPage/index.tsx
@@ -1,7 +1,7 @@
import { Button } from '@/components/ui/button'
import { Card, CardContent } from '@/components/ui/card'
// Removed dropdown menu import - no longer using relay selection
-import { FAST_READ_RELAY_URLS, SEARCHABLE_RELAY_URLS, HASHTAG_REGEX } from '@/constants'
+import { BIG_RELAY_URLS, FAST_READ_RELAY_URLS, FAST_WRITE_RELAY_URLS, SEARCHABLE_RELAY_URLS, HASHTAG_REGEX, ExtendedKind } from '@/constants'
import { normalizeUrl } from '@/lib/url'
import { normalizeTopic } from '@/lib/discussion-topics'
import { useFavoriteRelays } from '@/providers/FavoriteRelaysProvider'
@@ -9,7 +9,7 @@ import { useNostr } from '@/providers/NostrProvider'
import { forwardRef, useEffect, useState, useCallback, useRef } from 'react'
import { useTranslation } from 'react-i18next'
import PrimaryPageLayout from '@/layouts/PrimaryPageLayout'
-import { MessageSquarePlus, Book, BookOpen, Hash, Search, X } from 'lucide-react'
+import { MessageSquarePlus, Book, BookOpen, Hash, Search, X, RefreshCw } from 'lucide-react'
import ThreadCard from '@/pages/primary/DiscussionsPage/ThreadCard'
import TopicFilter from '@/pages/primary/DiscussionsPage/TopicFilter'
import ThreadSort, { SortOption } from '@/pages/primary/DiscussionsPage/ThreadSort'
@@ -101,11 +101,14 @@ type EventMapEntry = {
hashtags: string[]
allTopics: string[]
categorizedTopic: string
+ commentCount: number
+ lastCommentTime: number
+ lastVoteTime: number
}
const DiscussionsPage = forwardRef((_, ref) => {
const { t } = useTranslation()
- const { favoriteRelays } = useFavoriteRelays()
+ const { favoriteRelays, blockedRelays } = useFavoriteRelays()
const { pubkey } = useNostr()
const { navigateToNote } = useSmartNoteNavigation()
@@ -114,7 +117,8 @@ const DiscussionsPage = forwardRef((_, ref) => {
const [selectedSubtopic, setSelectedSubtopic] = useState(null)
// Removed relay filtering - using all relays
const [selectedSort, setSelectedSort] = useState('newest')
- const [eventMap, setEventMap] = useState
+ {/* Time Span Selector */}
+
+
+ {/* Refresh Button */}
+
+
{selectedTopic === 'all' && (
{
key={event.id}
thread={event}
subtopics={availableSubtopics}
+ commentCount={eventMap.get(event.id)?.commentCount || 0}
+ lastCommentTime={eventMap.get(event.id)?.lastCommentTime || 0}
+ lastVoteTime={eventMap.get(event.id)?.lastVoteTime || 0}
onThreadClick={() => {
navigateToNote(toNote(event))
}}
@@ -762,6 +1139,9 @@ const DiscussionsPage = forwardRef((_, ref) => {
key={event.id}
thread={event}
subtopics={availableSubtopics}
+ commentCount={eventMap.get(event.id)?.commentCount || 0}
+ lastCommentTime={eventMap.get(event.id)?.lastCommentTime || 0}
+ lastVoteTime={eventMap.get(event.id)?.lastVoteTime || 0}
onThreadClick={() => {
navigateToNote(toNote(event))
}}
@@ -843,6 +1223,9 @@ const DiscussionsPage = forwardRef((_, ref) => {
thread={event}
subtopics={threadSubtopics}
primaryTopic={entry?.categorizedTopic}
+ commentCount={entry?.commentCount || 0}
+ lastCommentTime={entry?.lastCommentTime || 0}
+ lastVoteTime={entry?.lastVoteTime || 0}
onThreadClick={() => {
navigateToNote(toNote(event))
}}
@@ -868,6 +1251,9 @@ const DiscussionsPage = forwardRef((_, ref) => {
thread={event}
subtopics={threadSubtopics}
primaryTopic={entry?.categorizedTopic}
+ commentCount={entry?.commentCount || 0}
+ lastCommentTime={entry?.lastCommentTime || 0}
+ lastVoteTime={entry?.lastVoteTime || 0}
onThreadClick={() => {
navigateToNote(toNote(event))
}}