Implement multi-select chats with bulk actions in sidebar#639
Conversation
- Ctrl+Click a chat to enter selection mode; additional Ctrl+Clicks toggle more chats - The currently open chat is automatically included when entering selection mode - Plain click while in selection mode exits selection and opens the clicked chat - Selected chats use the same visual style as the active (open) chat - Right-clicking a selected chat while multiple are selected shows a bulk Delete option - Bulk delete confirmation popup mirrors the single-chat UX including an 'Also delete for contacts' checkbox when any selected chat is a private user conversation - Escape / back button exits selection mode
…ntext menu - Mark as Unread: loops markDialogUnread for all selected peers - Mute: opens a new PopupBulkMute (mirrors PopupMute's time-picker UI) and applies the chosen duration to all selected peers - Archive: calls editPeerFolders with all selected peerIds in one API call
|
Thanks for this — the selection state machine and the context-menu swap are a solid foundation. My feedback splits into two parts: the interaction/UX model (the main thing), and a recap of the correctness notes from my earlier review. UX & interaction modelThe client already ships a selection system, used both for messages in chat and for shared-media/search results: 1. Selection should be shown with checkboxes, not a fill highlight. 2. Selection should be initiated from the menu, not Ctrl/Cmd+click. 3. There's no selection action bar. Net: Correctness & code quality (recap of my earlier review)Bringing these forward so everything is in one place:
Happy to help with any of these — especially the bulk-delete fix and extending |
This pull request introduces multi-select (bulk selection) functionality for dialogs (chats) in the sidebar, enabling users to select multiple chats and perform bulk actions such as marking as unread, muting, archiving, or deleting. It includes UI state management, context menu adjustments, and new popup dialogs for bulk actions.
Bulk selection and context menu enhancements:
AppDialogsManager, including methods to enter, update, toggle, and exit chat selection mode, and to track selected chats (selectedPeerIds,isSelectingChats). Ctrl/Cmd+Click now toggles selection, and the UI updates accordingly. [1] [2] [3]DialogsContextMenuto detect when bulk selection is active and display a special context menu with bulk actions (Mark as Unread, Mute, Archive, Delete) when right-clicking a selected chat. [1] [2] [3] [4]Bulk action implementations:
PopupBulkMutepopup for muting multiple chats at once, allowing the user to select mute duration.PopupDeleteDialogspopup for confirming deletion of multiple chats, including an option to also delete messages for contacts.UI and language support:
Supporting utilities and imports:
These changes collectively enable efficient management of multiple chats, improving usability for users handling large numbers of dialogs.