Skip to content

Remove ChannelOptionsTheme and move options visibility to config#6357

Open
gpunto wants to merge 1 commit intov7from
rm-channel-options-theme
Open

Remove ChannelOptionsTheme and move options visibility to config#6357
gpunto wants to merge 1 commit intov7from
rm-channel-options-theme

Conversation

@gpunto
Copy link
Copy Markdown
Contributor

@gpunto gpunto commented Apr 10, 2026

Goal

Remove ChannelOptionsTheme and move channel options visibility configuration into ChatUiConfig via ChannelListConfig.

Implementation

  • Delete ChannelOptionsTheme and its CompositionLocal; remove the corresponding ChatTheme parameter
  • Rename ChannelOptionItemVisibility to ChannelOptionsVisibility
  • Add optionVisibility to ChannelListConfig
  • Update all callers

Testing

  1. Open the channel list, long-press a channel, and verify all expected options appear
  2. Swipe a channel and verify mute action visibility respects the config
  3. Verify that passing a custom ChannelOptionsVisibility through ChatUiConfig correctly hides/shows options

Summary by CodeRabbit

  • Refactor
    • Reorganized channel options visibility configuration as part of the channel list settings within the main UI configuration system.
    • Removed the separate channel options theming component, simplifying the configuration structure.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 10, 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 10, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 10, 2026

SDK Size Comparison 📏

SDK Before After Difference Status
stream-chat-android-client 5.25 MB 5.82 MB 0.57 MB 🔴
stream-chat-android-ui-components 10.60 MB 10.96 MB 0.36 MB 🟡
stream-chat-android-compose 12.81 MB 12.25 MB -0.56 MB 🚀

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

coderabbitai bot commented Apr 10, 2026

Walkthrough

The PR consolidates channel options visibility configuration into ChatUiConfig.channelList.optionVisibility and removes the standalone ChannelOptionsTheme type. The visibility class is renamed from ChannelOptionItemVisibility to ChannelOptionsVisibility, with all references updated to read from the new config path instead of the theme layer.

Changes

Cohort / File(s) Summary
Sample Configuration Updates
stream-chat-android-compose-sample/src/main/java/io/getstream/chat/android/compose/sample/ui/SampleChatTheme.kt, stream-chat-android-compose-sample/src/main/java/io/getstream/chat/android/compose/sample/ui/chats/ChatsActivity.kt
Removed channelOptionsTheme parameter from SampleChatTheme and migrated configuration to use ChatUiConfig with nested ChannelListConfig.optionVisibility using the renamed ChannelOptionsVisibility type.
Channel Options Visibility Rename
stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/channels/ChannelOptionsVisibility.kt
Renamed public data class ChannelOptionItemVisibility to ChannelOptionsVisibility with identical constructor properties and defaults.
Theme API Removal
stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/ChannelOptionsTheme.kt, stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/ChatTheme.kt
Deleted ChannelOptionsTheme type entirely and removed channelOptionsTheme parameter and composition local from ChatTheme.
Config Structure Updates
stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/ChatUiConfig.kt
Added optionVisibility: ChannelOptionsVisibility property to ChannelListConfig with default value ChannelOptionsVisibility().
Implementation Updates
stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/channels/list/DefaultChannelSwipeActions.kt, stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/channels/ChannelOptions.kt
Updated references from ChatTheme.channelOptionsTheme.optionVisibility to ChatTheme.config.channelList.optionVisibility and updated helper function parameter types to use ChannelOptionsVisibility.
Public API Surface
stream-chat-android-compose/api/stream-chat-android-compose.api
Reflected removal of ChannelOptionsTheme type, introduction of ChannelOptionsVisibility, and updated ChannelListConfig constructor signature to include ChannelOptionsVisibility parameter; removed ChatTheme.getChannelOptionsTheme() accessor.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • Apply new design to channel detail screens #6205 — Modifies the same channel-options visibility/theming surface by renaming ChannelOptionItemVisibility to ChannelOptionsVisibility and relocating visibility configuration into the chat config structure.

Suggested reviewers

  • VelikovPetar

Poem

🐰 With config consolidation so spry,
The theme is now lean, oh my my!
Options move home to ChatUiConfig's nest,
ChannelOptionsVisibility dressed in its best,
A hop and a skip—the refactoring's blessed! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.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 title clearly and concisely summarizes the main changes: removing ChannelOptionsTheme and relocating options visibility configuration to ChatUiConfig.
Description check ✅ Passed The description covers the Goal, Implementation, and Testing sections adequately, but lacks UI Changes and Contributor/Reviewer checklists specified in 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 rm-channel-options-theme

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 (1)
stream-chat-android-compose/api/stream-chat-android-compose.api (1)

1209-1222: ⚠️ Potential issue | 🟡 Minor

Add 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 = …) and ChannelOptionItemVisibility are removed; use ChatUiConfig(channelList = ChannelListConfig(optionVisibility = ChannelOptionsVisibility(...))) instead. The sample app demonstrates the new pattern, but formal migration guidance (e.g., MIGRATION_TO_V7.md or 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 relocating ChannelOptionsVisibility to a config/theme package.

ChannelListConfig now depends on io.getstream.chat.android.compose.ui.components.channels, which increases cross-package coupling from theme/config into component code. Keeping visibility config types near ChatUiConfig would 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

📥 Commits

Reviewing files that changed from the base of the PR and between 1f1b9c1 and 746b933.

📒 Files selected for processing (9)
  • stream-chat-android-compose-sample/src/main/java/io/getstream/chat/android/compose/sample/ui/SampleChatTheme.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/list/DefaultChannelSwipeActions.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/channels/ChannelOptions.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/channels/ChannelOptionsVisibility.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/ChannelOptionsTheme.kt
  • 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/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

@gpunto gpunto force-pushed the rm-channel-options-theme branch 3 times, most recently from a40cc27 to c0291c2 Compare April 10, 2026 15:14
@gpunto gpunto force-pushed the rm-channel-options-theme branch from c0291c2 to edf1ac2 Compare April 10, 2026 15:21
@gpunto gpunto enabled auto-merge (squash) April 10, 2026 15:42
@gpunto gpunto force-pushed the rm-channel-options-theme branch from edf1ac2 to 946611c Compare April 10, 2026 15:47
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

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

See analysis details on SonarQube Cloud

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