-
Notifications
You must be signed in to change notification settings - Fork 370
fix(ui): constrain StreamMessageInput height when no constraint is given #2307
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
Conversation
When `StreamMessageInput` is used in an unconstrained environment, it tries to expand to fill all available vertical space. This change wraps the internal message input in a `Center` widget with `heightFactor: 1` to constrain its height.
WalkthroughA new entry was added to the changelog for the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant StreamMessageInput
participant CenterWidget
User->>StreamMessageInput: Uses StreamMessageInput in UI
StreamMessageInput->>CenterWidget: Builds child with heightFactor: 1
CenterWidget-->>StreamMessageInput: Sizes child without expanding to full height
StreamMessageInput-->>User: Renders correctly in unconstrained environment
Assessment against linked issues
Suggested reviewers
Poem
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 (
|
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: 0
🧹 Nitpick comments (2)
packages/stream_chat_flutter/CHANGELOG.md (1)
5-5
: Fix article & improve wording for clarityCurrent phrasing is grammatically off (“a unconstrained”) and a bit clunky.
Consider:- - Fixed `StreamMessageInput` tries to expand to full height when used in a unconstrained environment. + - Fixed issue where `StreamMessageInput` tried to expand to full height when used in an unconstrained environment.packages/stream_chat_flutter/lib/src/message_input/stream_message_input.dart (1)
665-667
: Height constraint fix looks good – consider also settingwidthFactor
for symmetry
heightFactor: 1
correctly prevents the input from stretching vertically in an unconstrained environment.For visual consistency (e.g., if this widget ever sits inside a
Row
with unconstrained horizontal space), you might want to setwidthFactor: 1
as well so theCenter
keeps both axes tied to the child’s size.- child: Center(heightFactor: 1, child: messageInput), + child: Center( + heightFactor: 1, + widthFactor: 1, // keeps horizontal sizing consistent + child: messageInput, + ),Purely optional – no functional issues with the current change.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
packages/stream_chat_flutter/CHANGELOG.md
(1 hunks)packages/stream_chat_flutter/lib/src/message_input/stream_message_input.dart
(1 hunks)
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2307 +/- ##
=======================================
Coverage 63.50% 63.50%
=======================================
Files 409 409
Lines 25584 25584
=======================================
Hits 16247 16247
Misses 9337 9337 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Submit a pull request
Linear: FLU-200
Description of the pull request
When
StreamMessageInput
is used in an unconstrained environment, it tries to expand to fill all available vertical space. This change wraps the internal message input in aCenter
widget withheightFactor: 1
to constrain its height.Screenshots / Videos
Summary by CodeRabbit