From a7682c757b388a9ba8ff5472ca5ad3eb8b62f1a6 Mon Sep 17 00:00:00 2001 From: Alejandro Date: Mon, 12 Jan 2026 09:07:56 +0100 Subject: [PATCH] Fix custom emoji rendering in compact view (#51) 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. Co-authored-by: Claude --- 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 ? ( + + ) : ( + + )} ); }