From e0450385ed4c6f56f0e4f08b3571780de658a8de Mon Sep 17 00:00:00 2001 From: Gigi Date: Fri, 3 Oct 2025 00:35:55 +0200 Subject: [PATCH] fix(ui): enforce 210-char truncation for both plain and parsed content\n\n- Show truncated plain text when parsedContent exists and not expanded\n- Render full parsed content only when expanded\n- Keep chevron toggle below content --- src/components/BookmarkItem.tsx | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/src/components/BookmarkItem.tsx b/src/components/BookmarkItem.tsx index c929e0ac..72448744 100644 --- a/src/components/BookmarkItem.tsx +++ b/src/components/BookmarkItem.tsx @@ -44,6 +44,8 @@ export const BookmarkItem: React.FC = ({ bookmark, index, onS // Extract URLs from bookmark content const extractedUrls = extractUrlsFromContent(bookmark.content) const hasUrls = extractedUrls.length > 0 + const contentLength = (bookmark.content || '').length + const shouldTruncate = !expanded && contentLength > 210 // Resolve author profile using applesauce const authorProfile = useEventModel(Models.ProfileModel, [bookmark.pubkey]) @@ -139,21 +141,24 @@ export const BookmarkItem: React.FC = ({ bookmark, index, onS {bookmark.parsedContent ? (
- {renderParsedContent(bookmark.parsedContent)} + {shouldTruncate && bookmark.content + ? + : renderParsedContent(bookmark.parsedContent)}
) : bookmark.content && ( - <> - - {bookmark.content.length > 210 && ( - - )} - +
+ +
+ )} + + {contentLength > 210 && ( + )}