Remove ChannelOptionsTheme and move options visibility to config#6357
Remove ChannelOptionsTheme and move options visibility to config#6357
Conversation
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
SDK Size Comparison 📏
|
WalkthroughThe PR consolidates channel options visibility configuration into Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
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 docstrings
🧪 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.
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/api/stream-chat-android-compose.api (1)
1209-1222:⚠️ Potential issue | 🟡 MinorAdd v7 migration documentation for channel options configuration.
The API changes are appropriate for v7, but consumers need release notes covering the migration path:
ChatTheme(channelOptionsTheme = …)andChannelOptionItemVisibilityare removed; useChatUiConfig(channelList = ChannelListConfig(optionVisibility = ChannelOptionsVisibility(...)))instead. The sample app demonstrates the new pattern, but formal migration guidance (e.g.,MIGRATION_TO_V7.mdor changelog entry) is absent.Applies also to lines 2848–2857 and 3693.
🤖 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 1209 - 1222, Add a v7 migration note explaining that ChatTheme(channelOptionsTheme = …) and ChannelOptionItemVisibility are removed and showing the new pattern using ChatUiConfig(channelList = ChannelListConfig(optionVisibility = ChannelOptionsVisibility(...))); create a MIGRATION_TO_V7.md (or add to CHANGELOG) with a short before/after snippet and mention the symbols ChannelOptionsVisibility, ChatTheme, ChannelOptionItemVisibility, ChatUiConfig, ChannelListConfig, and optionVisibility so consumers at the lines referenced (and in examples) know how to update their code.
🧹 Nitpick comments (1)
stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/ChatUiConfig.kt (1)
26-26: Consider relocatingChannelOptionsVisibilityto a config/theme package.
ChannelListConfignow depends onio.getstream.chat.android.compose.ui.components.channels, which increases cross-package coupling from theme/config into component code. Keeping visibility config types nearChatUiConfigwould preserve cleaner dependency direction.Also applies to: 50-50
🤖 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/ChatUiConfig.kt` at line 26, ChannelOptionsVisibility is defined in the components.channels package but is referenced from ChatUiConfig/ChannelListConfig, causing cross-package coupling; move the ChannelOptionsVisibility type into the theme/config package alongside ChatUiConfig (create/relocate the file into the ui.theme or ui.config package), update its package declaration and all imports/references (e.g., in ChannelListConfig and ChatUiConfig) to the new package, and run a quick project-wide refactor to fix any remaining usages so theme/config depends only on theme types rather than component internals.
🤖 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/components/channels/ChannelOptionsVisibility.kt`:
- Line 32: Regenerate the baseline profile artifacts so generated files
reference the new ChannelOptionsVisibility symbol instead of the stale
ChannelOptionItemVisibility by running the baseline profile build task (or the
project's profile generation command) and commit the updated artifacts; then add
migration documentation (e.g., create MIGRATION_TO_V7.md or update CHANGELOG)
that documents the breaking rename from ChannelOptionItemVisibility ->
ChannelOptionsVisibility and shows the code replacement examples and guidance
for users.
---
Outside diff comments:
In `@stream-chat-android-compose/api/stream-chat-android-compose.api`:
- Around line 1209-1222: Add a v7 migration note explaining that
ChatTheme(channelOptionsTheme = …) and ChannelOptionItemVisibility are removed
and showing the new pattern using ChatUiConfig(channelList =
ChannelListConfig(optionVisibility = ChannelOptionsVisibility(...))); create a
MIGRATION_TO_V7.md (or add to CHANGELOG) with a short before/after snippet and
mention the symbols ChannelOptionsVisibility, ChatTheme,
ChannelOptionItemVisibility, ChatUiConfig, ChannelListConfig, and
optionVisibility so consumers at the lines referenced (and in examples) know how
to update their code.
---
Nitpick comments:
In
`@stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/ChatUiConfig.kt`:
- Line 26: ChannelOptionsVisibility is defined in the components.channels
package but is referenced from ChatUiConfig/ChannelListConfig, causing
cross-package coupling; move the ChannelOptionsVisibility type into the
theme/config package alongside ChatUiConfig (create/relocate the file into the
ui.theme or ui.config package), update its package declaration and all
imports/references (e.g., in ChannelListConfig and ChatUiConfig) to the new
package, and run a quick project-wide refactor to fix any remaining usages so
theme/config depends only on theme types rather than component internals.
🪄 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: 2b2a45b3-6b5d-42e6-80c2-3e0bb78ca246
📒 Files selected for processing (9)
stream-chat-android-compose-sample/src/main/java/io/getstream/chat/android/compose/sample/ui/SampleChatTheme.ktstream-chat-android-compose-sample/src/main/java/io/getstream/chat/android/compose/sample/ui/chats/ChatsActivity.ktstream-chat-android-compose/api/stream-chat-android-compose.apistream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/channels/list/DefaultChannelSwipeActions.ktstream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/channels/ChannelOptions.ktstream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/channels/ChannelOptionsVisibility.ktstream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/ChannelOptionsTheme.ktstream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/ChatTheme.ktstream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/ChatUiConfig.kt
💤 Files with no reviewable changes (3)
- 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/ChannelOptionsTheme.kt
- stream-chat-android-compose-sample/src/main/java/io/getstream/chat/android/compose/sample/ui/SampleChatTheme.kt
...in/java/io/getstream/chat/android/compose/ui/components/channels/ChannelOptionsVisibility.kt
Show resolved
Hide resolved
a40cc27 to
c0291c2
Compare
c0291c2 to
edf1ac2
Compare
edf1ac2 to
946611c
Compare
|


Goal
Remove
ChannelOptionsThemeand move channel options visibility configuration intoChatUiConfigviaChannelListConfig.Implementation
ChannelOptionsThemeand itsCompositionLocal; remove the correspondingChatThemeparameterChannelOptionItemVisibilitytoChannelOptionsVisibilityoptionVisibilitytoChannelListConfigTesting
ChannelOptionsVisibilitythroughChatUiConfigcorrectly hides/shows optionsSummary by CodeRabbit