From 5d1242018c1f5e469f7b60ecd8fec6ed07bed929 Mon Sep 17 00:00:00 2001 From: Vadim Volkov Date: Thu, 26 Mar 2026 17:14:56 +0000 Subject: [PATCH] fix(viewer): display caption for album posts with grouped messages Albums group multiple messages by grouped_id, but only one message carries the caption text. With reverse-chronological sorting, the displayed "first" message may not be the one with the caption, causing it to be lost. Add getAlbumCaption() to scan all messages in the album group and find the one with non-empty text. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/web/templates/index.html | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/web/templates/index.html b/src/web/templates/index.html index 369f138..64e9076 100644 --- a/src/web/templates/index.html +++ b/src/web/templates/index.html @@ -1047,9 +1047,9 @@

{{ getChatName(selectedChat) - +
+ v-html="linkifyText(getAlbumCaption(msg) || msg.text)">
@@ -2538,6 +2538,16 @@

Create Share Token

} } + // For album messages, find the caption from any message in the group + const getAlbumCaption = (msg) => { + const groupedId = getGroupedId(msg) + if (!groupedId) return null + const album = getAlbumForMessage(msg) + if (!album) return null + const captionMsg = album.find(m => m.text && m.text.trim() !== '') + return captionMsg ? captionMsg.text : null + } + const isGroup = computed(() => { return selectedChat.value && (selectedChat.value.type === 'group' || selectedChat.value.type === 'channel') }) @@ -3648,6 +3658,7 @@

Create Share Token

isFirstInAlbum, isHiddenAlbumMessage, getAlbumGridClass, + getAlbumCaption, getChatName, getInitials, formatDate,