From 1614e01f0e12ec66770ed0a7d967b4e55a6f52fa Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 25 Jun 2026 23:55:26 +0000 Subject: [PATCH] feat: render a lone zap notification as a full note, not a bare card MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The single-zap/single-nutzap branch of MultiSetCompose dropped the bare RenderLnZap/RenderNutzap activity card straight into the feed, with no author column on the left, so it didn't read like the surrounding notes. Reuse NoteCompose on the zap-receipt note instead: it wraps the same zap card as the note body and gives it the standard note chrome — author picture on the left, username header, reactions row. Padding is handed to NoteCompose for this branch so it isn't doubled against the card column. NoteCompose's author column previously resolved baseNote.author, which for a kind-9735 zap receipt is the recipient's lightning provider (the signer), not the zapper. Resolve the sender from the embedded zap request the same way the thread's master note already does, so the picture on the left is the actual zapper. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01Cg8mHZDCfGmGAVDaeJxPFz --- .../amethyst/ui/note/MultiSetCompose.kt | 32 ++++++++++++------- .../amethyst/ui/note/NoteCompose.kt | 10 ++++++ 2 files changed, 30 insertions(+), 12 deletions(-) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/MultiSetCompose.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/MultiSetCompose.kt index 4a6c4afacf..16f954d257 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/MultiSetCompose.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/note/MultiSetCompose.kt @@ -87,8 +87,6 @@ import com.vitorpamplona.amethyst.ui.navigation.routes.Route import com.vitorpamplona.amethyst.ui.navigation.routes.authorRouteFor import com.vitorpamplona.amethyst.ui.navigation.routes.routeFor import com.vitorpamplona.amethyst.ui.note.elements.NoteDropDownMenu -import com.vitorpamplona.amethyst.ui.note.types.RenderLnZap -import com.vitorpamplona.amethyst.ui.note.types.RenderNutzap import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel import com.vitorpamplona.amethyst.ui.screen.loggedIn.notifications.CombinedZap import com.vitorpamplona.amethyst.ui.screen.loggedIn.notifications.MultiSetCard @@ -185,29 +183,39 @@ fun MultiSetCompose( }, onLongClick = { popupExpanded.value = true }, ).padding( - start = 12.dp, - end = 12.dp, - top = 10.dp, - bottom = if (isLargeCard) 10.dp else 0.dp, + // The large-card branch renders through NoteCompose, which applies + // its own 12dp/10dp note padding; let it own the inset there so we + // don't double it up. The gallery branch keeps the card's padding. + start = if (isLargeCard) 0.dp else 12.dp, + end = if (isLargeCard) 0.dp else 12.dp, + top = if (isLargeCard) 0.dp else 10.dp, + bottom = 0.dp, ) } Column(modifier = columnModifier) { when { + // Render the lone zap/nutzap as a full note (author picture on the left, + // the zap card as its body) by reusing NoteCompose on the receipt note, + // instead of dropping the bare activity card into the feed. singleZap != null -> - RenderLnZap( - note = singleZap.response, + NoteCompose( + baseNote = singleZap.response, + routeForLastRead = null, + isHiddenFeed = showHidden, quotesLeft = 1, - backgroundColor = backgroundColor, + parentBackgroundColor = backgroundColor, accountViewModel = accountViewModel, nav = nav, ) singleNutzap != null -> - RenderNutzap( - note = singleNutzap, + NoteCompose( + baseNote = singleNutzap, + routeForLastRead = null, + isHiddenFeed = showHidden, quotesLeft = 1, - backgroundColor = backgroundColor, + parentBackgroundColor = backgroundColor, accountViewModel = accountViewModel, nav = nav, ) 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 1579dae613..b618a75605 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 @@ -2010,6 +2010,16 @@ fun RenderAuthorImages( } else { NoteAuthorPicture(baseNote, Size55dp, accountViewModel = accountViewModel, nav = nav) } + } else if (noteEvent is LnZapEvent) { + // Zap receipts are signed by the recipient's lightning provider; show the + // sender from the embedded zap request instead of the service key, matching + // how the thread's master note resolves the author. + val zapSender = observeZapSender(baseNote, accountViewModel).value + if (zapSender != null) { + UserPicture(zapSender, Size55dp, accountViewModel = accountViewModel, nav = nav) + } else { + NoteAuthorPicture(baseNote, Size55dp, accountViewModel = accountViewModel, nav = nav) + } } else { NoteAuthorPicture(baseNote, Size55dp, accountViewModel = accountViewModel, nav = nav) }