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 ? `
@@ -287,7 +284,8 @@ export class FolkThreadGallery extends HTMLElement { .badge--published { background: rgba(34,197,94,0.15); color: #22c55e; } .badge--campaign { background: rgba(99,102,241,0.15); color: #a5b4fc; } .filter-bar { - display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 1.25rem; + display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.5rem; + justify-content: center; } .chip { display: inline-flex; align-items: center; gap: 0.4rem; diff --git a/modules/rsocials/mod.ts b/modules/rsocials/mod.ts index 25d0dcd6..b7f378ba 100644 --- a/modules/rsocials/mod.ts +++ b/modules/rsocials/mod.ts @@ -3026,7 +3026,7 @@ routes.get("/threads", (c) => { theme: "dark", body: ``, styles: ``, - scripts: ``, + scripts: ``, })); }); @@ -3173,28 +3173,15 @@ routes.get("/landing", (c) => { routes.get("/", (c) => { const space = c.req.param("space") || "demo"; - const host = c.req.header("host")?.split(":")[0] || ""; - const isSubdomain = (host.endsWith(".rspace.online") && host !== "rspace.online" && !host.startsWith("www.")) || host.endsWith(".rsocials.online"); - const base = isSubdomain ? "/rsocials" : `/${escapeHtml(space)}/rsocials`; return c.html(renderShell({ title: `rSocials — ${space} | rSpace`, moduleId: "rsocials", spaceSlug: space, modules: getModuleInfoList(), theme: "dark", - styles: ` -`, - body: ` -`, - scripts: ``, + styles: ``, + body: ``, + scripts: ``, })); });