Skip to content

A platform for community discussion. Free, open, simple.

UX: Improve channel context menu "leave" copy (#37230)

Martin Brennan5dfbe26c75b7
diff --git a/.gitignore b/.gitignore
index 68df10d7f07..668e5365ca2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -135,3 +135,4 @@ frontend/discourse-types/declarations
# AI customization
/.claude
/.cursor
+.playwright-mcp
diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-channel-sidebar-context-menu.gjs b/plugins/chat/assets/javascripts/discourse/components/chat-channel-sidebar-context-menu.gjs
index 5282b8e08df..da299fc04e2 100644
--- a/plugins/chat/assets/javascripts/discourse/components/chat-channel-sidebar-context-menu.gjs
+++ b/plugins/chat/assets/javascripts/discourse/components/chat-channel-sidebar-context-menu.gjs
@@ -35,6 +35,12 @@ export default class ChatChannelSidebarContextMenu extends Component {
: "chat.channel_settings.star_channel";
}
+ get leaveLabel() {
+ return this.channel.isDirectMessageChannel
+ ? "chat.channel_settings.close_channel"
+ : "chat.channel_settings.leave_channel";
+ }
+
@action
async toggleStarred() {
if (!this.currentUserMembership || this.isTogglingStarred) {
@@ -151,8 +157,8 @@ export default class ChatChannelSidebarContextMenu extends Component {
<DButton
@action={{this.leaveChannel}}
@icon="xmark"
- @label="chat.channel_settings.leave_channel"
- @title="chat.channel_settings.leave_channel"
+ @label={{this.leaveLabel}}
+ @title={{this.leaveLabel}}
class="chat-channel-sidebar-link-menu__leave-channel --danger"
/>
</dropdown.item>