Skip to content

Rename channel screen components to use Channel naming#6325

Open
gpunto wants to merge 9 commits intov7from
rename-channel-components
Open

Rename channel screen components to use Channel naming#6325
gpunto wants to merge 9 commits intov7from
rename-channel-components

Conversation

@gpunto
Copy link
Copy Markdown
Contributor

@gpunto gpunto commented Apr 1, 2026

Goal

Rename Compose SDK components to use "Channel" naming instead of "Messages" for the screen that displays a channel's content, since it represents the channel -> this follows with what's defined in the alignments doc.

Docs PR: https://github.com/GetStream/docs-content/pull/1140

Implementation

  • ChannelViewModelFactory (channel list) → ChannelListViewModelFactory — renamed first to free up the name
  • MessagesViewModelFactoryChannelViewModelFactory
  • MessagesScreenChannelScreen
  • MessageListHeaderChannelHeader (including all related classes like ChannelHeaderParams, ChannelHeaderCenterContentParams, etc.)
  • Updated ChatComponentFactory methods to match the new names

Testing

Verify that the channel screen, header, and channel list all work as before.

Summary by CodeRabbit

  • Refactor

    • Renamed message UI components and headers (MessagesScreen → ChannelScreen, MessageListHeader → ChannelHeader) and reorganized ViewModel factories to separate channel vs. list responsibilities; minor internal renames for message rendering and header defaults.
  • Documentation

    • Updated samples, guides, and snippets to use the new component and factory names.
  • Tests

    • Updated UI snapshots and tests to target the renamed components.
  • Chore

    • Adjusted benchmark synchronization to wait for the channel screen.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2026

PR checklist ✅

All required conditions are satisfied:

  • Title length is OK (or ignored by label).
  • At least one pr: label exists.
  • Sections ### Goal, ### Implementation, and ### Testing are filled.

🎉 Great job! This PR is ready for review.

@gpunto gpunto added the pr:breaking-change Breaking change label Apr 1, 2026
@gpunto gpunto changed the title Rename channel screen components Rename channel screen components to use Channel naming Apr 1, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2026

SDK Size Comparison 📏

SDK Before After Difference Status
stream-chat-android-client 5.25 MB 5.86 MB 0.61 MB 🔴
stream-chat-android-ui-components 10.60 MB 11.15 MB 0.55 MB 🔴
stream-chat-android-compose 12.81 MB 12.40 MB -0.41 MB 🚀

@gpunto gpunto marked this pull request as ready for review April 1, 2026 13:09
@gpunto gpunto requested a review from a team as a code owner April 1, 2026 13:09
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 1, 2026

Walkthrough

Renames and retypes message-centric compose APIs to channel-centric variants: MessagesScreenChannelScreen, MessageListHeaderChannelHeader, MessagesViewModelFactoryChannelViewModelFactory, and ChannelViewModelFactoryChannelListViewModelFactory. Updates ripple across core UI, theme/component factory, viewmodel factories, samples, docs, tests, and a benchmark test tag.

Changes

Cohort / File(s) Summary
Core messages → channel UI
stream-chat-android-compose/src/main/java/.../ui/messages/ChannelScreen.kt, .../ui/messages/header/ChannelHeader.kt, .../ui/messages/attachments/AttachmentPickerMenu.kt
Rename MessagesScreenChannelScreen; rename MessageListHeaderChannelHeader; update header slot types, preview names, and KDocs; adjust test tag usage and internal helper names.
ViewModel factory renames
stream-chat-android-compose/src/main/java/.../viewmodel/messages/ChannelViewModelFactory.kt, .../viewmodel/channels/ChannelListViewModelFactory.kt
MessagesViewModelFactoryChannelViewModelFactory (message/detail factory); ChannelViewModelFactoryChannelListViewModelFactory (list factory). Update class names and runtime error messages.
Chats & Channels screens
stream-chat-android-compose/src/main/java/.../ui/chats/ChatsScreen.kt, .../ui/channels/ChannelsScreen.kt, .../ui/channels/list/ChannelList.kt
Left/list pane factory parameter retyped to ChannelListViewModelFactory; detail/editor provider now yields ChannelViewModelFactory; replace message-detail usages with channel variants and update parameter types.
Theme / ChatComponentFactory
stream-chat-android-compose/src/main/java/.../ui/theme/ChatComponentFactory.kt, .../ChatComponentFactoryParams.kt
Rename header param data classes MessageListHeader*ChannelHeader*; replace MessageListHeader extension methods with ChannelHeader*Content; delegate to new default channel header implementations.
Message rendering internals
stream-chat-android-compose/src/main/java/.../components/messages/MessageContent.kt
Rename internal composable DefaultMessageContentDefaultMessageRegularContent and update delegations.
Samples, docs & guides
stream-chat-android-compose-sample/..., stream-chat-android-docs/..., stream-chat-android-ui-guides/...
Update sample apps, docs, and guide snippets to use ChannelScreen/ChannelViewModelFactory/ChannelListViewModelFactory and ChannelHeader; rename snippet objects and adjust imports and factory constructions.
Tests
stream-chat-android-compose/.../test/.../ChannelHeaderTest.kt, ChannelScreenTest.kt, ChannelListViewModelFactoryTest.kt, ChannelViewModelFactoryTest.kt
Rename test classes and update imports, under-test composables, snapshots, and asserted messages to match new channel-centric names.
Benchmark
stream-chat-android-benchmark/src/main/kotlin/.../MessageActions.kt
Macrobenchmark synchronization tag changed from Stream_MessagesScreenStream_ChannelScreen (Until.hasObject(By.res(...))).
Public API surface (.api file)
stream-chat-android-compose/api/stream-chat-android-compose.api
Public signatures updated: removed MessagesScreen and MessagesViewModelFactory; added ChannelScreen, ChannelViewModelFactory, and ChannelListViewModelFactory; header/theme public types and ChatComponentFactory interface methods updated accordingly.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Suggested labels

pr:new-feature

Poem

🐰 I hopped in code beneath the moonlit panel,
Messages to Channel—what a nimble channel.
Factories renamed, headers reappear,
Docs and tests follow with a joyful cheer.
✨—a rabbit's tiny refactor fandango

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 19.10% 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: renaming channel screen components to use Channel naming instead of Messages.
Description check ✅ Passed The pull request description includes Goal, Implementation, and Testing sections, but is missing UI Changes, Contributor/Reviewer Checklists, and GIF sections from the template.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch rename-channel-components

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
Copy Markdown

@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.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
stream-chat-android-docs/src/main/kotlin/io/getstream/chat/docs/kotlin/compose/messages/ChannelScreen.kt (1)

111-140: ⚠️ Potential issue | 🟡 Minor

Use the default messaging type in this docs snippet.

Line 140 still uses message:123, while the rest of this file uses messaging:123. Copy-pasting this block against the default setup will target a different channel type.

Suggested fix
-    private const val channelId: String =  "message:123"
+    private const val channelId: String = "messaging:123"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@stream-chat-android-docs/src/main/kotlin/io/getstream/chat/docs/kotlin/compose/messages/ChannelScreen.kt`
around lines 111 - 140, The channelId constant is using the wrong channel type;
update the private const val channelId from "message:123" to "messaging:123" so
it matches the rest of the file and the default setup; ensure any references to
channelId (e.g., ChannelViewModelFactory instantiation via factory and the
ChannelScreen call that receives viewModelFactory = factory) will therefore
target the correct "messaging:123" channel.
stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/ChannelScreen.kt (1)

106-137: ⚠️ Potential issue | 🟡 Minor

Refresh the ChannelScreen KDoc after the rename.

The exported API now uses Channel terminology, but the doc block still describes a Messages screen/list. That stale wording will surface in generated SDK docs right next to the renamed symbol.

As per coding guidelines, "Document public APIs with KDoc, including thread expectations and state notes".

🤖 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/ChannelScreen.kt`
around lines 106 - 137, Update the stale KDoc for the public composable
ChannelScreen to reflect the new Channel-focused API (rename occurrences of
"Messages screen/list" to "Channel screen" and adjust description to mention
Channel/active channel requirement), ensure parameter docs reference
ChannelViewModelFactory and channel-related behavior (thread expectations, state
notes like selected/active Channel), and remove any leftover references to
"Messages" UI; keep the same tags for params such as showHeader,
reactionSorting, onBackPressed, skipPushNotification, and include a brief note
about threading/state expectations for this public API.
🧹 Nitpick comments (3)
stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/viewmodel/messages/ChannelViewModelFactory.kt (1)

51-53: KDoc references outdated "Messages Screen" terminology.

The class KDoc still mentions "Messages Screen" at line 52, but the composable has been renamed to ChannelScreen. Consider updating to "Channel Screen" for consistency with the PR's naming changes.

📝 Suggested KDoc update
 /**
- * Holds all the dependencies needed to build the ViewModels for the Messages Screen.
+ * Holds all the dependencies needed to build the ViewModels for the Channel Screen.
  * Currently, builds the [MessageComposerViewModel], [MessageListViewModel] and [AttachmentsPickerViewModel].
🤖 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/viewmodel/messages/ChannelViewModelFactory.kt`
around lines 51 - 53, Update the class KDoc for ChannelViewModelFactory to
replace the outdated "Messages Screen" wording with "Channel Screen" for
consistency; edit the comment block that currently reads "Holds all the
dependencies needed to build the ViewModels for the Messages Screen." to instead
mention "Channel Screen" and keep the existing references to
MessageComposerViewModel, MessageListViewModel and AttachmentsPickerViewModel
unchanged.
stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/ChatComponentFactoryParams.kt (1)

360-423: Please document the old→new symbol map for these renamed header params.

These public type renames are source-breaking for ChatComponentFactory customizations. A short migration note covering MessageListHeader*Params -> ChannelHeader*Params will make the v7 upgrade much easier for downstream implementers.

Based on learnings: In GetStream/stream-chat-android, PRs against major version branches (e.g., v7) are allowed to introduce breaking public API changes. In these branches, adding deprecated delegating overloads for source compatibility isn’t required; instead, maintainers prefer documenting migration paths (e.g., MIGRATION_TO_V7.md/CHANGELOG) covering function signature changes and renamed/removed composables.

🤖 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/theme/ChatComponentFactoryParams.kt`
around lines 360 - 423, Add a short migration note that lists the renamed public
types so downstream users can map old symbols to new ones: document that
MessageListHeaderParams → ChannelHeaderParams,
MessageListHeaderLeadingContentParams → ChannelHeaderLeadingContentParams,
MessageListHeaderCenterContentParams → ChannelHeaderCenterContentParams, and
MessageListHeaderTrailingContentParams → ChannelHeaderTrailingContentParams;
place this mapping in the project’s upgrade/MIGRATION notes and reference it
from the CHANGELOG so implementers customizing ChatComponentFactory can find the
old→new symbol map easily.
stream-chat-android-docs/src/main/kotlin/io/getstream/chat/docs/kotlin/cookbook/CookbookMainActivity.kt (1)

82-82: Rename the cookbook route literal for consistency.

CustomChannelHeader is the sample-facing name now, but this route still exposes message_header/{cid}. Keeping the old term here makes the cookbook source harder to follow after the rename.

✏️ Suggested change
-    CustomChannelHeader("message_header/{cid}"),
+    CustomChannelHeader("channel_header/{cid}"),
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@stream-chat-android-docs/src/main/kotlin/io/getstream/chat/docs/kotlin/cookbook/CookbookMainActivity.kt`
at line 82, The route literal for the CustomChannelHeader sample is still
"message_header/{cid}" which is inconsistent with the sample-facing name; update
the route string to match CustomChannelHeader (for example
"custom_channel_header/{cid}") wherever it's declared or referenced so the route
name aligns with the CustomChannelHeader symbol.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/ChatComponentFactory.kt`:
- Around line 137-139: There are duplicate imports for
DefaultChannelHeaderLeadingContent and DefaultMessageContent causing ambiguity;
update the imports to use aliases (e.g., import
...DefaultChannelHeaderLeadingContent as DefaultChannelHeaderLeadingContentV2
and import ...DefaultMessageContent as DefaultMessageContentV2) and then update
every call site in ChatComponentFactory that references
DefaultChannelHeaderLeadingContent and DefaultMessageContent to use the new
aliased names (ensure both usages—where DefaultChannelHeaderLeadingContent and
DefaultMessageContent are passed/instantiated—are replaced consistently).

---

Outside diff comments:
In
`@stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/ChannelScreen.kt`:
- Around line 106-137: Update the stale KDoc for the public composable
ChannelScreen to reflect the new Channel-focused API (rename occurrences of
"Messages screen/list" to "Channel screen" and adjust description to mention
Channel/active channel requirement), ensure parameter docs reference
ChannelViewModelFactory and channel-related behavior (thread expectations, state
notes like selected/active Channel), and remove any leftover references to
"Messages" UI; keep the same tags for params such as showHeader,
reactionSorting, onBackPressed, skipPushNotification, and include a brief note
about threading/state expectations for this public API.

In
`@stream-chat-android-docs/src/main/kotlin/io/getstream/chat/docs/kotlin/compose/messages/ChannelScreen.kt`:
- Around line 111-140: The channelId constant is using the wrong channel type;
update the private const val channelId from "message:123" to "messaging:123" so
it matches the rest of the file and the default setup; ensure any references to
channelId (e.g., ChannelViewModelFactory instantiation via factory and the
ChannelScreen call that receives viewModelFactory = factory) will therefore
target the correct "messaging:123" channel.

---

Nitpick comments:
In
`@stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/ChatComponentFactoryParams.kt`:
- Around line 360-423: Add a short migration note that lists the renamed public
types so downstream users can map old symbols to new ones: document that
MessageListHeaderParams → ChannelHeaderParams,
MessageListHeaderLeadingContentParams → ChannelHeaderLeadingContentParams,
MessageListHeaderCenterContentParams → ChannelHeaderCenterContentParams, and
MessageListHeaderTrailingContentParams → ChannelHeaderTrailingContentParams;
place this mapping in the project’s upgrade/MIGRATION notes and reference it
from the CHANGELOG so implementers customizing ChatComponentFactory can find the
old→new symbol map easily.

In
`@stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/viewmodel/messages/ChannelViewModelFactory.kt`:
- Around line 51-53: Update the class KDoc for ChannelViewModelFactory to
replace the outdated "Messages Screen" wording with "Channel Screen" for
consistency; edit the comment block that currently reads "Holds all the
dependencies needed to build the ViewModels for the Messages Screen." to instead
mention "Channel Screen" and keep the existing references to
MessageComposerViewModel, MessageListViewModel and AttachmentsPickerViewModel
unchanged.

In
`@stream-chat-android-docs/src/main/kotlin/io/getstream/chat/docs/kotlin/cookbook/CookbookMainActivity.kt`:
- Line 82: The route literal for the CustomChannelHeader sample is still
"message_header/{cid}" which is inconsistent with the sample-facing name; update
the route string to match CustomChannelHeader (for example
"custom_channel_header/{cid}") wherever it's declared or referenced so the route
name aligns with the CustomChannelHeader symbol.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 97a166cf-17af-4803-9323-38f995023130

📥 Commits

Reviewing files that changed from the base of the PR and between 0bdf04c and c3ab4a1.

⛔ Files ignored due to path filters (3)
  • stream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.messages_ChannelHeaderTest_connected_state.png is excluded by !**/*.png
  • stream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.messages_ChannelHeaderTest_offline_state.png is excluded by !**/*.png
  • stream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.messages_ChannelHeaderTest_thread_mode.png is excluded by !**/*.png
📒 Files selected for processing (46)
  • stream-chat-android-benchmark/src/main/kotlin/io/getstream/chat/android/benchmark/scenario/MessageActions.kt
  • stream-chat-android-compose-sample/src/main/java/io/getstream/chat/android/compose/sample/feature/channel/add/AddChannelScreen.kt
  • stream-chat-android-compose-sample/src/main/java/io/getstream/chat/android/compose/sample/feature/channel/draft/DraftChannelScreen.kt
  • stream-chat-android-compose-sample/src/main/java/io/getstream/chat/android/compose/sample/feature/channel/list/ChannelsActivity.kt
  • stream-chat-android-compose-sample/src/main/java/io/getstream/chat/android/compose/sample/ui/MessagesActivity.kt
  • stream-chat-android-compose-sample/src/main/java/io/getstream/chat/android/compose/sample/ui/chats/ChatsActivity.kt
  • stream-chat-android-compose/api/stream-chat-android-compose.api
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/channels/ChannelsScreen.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/channels/list/ChannelList.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/chats/ChatsScreen.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/ChannelScreen.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/attachments/AttachmentPickerMenu.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/header/ChannelHeader.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/ChatComponentFactory.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/ChatComponentFactoryParams.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/viewmodel/channels/ChannelListViewModelFactory.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/viewmodel/messages/ChannelViewModelFactory.kt
  • stream-chat-android-compose/src/test/kotlin/io/getstream/chat/android/compose/ui/messages/ChannelHeaderTest.kt
  • stream-chat-android-compose/src/test/kotlin/io/getstream/chat/android/compose/ui/messages/ChannelScreenTest.kt
  • stream-chat-android-compose/src/test/kotlin/io/getstream/chat/android/compose/viewmodel/channels/ChannelListViewModelFactoryTest.kt
  • stream-chat-android-compose/src/test/kotlin/io/getstream/chat/android/compose/viewmodel/messages/ChannelViewModelFactoryTest.kt
  • stream-chat-android-docs/src/main/kotlin/io/getstream/chat/docs/kotlin/compose/ComponentArchitecture.kt
  • stream-chat-android-docs/src/main/kotlin/io/getstream/chat/docs/kotlin/compose/Overview.kt
  • stream-chat-android-docs/src/main/kotlin/io/getstream/chat/docs/kotlin/compose/channels/ChannelItem.kt
  • stream-chat-android-docs/src/main/kotlin/io/getstream/chat/docs/kotlin/compose/channels/ChannelList.kt
  • stream-chat-android-docs/src/main/kotlin/io/getstream/chat/docs/kotlin/compose/channels/ChannelsScreen.kt
  • stream-chat-android-docs/src/main/kotlin/io/getstream/chat/docs/kotlin/compose/channels/SelectedChannelMenu.kt
  • stream-chat-android-docs/src/main/kotlin/io/getstream/chat/docs/kotlin/compose/general/ChatTheme.kt
  • stream-chat-android-docs/src/main/kotlin/io/getstream/chat/docs/kotlin/compose/guides/AddingCustomAttachments.kt
  • stream-chat-android-docs/src/main/kotlin/io/getstream/chat/docs/kotlin/compose/guides/CustomizingImageAndVideoPreviews.kt
  • stream-chat-android-docs/src/main/kotlin/io/getstream/chat/docs/kotlin/compose/guides/ProvidingCustomReactions.kt
  • stream-chat-android-docs/src/main/kotlin/io/getstream/chat/docs/kotlin/compose/messages/AttachmentsPicker.kt
  • stream-chat-android-docs/src/main/kotlin/io/getstream/chat/docs/kotlin/compose/messages/ChannelHeader.kt
  • stream-chat-android-docs/src/main/kotlin/io/getstream/chat/docs/kotlin/compose/messages/ChannelScreen.kt
  • stream-chat-android-docs/src/main/kotlin/io/getstream/chat/docs/kotlin/compose/messages/MessageComposer.kt
  • stream-chat-android-docs/src/main/kotlin/io/getstream/chat/docs/kotlin/compose/messages/MessageList.kt
  • stream-chat-android-docs/src/main/kotlin/io/getstream/chat/docs/kotlin/compose/messages/ReactionsPicker.kt
  • stream-chat-android-docs/src/main/kotlin/io/getstream/chat/docs/kotlin/compose/messages/SelectedMessageMenu.kt
  • stream-chat-android-docs/src/main/kotlin/io/getstream/chat/docs/kotlin/compose/messages/SelectedReactionsMenu.kt
  • stream-chat-android-docs/src/main/kotlin/io/getstream/chat/docs/kotlin/cookbook/CookbookMainActivity.kt
  • stream-chat-android-docs/src/main/kotlin/io/getstream/chat/docs/kotlin/cookbook/ui/CustomChannelHeader.kt
  • stream-chat-android-docs/src/main/kotlin/io/getstream/chat/docs/kotlin/cookbook/ui/CustomComposerAndAttachmentsPicker.kt
  • stream-chat-android-ui-guides/src/main/java/io/getstream/chat/android/guides/catalog/compose/customattachments/MessagesActivity.kt
  • stream-chat-android-ui-guides/src/main/java/io/getstream/chat/android/guides/catalog/compose/customizingimageandvideoattachments/MessagesActivity.kt
  • stream-chat-android-ui-guides/src/main/java/io/getstream/chat/android/guides/catalog/compose/customreactions/MessagesActivity.kt
  • stream-chat-android-ui-uitests/src/main/java/io/getstream/chat/android/uitests/app/compose/ComposeMessagesActivity.kt

@gpunto
Copy link
Copy Markdown
Contributor Author

gpunto commented Apr 1, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 1, 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.

Copy link
Copy Markdown
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.

Nice one!
Just to double check, we keep the XML naming the same right?

@gpunto
Copy link
Copy Markdown
Contributor Author

gpunto commented Apr 2, 2026

Nice one! Just to double check, we keep the XML naming the same right?

Yeah, I left it as is. Do you think we should change it? Maybe it's still better to align?

@gpunto gpunto force-pushed the rename-channel-components branch from 62e531c to 72bfca4 Compare April 2, 2026 14:42
@VelikovPetar
Copy link
Copy Markdown
Contributor

Nice one! Just to double check, we keep the XML naming the same right?

Yeah, I left it as is. Do you think we should change it? Maybe it's still better to align?

I would say if they are now misaligned with both the Compose SDK, and the UIKit SDK - it would be good to rename them. In the end, it would be easier even for us to navigate the project if we have consistent naming

gpunto added 8 commits April 3, 2026 11:12
Free up the ChannelViewModelFactory name for the messages screen factory
by renaming the channel list factory to ChannelListViewModelFactory.
Also renames related type aliases:
- MessagesViewModelFactoryProvider → ChannelViewModelFactoryProvider
- DefaultMessagesViewModelFactoryProvider → DefaultChannelViewModelFactoryProvider
Renames the composable function, file, test, private helpers
(ChannelScreenContentBox, ChannelScreenMenus, ChannelScreenReactionsPicker),
test tag (Stream_ChannelScreen), and all references in docs/samples/guides.
Renames the composable function, file, internal helpers
(DefaultChannelHeaderLeadingContent, etc.), ChatComponentFactory methods,
param classes (ChannelHeaderParams, etc.), and all references in
docs/samples/guides.

Only the Compose SDK is affected; the XML UI Components SDK
(MessageListHeaderView, MessageListHeaderViewModel) is untouched.
@gpunto gpunto force-pushed the rename-channel-components branch from 72bfca4 to ca347bb Compare April 3, 2026 09:18
@gpunto
Copy link
Copy Markdown
Contributor Author

gpunto commented Apr 3, 2026

I would say if they are now misaligned with both the Compose SDK, and the UIKit SDK - it would be good to rename them. In the end, it would be easier even for us to navigate the project if we have consistent naming

Ok! I applied the renaming for ui-components in ca347bb. It ended up being more changes than expected, mostly due to all the references in resources. Let me know if that's fine or if you think it's too many breaking changes.

@gpunto gpunto force-pushed the rename-channel-components branch from 331e908 to 70a421c Compare April 3, 2026 09:51
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 3, 2026

Quality Gate Failed Quality Gate failed

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

See analysis details on SonarQube Cloud

@VelikovPetar
Copy link
Copy Markdown
Contributor

I would say if they are now misaligned with both the Compose SDK, and the UIKit SDK - it would be good to rename them. In the end, it would be easier even for us to navigate the project if we have consistent naming

Ok! I applied the renaming for ui-components in ca347bb. It ended up being more changes than expected, mostly due to all the references in resources. Let me know if that's fine or if you think it's too many breaking changes.

Ugh I didn't realise that resources would be affected as well. But IMO, this is good change and we should do it. As long as we explain the changes in the migration guide, I think we will be good. And as I mentioned, we already had discrepancies between the XML and Compose namings, I think that unifying them is the right thing to do! (additionally, there aren't too many breaking changes in the XML SDK, so even with these ones, a migration should be rather simple)

@gpunto
Copy link
Copy Markdown
Contributor Author

gpunto commented Apr 3, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 3, 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.

Copy link
Copy Markdown

@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.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/ChatComponentFactory.kt (1)

629-637: ⚠️ Potential issue | 🟠 Major

Don’t drop typingUsers from the default header delegate.

ChannelHeaderCenterContentParams carries typingUsers, but the default delegate ignores it here. That makes the default ChannelHeader render the normal member-status subtitle even when users are actively typing, so the “User Typing” state never appears.

🛠️ Proposed fix
     public fun RowScope.ChannelHeaderCenterContent(params: ChannelHeaderCenterContentParams) {
         DefaultChannelHeaderCenterContent(
             modifier = params.modifier,
             channel = params.channel,
             currentUser = params.currentUser,
             connectionState = params.connectionState,
+            typingUsers = params.typingUsers,
             messageMode = params.messageMode,
             onHeaderTitleClick = params.onClick,
         )
     }
// In DefaultChannelHeaderCenterContent(...):
// - add a `typingUsers: List<User>` parameter
// - prefer a typing subtitle when `typingUsers.isNotEmpty()`
// - fall back to `channel.getMembersStatusText(...)` otherwise
🤖 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/theme/ChatComponentFactory.kt`
around lines 629 - 637, The default header delegate is ignoring
ChannelHeaderCenterContentParams.typingUsers, so
DefaultChannelHeaderCenterContent should accept a typingUsers: List<User>
parameter and use it to choose the subtitle: when typingUsers.isNotEmpty() show
the typing users subtitle (prefer the typing state) and otherwise fall back to
channel.getMembersStatusText(...); update the call site in
ChannelHeaderCenterContent to pass params.typingUsers into
DefaultChannelHeaderCenterContent and ensure any downstream logic in
DefaultChannelHeaderCenterContent uses typingUsers instead of always computing
the member status text.
🧹 Nitpick comments (1)
stream-chat-android-compose/api/stream-chat-android-compose.api (1)

6620-6628: Please ensure release migration docs include explicit old→new symbol mapping.

This API snapshot confirms breaking renames in both channel-list and channel-content factories; documenting exact replacements in migration docs/changelog will reduce upgrade friction.

Based on learnings: in v7, breaking API changes are acceptable, but migration paths should be documented in MIGRATION_TO_V7.md/CHANGELOG.

Also applies to: 6709-6716

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@stream-chat-android-compose/api/stream-chat-android-compose.api` around lines
6620 - 6628, The release docs are missing explicit old→new symbol mappings for
renamed factories (e.g., ChannelListViewModelFactory and related channel-content
factory symbols shown in the API snapshot); update MIGRATION_TO_V7.md and
CHANGELOG to include a clear table/list mapping each old fully-qualified symbol
name to its new fully-qualified symbol (include constructors and create methods
such as ChannelListViewModelFactory.<init> overloads and
create(Class)/create(Class,CreationExtras) signatures) and add a short example
snippet for how to replace usages in client code so consumers can perform a
mechanical find-and-replace during migration.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/ChannelScreen.kt`:
- Around line 136-137: Update the public KDoc for the ChannelScreen function
(and any mentions of ChannelViewModelFactory in its header) to replace
references to "Messages screen/messages list" with "ChannelScreen" and describe
thread expectations and state behavior as per guidelines; explicitly document
that ChannelScreen is a composable public API, indicate which coroutine/thread
context (main/UI) it should be called on, and note any state hoisting or
lifecycle considerations (e.g., that it reads/consumes ViewModel state and
should not be recreated frequently).

---

Outside diff comments:
In
`@stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/ChatComponentFactory.kt`:
- Around line 629-637: The default header delegate is ignoring
ChannelHeaderCenterContentParams.typingUsers, so
DefaultChannelHeaderCenterContent should accept a typingUsers: List<User>
parameter and use it to choose the subtitle: when typingUsers.isNotEmpty() show
the typing users subtitle (prefer the typing state) and otherwise fall back to
channel.getMembersStatusText(...); update the call site in
ChannelHeaderCenterContent to pass params.typingUsers into
DefaultChannelHeaderCenterContent and ensure any downstream logic in
DefaultChannelHeaderCenterContent uses typingUsers instead of always computing
the member status text.

---

Nitpick comments:
In `@stream-chat-android-compose/api/stream-chat-android-compose.api`:
- Around line 6620-6628: The release docs are missing explicit old→new symbol
mappings for renamed factories (e.g., ChannelListViewModelFactory and related
channel-content factory symbols shown in the API snapshot); update
MIGRATION_TO_V7.md and CHANGELOG to include a clear table/list mapping each old
fully-qualified symbol name to its new fully-qualified symbol (include
constructors and create methods such as ChannelListViewModelFactory.<init>
overloads and create(Class)/create(Class,CreationExtras) signatures) and add a
short example snippet for how to replace usages in client code so consumers can
perform a mechanical find-and-replace during migration.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 0a708a5b-08dd-4427-80d5-7ed303e5d022

📥 Commits

Reviewing files that changed from the base of the PR and between 62e531c and 70a421c.

📒 Files selected for processing (21)
  • stream-chat-android-benchmark/src/main/kotlin/io/getstream/chat/android/benchmark/scenario/MessageActions.kt
  • stream-chat-android-compose-sample/src/main/java/io/getstream/chat/android/compose/sample/feature/channel/add/AddChannelScreen.kt
  • stream-chat-android-compose-sample/src/main/java/io/getstream/chat/android/compose/sample/feature/channel/draft/DraftChannelScreen.kt
  • stream-chat-android-compose-sample/src/main/java/io/getstream/chat/android/compose/sample/feature/channel/list/ChannelsActivity.kt
  • stream-chat-android-compose-sample/src/main/java/io/getstream/chat/android/compose/sample/ui/MessagesActivity.kt
  • stream-chat-android-compose-sample/src/main/java/io/getstream/chat/android/compose/sample/ui/chats/ChatsActivity.kt
  • stream-chat-android-compose/api/stream-chat-android-compose.api
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/channels/ChannelsScreen.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/channels/header/ChannelListHeader.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/channels/list/ChannelList.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/chats/ChatsScreen.kt
  • 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/ChannelScreen.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/attachments/AttachmentPickerMenu.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/header/ChannelHeader.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/ChatComponentFactory.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/ChatComponentFactoryParams.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/viewmodel/channels/ChannelListViewModelFactory.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/viewmodel/messages/ChannelViewModelFactory.kt
  • stream-chat-android-compose/src/test/kotlin/io/getstream/chat/android/compose/ui/messages/ChannelHeaderTest.kt
  • stream-chat-android-compose/src/test/kotlin/io/getstream/chat/android/compose/ui/messages/ChannelScreenTest.kt
✅ Files skipped from review due to trivial changes (4)
  • stream-chat-android-benchmark/src/main/kotlin/io/getstream/chat/android/benchmark/scenario/MessageActions.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/attachments/AttachmentPickerMenu.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/viewmodel/messages/ChannelViewModelFactory.kt
  • stream-chat-android-compose-sample/src/main/java/io/getstream/chat/android/compose/sample/ui/MessagesActivity.kt
🚧 Files skipped from review as they are similar to previous changes (10)
  • stream-chat-android-compose-sample/src/main/java/io/getstream/chat/android/compose/sample/feature/channel/list/ChannelsActivity.kt
  • stream-chat-android-compose/src/test/kotlin/io/getstream/chat/android/compose/ui/messages/ChannelScreenTest.kt
  • stream-chat-android-compose-sample/src/main/java/io/getstream/chat/android/compose/sample/feature/channel/add/AddChannelScreen.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/viewmodel/channels/ChannelListViewModelFactory.kt
  • stream-chat-android-compose/src/test/kotlin/io/getstream/chat/android/compose/ui/messages/ChannelHeaderTest.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/channels/header/ChannelListHeader.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/channels/ChannelsScreen.kt
  • stream-chat-android-compose-sample/src/main/java/io/getstream/chat/android/compose/sample/ui/chats/ChatsActivity.kt
  • stream-chat-android-compose-sample/src/main/java/io/getstream/chat/android/compose/sample/feature/channel/draft/DraftChannelScreen.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/ChatComponentFactoryParams.kt

Comment on lines +136 to +137
public fun ChannelScreen(
viewModelFactory: ChannelViewModelFactory,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Finish the public KDoc rename.

The surrounding KDoc still calls this the “Messages screen/messages list”, so IDE docs stay out of sync with the new ChannelScreen API. As per coding guidelines, "Document public APIs with KDoc, including thread expectations and state notes".

🧰 Tools
🪛 GitHub Check: SonarCloud Code Analysis

[failure] 136-136: Refactor this method to reduce its Cognitive Complexity from 23 to the 15 allowed.

See more on https://sonarcloud.io/project/issues?id=GetStream_stream-chat-android&issues=AZ1Im5lO3JBpSDiAqhhq&open=AZ1Im5lO3JBpSDiAqhhq&pullRequest=6325


[warning] 136-136: This function has 17 parameters, which is greater than the 7 authorized.

See more on https://sonarcloud.io/project/issues?id=GetStream_stream-chat-android&issues=AZ1Im5lO3JBpSDiAqhho&open=AZ1Im5lO3JBpSDiAqhho&pullRequest=6325

🤖 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/ChannelScreen.kt`
around lines 136 - 137, Update the public KDoc for the ChannelScreen function
(and any mentions of ChannelViewModelFactory in its header) to replace
references to "Messages screen/messages list" with "ChannelScreen" and describe
thread expectations and state behavior as per guidelines; explicitly document
that ChannelScreen is a composable public API, indicate which coroutine/thread
context (main/UI) it should be called on, and note any state hoisting or
lifecycle considerations (e.g., that it reads/consumes ViewModel state and
should not be recreated frequently).

@VelikovPetar VelikovPetar enabled auto-merge (squash) April 6, 2026 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:breaking-change Breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants