Fix Leave option not shown when Delete option is visible for group channels#6416
Fix Leave option not shown when Delete option is visible for group channels#6416VelikovPetar wants to merge 1 commit intodevelopfrom
Leave option not shown when Delete option is visible for group channels#6416Conversation
Co-Authored-By: Claude <noreply@anthropic.com>
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
SDK Size Comparison 📏
|
|
Leave and Delete options together for group channels
Leave and Delete options together for group channelsLeave option not shown when Delete option is visible for group channels
|
ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (6)
📒 Files selected for processing (5)
WalkthroughThe pull request refactors channel info option styling from externally applied color providers to a ChangesDestructive Action Styling and Dual Options Support
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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 |



Goal
For group channels where the current user has both
leave-channelanddelete-channelcapabilities (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: appendsLeaveChannelwheneverleave-channelcapability is present, and independently appendsDeleteChannelwhendelete-channelis present (previously the two were mutually exclusive viaif/else).ChannelOptions.buildGroupChannelActions(Compose channel-list bottom sheet): showsLeaveGroupwhenevercanLeaveChannel, dropping the&& !canDeleteChannelexclusion.ChannelInfoOptionButton: replaces theCompositionLocalProvider(LocalContentColor = accentError)wrapper with an explicitdestructive: Booleanparameter that drives icontintand textcolor(buttonDestructiveTextvstextSecondary/textPrimary). Call sites forBlockUser,LeaveChannel, andDeleteChannelpass the appropriate flag —LeaveChannelandDeleteChannelare destructive,BlockUseris not.ChannelInfoViewControllerTest: existing owner-capabilities test updated to expect bothLeaveChannelandDeleteChannelin the option list.ChannelInfoOptionItemTest(direct + group, light + dark) andDirectChannelInfoContentTestto reflect the explicit destructive coloring.Testing
ChannelInfoViewControllerTestcovers the owner case (both capabilities → both options listed).Summary by CodeRabbit
Release Notes
UI Improvements
Bug Fixes