Skip to content

Fix Leave option not shown when Delete option is visible for group channels#6416

Draft
VelikovPetar wants to merge 1 commit intodevelopfrom
bug/AND-1170_show_leave_and_delete_for_group_channels
Draft

Fix Leave option not shown when Delete option is visible for group channels#6416
VelikovPetar wants to merge 1 commit intodevelopfrom
bug/AND-1170_show_leave_and_delete_for_group_channels

Conversation

@VelikovPetar
Copy link
Copy Markdown
Contributor

@VelikovPetar VelikovPetar commented May 6, 2026

Goal

For group channels where the current user has both leave-channel and delete-channel capabilities (typically channel owners/admins), the channel info screen and the Compose channel-list options menu were only surfacing Delete and hiding Leave. Users want to be able to leave a group they own without having to delete it for everyone.

This change makes both options available whenever the user has the corresponding capability.

Implementation

  • ChannelInfoViewController.buildChannelOptionList: appends LeaveChannel whenever leave-channel capability is present, and independently appends DeleteChannel when delete-channel is present (previously the two were mutually exclusive via if/else).
  • ChannelOptions.buildGroupChannelActions (Compose channel-list bottom sheet): shows LeaveGroup whenever canLeaveChannel, dropping the && !canDeleteChannel exclusion.
  • ChannelInfoOptionButton: replaces the CompositionLocalProvider(LocalContentColor = accentError) wrapper with an explicit destructive: Boolean parameter that drives icon tint and text color (buttonDestructiveText vs textSecondary/textPrimary). Call sites for BlockUser, LeaveChannel, and DeleteChannel pass the appropriate flag — LeaveChannel and DeleteChannel are destructive, BlockUser is not.
  • ChannelInfoViewControllerTest: existing owner-capabilities test updated to expect both LeaveChannel and DeleteChannel in the option list.
  • Snapshot images regenerated for ChannelInfoOptionItemTest (direct + group, light + dark) and DirectChannelInfoContentTest to reflect the explicit destructive coloring.

Testing

  • Updated unit test in ChannelInfoViewControllerTest covers the owner case (both capabilities → both options listed).
  • Updated snapshot tests cover the destructive coloring in light/dark mode for both direct and group channel option items.
  • Manual verification: open a group where you have both leave and delete capabilities and confirm both options appear in the channel info screen and in the Compose channel-list long-press menu.

Co-Authored-By: Claude <noreply@anthropic.com>
@VelikovPetar VelikovPetar added the pr:bug Bug fix label May 6, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 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 (or ignored for dependabot PRs).

🎉 Great job! This PR is ready for review.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

SDK Size Comparison 📏

SDK Before After Difference Status
stream-chat-android-client 5.82 MB 5.82 MB 0.00 MB 🟢
stream-chat-android-ui-components 11.02 MB 11.02 MB 0.00 MB 🟢
stream-chat-android-compose 12.37 MB 12.37 MB 0.00 MB 🟢

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 6, 2026

@VelikovPetar VelikovPetar changed the title Show Leave and Delete options together for group channels (AND-1170) Show Leave and Delete options together for group channels May 6, 2026
@VelikovPetar VelikovPetar changed the title Show Leave and Delete options together for group channels Fix Leave option not shown when Delete option is visible for group channels May 6, 2026
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