feat(zap): render zap messages as mini-posts in the engagement drawer#559
Merged
Conversation
…] on top banner
Two surfaces render zap-receipt messages, each with a different
treatment to suit its constraints.
Engagement-drawer zap row (mini-post)
- Now renders the message through the same `RichContent` pipeline a
regular post body uses. Body text, plain links, hashtags, profile
/ note mentions, and inline images all render the way they would
in a feed post. The row grows vertically rather than truncating —
long zapvertising payloads stay readable.
- Layout: avatar (top-aligned, 30dp) + right-side column (display
name + private icon + bolt + sats on top; RichContent body below).
- `eventRepo` is plumbed from `ReactionDetailsSection` into `ZapRow`
so RichContent can resolve profile mentions.
Top-zap banner above the action bar
- Single-line preview. Image URLs collapse to the literal token
`[image]` (helpers in `ui/util/ZapMessageImage.kt`) so the sats
amount stays visible. Surrounding text is preserved
("nice post [image]"). No image is loaded in the banner — the
drawer handles that.
Cross-platform: `ZAP_IMAGE_PARITY.md` documents the contract — banner
uses URL-collapse, drawer uses the full post-body renderer; iOS port
checklist + visual test included.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Zap messages used to render as a single truncated line in the
engagement drawer and a raw URL on the top-zap banner. That worked
for short "thanks!" zaps but mangled longer messages — anything with
body text + a link + an image got chopped to `...tes…` and the
content was lost.
This PR treats the two surfaces differently to suit their constraints:
display name + private icon + bolt + sats in a header row, then
the message body renders through the same `RichContent` pipeline a
regular kind-1 post body uses. Inline images, hashtags, profile /
note mentions, plain links with OG preview cards, all rendered the
same as in the feed. Body is not truncated; row grows vertically.
preview. Image URLs collapse to the literal `[image]` token via a
small `ZapMessageImage` helper so the sats amount stays visible.
contract for the iOS agent — banner uses the URL-collapse helper,
drawer delegates to the iOS post-body renderer.
`eventRepo` is plumbed from `ReactionDetailsSection` into `ZapRow` so
the rich-content pipeline can resolve profile mentions / quoted
notes from cache.
Test plan
single-line text below the header (no body wrap, no card).
shows the body, with an OG preview card for nostr.com below.
— drawer row body renders the inline image; top-zap banner
shows `[image]`.
image; top-zap banner shows `text [image]` (or
`[image] text`).
nothing is truncated; sats amount stays visible in the header.
still opens.
zapper's profile.
as a quoted note card inside the zap row.