Skip to content

Apply option text limit to suggest poll option dialog#6446

Open
gpunto wants to merge 1 commit into
v6from
v6-xml-poll-suggest-option-limit
Open

Apply option text limit to suggest poll option dialog#6446
gpunto wants to merge 1 commit into
v6from
v6-xml-poll-suggest-option-limit

Conversation

@gpunto
Copy link
Copy Markdown
Contributor

@gpunto gpunto commented May 19, 2026

Goal

Apply PollsConfig.optionTextLimit to the "Suggest an option" dialog so the configured character limit is enforced there too, not only inside CreatePollDialogFragment.

Implementation

SuggestPollOptionDialogFragment now installs an InputFilter.LengthFilter on the option input when ChatUI.pollsConfig.optionTextLimit is set and positive.

Testing

  • With ChatUI.pollsConfig = PollsConfig(optionTextLimit = 10), open a poll that allows suggesting options, tap "Suggest an option", and verify the input cannot exceed 10 characters.
  • With ChatUI.pollsConfig left at its default (optionTextLimit = null), verify the input accepts arbitrarily long text as before.

Summary by CodeRabbit

  • Bug Fixes
    • Poll option input field now enforces a maximum character limit.

Review Change Stack

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 19, 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 (or ignored for dependabot PRs).

🎉 Great job! This PR is ready for review.

@gpunto gpunto added the pr:improvement Improvement label May 19, 2026
@gpunto gpunto changed the title Apply optionTextLimit to suggest poll option dialog Apply option text limit to suggest poll option dialog May 19, 2026
@github-actions
Copy link
Copy Markdown
Contributor

SDK Size Comparison 📏

SDK Before After Difference Status
stream-chat-android-client 5.26 MB 5.26 MB 0.00 MB 🟢
stream-chat-android-offline 5.49 MB 5.49 MB 0.00 MB 🟢
stream-chat-android-ui-components 10.64 MB 10.66 MB 0.01 MB 🟢
stream-chat-android-compose 12.87 MB 12.87 MB 0.00 MB 🟢

@sonarqubecloud
Copy link
Copy Markdown

@gpunto gpunto marked this pull request as ready for review May 19, 2026 14:44
@gpunto gpunto requested a review from a team as a code owner May 19, 2026 14:44
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 19, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 45b98867-9f65-404f-a86a-5f1ed6f4af66

📥 Commits

Reviewing files that changed from the base of the PR and between d404872 and 25bc2f4.

📒 Files selected for processing (1)
  • stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/feature/messages/list/internal/poll/SuggestPollOptionDialogFragment.kt

Walkthrough

This PR adds input length validation to the poll option suggestion dialog. It imports InputFilter and applies a LengthFilter to the text input field based on the configured maximum option text length from ChatUI.pollsConfig.

Changes

Poll Option Input Validation

Layer / File(s) Summary
Poll option length filter enforcement
stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/feature/messages/list/internal/poll/SuggestPollOptionDialogFragment.kt
Adds InputFilter import and conditionally applies InputFilter.LengthFilter to binding.optionInput when ChatUI.pollsConfig.optionTextLimit is non-null and positive.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5 minutes

Possibly related PRs

Suggested reviewers

  • andremion

Poem

🐰 A hop, a filter, a text field refined,
Poll options now bounded, by length intertwined,
Config whispers limits, the keyboard obeys,
No rambling suggestions—just sensible ways! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and accurately describes the main change: applying the option text limit to the suggest poll option dialog.
Description check ✅ Passed The PR description covers Goal and Implementation sections well. Testing section is present with specific test cases. However, UI Changes and Contributor/Reviewer Checklists are missing from the template.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch v6-xml-poll-suggest-option-limit

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.

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.

1 participant