Skip to content

[AND-448] Fix MessageItem not respecting messageItemMaxWidth. #5722

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 11, 2025

Conversation

VelikovPetar
Copy link
Contributor

🎯 Goal

The ChatTheme.dimens.messageItemMaxWidth wasn't being respected for values larger than 300dp due to a fixed widthIn(max = 300.dp) modifier on the parent component. With this PR, the limit is removed, and we ensure that the ChatTheme.dimens.messageItemMaxWidth is respected (if it would fit in the screen)

🛠 Implementation details

  • Remove fixed widthIn(max = 300.dp) modifier
  • Ensure the message bubble takes up as much possible space as needed, but not more than the instructed value

🎨 UI Changes

messageItemMaxWidth Before After
250dp (default) before-250 after-250
300dp before-300 after-300
400dp before-400 after-400
500dp before-500 after-500

🧪 Testing

  1. Set ChatTheme.dimens.messageItemMaxWidth to a specific value
  2. Run Compose sample
  3. The message bubble show respect the new maxWidth (if possible)

Copy link
Contributor

github-actions bot commented Apr 9, 2025

SDK Size Comparison 📏

SDK Before After Difference Status
stream-chat-android-client 3.16 MB 3.16 MB 0.00 MB 🟢
stream-chat-android-offline 3.38 MB 3.38 MB 0.00 MB 🟢
stream-chat-android-ui-components 7.89 MB 7.89 MB 0.00 MB 🟢
stream-chat-android-compose 9.94 MB 9.94 MB 0.00 MB 🟢

@VelikovPetar VelikovPetar marked this pull request as ready for review April 9, 2025 17:17
@VelikovPetar VelikovPetar requested a review from a team as a code owner April 9, 2025 17:17
@VelikovPetar VelikovPetar merged commit 6df56f5 into develop Apr 11, 2025
14 checks passed
@VelikovPetar VelikovPetar deleted the bug/fix-mesage-item-not-respecting-max-width branch April 11, 2025 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants