From 543ae6a1b3726c8b9d61e3541317a8b05bbe6fd2 Mon Sep 17 00:00:00 2001 From: Laan Tungir Date: Thu, 25 Jun 2026 21:02:21 -0400 Subject: [PATCH] Fix feed.html: disable inline comment rendering that caused flash of replies Two fixes: 1. post-interactions2.mjs: only call addCommentToPost when getCommentsVisible() is true 2. feed.html: call cards.setCommentsVisible(false) after initPostCards to disable inline comment rendering for the new simplified feed The old feed (feed-old.html) still has the Comments toggle and can re-enable them. --- www/feed.html | 6 ++++++ www/js/post-interactions2.mjs | 4 +++- www/js/version.json | 6 +++--- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/www/feed.html b/www/feed.html index 5982f58..023061f 100644 --- a/www/feed.html +++ b/www/feed.html @@ -343,6 +343,12 @@ import { initPostCards } from './js/post-interactions2.mjs'; onMuteIntent: handleMuteIntent }); + // Disable inline comment rendering — the new feed shows posts only. + // Comments are viewed on the post-feed.html thread page (new tab). + if (typeof cards.setCommentsVisible === 'function') { + cards.setCommentsVisible(false); + } + function initHamburgerMenu() { hamburgerInstance = new HamburgerMorphing('#divSvgHam', { foreground: 'var(--primary-color)', diff --git a/www/js/post-interactions2.mjs b/www/js/post-interactions2.mjs index b767aee..4fc5924 100644 --- a/www/js/post-interactions2.mjs +++ b/www/js/post-interactions2.mjs @@ -69,7 +69,9 @@ export function initPostCards(deps = {}) { function handleUpdate(postId, state, event, currentPubkey) { interactions.updateInteractionBar(postId, state); - if (event && event.kind === 1 && interactions.isCommentEvent?.(event, postId)) { + // Only render inline comments if comments are visible (the new feed + // sets commentsVisible=false to avoid inline reply rendering). + if (event && event.kind === 1 && interactions.isCommentEvent?.(event, postId) && interactions.getCommentsVisible?.()) { interactions.addCommentToPost(postId, { id: event.id, pubkey: event.pubkey, diff --git a/www/js/version.json b/www/js/version.json index bebaa14..9f8bde8 100644 --- a/www/js/version.json +++ b/www/js/version.json @@ -1,5 +1,5 @@ { - "VERSION": "v0.7.32", - "VERSION_NUMBER": "0.7.32", - "BUILD_DATE": "2026-06-26T00:57:34.005Z" + "VERSION": "v0.7.33", + "VERSION_NUMBER": "0.7.33", + "BUILD_DATE": "2026-06-26T01:02:21.256Z" }