fix(viewer): display caption for album posts with grouped messages#97
Merged
GeiserX merged 1 commit intoGeiserX:mainfrom Mar 26, 2026
Merged
Conversation
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) <noreply@anthropic.com>
GeiserX
approved these changes
Mar 26, 2026
Owner
GeiserX
left a comment
There was a problem hiding this comment.
Clean fix, correct use of existing album helpers. LGTM.
Owner
|
Thanks @vadimvolk! Released as v7.3.2 and deployed. |
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
grouped_id) lose their caption in the viewer when the message carrying the text is not the first one in reverse-chronological sort ordergetAlbumCaption()helper that scans all messages in an album group to find and display the one with non-empty textType of Change
Database Changes
scripts/Data Consistency Checklist
N/A — no database code modified.
Root Cause
Messages are sorted newest-first via
flex-col-reverse. For an album withgrouped_id = 14178103535648053:isHiddenAlbumMessage()isFirstInAlbum()picks id=1261 (newer, no caption) as the representative message. The template rendersmsg.textof that message — which is empty. The actual caption on id=1260 is never shown because that message is hidden.Additionally, without
getAlbumCaptionin the Vue return object, the template throwsTypeError: getAlbumCaption is not a function, crashing the entire Vue app and showing a blank blue page.Fix
Three changes in
src/web/templates/index.html:getAlbumCaption(msg)helper — scans all messages with the samegrouped_idand returns the first non-emptytextlinkifyText(msg.text)tolinkifyText(getAlbumCaption(msg) || msg.text)so albums show the caption regardless of sort ordergetAlbumCaptionso the template can call itSteps to Reproduce
grouped_id) where the caption is on a message that is not the newest in the groupTypeError: getAlbumCaption is not a function(blank blue page)SQL to verify data is present
Testing
python -m pytest tests/ -v) — 253 passed, 0 failed (Python 3.14.3)ruff check .)ruff format --check .)Security Checklist
Deployment Notes