From b835767a62067867109c8fbb8544a4d617ae184f Mon Sep 17 00:00:00 2001 From: "michael.hoff" Date: Tue, 7 Jul 2026 19:16:16 -0400 Subject: [PATCH 1/2] forum: show a live post count in the thread header and clear the composer after posting --- forum.html | 2 +- forum.js | 11 +++++++++++ styles.css | 4 ++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/forum.html b/forum.html index ebce572..b7f78ca 100644 --- a/forum.html +++ b/forum.html @@ -33,7 +33,7 @@

Forum

-

Thread

+

Thread

  • isnull teamWelcome to the forum — say hello!
diff --git a/forum.js b/forum.js index 12534d9..f05e817 100644 --- a/forum.js +++ b/forum.js @@ -4,6 +4,13 @@ document.addEventListener("DOMContentLoaded", () => { const nameEl = document.getElementById("forum-name"); const msgEl = document.getElementById("forum-message"); const list = document.getElementById("forum-posts"); + const countEl = document.getElementById("forum-count"); + const refreshCount = () => { + if (!countEl) return; + const n = list.children.length; + countEl.textContent = n + (n === 1 ? " post" : " posts"); + }; + refreshCount(); if (!postBtn || !nameEl || !msgEl || !list) return; postBtn.addEventListener("click", () => { @@ -25,7 +32,11 @@ document.addEventListener("DOMContentLoaded", () => { when.className = "forum-time"; when.textContent = new Date().toLocaleTimeString(); li.appendChild(when); + refreshCount(); list.appendChild(li); + nameEl.value = ""; + msgEl.value = ""; + }); }); diff --git a/styles.css b/styles.css index da763c5..2c9e5aa 100644 --- a/styles.css +++ b/styles.css @@ -90,3 +90,7 @@ h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; } } .forum-time { margin-left: 8px; color: #888; font-size: 0.85em; } + +.forum-count { font-size: 0.6em; color: #888; font-weight: normal; margin-left: 8px; } + +.forum-count { font-size: 0.6em; color: #888; font-weight: normal; margin-left: 8px; } From 586a37653e853fb5ef4fc25fc41e44a8e9a25b9b Mon Sep 17 00:00:00 2001 From: "michael.hoff" Date: Tue, 7 Jul 2026 22:56:35 -0400 Subject: [PATCH 2/2] forum: refresh the post count after the new post joins the thread (fix stale badge) --- forum.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/forum.js b/forum.js index f05e817..d434a6b 100644 --- a/forum.js +++ b/forum.js @@ -32,8 +32,8 @@ document.addEventListener("DOMContentLoaded", () => { when.className = "forum-time"; when.textContent = new Date().toLocaleTimeString(); li.appendChild(when); - refreshCount(); list.appendChild(li); + refreshCount(); nameEl.value = ""; msgEl.value = "";