From 171cbaaeee8e0d65fa94181bdb3f5066abdd5f7d Mon Sep 17 00:00:00 2001 From: Adrian Bonpin Date: Wed, 29 Apr 2026 12:46:57 +0800 Subject: [PATCH] feat: enable recursive comment threading up to 3 levels deep --- components/comments/comment-item.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/components/comments/comment-item.tsx b/components/comments/comment-item.tsx index 0d572d6..2952685 100644 --- a/components/comments/comment-item.tsx +++ b/components/comments/comment-item.tsx @@ -40,6 +40,8 @@ function getInitial(name: string | null | undefined): string { return name?.charAt(0)?.toUpperCase() || "?" } +const MAX_DEPTH = 3 + interface CommentItemProps { comment: CommentData depth?: number @@ -164,7 +166,7 @@ export function CommentItem({ } return ( -
0 ? "ml-8 border-l border-border pl-4" : ""}> +
0 ? "ml-4 border-l border-border pl-3" : ""}>
{/* Avatar */}
@@ -214,7 +216,7 @@ export function CommentItem({ {upvotes} - {session && depth === 0 && ( + {session && depth < MAX_DEPTH && (