From 56f377144613da2f61318442d3f4c00af23911f6 Mon Sep 17 00:00:00 2001 From: Taylor Ho Date: Thu, 30 Jul 2026 17:07:52 -0700 Subject: [PATCH] feat(desktop): preserve rich preview description structure - Render OG description line breaks instead of collapsing them into spaces - Group blank-line-separated paragraphs with compact spacing to avoid oversized gaps - Reuse the rich preview image component for consistent skeleton and lightbox behavior across link types Co-authored-by: Taylor Ho Signed-off-by: Taylor Ho --- .../ui/rich-link-preview-attachment.tsx | 72 +++++++++---------- 1 file changed, 34 insertions(+), 38 deletions(-) diff --git a/desktop/src/shared/ui/rich-link-preview-attachment.tsx b/desktop/src/shared/ui/rich-link-preview-attachment.tsx index c9937c557..f2728cfa9 100644 --- a/desktop/src/shared/ui/rich-link-preview-attachment.tsx +++ b/desktop/src/shared/ui/rich-link-preview-attachment.tsx @@ -102,6 +102,27 @@ function LinkPreviewImage({ ); } +function LinkPreviewDescription({ + className, + description, +}: { + className?: string; + description: string; +}) { + return ( +
+ {description.split(/\n{2,}/).map((paragraph) => ( +

+ {paragraph} +

+ ))} +
+ ); +} + function TweetPreview({ className, onRemove, @@ -141,12 +162,10 @@ function TweetPreview({ {preview.title} {contentExpanded && preview.description ? ( -
- {preview.description} -
+ ) : null} {contentExpanded && reserveImage ? ( {preview.title} {contentExpanded && preview.description ? ( -
- {preview.description} -
+ ) : null} {contentExpanded && reserveImage ? ( - -
- {showImage ? ( - {`Preview - ) : ( -
- )} -
-
+ ) : null} {hasExpandableContent ? (