Skip to content

Show muted icon on channel items for DMs with muted users#6302

Merged
gpunto merged 2 commits intov7from
mute-icon-channel
Mar 30, 2026
Merged

Show muted icon on channel items for DMs with muted users#6302
gpunto merged 2 commits intov7from
mute-icon-channel

Conversation

@gpunto
Copy link
Copy Markdown
Contributor

@gpunto gpunto commented Mar 27, 2026

Goal

In the channel list, we are currently displaying the muted icon only when the channel is muted. However, for direct messages, we should look at the muted users instead.

Implementation

Check user mutes to decide whether to show the muted icon on items representing direct messages channels

🎨 UI Changes

In the screenshots below, the sheet shows that the user is muted. The channel list lacks the icon in the "Before" screenshot

Before After
Screenshot_20260327_150141 Screenshot_20260327_150109

Testing

Mute a user and then check that the muted icon is shown on the corresponding direct message channel item

Summary by CodeRabbit

Release Notes

  • New Features

    • Channel list now displays mute indicators, showing when a channel is muted or when a direct message recipient is muted.
  • Tests

    • Added test coverage for mute state display across different channel types.

@gpunto gpunto added the pr:bug Bug fix label Mar 27, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 27, 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.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 27, 2026

SDK Size Comparison 📏

SDK Before After Difference Status
stream-chat-android-client 5.25 MB 5.68 MB 0.43 MB 🟡
stream-chat-android-ui-components 10.60 MB 10.99 MB 0.39 MB 🟡
stream-chat-android-compose 12.81 MB 12.11 MB -0.70 MB 🚀

@gpunto gpunto force-pushed the mute-icon-channel branch from 31e5f31 to cc34408 Compare March 27, 2026 14:22
@gpunto gpunto marked this pull request as ready for review March 30, 2026 07:39
@gpunto gpunto requested a review from a team as a code owner March 30, 2026 07:39
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

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

See analysis details on SonarQube Cloud

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 30, 2026

Walkthrough

The changes extend ChannelListViewModel to derive user mute state from GlobalState.muted and incorporate it into channel item rendering. Channel items now display as muted when either the channel itself is muted or, for 1:1 conversations, when the other member is muted by the current user. Test coverage validates this behavior across different channel types.

Changes

Cohort / File(s) Summary
Mute State Integration
stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/viewmodel/channels/ChannelListViewModel.kt
Added globalMuted StateFlow from GlobalState; updated createChannelItems to accept userMutes and currentUser; implemented logic to set ItemState.ChannelItemState.isMuted for channels muted directly or via other member's mute in 1:1 conversations using Channel.isOneToOneMutedByUser() helper.
Test Coverage
stream-chat-android-compose/src/test/kotlin/io/getstream/chat/android/compose/viewmodel/channels/ChannelListViewModelTest.kt
Added test cases for mute state rendering: DM with muted other user, DM without muted user, and group channel with muted member. Introduced givenUserMutes() helper and shared test fixtures (currentUser, otherUser, directChannel, otherUserMute).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

Poem

🐰 A quiet hop through muted chat,
Where voices hush, and that is that,
One-on-one or group so grand,
Mute state flows throughout the land,
Tests assure the logic's right,
Peace preserved in every sight!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 18.18% 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 specifically describes the main change: showing muted icons on DM channel items when users are muted, which aligns with the implementation and objectives.
Description check ✅ Passed The description includes Goal, Implementation, and UI Changes with before/after screenshots, but lacks Testing details, Testing patch, and most contributor/reviewer checklist items.

✏️ 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 mute-icon-channel

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: 2

🤖 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/test/kotlin/io/getstream/chat/android/compose/viewmodel/channels/ChannelListViewModelTest.kt`:
- Around line 196-256: Add a Paparazzi UI snapshot test that renders a 1:1
(direct) channel row with a muted user and verifies the inline mute indicator
using verifyPaparazziDebug; create a new test function (e.g. `fun
givenMutedDm_showsMutedIcon_paparazzi()`) in the Compose test suite, set up a
Paparazzi rule and theme, compose the channel row component under test (use the
same item state used in tests such as ItemState.ChannelItemState or the
ChannelRow/ChannelListItem composable that renders it) feeding it a direct
channel instance (like directChannel) and a mute state (like otherUserMute) so
the UI shows the mute icon, then call verifyPaparazziDebug to capture and assert
the snapshot; ensure the test file follows the repository naming conventions so
it is picked up by verifyPaparazziDebug.
🪄 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: f36b09eb-da1b-4c3d-b263-c9c403e5c04b

📥 Commits

Reviewing files that changed from the base of the PR and between b5937ec and 1a0038f.

📒 Files selected for processing (2)
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/viewmodel/channels/ChannelListViewModel.kt
  • stream-chat-android-compose/src/test/kotlin/io/getstream/chat/android/compose/viewmodel/channels/ChannelListViewModelTest.kt

@gpunto gpunto merged commit 0a6ceb0 into v7 Mar 30, 2026
14 of 16 checks passed
@gpunto gpunto deleted the mute-icon-channel branch March 30, 2026 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:bug Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants