Skip to content

refactor(ui): redesign and modernize poll creator components#2611

Merged
xsahil03x merged 12 commits intov10.0.0from
refactor/create-poll-redesign
Apr 16, 2026
Merged

refactor(ui): redesign and modernize poll creator components#2611
xsahil03x merged 12 commits intov10.0.0from
refactor/create-poll-redesign

Conversation

@xsahil03x
Copy link
Copy Markdown
Member

Description of the pull request

  • Replace PollSwitchListTile and PollSwitchTextField with PollConfigOption for a card-style configuration UI.
  • Redesign PollOptionListItem to support both existing options and a dedicated "add option" button variant.
  • Integrate StreamStepper for managing maximum votes per person.
  • Replace custom StreamPollTextField with the standard StreamTextInput from stream_core_flutter.
  • Update StreamPollCreatorThemeData to use modernized sub-styles (StreamPollConfigOptionStyle, StreamButtonThemeStyle, and StreamTextInputStyle).
  • Improve poll option validation logic to handle duplicates and empty states more effectively.
  • Refresh AlertDialog styles within the poll creator to align with the new design language.
  • Update tests to reflect UI component changes and new finding logic.

Screenshots / Videos

Before After
Screenshot 2026-04-10 at 13 30 39 simulator_screenshot_8A6A46EE-32DF-4FEB-A0F6-936F258FB925

* Replace `PollSwitchListTile` and `PollSwitchTextField` with `PollConfigOption` for a card-style configuration UI.
* Redesign `PollOptionListItem` to support both existing options and a dedicated "add option" button variant.
* Integrate `StreamStepper` for managing maximum votes per person.
* Replace custom `StreamPollTextField` with the standard `StreamTextInput` from `stream_core_flutter`.
* Update `StreamPollCreatorThemeData` to use modernized sub-styles (`StreamPollConfigOptionStyle`, `StreamButtonThemeStyle`, and `StreamTextInputStyle`).
* Improve poll option validation logic to handle duplicates and empty states more effectively.
* Refresh `AlertDialog` styles within the poll creator to align with the new design language.
* Update tests to reflect UI component changes and new finding logic.

Note: Temporary dependency path update for `stream_core_flutter` in `melos.yaml` and `pubspec.yaml`.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 10, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: fa107e0a-0263-43d0-9f01-96700d732c01

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/create-poll-redesign

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.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 13, 2026

Codecov Report

❌ Patch coverage is 94.16667% with 14 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (v10.0.0@0f532ff). Learn more about missing BASE report.

Files with missing lines Patch % Lines
...oll/creator/poll_option_reorderable_list_view.dart 93.47% 6 Missing ⚠️
...chat_flutter/lib/src/theme/poll_creator_theme.dart 42.85% 4 Missing ⚠️
...b/src/poll/creator/stream_poll_creator_dialog.dart 90.32% 3 Missing ⚠️
...b/src/poll/creator/stream_poll_creator_widget.dart 96.29% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             v10.0.0    #2611   +/-   ##
==========================================
  Coverage           ?   65.65%           
==========================================
  Files              ?      426           
  Lines              ?    26066           
  Branches           ?        0           
==========================================
  Hits               ?    17114           
  Misses             ?     8952           
  Partials           ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

///
/// If `null`, the button is disabled.
/// Only used by the [addOption] constructor.
final VoidCallback? onPressed;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would rename this to onAddOptionPressed to make it clear it's not for pressing on a regular option.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done


final spacing = context.streamSpacing;

final effectiveTitleStyle = theme.headerTextStyle ?? defaults.headerTextStyle;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would call this effectiveHeaderStyle

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done

const SizedBox(height: 32),
PollSwitchListTile(
SizedBox(height: spacing.xxl),
PollConfigOption(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

These default options, is that something we want to make configurable?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

not really, they already are options right now and disabled by default.

xsahil03x and others added 3 commits April 16, 2026 15:39
…ll-redesign

# Conflicts:
#	packages/stream_chat_flutter/lib/src/poll/creator/poll_option_reorderable_list_view.dart
#	packages/stream_chat_flutter/lib/src/poll/creator/stream_poll_creator_dialog.dart
#	packages/stream_chat_flutter/test/src/poll/creator/poll_option_reorderable_list_view_test.dart
@xsahil03x xsahil03x merged commit 9a1d8a4 into v10.0.0 Apr 16, 2026
9 checks passed
@xsahil03x xsahil03x deleted the refactor/create-poll-redesign branch April 16, 2026 14:05
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