From cc5f6e9b0dcf19232d94c9e82a5536f836244784 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 11 Jan 2026 21:05:47 +0000 Subject: [PATCH] Fix custom emoji rendering in compact view Custom emoji were not displaying in compact event previews because DefaultCompactPreview was passing only content string to RichText, which strips emoji tag metadata needed for :shortcode: -> URL mapping. Now passes full event object to preserve emoji tags when rendering content, while still using plain text rendering for specific titles. Fixes emoji display in compact rows and reply previews. --- src/components/nostr/compact/index.tsx | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/src/components/nostr/compact/index.tsx b/src/components/nostr/compact/index.tsx index a50453e..90c62f7 100644 --- a/src/components/nostr/compact/index.tsx +++ b/src/components/nostr/compact/index.tsx @@ -69,19 +69,25 @@ export function DefaultCompactPreview({ event }: { event: NostrEvent }) { // Try to get a title, fall back to content preview const title = getEventDisplayTitle(event, false); - // If title is the content itself, truncate it - const displayText = - title === event.content && title.length > 80 - ? title.slice(0, 80) + "..." - : title; + // If event has a specific title (not the content itself), show it as plain text + // Otherwise, render the full event content with RichText for custom emoji support + const hasSpecificTitle = title !== event.content; return ( - + {hasSpecificTitle ? ( + + ) : ( + + )} ); }