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.
This commit is contained in:
Narasimha-sc
2026-03-31 21:39:55 +01:00
committed by GitHub
parent 580e781a66
commit 3f86a7bb62
@@ -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) }