From ba35a4e527b695cd9967c88e687ae7ff7a450633 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 29 May 2026 21:30:44 +0000 Subject: [PATCH] feat(podcasts): translatable descriptions on the NoteCompose feed cards RenderPodcastMetadata and RenderPodcastEpisode rendered their description tag as a plain Text. Both now use TranslatableRichTextViewer (rich text + translation), matching the podcast screen header. The metadata card finally uses its previously-ignored canPreview/backgroundColor params; the episode card gives its short description a distinct id so it doesn't share remember state with the markdown body below it. --- .../amethyst/ui/note/types/PodcastEpisode.kt | 16 +++++++++----- .../amethyst/ui/note/types/PodcastMetadata.kt | 22 +++++++++++++------ 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/PodcastEpisode.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/PodcastEpisode.kt index 0187688979..faa0258569 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/PodcastEpisode.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/PodcastEpisode.kt @@ -104,12 +104,18 @@ fun RenderPodcastEpisode( } description?.let { - Text( - text = it, - style = MaterialTheme.typography.bodyMedium, - maxLines = 3, - overflow = TextOverflow.Ellipsis, + val descriptionTags = remember(noteEvent) { noteEvent.tags.toImmutableListOfLists() } + + TranslatableRichTextViewer( + content = it, + canPreview = canPreview, + quotesLeft = 1, modifier = Modifier.fillMaxWidth(), + tags = descriptionTags, + backgroundColor = backgroundColor, + id = note.idHex + "-description", + accountViewModel = accountViewModel, + nav = nav, ) } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/PodcastMetadata.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/PodcastMetadata.kt index b9915f342e..c7f829c4c3 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/PodcastMetadata.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/PodcastMetadata.kt @@ -43,7 +43,9 @@ import androidx.compose.ui.unit.dp import com.vitorpamplona.amethyst.R import com.vitorpamplona.amethyst.commons.icons.symbols.Icon import com.vitorpamplona.amethyst.commons.icons.symbols.MaterialSymbols +import com.vitorpamplona.amethyst.commons.model.toImmutableListOfLists import com.vitorpamplona.amethyst.model.Note +import com.vitorpamplona.amethyst.ui.components.TranslatableRichTextViewer import com.vitorpamplona.amethyst.ui.navigation.navs.INav import com.vitorpamplona.amethyst.ui.navigation.routes.Route import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel @@ -58,8 +60,8 @@ import com.vitorpamplona.quartz.nipF4Podcasts.metadata.PodcastMetadataEvent fun RenderPodcastMetadata( note: Note, makeItShort: Boolean, - @Suppress("UNUSED_PARAMETER") canPreview: Boolean, - @Suppress("UNUSED_PARAMETER") backgroundColor: MutableState, + canPreview: Boolean, + backgroundColor: MutableState, accountViewModel: AccountViewModel, nav: INav, ) { @@ -99,12 +101,18 @@ fun RenderPodcastMetadata( } description?.takeIf { !makeItShort }?.let { - Text( - text = it, - style = MaterialTheme.typography.bodyMedium, - maxLines = 5, - overflow = TextOverflow.Ellipsis, + val tags = remember(noteEvent) { noteEvent.tags.toImmutableListOfLists() } + + TranslatableRichTextViewer( + content = it, + canPreview = canPreview, + quotesLeft = 1, modifier = Modifier.fillMaxWidth(), + tags = tags, + backgroundColor = backgroundColor, + id = note.idHex, + accountViewModel = accountViewModel, + nav = nav, ) }