-
Notifications
You must be signed in to change notification settings - Fork 368
feat(ui): allow further customization of StreamMessageInput padding #2328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(ui): allow further customization of StreamMessageInput padding #2328
Conversation
…on of StreamMessageInput
WalkthroughThis change introduces two new layout parameters, Changes
Sequence Diagram(s)sequenceDiagram
participant Test as Widget Test
participant Widget as StreamMessageInput
participant UI as UI Layout
Test->>Widget: Instantiate with custom padding/textInputMargin
Widget->>UI: Build with specified padding and margin
UI-->>Test: Rendered with expected layout
Estimated code review effort🎯 2 (Simple) | ⏱️ ~7 minutes Suggested reviewers
Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
✨ Finishing Touches🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2328 +/- ##
=======================================
Coverage 63.65% 63.65%
=======================================
Files 409 409
Lines 25617 25619 +2
=======================================
+ Hits 16306 16308 +2
Misses 9311 9311 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this 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
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
packages/stream_chat_flutter/CHANGELOG.md
(1 hunks)
🧰 Additional context used
🪛 LanguageTool
packages/stream_chat_flutter/CHANGELOG.md
[style] ~7-~7: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...e context access in async operations. - Added padding
and textFieldMargin
to `Str...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (11)
- GitHub Check: build (android)
- GitHub Check: format
- GitHub Check: analyze
- GitHub Check: build (ios)
- GitHub Check: test
- GitHub Check: analyze_legacy_versions
- GitHub Check: stream_chat_flutter_core
- GitHub Check: stream_chat_persistence
- GitHub Check: stream_chat_flutter
- GitHub Check: stream_chat_localizations
- GitHub Check: stream_chat
Updated changelog to fix naming conflict and remove from 9.15.0 (moved to Upcoming). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @dballance LGTM, can you just fix the field name in changelog? Thanks
Yeah - sorry about that. I thought I had it correct but got cross somewhere along the way. |
CLA
Description of the pull request
StreamMessageInput
currently contains some hard-coded padding (const EdgeInsets.all(8)
) and some fixed, non-configurable margins.This allows direct overriding of these paddings and margins so users can customize their inputs without unnecessary margin / padding.
Example code used to produce these screenshots (borders are transparent gradients):
With the updates here, I provided the below to produce the "after" shots
Note: Here is the current implementation for the margin calculation - which adds margin to the input anytime you use
SendButtonLocation.inside
or anyActionLocations
that isn'tActionLocationLeft
(or commands button is enabled).Certainly open to naming suggestions or even abstracting as some "TextInputEdgeInsets" that would contain both a
margin
andpadding
property. Could also be convinced that we should just vendor theStreamMessageInput
class here and make these changes ourselves, but seems like there may be a possibility to get this working in the shared lib.Screenshots / Videos
Here shows a top and bottom view of the before and after

I also attempted to drop
actionsLocation: ActionsLocation.leftInside
andsendButtonLocation: SendButtonLocation.inside
, which produced the below:Still not ideal, as there is extraneous margin around the text input.
Summary by CodeRabbit