From 120c31ac954f0ff46adc053d30f337cbfc171421 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 26 Jun 2026 14:49:47 +0000 Subject: [PATCH 1/2] feat: always show short preview for posts inside zap activity cards The lightning, nutzap, and onchain activity cards embed the zapped post via RenderZappedPost with makeItShort = true. The 2-line compact preview, however, only triggered when the logged-in user authored the post (makeItShort && isLoggedUser(author)). When the user is merely a zap-split beneficiary of someone else's post, that check failed and the post rendered in full instead of the intended compact preview. Gate the short preview on the boosted-note flag as well, so any post embedded in one of these activity cards (the only makeItShort callers that pass isBoostedNote = true) is always shown as a 2-line preview, regardless of author. Other makeItShort callers (Report, community post approval, attestation, reply composition, compose screens) all use isQuotedNote instead, so their behavior is unchanged. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01Q4rrFiWApq8EFpk4fSuTFH --- .../java/com/vitorpamplona/amethyst/ui/note/NoteCompose.kt | 7 +++++++ .../java/com/vitorpamplona/amethyst/ui/note/types/Chat.kt | 6 +++++- .../java/com/vitorpamplona/amethyst/ui/note/types/Poll.kt | 6 +++++- .../vitorpamplona/amethyst/ui/note/types/PublicMessage.kt | 6 +++++- .../java/com/vitorpamplona/amethyst/ui/note/types/Text.kt | 6 +++++- .../com/vitorpamplona/amethyst/ui/note/types/ZapPoll.kt | 6 +++++- 6 files changed, 32 insertions(+), 5 deletions(-) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/NoteCompose.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/NoteCompose.kt index b618a75605..8cfc620738 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/NoteCompose.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/NoteCompose.kt @@ -765,6 +765,7 @@ fun InnerNoteWithReactions( unPackReply = unPackReply, accountViewModel = accountViewModel, nav = nav, + isBoostedNote = isBoostedNote, ) if (!makeItShort) { @@ -913,6 +914,7 @@ private fun RenderNoteRow( editState: State>, accountViewModel: AccountViewModel, nav: INav, + isBoostedNote: Boolean = false, ) { when (val noteEvent = baseNote.event) { is AppDefinitionEvent -> { @@ -1367,6 +1369,7 @@ private fun RenderNoteRow( backgroundColor, accountViewModel, nav, + isBoostedNote = isBoostedNote, ) } @@ -1379,6 +1382,7 @@ private fun RenderNoteRow( backgroundColor, accountViewModel, nav, + isBoostedNote = isBoostedNote, ) } @@ -1391,6 +1395,7 @@ private fun RenderNoteRow( backgroundColor, accountViewModel, nav, + isBoostedNote = isBoostedNote, ) } @@ -1526,6 +1531,7 @@ private fun RenderNoteRow( backgroundColor, accountViewModel, nav, + isBoostedNote = isBoostedNote, ) } @@ -1540,6 +1546,7 @@ private fun RenderNoteRow( editState, accountViewModel, nav, + isBoostedNote = isBoostedNote, ) } } diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/Chat.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/Chat.kt index a499e28509..e51612e3a7 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/Chat.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/Chat.kt @@ -49,11 +49,15 @@ fun RenderChat( backgroundColor: MutableState, accountViewModel: AccountViewModel, nav: INav, + isBoostedNote: Boolean = false, ) { val noteEvent = note.event ?: return val eventContent = remember(noteEvent) { noteEvent.content } - if (makeItShort && accountViewModel.isLoggedUser(note.author)) { + // A boosted note inside a zap/nutzap/onchain activity card is always shown as a + // compact 2-line preview, even when the logged-in user is only a zap-split + // beneficiary (and thus not the author) of the post being zapped. + if (makeItShort && (isBoostedNote || accountViewModel.isLoggedUser(note.author))) { Text( text = eventContent, color = MaterialTheme.colorScheme.placeholderText, diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/Poll.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/Poll.kt index 6b7d0896af..0bcc0df398 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/Poll.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/Poll.kt @@ -116,10 +116,14 @@ fun RenderPoll( backgroundColor: MutableState, accountViewModel: AccountViewModel, nav: INav, + isBoostedNote: Boolean = false, ) { val noteEvent = note.event as? PollEvent ?: return - if (makeItShort && accountViewModel.isLoggedUser(note.author)) { + // A boosted note inside a zap/nutzap/onchain activity card is always shown as a + // compact 2-line preview, even when the logged-in user is only a zap-split + // beneficiary (and thus not the author) of the post being zapped. + if (makeItShort && (isBoostedNote || accountViewModel.isLoggedUser(note.author))) { Text( text = noteEvent.content, color = MaterialTheme.colorScheme.placeholderText, diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/PublicMessage.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/PublicMessage.kt index 73b05b19c8..4fa6b422fa 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/PublicMessage.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/PublicMessage.kt @@ -55,11 +55,15 @@ fun RenderPublicMessage( backgroundColor: MutableState, accountViewModel: AccountViewModel, nav: INav, + isBoostedNote: Boolean = false, ) { val noteEvent = note.event as? PublicMessageEvent ?: return val content = remember(noteEvent) { noteEvent.peopleAndContent() } - if (makeItShort && accountViewModel.isLoggedUser(note.author)) { + // A boosted note inside a zap/nutzap/onchain activity card is always shown as a + // compact 2-line preview, even when the logged-in user is only a zap-split + // beneficiary (and thus not the author) of the post being zapped. + if (makeItShort && (isBoostedNote || accountViewModel.isLoggedUser(note.author))) { Text( text = content, color = MaterialTheme.colorScheme.placeholderText, diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/Text.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/Text.kt index c082b39990..49c0aaf890 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/Text.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/Text.kt @@ -79,6 +79,7 @@ fun RenderTextEvent( editState: State>, accountViewModel: AccountViewModel, nav: INav, + isBoostedNote: Boolean = false, ) { val noteEvent = note.event ?: return @@ -183,7 +184,10 @@ fun RenderTextEvent( } } - if (makeItShort && accountViewModel.isLoggedUser(note.author)) { + // A boosted note inside a zap/nutzap/onchain activity card is always shown as a + // compact 2-line preview, even when the logged-in user is only a zap-split + // beneficiary (and thus not the author) of the post being zapped. + if (makeItShort && (isBoostedNote || accountViewModel.isLoggedUser(note.author))) { Text( text = eventContent, color = MaterialTheme.colorScheme.placeholderText, diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/ZapPoll.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/ZapPoll.kt index 48847aa61b..d99aa11976 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/ZapPoll.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/types/ZapPoll.kt @@ -60,6 +60,7 @@ fun RenderZapPoll( backgroundColor: MutableState, accountViewModel: AccountViewModel, nav: INav, + isBoostedNote: Boolean = false, ) { val noteEvent = note.event as? ZapPollEvent ?: return val eventContent = noteEvent.content @@ -92,7 +93,10 @@ fun RenderZapPoll( } } - if (makeItShort && accountViewModel.isLoggedUser(note.author)) { + // A boosted note inside a zap/nutzap/onchain activity card is always shown as a + // compact 2-line preview, even when the logged-in user is only a zap-split + // beneficiary (and thus not the author) of the post being zapped. + if (makeItShort && (isBoostedNote || accountViewModel.isLoggedUser(note.author))) { Text( text = eventContent, color = MaterialTheme.colorScheme.placeholderText, From bf2dc03a5097e0ae26ee985bcb9153581db17217 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 26 Jun 2026 14:54:09 +0000 Subject: [PATCH 2/2] fix: escape apostrophe inside CDATA in fr-rCA strings The Crowdin-synced values-fr-rCA/strings.xml had unescaped apostrophes inside the CDATA sections of block_hide_user and report_dialog_block_hide_user_btn, which aapt2 rejects ("Invalid unicode escape sequence"), breaking resource compilation. Escape them as \' to match the known-good values-fr translations. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01Q4rrFiWApq8EFpk4fSuTFH --- amethyst/src/main/res/values-fr-rCA/strings.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/amethyst/src/main/res/values-fr-rCA/strings.xml b/amethyst/src/main/res/values-fr-rCA/strings.xml index 5eefcf644f..d456a47d35 100644 --- a/amethyst/src/main/res/values-fr-rCA/strings.xml +++ b/amethyst/src/main/res/values-fr-rCA/strings.xml @@ -44,7 +44,7 @@ OTS : En attente Demande de suppression Bloquer / Signaler - + Signaler Spam / Arnaque Signaler une falsification d\'identité Signaler un comportement illégal @@ -401,7 +401,7 @@ Nudité ou contenu graphique Comportement illégal Bloquer un utilisateur cachera son contenu dans votre application. Vos notes sont toujours visibles publiquement, y compris pour les personnes que vous bloquez. Les utilisateurs bloqués sont listés sur l\'écran Filtres de Sécurité. - + Signaler un Abus Tous les rapports publiés seront visibles publiquement. Fournir un contexte optionnel supplémentaire sur votre signalement…