compose: Show poll option text in full and align option layout with the design#6559
Conversation
Remove the 2-line cap on poll option text so long options render in full, matching iOS. Top-align the option row content (radio, voter avatars, vote count) to the first line and keep a consistent gap from the option text to the progress bar regardless of how many lines the option wraps to.
Give each poll option a rounded, 8dp-padded tap frame with a Material ripple, replacing the flat state overlay that came from the fallback indication. Tighten the spacing between options and align the options group to the design's 8dp inset with a 2dp gap, in both the message bubble and the more-options sheet. Reserve the voter-avatar height for the votes area on non-anonymous polls so an option with a voter avatar keeps the same height as one without.
Move the 8dp gap between the option text and the votes area onto the row so it applies whether or not the option has voter avatars. Previously the gap only came from the avatar padding, so an option without avatars had its vote count flush against the text.
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
|
@CodeRabbit review |
✅ Action performedReview finished.
|
|
WalkthroughThis PR refines poll-related Compose UI. It introduces a shared ChangesPoll UI Spacing and Interaction Refinements
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related PRs
Suggested labels: Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/messages/PollMessageContent.kt (1)
296-304: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueConsider placing
modifieras the first parameter inPollButtons.Compose convention recommends the
modifierparameter be the first parameter (or at least the first with a default) for consistency across the codebase. The publicPollMessageContentalready follows this convention. SincePollButtonsis called with named arguments, movingmodifierto the first position is safe.♻️ Optional refactor
private fun PollButtons( + modifier: Modifier = Modifier, poll: Poll, style: PollStyle, selectPoll: (Message, Poll, PollSelectionType) -> Unit, message: Message, showDialog: MutableState<Boolean>, showAddAnswerDialog: MutableState<Boolean>, isMine: Boolean, onClosePoll: (String) -> Unit, - modifier: Modifier = Modifier, ) {🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/messages/PollMessageContent.kt` around lines 296 - 304, Move the `modifier` parameter to the first position in `PollButtons` to match Compose conventions and the existing `PollMessageContent` signature. Update the `PollButtons` function declaration so `modifier` is the leading default parameter, and keep its call sites working with named arguments without changing behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In
`@stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/messages/PollMessageContent.kt`:
- Around line 296-304: Move the `modifier` parameter to the first position in
`PollButtons` to match Compose conventions and the existing `PollMessageContent`
signature. Update the `PollButtons` function declaration so `modifier` is the
leading default parameter, and keep its call sites working with named arguments
without changing behavior.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: fbc2a034-2072-4ec1-b1a9-b36cfde6943a
⛔ Files ignored due to path filters (7)
stream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.components.messages_PollMessageContentTest_poll_content.pngis excluded by!**/*.pngstream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.components.messages_PollMessageContentTest_poll_content_with_long_option_text.pngis excluded by!**/*.pngstream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.components.messages_PollMessageContentTest_poll_content_with_mixed_vote_states.pngis excluded by!**/*.pngstream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.components.poll_PollMoreOptionsDialogTest_more_options.pngis excluded by!**/*.pngstream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.components.poll_PollMoreOptionsDialogTest_more_options_in_dark_mode.pngis excluded by!**/*.pngstream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.messages_MessageListTest_loaded_messages.pngis excluded by!**/*.pngstream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.messages_MessageListTest_loaded_messages_in_dark_mode.pngis excluded by!**/*.png
📒 Files selected for processing (5)
stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/avatar/AvatarStack.ktstream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/messages/PollMessageContent.ktstream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/poll/PollMoreOptionsDialog.ktstream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/poll/PollOptionVotingRow.ktstream-chat-android-compose/src/test/kotlin/io/getstream/chat/android/compose/ui/components/messages/PollMessageContentTest.kt
SDK Size Comparison 📏
|
|
🚀 Available in v7.6.0 |



Goal
In the Compose SDK, long poll option text in the message bubble was truncated to 2 lines with an ellipsis. On iOS the full text is shown, so this was a parity gap. This change shows the full option text and, while on the same option row, aligns the layout with the design spec.
Resolves AND-1274
Implementation
maxLines = 2/TextOverflow.Ellipsison the option text so it renders in full.items-start. ALineHeightStylewithTrim.Nonekeeps the gap from the text to the progress bar consistent for one-line and multi-line options.clip+combinedClickable(indication = ripple())), replacing the flat state overlay that came from the fallback indication. An 8dp padding makes the ripple wrap the whole option (radio, text, votes, progress bar).PollMessageContent) and the more-options sheet (PollMoreOptionsDialog).avatarSize + AvatarStackBorderSize) for the votes area on non-anonymous polls, so an option with a voter avatar keeps the same height as one without.🎨 UI Changes
Visual changes on the poll message and the more-options sheet:
Before and after are captured in the updated Paparazzi snapshots in this PR (
PollMessageContentTest,PollMoreOptionsDialogTest,MessageListTest).Testing
Summary by CodeRabbit
New Features
Bug Fixes