Skip to content

[stable-25.0.x] fix(chat): fix media message sizing and align caption/bubble width to it - #6628

Merged
mahibi merged 1 commit into
stable-25.0.xfrom
backport/6616/stable-25.0.x
Sep 3, 2026
Merged

[stable-25.0.x] fix(chat): fix media message sizing and align caption/bubble width to it#6628
mahibi merged 1 commit into
stable-25.0.xfrom
backport/6616/stable-25.0.x

Conversation

@backportbot

@backportbot backportbot Bot commented Sep 3, 2026

Copy link
Copy Markdown

Backport of PR #6616

Fixes a cluster of related Compose layout bugs in single-media chat messages where the bubble's width, height, and caption wrapping didn't track the actual
rendered photo/video:

- Height cap for extreme aspect ratios: a very tall, narrow image used to render at full natural height, dwarfing the conversation. Height is now capped to a
fraction of the screen height, with both width and height scaled together (fittedMediaSize) so the container always matches the image's real aspect ratio —
avoiding the mismatched background/border that appeared when only height was capped.
- Minimum size floor: media is no longer allowed to shrink below a sensible minimum width/height.
- Bubble no longer wider than its media: the caption text, timestamp/read-receipt row, and quoted-reply header now size against the media's actual resolved width
(contentMinWidth, threaded down as an absolute Dp rather than a fraction guessed too early) instead of always filling the bubble — closing the gap that used to
appear next to narrow (e.g. portrait) images.
- Long captions wrap instead of stretching the bubble, but can grow past the media's width up to the bubble's own max width when the media is very thin, so a
caption isn't forced to wrap after almost every word.
- OverlayMetadataBadge fix: the timestamp pill overlaid on captionless photos was being counted by the Box's "widest child" sizing pass, letting it override the
media's own (narrower) width; it's now excluded via matchParentSize().
- Consistent aspect-ratio source: the width fraction used for the caption/quote rows now derives from the same aspect ratio actually used to render the media
(falling back to the loaded image's intrinsic ratio when the server doesn't report dimensions), instead of only the server-reported value, which could silently
disagree with what was on screen.

Assisted-by: Claude Code:claude-sonnet-5

Signed-off-by: Marcel Hibbe <[email protected]>
@backportbot
backportbot Bot requested a review from mahibi September 3, 2026 07:59
@backportbot backportbot Bot added 3. to review Waiting for reviews AI assisted labels Sep 3, 2026
@backportbot backportbot Bot added this to the 25.0.0 milestone Sep 3, 2026
@mahibi
mahibi merged commit aa2ab65 into stable-25.0.x Sep 3, 2026
10 of 15 checks passed
@mahibi
mahibi deleted the backport/6616/stable-25.0.x branch September 3, 2026 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews AI assisted

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant