AddheaderContent and footerContent slots to Messages composable#6166
AddheaderContent and footerContent slots to Messages composable#6166VelikovPetar merged 5 commits intoGetStream:developfrom
headerContent and footerContent slots to Messages composable#6166Conversation
VelikovPetar
left a comment
There was a problem hiding this comment.
Before we can merge the PR, you will need to do couple of things:
- Run
./gradlew detekt- and fix any findings - Run
./gradlew apiDump spotlessApplyand commit the changes - to update the public.apibaseline - Ensure the PR description matches the pull request template
- Ensure the PR has the label
pr:new-feature - Make sure you have signed the Stream CLA
...android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/list/Messages.kt
Outdated
Show resolved
Hide resolved
...android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/list/Messages.kt
Outdated
Show resolved
Hide resolved
...android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/list/Messages.kt
Outdated
Show resolved
Hide resolved
...android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/list/Messages.kt
Outdated
Show resolved
Hide resolved
WalkthroughTwo new optional composable parameters, Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/list/Messages.kt (1)
177-181: Prefer idiomaticcontent()overcontent.invoke().Both invocation sites use the explicit
.invoke()form, which is unnecessarily verbose in Kotlin.♻️ Proposed fix
footerContent?.let { content -> item { - content.invoke() + content() } }headerContent?.let { content -> item { - content.invoke() + content() } }Also applies to: 215-219
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/list/Messages.kt` around lines 177 - 181, Replace explicit lambda invocation calls using .invoke() with idiomatic direct calls: change content.invoke() to content() for the footerContent lambda in Messages.kt (the footerContent?.let { content -> item { content.invoke() } } block) and likewise replace any other occurrences (e.g., the similar block around lines 215-219) so the lambda is invoked as content().
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In
`@stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/list/Messages.kt`:
- Around line 177-181: Replace explicit lambda invocation calls using .invoke()
with idiomatic direct calls: change content.invoke() to content() for the
footerContent lambda in Messages.kt (the footerContent?.let { content -> item {
content.invoke() } } block) and likewise replace any other occurrences (e.g.,
the similar block around lines 215-219) so the lambda is invoked as content().
headingContent and footerContent slots to MessagesheaderContent and footerContent slots to Messages
I resolved all these, except for the label one, which I'm not able to do because of permissions |
headerContent and footerContent slots to MessagesheaderContent and footerContent slots to Messages
headerContent and footerContent slots to MessagesheaderContent and footerContent slots to Messages composable
|
Awesome, thanks guys! |
|
Hey @tafelnl, |
|
🚀 Available in v6.33.0 |
Goal
The Messages component now supports optional header and footer content parameters for enhanced customization. Developers can add custom composable content at the top and bottom of the message list to display supplementary information, action controls, or additional UI elements, while maintaining full backward compatibility with existing implementations.
Resolves: https://linear.app/stream/issue/AND-1074
Implementation
Using the slots that are also used for similar composables.
Testing
This can be tested by providing this composables with the
headerContentandfooterContentparams.☑️Contributor Checklist
General
developbranchCode & documentation
☑️Reviewer Checklist