fix(chat): fix media message sizing and align caption/bubble width to it - #6616
Merged
Merged
Conversation
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]>
mahibi
force-pushed
the
bugfix/noid/improveMediaDimensionsAndPadding
branch
from
September 2, 2026 10:34
514f627 to
5c0c06a
Compare
mahibi
marked this pull request as ready for review
September 2, 2026 11:00
Collaborator
Author
|
/backport to stable-25.0.x |
|
The backport to # Switch to the target branch and update it
git checkout stable-25.0.x
git pull origin stable-25.0.x
# Create the new backport branch
git checkout -b backport/6616/stable-25.0.x
# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts, resolve them
git cherry-pick 5c0c06ae
# Push the cherry pick commit to the remote repository and open a pull request
git push origin backport/6616/stable-25.0.xError: Failed to clone repository: Failed to create working tree: fatal: remote error: GitHub is temporarily limiting some unauthenticated downloads to protect the stability of the platform. Please retry later or authenticate. Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports. |
Collaborator
Author
|
/backport to stable-25.0.x |
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.
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:
Assisted-by: Claude Code:claude-sonnet-5
🖼️ Screenshots
screenshots are a bit off but basically the PR fixes that photos with uncommon dimensions are well displayed instead to mess the messages view.
🏡 After
🏚️ Before
🚧 TODO
🏁 Checklist
/backport to stable-xx.x🤖 AI (if applicable)