From 6b2b7245f4b92eafa92dd7739f3e74faf64a86d2 Mon Sep 17 00:00:00 2001 From: Peter Meier Date: Tue, 28 Apr 2026 14:52:30 +0200 Subject: [PATCH] refactor: fold comment count into PostActions toolbar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CommentCountBadge was a separate component rendered next to PostActions — two adjacent strips of buttons that should have been one toolbar. Merges the count fetch + click-to-scroll behaviour into PostActions behind `commentPageId` / `commentTargetId` props. The standalone CommentCountBadge.svelte is now redundant; deleted. Layout under the post hero is now a single row: [💬 3] [↗ Teilen] [📋 Link] [🖨️] [⏱ 4 min] Co-Authored-By: Claude Opus 4.7 --- src/lib/components/CommentCountBadge.svelte | 65 --------------------- src/lib/components/PostActions.svelte | 65 ++++++++++++++++++++- src/lib/translations.ts | 2 +- src/routes/post/[slug]/+page.svelte | 9 +-- 4 files changed, 67 insertions(+), 74 deletions(-) delete mode 100644 src/lib/components/CommentCountBadge.svelte diff --git a/src/lib/components/CommentCountBadge.svelte b/src/lib/components/CommentCountBadge.svelte deleted file mode 100644 index 903c296..0000000 --- a/src/lib/components/CommentCountBadge.svelte +++ /dev/null @@ -1,65 +0,0 @@ - - - - - {count ?? "…"} - diff --git a/src/lib/components/PostActions.svelte b/src/lib/components/PostActions.svelte index 7045e3a..9b28a60 100644 --- a/src/lib/components/PostActions.svelte +++ b/src/lib/components/PostActions.svelte @@ -1,12 +1,16 @@ -
+
+ {#if commentPageId} + + + {commentCount ?? "…"} + + {/if} +
- {#if data.commentPageId} - - {/if}