android: refine chats multi-select menu labels and state
Some checks failed
Android CI / android (push) Failing after 5m17s
Android Release / release (push) Has started running
CI / test (push) Has been cancelled

This commit is contained in:
Codex
2026-03-09 22:19:54 +03:00
parent e6a9fe9cca
commit 77697ff36e
2 changed files with 22 additions and 14 deletions

View File

@@ -609,3 +609,8 @@
- selected chat -> colored circle with check icon, - selected chat -> colored circle with check icon,
- unselected chat -> empty outlined circle. - unselected chat -> empty outlined circle.
- This matches the reference behavior and makes selected rows easier to scan. - This matches the reference behavior and makes selected rows easier to scan.
### Step 96 - Selection menu labels and behavior polish
- Updated multi-select top actions/menu to be closer to Telegram reference in wording.
- Added dynamic `Закрепить/Открепить` label in selection overflow based on selected chats pinned state.
- Kept non-supported actions explicit with user feedback (Toast), avoiding silent no-op behavior.

View File

@@ -180,6 +180,10 @@ fun ChatListScreen(
var manageRoleText by remember { mutableStateOf("member") } var manageRoleText by remember { mutableStateOf("member") }
val isTabletLayout = LocalConfiguration.current.screenWidthDp >= 840 val isTabletLayout = LocalConfiguration.current.screenWidthDp >= 840
val listState = rememberLazyListState() val listState = rememberLazyListState()
val selectedChats = remember(state.chats, selectedChatIds) {
state.chats.filter { selectedChatIds.contains(it.id) }
}
val allSelectedPinned = selectedChats.isNotEmpty() && selectedChats.all { it.pinned }
BackHandler(enabled = isSearchMode) { BackHandler(enabled = isSearchMode) {
isSearchMode = false isSearchMode = false
localSearchQuery = "" localSearchQuery = ""
@@ -265,20 +269,19 @@ fun ChatListScreen(
actions = { actions = {
if (selectedChatIds.isNotEmpty()) { if (selectedChatIds.isNotEmpty()) {
IconButton(onClick = { IconButton(onClick = {
Toast.makeText(context, "Bulk mute will be added next.", Toast.LENGTH_SHORT).show() Toast.makeText(context, "Настройки звука для выбранных будут добавлены позже.", Toast.LENGTH_SHORT).show()
}) { }) {
Icon( Icon(
imageVector = Icons.Filled.NotificationsOff, imageVector = Icons.Filled.NotificationsOff,
contentDescription = "Mute selected", contentDescription = "Выключить уведомления",
) )
} }
IconButton(onClick = { IconButton(onClick = {
selectedChatIds = emptySet() Toast.makeText(context, "Архивирование выбранных будет добавлено позже.", Toast.LENGTH_SHORT).show()
onTabSelected(ChatTab.ARCHIVED)
}) { }) {
Icon( Icon(
imageVector = Icons.Filled.FolderOpen, imageVector = Icons.Filled.FolderOpen,
contentDescription = "Archive selected", contentDescription = "Архивировать",
) )
} }
IconButton(onClick = { IconButton(onClick = {
@@ -294,7 +297,7 @@ fun ChatListScreen(
IconButton(onClick = { showSelectionMenu = true }) { IconButton(onClick = { showSelectionMenu = true }) {
Icon( Icon(
imageVector = Icons.Filled.MoreVert, imageVector = Icons.Filled.MoreVert,
contentDescription = "Selection menu", contentDescription = "Меню выбранного",
) )
} }
DropdownMenu( DropdownMenu(
@@ -302,35 +305,35 @@ fun ChatListScreen(
onDismissRequest = { showSelectionMenu = false }, onDismissRequest = { showSelectionMenu = false },
) { ) {
DropdownMenuItem( DropdownMenuItem(
text = { Text("Unpin") }, text = { Text(if (allSelectedPinned) "Открепить" else "Закрепить") },
leadingIcon = { Icon(Icons.Filled.PushPin, contentDescription = null) }, leadingIcon = { Icon(Icons.Filled.PushPin, contentDescription = null) },
onClick = { onClick = {
showSelectionMenu = false showSelectionMenu = false
Toast.makeText(context, "Bulk pin/unpin will be added next.", Toast.LENGTH_SHORT).show() Toast.makeText(context, "Закрепление будет добавлено после API поддержки.", Toast.LENGTH_SHORT).show()
}, },
) )
DropdownMenuItem( DropdownMenuItem(
text = { Text("Add to folder") }, text = { Text("Добавить в папку") },
leadingIcon = { Icon(Icons.Filled.FolderOpen, contentDescription = null) }, leadingIcon = { Icon(Icons.Filled.FolderOpen, contentDescription = null) },
onClick = { onClick = {
showSelectionMenu = false showSelectionMenu = false
Toast.makeText(context, "Folders UI will be added next.", Toast.LENGTH_SHORT).show() Toast.makeText(context, "Папки чатов будут добавлены позже.", Toast.LENGTH_SHORT).show()
}, },
) )
DropdownMenuItem( DropdownMenuItem(
text = { Text("Mark unread") }, text = { Text("Пометить непрочитанным") },
leadingIcon = { Icon(Icons.Filled.DoneAll, contentDescription = null) }, leadingIcon = { Icon(Icons.Filled.DoneAll, contentDescription = null) },
onClick = { onClick = {
showSelectionMenu = false showSelectionMenu = false
Toast.makeText(context, "Mark unread action will be added next.", Toast.LENGTH_SHORT).show() Toast.makeText(context, "Отметка непрочитанным будет добавлена позже.", Toast.LENGTH_SHORT).show()
}, },
) )
DropdownMenuItem( DropdownMenuItem(
text = { Text("Clear cache") }, text = { Text("Удалить из кэша") },
leadingIcon = { Icon(Icons.Filled.Delete, contentDescription = null) }, leadingIcon = { Icon(Icons.Filled.Delete, contentDescription = null) },
onClick = { onClick = {
showSelectionMenu = false showSelectionMenu = false
Toast.makeText(context, "Media cache clear will be added next.", Toast.LENGTH_SHORT).show() Toast.makeText(context, "Очистка кэша будет добавлена позже.", Toast.LENGTH_SHORT).show()
}, },
) )
} }