From 3f86a7bb62547037903f635b3709bd091a4460df Mon Sep 17 00:00:00 2001 From: Narasimha-sc <166327228+Narasimha-sc@users.noreply.github.com> Date: Tue, 31 Mar 2026 20:39:55 +0000 Subject: [PATCH] ui: fix filter button appearing before call buttons during active call (#6733) During an active call, the content filter button appeared before the call timer and end call button in the toolbar. Move the content filter button after chat-type specific buttons so call controls always appear first. --- .../simplex/common/views/chat/ChatView.kt | 39 ++++++++++--------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/ChatView.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/ChatView.kt index 5206d0556c..b88620b6f9 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/ChatView.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/ChatView.kt @@ -1172,25 +1172,6 @@ fun BoxScope.ChatInfoToolbar( chatInfo.contact.active && activeCall == null - // Content filter button: always in bar on desktop and for groups; on Android for direct chats it - // goes into the three-dots menu UNLESS calls are unavailable, in which case it appears in the bar - if (showContentFilterButton && (appPlatform.isDesktop || chatInfo is ChatInfo.Group || - (appPlatform.isAndroid && chatInfo is ChatInfo.Direct && !canStartCall && activeCall == null))) { - val enabled = chatInfo !is ChatInfo.Local || chatInfo.noteFolder.ready - barButtons.add { - IconButton( - { showContentFilterMenu.value = true }, - enabled = enabled - ) { - Icon( - painterResource(MR.images.ic_photo_library), - null, - tint = MaterialTheme.colors.primary - ) - } - } - } - // Chat-type specific buttons when (chatInfo) { is ChatInfo.Local -> { @@ -1285,6 +1266,26 @@ fun BoxScope.ChatInfoToolbar( else -> {} } + // Content filter button: always in bar on desktop and for groups; on Android for direct chats it + // goes into the three-dots menu UNLESS calls are unavailable, in which case it appears in the bar. + // Must be after chat-type buttons so call buttons appear before filter during active call. + if (showContentFilterButton && (appPlatform.isDesktop || chatInfo is ChatInfo.Group || + (appPlatform.isAndroid && chatInfo is ChatInfo.Direct && !canStartCall && activeCall == null))) { + val enabled = chatInfo !is ChatInfo.Local || chatInfo.noteFolder.ready + barButtons.add { + IconButton( + { showContentFilterMenu.value = true }, + enabled = enabled + ) { + Icon( + painterResource(MR.images.ic_photo_library), + null, + tint = MaterialTheme.colors.primary + ) + } + } + } + val enableNtfs = chatInfo.chatSettings?.enableNtfs if (((chatInfo is ChatInfo.Direct && chatInfo.contact.ready && chatInfo.contact.active) || chatInfo is ChatInfo.Group) && enableNtfs != null) { val ntfMode = remember { mutableStateOf(enableNtfs) }