Skip to content

Update actions for channels in the channel list#6327

Open
gpunto wants to merge 8 commits intov7from
rm-archive-primary
Open

Update actions for channels in the channel list#6327
gpunto wants to merge 8 commits intov7from
rm-archive-primary

Conversation

@gpunto
Copy link
Copy Markdown
Contributor

@gpunto gpunto commented Apr 1, 2026

Goal

Clean up channel actions:

  • The swipe action should only be "mute group", so we remove fallbacks for swipe actions
  • The "more actions" sheet for groups should not display "mute group" as that's the swipe action
  • Update the mute icon on DM channels to only reflect channel mutes and differentiate between "mute channel" (primary swipe action) and "mute user"

Implementation

  • Update swipe actions to only show mute/unmute as the primary action (remove archive and pin)
  • Remove ChannelAction.requiredCapability (it was unused)
  • Disable archive channel action by default in ChannelOptionItemVisibility as we don't have an archive screen in the SDK
  • Revert showing muted icon on DM channels based on user mute: the icon now only reflects channel mutes
  • Remove "Mute Group" / "Unmute Group" from the group channel actions sheet (the swipe action already handles channel muting)
  • Swipe actions now respect ChannelOptionItemVisibility (e.g. isMuteChannelVisible)

🎨 UI Changes

None

Testing

  • Swipe a channel item and verify only "More" and "Mute"/"Unmute" actions are shown
  • Long press a group channel → sheet should not show Mute Group
  • Long press a DM channel → sheet should show Mute User, but not Mute Channel/Group
  • Mute a DM channel via swipe → verify the mute icon appears on the channel item
  • Set isMuteChannelVisible = false in ChannelOptionItemVisibility → verify the mute swipe action is hidden

Summary by CodeRabbit

  • Changes
    • Streamlined channel list swipe actions to display only mute/unmute functionality
    • Removed archive and pin actions from the swipe menu
    • Removed mute option from group channel management menus
    • Archive channel visibility is now hidden by default
    • Updated channel muting to use channel-level controls only

@gpunto gpunto changed the title Clean up channel list actions Update actions for channels in the channel list Apr 1, 2026
@gpunto gpunto changed the base branch from develop to v7 April 1, 2026 12:59
@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:improvement Improvement label 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.17 MB 0.57 MB 🔴
stream-chat-android-compose 12.81 MB 12.41 MB -0.40 MB 🚀

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

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 1, 2026

Walkthrough

This pull request removes per-user muting logic for 1:1 channels, simplifies primary swipe actions to mute/unmute only, eliminates group channel muting, removes the requiredCapability property from the action interface, and defaults archive visibility to hidden. Multiple string resources for removed actions are cleaned up.

Changes

Cohort / File(s) Summary
Swipe Action Simplification
DefaultChannelSwipeActions.kt
Primary swipe action reduced to mute/unmute with capability gating. Archive/pin/unpin logic removed. String resolution now uses LocalResources.current. Click handler simplified to remove lambda wrapper.
Action Capability Refactoring
ChannelAction.kt, stream-chat-android-ui-common/api/stream-chat-android-ui-common.api
Removed requiredCapability property from ChannelAction interface and all concrete implementations (LeaveGroup, MuteChannel, UnmuteChannel, DeleteConversation, etc.). Capability enforcement mechanism fully retired from API.
Channel Options Updates
ChannelOptions.kt, ChannelOptionItemVisibility.kt
Mute/unmute removed from group channel actions. isArchiveChannelVisible default changed from true to false. Remaining group actions: View Info, Archive, Delete (owner), Leave (member).
Mute State Simplification
ChannelListViewModel.kt, ChannelListViewModelTest.kt
Removed per-user muting logic and isOneToOne detection; isMuted now depends solely on channel-level mutes. Eliminated userMutes and currentUser from state combiner and createChannelItems. Removed three related unit tests and helper fixtures.
String Resource Cleanup
strings.xml
Removed swipe action labels: stream_compose_swipe_action_pin, stream_compose_swipe_action_unpin, stream_compose_swipe_action_archive, stream_compose_swipe_action_unarchive. Removed group menu labels: stream_compose_selected_channel_menu_mute_group, stream_compose_selected_channel_menu_unmute_group.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 Hop, hop—mute actions now,
Swipe simplified somehow!
Archive hidden from sight,
Capabilities light,
One flow replaces the old vow!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 71.43% 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 'Update actions for channels in the channel list' directly reflects the main objective of simplifying channel actions in the list view.
Description check ✅ Passed The PR description includes all required template sections: Goal, Implementation, UI Changes, Testing, and Contributor/Reviewer Checklists with appropriate content.

✏️ 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-archive-primary

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/src/main/java/io/getstream/chat/android/compose/ui/components/channels/ChannelOptions.kt (1)

101-143: ⚠️ Potential issue | 🟠 Major

Don’t let isMuteChannelVisible hide Mute User in DMs.

After removing group mute actions, this builder still wires optionVisibility.isMuteChannelVisible into buildDmMuteUserAction. That means a caller can’t hide channel mute/unmute without also hiding the DM-sheet Mute User action, which no longer matches the flag name/KDoc or the new channel-vs-user split in this PR. The same cleanup also leaves buildDefaultChannelActions.isMuted looking like a no-op parameter. Please finish the split by decoupling DM user-mute visibility from channel-mute visibility and dropping the dead argument while you’re here.

Based on learnings, PRs against major version branches such as v7 may introduce breaking public API changes without compatibility overloads.

Also applies to: 171-176

🤖 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/components/channels/ChannelOptions.kt`
around lines 101 - 143, The DM mute action visibility is incorrectly tied to
optionVisibility.isMuteChannelVisible and the isMuted parameter is now unused;
update buildDefaultChannelActions to remove the dead isMuted parameter,
introduce/consume a DM-specific visibility flag (e.g.
optionVisibility.isMuteUserVisible) and pass that to buildDmMuteUserAction via
buildDmChannelActions (or add a new parameter to
buildDmChannelActions/buildDmMuteUserAction) so hiding channel mute no longer
hides the DM "Mute User" action; also update related KDoc and any call sites
(and the other occurrence around lines 171-176) to use the DM-specific flag
instead of isMuteChannelVisible.
🤖 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/channels/list/DefaultChannelSwipeActions.kt`:
- Around line 93-108: The cached ChannelAction uses remember(channel.cid,
isMuted, canMute) so its label won't update on locale change; compute the
localized labels (e.g., val muteLabel =
resources.getString(R.string.stream_compose_swipe_action_mute) and val
unmuteLabel = resources.getString(R.string.stream_compose_swipe_action_unmute))
before calling remember and include those label strings in the remember key
(remember(channel.cid, isMuted, canMute, muteLabel, unmuteLabel)) so
MuteChannel/UnmuteChannel instances are recreated with updated localized text;
keep the existing handlerState/onAction logic and return the resolved action as
before.

---

Outside diff comments:
In
`@stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/channels/ChannelOptions.kt`:
- Around line 101-143: The DM mute action visibility is incorrectly tied to
optionVisibility.isMuteChannelVisible and the isMuted parameter is now unused;
update buildDefaultChannelActions to remove the dead isMuted parameter,
introduce/consume a DM-specific visibility flag (e.g.
optionVisibility.isMuteUserVisible) and pass that to buildDmMuteUserAction via
buildDmChannelActions (or add a new parameter to
buildDmChannelActions/buildDmMuteUserAction) so hiding channel mute no longer
hides the DM "Mute User" action; also update related KDoc and any call sites
(and the other occurrence around lines 171-176) to use the DM-specific flag
instead of isMuteChannelVisible.
🪄 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: 830cae27-743b-416a-94e5-5ab90364ac70

📥 Commits

Reviewing files that changed from the base of the PR and between 9ce7d4f and 2ad18d8.

📒 Files selected for processing (8)
  • 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/ChannelOptionItemVisibility.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/viewmodel/channels/ChannelListViewModel.kt
  • stream-chat-android-compose/src/main/res/values/strings.xml
  • stream-chat-android-compose/src/test/kotlin/io/getstream/chat/android/compose/viewmodel/channels/ChannelListViewModelTest.kt
  • stream-chat-android-ui-common/api/stream-chat-android-ui-common.api
  • stream-chat-android-ui-common/src/main/kotlin/io/getstream/chat/android/ui/common/state/channels/actions/ChannelAction.kt
💤 Files with no reviewable changes (4)
  • stream-chat-android-compose/src/test/kotlin/io/getstream/chat/android/compose/viewmodel/channels/ChannelListViewModelTest.kt
  • stream-chat-android-ui-common/src/main/kotlin/io/getstream/chat/android/ui/common/state/channels/actions/ChannelAction.kt
  • stream-chat-android-compose/src/main/res/values/strings.xml
  • stream-chat-android-ui-common/api/stream-chat-android-ui-common.api

@gpunto gpunto marked this pull request as ready for review April 1, 2026 15:44
@gpunto gpunto requested a review from a team as a code owner April 1, 2026 15:44
@gpunto gpunto force-pushed the rm-archive-primary branch from 2ad18d8 to 13dd62d Compare April 2, 2026 08:57
@gpunto gpunto force-pushed the rm-archive-primary branch from 13dd62d to 8ed2de5 Compare April 2, 2026 11:26
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 2, 2026

Quality Gate Failed Quality Gate failed

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

See analysis details on SonarQube Cloud

) : ChannelAction {
@DrawableRes
override val icon: Int = R.drawable.stream_ic_action_leave
override val requiredCapability: String = ChannelCapabilities.LEAVE_CHANNEL
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM! Just one small question: I find it a bit strange that this was introduced in the refactor, but not actually used. Is it possible that we were missing some requiredCapabilities check? Or was its usage naturally removed as we were polishing the UI?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

TBH I'm not sure, maybe @aleksandar-apostolov remembers?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:improvement Improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants