From 560761968b79f4c270248b1e9ee7985422a6a6a9 Mon Sep 17 00:00:00 2001 From: Mannu Date: Sun, 24 May 2026 08:01:56 +0530 Subject: [PATCH] feat: collapsible post cards in circle feed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Posts start collapsed showing author, timestamp, a thumbnail (if image) and truncated text preview with โ–ผ chevron. Tap the author row to expand the full post (body, full image, reactions, comments). Tap again to collapse. Lets users scan many posts quickly and expand only what interests them. Co-Authored-By: Claude Sonnet 4.6 --- src/app/circle/[id]/page.tsx | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/src/app/circle/[id]/page.tsx b/src/app/circle/[id]/page.tsx index ea934d0..bd99201 100644 --- a/src/app/circle/[id]/page.tsx +++ b/src/app/circle/[id]/page.tsx @@ -29,6 +29,7 @@ function PostCard({ onDeleted: (id: string) => void; onReact: (postId: string, emoji: string) => void; }) { + const [collapsed, setCollapsed] = useState(true); const [showComments, setShowComments] = useState(false); const [comments, setComments] = useState([]); const [commentText, setCommentText] = useState(""); @@ -112,15 +113,31 @@ function PostCard({ )}
- {/* Author row */} + {/* Author row โ€” tap to collapse/expand */}
-
-
๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘ง
-
+
+ {/* Collapsed preview */} + {collapsed && ( +
+ {post.imageUrl && ( + + )} + {post.body && ( + {post.body} + )} + โ–ผ +
+ )} + {!collapsed && โ–ฒ} + {/* โ‹ฏ menu โ€” rendered outside overflow:hidden so it doesn't get clipped */}
@@ -153,6 +170,12 @@ function PostCard({
+ {/* Collapsed divider */} + {collapsed &&
} + + {/* Expanded content */} + {!collapsed && <> + {/* Delete confirmation */} {deleteConfirm && (
@@ -257,6 +280,7 @@ function PostCard({
)} + } {/* end !collapsed */}
);