Skip to content

Comments

Delete deprecated MessageContentFactory#6098

Merged
VelikovPetar merged 1 commit intov7from
delete-messcontfac
Jan 23, 2026
Merged

Delete deprecated MessageContentFactory#6098
VelikovPetar merged 1 commit intov7from
delete-messcontfac

Conversation

@gpunto
Copy link
Contributor

@gpunto gpunto commented Jan 23, 2026

🎯 Goal

Removing the deprecated MessageContentFactory before updating the message item design.

🛠 Implementation details

Remove class and all related references. All the if checks that were checking if (factory == Deprecated) were simplified to only the true branch.

🎨 UI Changes

None

🧪 Testing

Everything should work as normal

Summary by CodeRabbit

  • Breaking Changes

    • Removed the deprecated MessageContentFactory class and its related APIs from public use. Applications relying on this class will need to migrate to the ChatTheme component factory approach.
  • Refactoring

    • Simplified message component signatures across the library by consolidating factory parameters for improved consistency and ease of use.

✏️ Tip: You can customize this high-level summary in your review settings.

@gpunto
Copy link
Contributor Author

gpunto commented Jan 23, 2026

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented Jan 23, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@github-actions
Copy link
Contributor

SDK Size Comparison 📏

SDK Before After Difference Status
stream-chat-android-client 5.25 MB 5.25 MB 0.00 MB 🟢
stream-chat-android-offline 5.48 MB 5.48 MB 0.00 MB 🟢
stream-chat-android-ui-components 10.62 MB 10.61 MB -0.01 MB 🚀
stream-chat-android-compose 12.84 MB 11.63 MB -1.21 MB 🚀

@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
77.8% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@coderabbitai
Copy link

coderabbitai bot commented Jan 23, 2026

Walkthrough

The PR removes the deprecated MessageContentFactory class and parameter from the public API. Message content rendering now exclusively uses ChatTheme.componentFactory, eliminating the factory parameter from multiple composable functions and simplifying branching logic across the Compose library.

Changes

Cohort / File(s) Summary
Factory Removal
stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/messages/factory/MessageContentFactory.kt
Entire file deleted (158 lines). Removed deprecated MessageContentFactory class with public methods for composing message content (Giphy, Deleted, Text, Quoted, etc.). Class was annotated for deprecation in favor of ChatTheme.componentFactory.
Message Content Composables
stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/messages/MessageContent.kt, stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/list/MessageItem.kt, stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/list/MessageContainer.kt
Removed messageContentFactory parameter from public composables (MessageContent, MessageItem, DefaultMessageItemFooterContent, DefaultMessageItemCenterContent, RegularMessageContent, MessageContainer, DefaultMessageItem). Eliminated conditional branching and now consistently use ChatTheme.componentFactory for all message content rendering.
Message List
stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/list/MessageList.kt, stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/MessagesScreen.kt
Removed messageContentFactory parameter from public MessageList() and MessagesScreen() overloads. Simplified message item composition to always use component factory without conditional logic or factory parameter passing.
Theme & Component Factory
stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/ChatTheme.kt, stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/ChatComponentFactory.kt
Removed messageContentFactory parameter from ChatTheme(...) constructor. Removed ChatTheme.messageContentFactory accessor property. Removed LocalMessageContentFactory compositionLocalof declaration. Removed messageContentFactory from internal calls in ChatComponentFactory (e.g., DefaultMessageContainer, MessageListItemContainer).
Public API Surface
stream-chat-android-compose/api/stream-chat-android-compose.api
Updated public API signatures to reflect removal of messageContentFactory parameters from MessageContent, MessageContainer, MessageItem, MessageList, MessagesScreen, and ChatTheme. Removed MessageContentFactory class from public surface.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

compose

Suggested reviewers

  • VelikovPetar
  • andremion

Poem

🐰 A factory deprecated bids farewell,
No more branching in our shell!
ComponentTheme now leads the way,
Simpler paths for every day. ✨
Message content, clean and free—
No conditions left to see!

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 68.75% 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 title 'Delete deprecated MessageContentFactory' clearly and accurately describes the primary change: removing an entire deprecated class and all its references throughout the codebase.
Description check ✅ Passed The description covers the main sections (Goal, Implementation details, UI Changes, Testing) but lacks several recommended elements from the template like changelog updates, test coverage details, and contributor checklist completion.

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

✨ Finishing touches
  • 📝 Generate docstrings

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.

@gpunto gpunto marked this pull request as ready for review January 23, 2026 11:18
@gpunto gpunto requested a review from a team as a code owner January 23, 2026 11:18
@VelikovPetar VelikovPetar merged commit 0022337 into v7 Jan 23, 2026
17 of 19 checks passed
@VelikovPetar VelikovPetar deleted the delete-messcontfac branch January 23, 2026 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants