Skip to content

Update design of the poll results screen#6202

Merged
gpunto merged 2 commits intov7from
redesign/poll-results
Mar 4, 2026
Merged

Update design of the poll results screen#6202
gpunto merged 2 commits intov7from
redesign/poll-results

Conversation

@gpunto
Copy link
Contributor

@gpunto gpunto commented Mar 3, 2026

Goal

Update design of the poll results screen

Implementation

  • Update PollViewResultDialog to match the Figma specs
  • Extract PollResultSection composable for the shared rounded card background
  • Add headingExtraSmall typography style and fontWeightMedium token
  • Keep options in their original order instead of sorting by vote count

🎨 UI Changes

Before After
Screenshot_20260303_123834 Screenshot_20260303_123253

Testing

Can be checked in the sample for any poll

Summary by CodeRabbit

  • New Features

    • Added new heading typography style and medium font weight option
    • Introduced total votes display in poll results dialog
  • Improvements

    • Redesigned poll results dialog with enhanced layout and visual hierarchy
    • Updated poll winner indicator icon design
    • Enhanced poll vote item styling with avatar borders
    • Improved text formatting and spacing across poll components
  • Bug Fixes

    • Poll options now display in original order

@gpunto gpunto added the pr:improvement Improvement label Mar 3, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 3, 2026

PR checklist ✅

All required conditions are satisfied:

  • Title length is OK (or ignored by label).
  • At least one pr: label exists.
  • Sections ### Goal, ### Implementation, and ### Testing are filled.

🎉 Great job! This PR is ready for review.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 3, 2026

SDK Size Comparison 📏

SDK Before After Difference Status
stream-chat-android-client 5.25 MB 5.69 MB 0.44 MB 🟡
stream-chat-android-ui-components 10.60 MB 10.97 MB 0.37 MB 🟡
stream-chat-android-compose 12.81 MB 11.96 MB -0.85 MB 🚀

@gpunto gpunto force-pushed the redesign/poll-results branch 3 times, most recently from 6c2bb81 to 1ba4fe2 Compare March 3, 2026 13:00
@gpunto gpunto marked this pull request as ready for review March 3, 2026 14:28
@gpunto gpunto requested a review from a team as a code owner March 3, 2026 14:28
@coderabbitai
Copy link

coderabbitai bot commented Mar 3, 2026

Walkthrough

This pull request introduces typography enhancements and refactors poll-related UI components within the Stream Chat Android Compose library. Key changes include adding a new headingExtraSmall TextStyle to the design system, restructuring the poll results dialog layout, updating poll icons and resources, removing vote-count-based sorting of poll options, and improving visual styling of poll-related components with token-based spacing and updated avatar rendering.

Changes

Cohort / File(s) Summary
Poll UI Components
stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/poll/PollViewResultDialog.kt, PollVoteItem.kt, PollDialogHeader.kt, PollOptionVotesDialog.kt
Refactored PollViewResultDialog from LazyColumn to Column-based layout with total votes display; introduced PollResultSection, PollResultOptionInfo, and PollViewResultItemFooter components; replaced TextButton with StreamTextButton; updated avatar rendering with borders and circular styling; replaced padding with token-based spacing (StreamTokens); updated icon from award to trophy.
Theme and Design System
stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/StreamDesign.kt, StreamTokens.kt, stream-chat-android-compose/api/stream-chat-android-compose.api
Added new headingExtraSmall TextStyle to Typography data class; expanded Typography constructor signature from 12 to 13 TextStyle parameters; added fontWeightMedium token to StreamTokens; updated API signatures including component13 accessor and copy method.
Poll Resources
stream-chat-android-compose/src/main/res/drawable/stream_compose_ic_trophy.xml, stream-chat-android-compose/src/main/res/values/strings.xml
Updated trophy icon drawable with new pathData using stroke-based rendering; added new string resources for poll UI (total vote counts plurals, question label, option label, view more action).
Poll Business Logic
stream-chat-android-ui-common/src/main/kotlin/io/getstream/chat/android/ui/common/feature/messages/poll/PollResultsViewController.kt, PollResultsViewControllerTest.kt
Removed sorting of poll options by vote count; options now display in original poll order; updated test assertions to reflect new ordering expectations.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • Update polls to the new design #6155: Overlapping changes to poll UI components including PollViewResultDialog, PollOptionVotesDialog, and poll-related resources within the same feature area.

Suggested reviewers

  • VelikovPetar

Poem

🐰 A trophy gleams where votes align,
No sorting needed, polls now shine!
With spacing tokens, borders round,
The poll results are homeward bound! 🏆

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 7.14% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Update design of the poll results screen' accurately describes the main purpose of the changeset, which involves redesigning the poll results UI component.
Description check ✅ Passed The PR description includes Goal, Implementation, UI Changes with before/after screenshots, and Testing sections, covering all major required sections from the template.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch redesign/poll-results

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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$d over %d to 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 local 2.dp with 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 run verifyPaparazziDebug.

🤖 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.

📥 Commits

Reviewing files that changed from the base of the PR and between 3e696eb and 1ba4fe2.

⛔ 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.png is excluded by !**/*.png
  • stream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.components.poll_PollMoreOptionsDialogTest_light_mode.png is excluded by !**/*.png
  • stream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.components.poll_PollOptionVotesDialogTest_content_in_dark_mode.png is excluded by !**/*.png
  • stream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.components.poll_PollOptionVotesDialogTest_content_in_light_mode.png is excluded by !**/*.png
  • stream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.components.poll_PollOptionVotesDialogTest_loading_in_dark_mode.png is excluded by !**/*.png
  • stream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.components.poll_PollOptionVotesDialogTest_loading_in_light_mode.png is excluded by !**/*.png
  • stream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.components.poll_PollOptionVotesDialogTest_loading_more_in_dark_mode.png is excluded by !**/*.png
  • stream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.components.poll_PollOptionVotesDialogTest_loading_more_in_light_mode.png is excluded by !**/*.png
  • stream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.components.poll_PollViewResultDialogTest_dark_mode.png is excluded by !**/*.png
  • stream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.components.poll_PollViewResultDialogTest_light_mode.png is excluded by !**/*.png
📒 Files selected for processing (11)
  • stream-chat-android-compose/api/stream-chat-android-compose.api
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/poll/PollDialogHeader.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/poll/PollOptionVotesDialog.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/poll/PollViewResultDialog.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/poll/PollVoteItem.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/StreamDesign.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/StreamTokens.kt
  • stream-chat-android-compose/src/main/res/drawable/stream_compose_ic_trophy.xml
  • stream-chat-android-compose/src/main/res/values/strings.xml
  • stream-chat-android-ui-common/src/main/kotlin/io/getstream/chat/android/ui/common/feature/messages/poll/PollResultsViewController.kt
  • stream-chat-android-ui-common/src/test/kotlin/io/getstream/chat/android/ui/common/feature/messages/poll/PollResultsViewControllerTest.kt

@gpunto gpunto force-pushed the redesign/poll-results branch from 29d5b41 to ec8e2d0 Compare March 4, 2026 08:46
@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 4, 2026

@gpunto gpunto enabled auto-merge (squash) March 4, 2026 09:19
@gpunto gpunto merged commit 4d62321 into v7 Mar 4, 2026
15 checks passed
@gpunto gpunto deleted the redesign/poll-results branch March 4, 2026 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:improvement Improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants