From f5e39c0752ff483008120d8895cda2b201017705 Mon Sep 17 00:00:00 2001 From: ARIA Date: Thu, 20 Aug 2026 21:00:36 +0200 Subject: [PATCH] Channel context menu: hide Delete for the default channel (it can be renamed but not deleted; server already enforces this) --- .../src/commonMain/kotlin/iris/ui/screens/ChatScreen.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/shared/src/commonMain/kotlin/iris/ui/screens/ChatScreen.kt b/app/shared/src/commonMain/kotlin/iris/ui/screens/ChatScreen.kt index a20f40d..0af009d 100644 --- a/app/shared/src/commonMain/kotlin/iris/ui/screens/ChatScreen.kt +++ b/app/shared/src/commonMain/kotlin/iris/ui/screens/ChatScreen.kt @@ -1082,7 +1082,8 @@ private fun IconImage(base64: String, size: Dp) { /** * Long-press / right-click context menu for a channel row: rename, favorite - * (state-aware), icon (state-aware), delete. + * (state-aware), icon (state-aware), delete. The default channel cannot be + * deleted (the server enforces this too), so its "Delete" item is hidden. */ @Composable private fun ChannelContextMenu( @@ -1105,7 +1106,9 @@ private fun ChannelContextMenu( text = { Text(if (hasIcon) "Change icon" else "Add icon") }, onClick = { onDismiss(); onEditIcon() }, ) - DropdownMenuItem(text = { Text("Delete") }, onClick = { onDismiss(); onDelete() }) + if (!ch.isDefault) { + DropdownMenuItem(text = { Text("Delete") }, onClick = { onDismiss(); onDelete() }) + } } }