Skip to content

AddheaderContent and footerContent slots to Messages composable#6166

Merged
VelikovPetar merged 5 commits intoGetStream:developfrom
tafelnl:patch-1
Feb 25, 2026
Merged

AddheaderContent and footerContent slots to Messages composable#6166
VelikovPetar merged 5 commits intoGetStream:developfrom
tafelnl:patch-1

Conversation

@tafelnl
Copy link
Contributor

@tafelnl tafelnl commented Feb 18, 2026

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 headerContent and footerContent params.

☑️Contributor Checklist

General

  • I have signed the Stream CLA (required)
  • Assigned a person / code owner group (required)
  • Thread with the PR link started in a respective Slack channel (required internally)
  • PR targets the develop branch
  • PR is linked to the GitHub issue it resolves

Code & documentation

  • New code is covered by unit tests
  • Comparison screenshots added for visual changes
  • Affected documentation updated (KDocs, docusaurus, tutorial)

☑️Reviewer Checklist

  • UI Components sample runs & works
  • Compose sample runs & works
  • UI Changes correct (before & after images)
  • Bugs validated (bugfixes)
  • New feature tested and works
  • All code we touched has new or updated KDocs
  • Check the SDK Size Comparison table in the CI logs

@tafelnl tafelnl requested a review from a team as a code owner February 18, 2026 12:51
Copy link
Contributor

@VelikovPetar VelikovPetar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before we can merge the PR, you will need to do couple of things:

  1. Run ./gradlew detekt - and fix any findings
  2. Run ./gradlew apiDump spotlessApply and commit the changes - to update the public .api baseline
  3. Ensure the PR description matches the pull request template
  4. Ensure the PR has the label pr:new-feature
  5. Make sure you have signed the Stream CLA

@coderabbitai
Copy link

coderabbitai bot commented Feb 20, 2026

Walkthrough

Two new optional composable parameters, headerContent and footerContent, are added to the Messages composable function. Rendering hooks are introduced in LazyColumn to place these components at the top and bottom of the message list respectively, without affecting existing loading indicators or item rendering logic.

Changes

Cohort / File(s) Summary
New Composable Parameters
stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/list/Messages.kt
Added headerContent and footerContent optional parameters to Messages composable. Integrated rendering hooks into LazyColumn to display footerContent at the top and headerContent at the bottom of the message list as single list items.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A footer here, a header there,
New composable slots placed with care,
The messages flow, content takes flight,
Your chat lists now perfectly bright! 🎉

🚥 Pre-merge checks | ✅ 2 | ❌ 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 (2 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title accurately describes the main change: adding headerContent and footerContent slots to the Messages composable, which aligns with the actual modifications made to the file.
Description check ✅ Passed The PR description covers all key sections: Goal clearly states the purpose, Implementation describes the approach, and Testing explains how to validate the change.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/list/Messages.kt (1)

177-181: Prefer idiomatic content() over content.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().

@tafelnl tafelnl changed the title feat: add support for headingContent and footerContent slots to Messages feat: add support for headerContent and footerContent slots to Messages Feb 20, 2026
@tafelnl
Copy link
Contributor Author

tafelnl commented Feb 20, 2026

Before we can merge the PR, you will need to do couple of things:

  1. Run ./gradlew detekt - and fix any findings
  2. Run ./gradlew apiDump spotlessApply and commit the changes - to update the public .api baseline
  3. Ensure the PR description matches the pull request template
  4. Ensure the PR has the label pr:new-feature
  5. Make sure you have signed the Stream CLA

I resolved all these, except for the label one, which I'm not able to do because of permissions

@tafelnl tafelnl requested a review from VelikovPetar February 20, 2026 10:30
@tafelnl tafelnl changed the title feat: add support for headerContent and footerContent slots to Messages feat: add support for headerContent and footerContent slots to Messages Feb 20, 2026
@VelikovPetar VelikovPetar added the pr:new-feature New feature label Feb 20, 2026
@VelikovPetar VelikovPetar changed the title feat: add support for headerContent and footerContent slots to Messages AddheaderContent and footerContent slots to Messages composable Feb 25, 2026
@VelikovPetar VelikovPetar merged commit 4c55830 into GetStream:develop Feb 25, 2026
13 of 14 checks passed
@tafelnl
Copy link
Contributor Author

tafelnl commented Feb 25, 2026

Awesome, thanks guys!

@tafelnl tafelnl deleted the patch-1 branch February 25, 2026 09:23
@VelikovPetar
Copy link
Contributor

VelikovPetar commented Feb 25, 2026

Hey @tafelnl,
Thank you for the contribution! We have couple more PRs that we need to merge by the end of this week, and we will publish the new version including this change on Friday the latest!

@stream-public-bot stream-public-bot added the released Included in a release label Feb 27, 2026
@stream-public-bot
Copy link
Contributor

🚀 Available in v6.33.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:new-feature New feature released Included in a release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants