android, desktop, ios: render media support messages in the chat list preview, not the status text

ChatPreviewView showed the status info text (e.g. a pending invitee's 'reviewed by admins')
whenever the last item's text was empty (hasMsgContent), which also caught caption-less media — so
a photo/voice/file support message showed the status text next to its already-rendered thumbnail.
Show the status only for true no-content items (events, msgContent == null); any message, including
caption-less media, falls through to render its content.
This commit is contained in:
Narasimha-sc
2026-07-20 13:31:05 +00:00
parent 1a2b05bfd8
commit c31aebca67
2 changed files with 8 additions and 2 deletions
@@ -352,7 +352,10 @@ struct ChatPreviewView: View {
if chatModel.draftChatId == chat.id, let draft = chatModel.draft {
let (t, hasSecrets) = messageDraft(draft)
chatPreviewLayout(t, draft: true, hasFilePreview: hasFilePreview, hasSecrets: hasSecrets)
} else if cItem?.content.hasMsgContent != true, let previewText = chatPreviewInfoText() {
} else if cItem?.content.msgContent == nil, let previewText = chatPreviewInfoText() {
// only a no-content item (a group/connection event) shows the status text; a message
// including caption-less media falls through to render its content (thumbnail shown
// separately), e.g. a pending invitee's photo shows "image" instead of "reviewed by admins"
chatPreviewInfoTextLayout(previewText)
} else if let cItem = cItem {
let (t, hasSecrets) = chatItemPreview(cItem)
@@ -246,7 +246,10 @@ fun ChatPreviewView(
inlineContent = inlineTextContent,
modifier = Modifier.fillMaxWidth()
)
} else if (ci?.content?.hasMsgContent != true && previewText != null) {
} else if (ci?.content?.msgContent == null && previewText != null) {
// only a no-content item (a group/connection event) shows the status text; a message —
// including caption-less media — falls through to render its content (the media thumbnail is
// shown separately), e.g. a pending invitee's photo shows "image" instead of "reviewed by admins"
Text(previewText.first, color = previewText.second)
} else if (ci != null && showChatPreviews) {
val (text: CharSequence, inlineTextContent) = when {