Skip to content

Conversation

andremion
Copy link
Contributor

@andremion andremion commented Oct 2, 2025

🛠 Implementation details

  • Add a unique identifier for MessageListItemState.
  • Add distinctUntilChanged before mapping the message list state to ensure that the reversed message list is only recreated when the actual state changes, not on every emission.

🧪 Testing

Apply the provided patch and look for log entries of alor: MessageListStartOfTheChannelItemContent when entering a channel, scrolling to the very first sent message.

MessageListStartOfTheChannelItemContent recompositions
Subject: [PATCH] MessageListStartOfTheChannelItemContent recompositions
---
Index: stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/ChatComponentFactory.kt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/ChatComponentFactory.kt b/stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/ChatComponentFactory.kt
--- a/stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/ChatComponentFactory.kt	(revision 58eca85b0fd27686866ef68bcf708dc18a57edc6)
+++ b/stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/ChatComponentFactory.kt	(date 1759409581641)
@@ -989,6 +989,8 @@
     public fun LazyItemScope.MessageListStartOfTheChannelItemContent(
         startOfTheChannelItem: StartOfTheChannelItemState,
     ) {
+        println("alor: MessageListStartOfTheChannelItemContent")
+        Text("MessageListStartOfTheChannelItemContent")
     }
 
     /**

@andremion andremion added the compose Jetpack Compose label Oct 2, 2025
Copy link
Contributor

github-actions bot commented Oct 2, 2025

SDK Size Comparison 📏

SDK Before After Difference Status
stream-chat-android-client 3.23 MB 3.23 MB 0.00 MB 🟢
stream-chat-android-offline 3.45 MB 3.45 MB 0.00 MB 🟢
stream-chat-android-ui-components 10.53 MB 10.54 MB 0.00 MB 🟢
stream-chat-android-compose 12.75 MB 12.75 MB 0.00 MB 🟢

@andremion andremion marked this pull request as ready for review October 3, 2025 12:36
@andremion andremion requested a review from a team as a code owner October 3, 2025 12:36
…s ensures that the reversed message list is only recreated when the actual state changes, not on every emission.
@andremion andremion force-pushed the AND-782-messageliststartofthechannelitemcontent-recomposition-issue branch from 9eca29e to 298434d Compare October 3, 2025 13:34
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.

Approved but. the coverage seems pretty low: should we add tests for the new id property?

@andremion
Copy link
Contributor Author

Approved but. the coverage seems pretty low: should we add tests for the new id property?

We should not merge anything until we have #5941 merged.
so that we will have a better view of the coverage

Copy link

sonarqubecloud bot commented Oct 6, 2025

@andremion andremion enabled auto-merge (squash) October 6, 2025 09:45
@andremion andremion merged commit 4edf06c into develop Oct 6, 2025
13 checks passed
@andremion andremion deleted the AND-782-messageliststartofthechannelitemcontent-recomposition-issue branch October 6, 2025 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

compose Jetpack Compose

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants