From ab25b7531d789057d1f8473f4dc59435c7df8a9f Mon Sep 17 00:00:00 2001 From: Mannu Date: Sun, 24 May 2026 08:13:54 +0530 Subject: [PATCH] fix: collapsed post preview centered + auto-expand on edit/delete MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Collapsed preview (thumbnail + text) moved to its own row centered below the author line instead of being pushed to the right - Chevron ▼/▲ stays on the author row right side as the only element - Edit post and Delete post now call setCollapsed(false) first so the edit textarea / delete confirmation is always visible when triggered from a collapsed card Co-Authored-By: Claude Sonnet 4.6 --- src/app/circle/[id]/page.tsx | 38 ++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/src/app/circle/[id]/page.tsx b/src/app/circle/[id]/page.tsx index bd99201..4a97bad 100644 --- a/src/app/circle/[id]/page.tsx +++ b/src/app/circle/[id]/page.tsx @@ -124,19 +124,7 @@ function PostCard({

{post.authorFamilyName}

{timeAgo(post.createdAt)}{post.sourceKind ? ` · shared a ${post.sourceKind}` : ""}

- {/* Collapsed preview */} - {collapsed && ( -
- {post.imageUrl && ( - - )} - {post.body && ( - {post.body} - )} - -
- )} - {!collapsed && } + {collapsed ? "▼" : "▲"} {/* ⋯ menu — rendered outside overflow:hidden so it doesn't get clipped */}
@@ -147,13 +135,13 @@ function PostCard({
{isOwn && ( )} {(isOwn || isAdmin) && ( )} @@ -170,8 +158,24 @@ function PostCard({
- {/* Collapsed divider */} - {collapsed &&
} + {/* Collapsed preview row — centered under author line */} + {collapsed && (post.body || post.imageUrl) && ( + + )} + {/* Collapsed divider when no preview content */} + {collapsed && !post.body && !post.imageUrl && ( +
+ )} {/* Expanded content */} {!collapsed && <>