-
Notifications
You must be signed in to change notification settings - Fork 369
feat(ui): add bottom and bottomOpacity to ChannelHeader #2318
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): add bottom and bottomOpacity to ChannelHeader #2318
Conversation
WalkthroughThe Changes
Sequence Diagram(s)sequenceDiagram
participant App
participant StreamChannelHeader
participant BottomWidget
App->>StreamChannelHeader: Create with bottom widget and bottomOpacity
StreamChannelHeader->>BottomWidget: Render as bottom (if provided)
StreamChannelHeader->>App: Display header with optional bottom
Estimated code review effort🎯 2 (Simple) | ⏱️ ~7 minutes Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. ✨ 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 (
|
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/lib/src/channel/channel_header.dart
(4 hunks)
🔇 Additional comments (4)
packages/stream_chat_flutter/lib/src/channel/channel_header.dart (4)
69-69
: LGTM! Constructor parameter follows Flutter conventions.The
bottom
parameter addition is well-placed and consistent with the existing parameter structure.
72-72
: LGTM! Appropriate default value for bottomOpacity.The default value of 1 matches AppBar's default behavior and maintains consistency with similar numeric properties.
111-112
: LGTM! Proper field declaration with appropriate documentation.The field uses the correct type
PreferredSizeWidget?
that matches AppBar's bottom property, and the documentation is clear and concise.
125-126
: LGTM! Proper field declaration with clear documentation.The field uses the correct
double
type and provides clear documentation about controlling the bottom widget's opacity.
ca87004
to
52f51e5
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2318 +/- ##
=======================================
Coverage 63.65% 63.66%
=======================================
Files 409 409
Lines 25609 25614 +5
=======================================
+ Hits 16301 16306 +5
Misses 9308 9308 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Hey @dballance , Thank you for the contribution. Can you also add some golden tests for these features and update the changelog entry? Thanks |
@xsahil03x been traveling - trying to get this accomplished. How exactly can I go about running goldens? Seems locally (macos) all the CI goldens fail in my environment. Further, it's trying to run MacOS variants and failing as well. |
Hey @dballance , you can use |
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 (1)
packages/stream_chat_flutter/test/src/channel/channel_header_test.dart (1)
481-548
: Well-structured golden test for the bottom widget functionality.The test implementation follows established patterns and properly covers the visual rendering of the new
bottom
property. The mock setup is comprehensive and the test constraints are appropriate.However, consider adding a companion test for the
bottomOpacity
property to ensure complete coverage of both new features mentioned in the PR objectives.goldenTest( 'golden test for StreamChannelHeader with bottom widget and opacity', fileName: 'channel_header_bottom_widget_opacity', constraints: const BoxConstraints.tightFor(width: 300, height: 60), builder: () { // ... same mock setup ... return MaterialAppWrapper( home: StreamChat( client: client, connectivityStream: Stream.value([ConnectivityResult.wifi]), child: StreamChannel( channel: channel, child: const Scaffold( body: StreamChannelHeader( bottom: PreferredSize( preferredSize: Size.fromHeight(1), child: Divider(height: 1, color: Colors.red), ), bottomOpacity: 0.5, // Test the opacity functionality ), ), ), ), ); }, );
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
packages/stream_chat_flutter/test/src/channel/goldens/ci/channel_header_bottom_widget.png
is excluded by!**/*.png
📒 Files selected for processing (1)
packages/stream_chat_flutter/test/src/channel/channel_header_test.dart
(2 hunks)
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.
LGTM
CLA
Description of the pull request
Adds
bottom
andbottomOpacity
options toChannelHeader
to pass through toAppBar
Screenshots / Videos
N/A
Summary by CodeRabbit