diff --git a/modules/rsocials/components/folk-thread-gallery.ts b/modules/rsocials/components/folk-thread-gallery.ts index 28810041..ae5dd7a9 100644 --- a/modules/rsocials/components/folk-thread-gallery.ts +++ b/modules/rsocials/components/folk-thread-gallery.ts @@ -22,7 +22,7 @@ interface DraftPostCard { threadId?: string; } -type StatusFilter = 'all' | 'draft' | 'scheduled' | 'published'; +type StatusFilter = 'draft' | 'scheduled' | 'published'; const STATUS_STORAGE_KEY = 'rsocials:gallery:status-filter'; export class FolkThreadGallery extends HTMLElement { @@ -32,7 +32,7 @@ export class FolkThreadGallery extends HTMLElement { private _offlineUnsub: (() => void) | null = null; private _subscribedDocIds: string[] = []; private _isDemoFallback = false; - private _statusFilter: StatusFilter = 'all'; + private _statusFilter: StatusFilter = 'draft'; static get observedAttributes() { return ['space']; } @@ -42,7 +42,7 @@ export class FolkThreadGallery extends HTMLElement { // Restore last status filter try { const saved = localStorage.getItem(STATUS_STORAGE_KEY); - if (saved === 'draft' || saved === 'scheduled' || saved === 'published' || saved === 'all') { + if (saved === 'draft' || saved === 'scheduled' || saved === 'published') { this._statusFilter = saved; } } catch { /* ignore */ } @@ -162,7 +162,7 @@ export class FolkThreadGallery extends HTMLElement { // Filter + sort posts by status + recency const filteredPosts = this._allPosts - .filter(p => filter === 'all' || p.status === filter) + .filter(p => p.status === filter) .sort((a, b) => { const aT = a.scheduledAt ? new Date(a.scheduledAt).getTime() : 0; const bT = b.scheduledAt ? new Date(b.scheduledAt).getTime() : 0; @@ -171,7 +171,6 @@ export class FolkThreadGallery extends HTMLElement { // Status counts for chip badges const counts = { - all: this._allPosts.length, draft: this._allPosts.filter(p => p.status === 'draft').length, scheduled: this._allPosts.filter(p => p.status === 'scheduled').length, published: this._allPosts.filter(p => p.status === 'published').length, @@ -183,15 +182,13 @@ export class FolkThreadGallery extends HTMLElement { `; const filterBar = `
`; - // Threads are shown only when status is "all" or "published" — they don't have draft state in this schema. - const showThreads = filter === 'all' || filter === 'published'; - const threadsVisible = showThreads ? threads : []; + // Threads render alongside published posts (they have no draft state). + const threadsVisible = filter === 'published' ? threads : []; const threadCardsHTML = filteredPosts.length === 0 && threadsVisible.length === 0 ? `