fix: render custom emoji in highlight comments

The NIP-84 highlight comment was passed to TranslatableRichTextViewer with
an empty tag list, so custom emoji (:shortcode:) never resolved against the
event's `emoji` tags and rendered as raw text.

Thread the highlight event's tags through to the comment's rich-text viewer
so the emoji map is built from them, matching how regular text notes render.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FyyodHWxSHeiY6pndPxGSb
This commit is contained in:
Claude
2026-07-29 02:04:05 +00:00
parent ebf04de516
commit 74be87c305
@@ -43,7 +43,9 @@ import androidx.compose.ui.graphics.Color
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.vitorpamplona.amethyst.commons.model.EmptyTagList
import com.vitorpamplona.amethyst.commons.model.ImmutableListOfLists
import com.vitorpamplona.amethyst.commons.model.highlights.HighlightQuote
import com.vitorpamplona.amethyst.commons.model.toImmutableListOfLists
import com.vitorpamplona.amethyst.commons.ui.components.ClickableTextPrimary
import com.vitorpamplona.amethyst.commons.ui.note.HighlightQuoteIndent
import com.vitorpamplona.amethyst.commons.ui.note.HighlightQuoteSpacing
@@ -91,6 +93,7 @@ fun RenderHighlight(
DisplayHighlight(
comment = noteEvent.comment(),
commentTags = remember(noteEvent) { noteEvent.tags.toImmutableListOfLists() },
highlight = noteEvent.quote(),
context = noteEvent.contextOrReconstructed(),
authorHex = noteEvent.author(),
@@ -160,6 +163,7 @@ fun DisplayHighlightPreviewNewLine() {
@Composable
fun DisplayHighlight(
comment: String?,
commentTags: ImmutableListOfLists<String> = EmptyTagList,
highlight: String,
context: String?,
authorHex: String?,
@@ -181,7 +185,7 @@ fun DisplayHighlight(
canPreview = canPreview && !makeItShort,
quotesLeft = quotesLeft,
modifier = Modifier.fillMaxWidth(),
tags = EmptyTagList,
tags = commentTags,
backgroundColor = backgroundColor,
id = it,
callbackUri = null,