feat(ui): show read-count in mark-all-read confirmation alert

Sample the unread total for the active mode (DM/Channels/Rooms) before
clearing, then alert "N marked read". Matches the original FEATURES.md
design note.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Jakub
2026-05-24 22:46:54 +02:00
parent 31cfbf4997
commit 3e4e85e1ff

View File

@@ -865,16 +865,20 @@ public:
if (_ctx_menu.active) {
auto res = _ctx_menu.handleInput(c);
if (res == PopupMenu::SELECTED) {
int cleared = 0;
if (_mode_sel == 0) {
cleared = getDMUnreadTotal();
_task->clearAllDMUnread();
_task->showAlert("DMs marked read", 800);
} else if (_mode_sel == 1) {
cleared = _task->getChannelUnreadCount();
clearAllChannelUnread();
_task->showAlert("Channels marked read", 800);
} else {
cleared = _task->getRoomUnreadCount();
_task->clearRoomUnread();
_task->showAlert("Rooms marked read", 800);
}
char msg[32];
snprintf(msg, sizeof(msg), "%d marked read", cleared);
_task->showAlert(msg, 800);
}
return true;
}