Conversation
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
SDK Size Comparison 📏
|
6c2bb81 to
1ba4fe2
Compare
WalkthroughThis pull request introduces typography enhancements and refactors poll-related UI components within the Stream Chat Android Compose library. Key changes include adding a new Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). 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.
Actionable comments posted: 1
🧹 Nitpick comments (3)
stream-chat-android-compose/src/main/res/values/strings.xml (1)
328-328: Use positional formatting in the new option label string.On Line 328, prefer
%1$dover%dto make reordering easier for localization tooling/translators.🌐 Suggested tweak
- <string name="stream_compose_poll_option_label">Option %d</string> + <string name="stream_compose_poll_option_label">Option %1$d</string>🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@stream-chat-android-compose/src/main/res/values/strings.xml` at line 328, Update the string resource stream_compose_poll_option_label to use positional formatting so translators can reorder arguments; replace the placeholder "%d" with "%1$d" in the string value (i.e., change the value of stream_compose_poll_option_label from "Option %d" to "Option %1$d").stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/poll/PollVoteItem.kt (1)
42-42: Optional: replace local2.dpwith a spacing token.Line 42 introduces a magic value for border thickness. Using a token (for example
StreamTokens.spacing3xs) keeps spacing decisions centralized.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/poll/PollVoteItem.kt` at line 42, Replace the magic literal 2.dp used for border thickness by using the centralized spacing token (e.g., StreamTokens.spacing3xs) instead of local val borderSize = 2.dp in PollVoteItem.kt; update the declaration of borderSize to reference the token (ensuring the token's type matches expected Dp or convert appropriately) so spacing decisions stay centralized and consistent across the UI.stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/poll/PollViewResultDialog.kt (1)
145-193: Please add Paparazzi coverage for this redesigned results layout.This is a substantial Compose UI redesign; snapshot coverage will protect spacing/structure regressions across states (empty, winner, and view-more cases).
If you want, I can draft a Paparazzi test matrix for these states.
Based on learnings: Applies to /stream-chat-android-compose//*Test.kt : Add Paparazzi snapshots for Compose UI regressions and runverifyPaparazziDebug.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/poll/PollViewResultDialog.kt` around lines 145 - 193, Add Paparazzi snapshot tests for the redesigned PollViewResultDialog layout to cover empty state, winner state, and view-more state: create tests that compose PollViewResultDialog (or directly compose PollViewResultTitle + PollViewResultItem list) with controlled state.results and pollName, render with systemBarsPadding and full size, and capture snapshots to detect spacing/structure regressions; place tests under stream-chat-android-compose/**/*Test.kt, use Paparazzi to assert snapshots (run verifyPaparazziDebug) and include variants for different device sizes/densities if needed to exercise LazyColumn rendering and totalVotes footer.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/poll/PollViewResultDialog.kt`:
- Around line 259-265: The winner trophy icon currently has contentDescription =
null which hides the semantic meaning from accessibility services; update the
Icon in PollViewResultDialog (the branch checking item.isWinner) to provide a
meaningful contentDescription (e.g., a localized string resource like
R.string.stream_compose_poll_winner or a formatted string including option text)
so TalkBack announces the winner marker, and apply the exact same change to the
corresponding Icon in PollOptionVotesDialog to keep behavior consistent; ensure
you use the existing ChatTheme/localization approach used elsewhere for strings
rather than hardcoding text.
---
Nitpick comments:
In
`@stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/poll/PollViewResultDialog.kt`:
- Around line 145-193: Add Paparazzi snapshot tests for the redesigned
PollViewResultDialog layout to cover empty state, winner state, and view-more
state: create tests that compose PollViewResultDialog (or directly compose
PollViewResultTitle + PollViewResultItem list) with controlled state.results and
pollName, render with systemBarsPadding and full size, and capture snapshots to
detect spacing/structure regressions; place tests under
stream-chat-android-compose/**/*Test.kt, use Paparazzi to assert snapshots (run
verifyPaparazziDebug) and include variants for different device sizes/densities
if needed to exercise LazyColumn rendering and totalVotes footer.
In
`@stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/poll/PollVoteItem.kt`:
- Line 42: Replace the magic literal 2.dp used for border thickness by using the
centralized spacing token (e.g., StreamTokens.spacing3xs) instead of local val
borderSize = 2.dp in PollVoteItem.kt; update the declaration of borderSize to
reference the token (ensuring the token's type matches expected Dp or convert
appropriately) so spacing decisions stay centralized and consistent across the
UI.
In `@stream-chat-android-compose/src/main/res/values/strings.xml`:
- Line 328: Update the string resource stream_compose_poll_option_label to use
positional formatting so translators can reorder arguments; replace the
placeholder "%d" with "%1$d" in the string value (i.e., change the value of
stream_compose_poll_option_label from "Option %d" to "Option %1$d").
ℹ️ Review info
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (10)
stream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.components.poll_PollMoreOptionsDialogTest_dark_mode.pngis excluded by!**/*.pngstream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.components.poll_PollMoreOptionsDialogTest_light_mode.pngis excluded by!**/*.pngstream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.components.poll_PollOptionVotesDialogTest_content_in_dark_mode.pngis excluded by!**/*.pngstream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.components.poll_PollOptionVotesDialogTest_content_in_light_mode.pngis excluded by!**/*.pngstream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.components.poll_PollOptionVotesDialogTest_loading_in_dark_mode.pngis excluded by!**/*.pngstream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.components.poll_PollOptionVotesDialogTest_loading_in_light_mode.pngis excluded by!**/*.pngstream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.components.poll_PollOptionVotesDialogTest_loading_more_in_dark_mode.pngis excluded by!**/*.pngstream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.components.poll_PollOptionVotesDialogTest_loading_more_in_light_mode.pngis excluded by!**/*.pngstream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.components.poll_PollViewResultDialogTest_dark_mode.pngis excluded by!**/*.pngstream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.components.poll_PollViewResultDialogTest_light_mode.pngis excluded by!**/*.png
📒 Files selected for processing (11)
stream-chat-android-compose/api/stream-chat-android-compose.apistream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/poll/PollDialogHeader.ktstream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/poll/PollOptionVotesDialog.ktstream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/poll/PollViewResultDialog.ktstream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/poll/PollVoteItem.ktstream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/StreamDesign.ktstream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/StreamTokens.ktstream-chat-android-compose/src/main/res/drawable/stream_compose_ic_trophy.xmlstream-chat-android-compose/src/main/res/values/strings.xmlstream-chat-android-ui-common/src/main/kotlin/io/getstream/chat/android/ui/common/feature/messages/poll/PollResultsViewController.ktstream-chat-android-ui-common/src/test/kotlin/io/getstream/chat/android/ui/common/feature/messages/poll/PollResultsViewControllerTest.kt
...e/src/main/java/io/getstream/chat/android/compose/ui/components/poll/PollViewResultDialog.kt
Show resolved
Hide resolved
.../src/main/java/io/getstream/chat/android/compose/ui/components/poll/PollOptionVotesDialog.kt
Outdated
Show resolved
Hide resolved
29d5b41 to
ec8e2d0
Compare
|



Goal
Update design of the poll results screen
Implementation
PollViewResultDialogto match the Figma specsPollResultSectioncomposable for the shared rounded card backgroundheadingExtraSmalltypography style andfontWeightMediumtoken🎨 UI Changes
Testing
Can be checked in the sample for any poll
Summary by CodeRabbit
New Features
Improvements
Bug Fixes