mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-11-02 19:02:00 +00:00
feat(ui): drop echo toasts for actions the screen already shows
L1: Counters reset, Trail reset, Contact added/deleted, Logged in (admin), Logged out, Channel deleted, Share target / Bot channel / Bot room set, PIN set/cleared, Preset saved/deleted, and Unpinned on the favourites grid. L2: Channel deleted, Counters reset, Region/Preset/Scope/Waypoint deleted, Target cleared, Trail cleared, Message history deleted, Contact added/deleted. Failures and Unpinned where the item leaves the screen stay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -145,7 +145,6 @@ void UITask::channelAction(uint8_t act) {
|
|||||||
if (!tapConfirmed(s_del_lbl, "Delete?")) break;
|
if (!tapConfirmed(s_del_lbl, "Delete?")) break;
|
||||||
chanctl::remove(idx);
|
chanctl::remove(idx);
|
||||||
navClosePopup();
|
navClosePopup();
|
||||||
showToast("Channel deleted");
|
|
||||||
showChats();
|
showChats();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -383,5 +383,4 @@ void UITask::diagReset() {
|
|||||||
diag::resetCounters();
|
diag::resetCounters();
|
||||||
navClosePopup();
|
navClosePopup();
|
||||||
refreshDiag();
|
refreshDiag();
|
||||||
showToast("Counters reset");
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -91,7 +91,6 @@ void UITask::mapRegionAction(uint8_t act) {
|
|||||||
mapview::labels::flush();
|
mapview::labels::flush();
|
||||||
mapview::s_cache.invalidate();
|
mapview::s_cache.invalidate();
|
||||||
mapRegionsPopup();
|
mapRegionsPopup();
|
||||||
showToast("Region deleted");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -540,7 +540,6 @@ void UITask::navPick(int code) {
|
|||||||
if (navmap::s_tb.active()) { navmap::s_tb.stop(); showToast("Track back stopped"); break; }
|
if (navmap::s_tb.active()) { navmap::s_tb.stop(); showToast("Track back stopped"); break; }
|
||||||
_core->locator.clearTarget();
|
_core->locator.clearTarget();
|
||||||
prefsSave();
|
prefsSave();
|
||||||
showToast("Target cleared");
|
|
||||||
break;
|
break;
|
||||||
case navmap::T_WAYPOINT: {
|
case navmap::T_WAYPOINT: {
|
||||||
if (idx >= _core->waypoints.count()) return;
|
if (idx >= _core->waypoints.count()) return;
|
||||||
@@ -734,7 +733,6 @@ void UITask::navWaypointAction(uint8_t act) {
|
|||||||
if (!tapConfirmed(_nav_del_lbl, "Delete?")) break;
|
if (!tapConfirmed(_nav_del_lbl, "Delete?")) break;
|
||||||
_core->waypoints.remove(i);
|
_core->waypoints.remove(i);
|
||||||
navClosePopup();
|
navClosePopup();
|
||||||
showToast("Waypoint deleted");
|
|
||||||
rebuildMapMarkers();
|
rebuildMapMarkers();
|
||||||
layoutMap();
|
layoutMap();
|
||||||
refreshNavBar();
|
refreshNavBar();
|
||||||
@@ -1332,7 +1330,6 @@ void UITask::navToolAction(uint8_t act) {
|
|||||||
case navmap::TL_TRAIL_RESET:
|
case navmap::TL_TRAIL_RESET:
|
||||||
if (!tapConfirmed(_nav_reset_lbl, "Reset?")) return;
|
if (!tapConfirmed(_nav_reset_lbl, "Reset?")) return;
|
||||||
tr.reset();
|
tr.reset();
|
||||||
showToast("Trail cleared");
|
|
||||||
rebuildMapMarkers();
|
rebuildMapMarkers();
|
||||||
layoutMap();
|
layoutMap();
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -99,7 +99,6 @@ void UITask::presetAction(uint8_t act) {
|
|||||||
prefsSave();
|
prefsSave();
|
||||||
navClosePopup();
|
navClosePopup();
|
||||||
rebuildRadio();
|
rebuildRadio();
|
||||||
showToast("Preset deleted");
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -217,7 +216,6 @@ void UITask::scopeAction(uint8_t act) {
|
|||||||
if (s_scope > 0) the_mesh.removeScope((uint8_t)s_scope);
|
if (s_scope > 0) the_mesh.removeScope((uint8_t)s_scope);
|
||||||
navClosePopup();
|
navClosePopup();
|
||||||
buildScopes();
|
buildScopes();
|
||||||
showToast("Scope deleted");
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -355,7 +355,6 @@ void UITask::storageClearHistory() {
|
|||||||
s_archive.clearAll();
|
s_archive.clearAll();
|
||||||
_core->history.clearAll();
|
_core->history.clearAll();
|
||||||
_core->markAllRead();
|
_core->markAllRead();
|
||||||
showToast("Message history deleted");
|
|
||||||
startWalk();
|
startWalk();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3787,7 +3787,6 @@ void UITask::nodeAction(uint8_t action) {
|
|||||||
break;
|
break;
|
||||||
case NODE_ADD:
|
case NODE_ADD:
|
||||||
if (the_mesh.addDiscoveredContact(e.pub_key, e.name, e.type)) {
|
if (the_mesh.addDiscoveredContact(e.pub_key, e.name, e.type)) {
|
||||||
showToast("Contact added");
|
|
||||||
_screen = SCR_NEARBY;
|
_screen = SCR_NEARBY;
|
||||||
buildNearby();
|
buildNearby();
|
||||||
} else {
|
} else {
|
||||||
@@ -3826,7 +3825,6 @@ void UITask::nodeAction(uint8_t action) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (the_mesh.deleteContactByKey(e.pub_key)) {
|
if (the_mesh.deleteContactByKey(e.pub_key)) {
|
||||||
showToast("Contact deleted");
|
|
||||||
_screen = SCR_NEARBY;
|
_screen = SCR_NEARBY;
|
||||||
buildNearby();
|
buildNearby();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -140,7 +140,6 @@ public:
|
|||||||
case AdminSession::LOGGED_IN:
|
case AdminSession::LOGGED_IN:
|
||||||
_tab = admin::TAB_SYSTEM;
|
_tab = admin::TAB_SYSTEM;
|
||||||
_row_sel = _row_scroll = 0;
|
_row_sel = _row_scroll = 0;
|
||||||
_task->showAlert("Logged in (admin)", 1000);
|
|
||||||
break;
|
break;
|
||||||
case AdminSession::NOT_ADMIN: _task->showAlert("Not admin on this node", 1600); returnToOrigin(); break;
|
case AdminSession::NOT_ADMIN: _task->showAlert("Not admin on this node", 1600); returnToOrigin(); break;
|
||||||
case AdminSession::LOGIN_FAILED: _task->showAlert("Login failed", 1400); returnToOrigin(); break;
|
case AdminSession::LOGIN_FAILED: _task->showAlert("Login failed", 1400); returnToOrigin(); break;
|
||||||
|
|||||||
@@ -1043,7 +1043,6 @@ public:
|
|||||||
the_mesh.savePrefs();
|
the_mesh.savePrefs();
|
||||||
}
|
}
|
||||||
_pick_target = false;
|
_pick_target = false;
|
||||||
_task->showAlert("Share target set", 1200);
|
|
||||||
_task->gotoLiveShareScreen();
|
_task->gotoLiveShareScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1086,7 +1085,6 @@ public:
|
|||||||
the_mesh.savePrefs();
|
the_mesh.savePrefs();
|
||||||
}
|
}
|
||||||
_pick_bot_channel = false;
|
_pick_bot_channel = false;
|
||||||
_task->showAlert("Bot channel set", 1200);
|
|
||||||
_task->gotoBotScreen();
|
_task->gotoBotScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1112,7 +1110,6 @@ public:
|
|||||||
}
|
}
|
||||||
_pick_bot_room = false;
|
_pick_bot_room = false;
|
||||||
_room_mode = false;
|
_room_mode = false;
|
||||||
_task->showAlert("Bot room set", 1200);
|
|
||||||
_task->gotoBotScreen();
|
_task->gotoBotScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1130,7 +1127,6 @@ public:
|
|||||||
the_mesh.savePrefs();
|
the_mesh.savePrefs();
|
||||||
}
|
}
|
||||||
_pick_target = false;
|
_pick_target = false;
|
||||||
_task->showAlert("Share target set", 1200);
|
|
||||||
_task->gotoLiveShareScreen();
|
_task->gotoLiveShareScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1961,7 +1957,6 @@ public:
|
|||||||
} else if (sel != _ctx_fav_idx) {
|
} else if (sel != _ctx_fav_idx) {
|
||||||
// Logout: only reachable when isRoomLoggedIn() added this item.
|
// Logout: only reachable when isRoomLoggedIn() added this item.
|
||||||
_task->core().rooms.logout(_sel_contact.id.pub_key);
|
_task->core().rooms.logout(_sel_contact.id.pub_key);
|
||||||
_task->showAlert("Logged out", 1000);
|
|
||||||
}
|
}
|
||||||
// Fav is a value row -- Enter never selects it (see cycleRoomCtxValue).
|
// Fav is a value row -- Enter never selects it (see cycleRoomCtxValue).
|
||||||
}
|
}
|
||||||
@@ -2132,7 +2127,6 @@ public:
|
|||||||
// Delete/Cancel sub-menu, defaults to Cancel (see where it's opened).
|
// Delete/Cancel sub-menu, defaults to Cancel (see where it's opened).
|
||||||
if (res == PopupMenu::SELECTED && _ctx_menu.selectedIndex() == 0) { // "Delete"
|
if (res == PopupMenu::SELECTED && _ctx_menu.selectedIndex() == 0) { // "Delete"
|
||||||
chanctl::remove(_ctx_ch_idx);
|
chanctl::remove(_ctx_ch_idx);
|
||||||
_task->showAlert("Channel deleted", 1000);
|
|
||||||
}
|
}
|
||||||
if (res != PopupMenu::NONE) {
|
if (res != PopupMenu::NONE) {
|
||||||
_ch_delete_confirm_active = false;
|
_ch_delete_confirm_active = false;
|
||||||
|
|||||||
@@ -194,7 +194,6 @@ class NearbyScreen : public UIScreen, protected NearbyModel {
|
|||||||
uint8_t key[PUB_KEY_SIZE];
|
uint8_t key[PUB_KEY_SIZE];
|
||||||
memcpy(key, e->pub_key, PUB_KEY_SIZE);
|
memcpy(key, e->pub_key, PUB_KEY_SIZE);
|
||||||
if (the_mesh.deleteContactByKey(key)) {
|
if (the_mesh.deleteContactByKey(key)) {
|
||||||
_task->showAlert("Contact deleted", 1200);
|
|
||||||
_detail = false; // the node this detail/nav view showed is gone
|
_detail = false; // the node this detail/nav view showed is gone
|
||||||
_nav = false;
|
_nav = false;
|
||||||
refresh();
|
refresh();
|
||||||
@@ -404,7 +403,6 @@ class NearbyScreen : public UIScreen, protected NearbyModel {
|
|||||||
const Entry* e = selected();
|
const Entry* e = selected();
|
||||||
if (e && e->has_key) {
|
if (e && e->has_key) {
|
||||||
if (the_mesh.addDiscoveredContact(e->pub_key, e->name, e->type)) {
|
if (the_mesh.addDiscoveredContact(e->pub_key, e->name, e->type)) {
|
||||||
_task->showAlert("Contact added", 1200);
|
|
||||||
refresh(); // now a known contact — re-sort / re-mark this pass
|
refresh(); // now a known contact — re-sort / re-mark this pass
|
||||||
} else {
|
} else {
|
||||||
_task->showAlert("Contacts full", 1200);
|
_task->showAlert("Contacts full", 1200);
|
||||||
|
|||||||
@@ -182,7 +182,6 @@ public:
|
|||||||
if (res == KeyboardWidget::DONE) {
|
if (res == KeyboardWidget::DONE) {
|
||||||
if (_picker.save(p, _task->keyboard().buf, rptTarget(p))) {
|
if (_picker.save(p, _task->keyboard().buf, rptTarget(p))) {
|
||||||
_dirty = true;
|
_dirty = true;
|
||||||
_task->showAlert("Preset saved", 800);
|
|
||||||
}
|
}
|
||||||
_picker.saving = false;
|
_picker.saving = false;
|
||||||
} else if (res == KeyboardWidget::CANCELLED) {
|
} else if (res == KeyboardWidget::CANCELLED) {
|
||||||
@@ -224,7 +223,6 @@ public:
|
|||||||
break;
|
break;
|
||||||
case RadioPresetPicker::DELETED:
|
case RadioPresetPicker::DELETED:
|
||||||
_dirty = true;
|
_dirty = true;
|
||||||
_task->showAlert("Preset deleted", 800);
|
|
||||||
break;
|
break;
|
||||||
case RadioPresetPicker::NONE:
|
case RadioPresetPicker::NONE:
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -746,7 +746,6 @@ public:
|
|||||||
}
|
}
|
||||||
_edit_lock_pass = false;
|
_edit_lock_pass = false;
|
||||||
_lock_pass_first[0] = '\0';
|
_lock_pass_first[0] = '\0';
|
||||||
_task->showAlert("PIN set", 900);
|
|
||||||
}
|
}
|
||||||
} else if (res == KeyboardWidget::CANCELLED) {
|
} else if (res == KeyboardWidget::CANCELLED) {
|
||||||
_edit_lock_pass = false;
|
_edit_lock_pass = false;
|
||||||
@@ -837,7 +836,6 @@ public:
|
|||||||
if (res == KeyboardWidget::DONE) {
|
if (res == KeyboardWidget::DONE) {
|
||||||
if (p && _picker.save(p, _kb->buf, radioTarget(p))) {
|
if (p && _picker.save(p, _kb->buf, radioTarget(p))) {
|
||||||
_dirty = true;
|
_dirty = true;
|
||||||
_task->showAlert("Preset saved", 800);
|
|
||||||
}
|
}
|
||||||
_picker.saving = false;
|
_picker.saving = false;
|
||||||
} else if (res == KeyboardWidget::CANCELLED) {
|
} else if (res == KeyboardWidget::CANCELLED) {
|
||||||
@@ -862,7 +860,6 @@ public:
|
|||||||
break;
|
break;
|
||||||
case RadioPresetPicker::DELETED:
|
case RadioPresetPicker::DELETED:
|
||||||
_dirty = true;
|
_dirty = true;
|
||||||
_task->showAlert("Preset deleted", 800);
|
|
||||||
break;
|
break;
|
||||||
case RadioPresetPicker::NONE:
|
case RadioPresetPicker::NONE:
|
||||||
break;
|
break;
|
||||||
@@ -981,7 +978,6 @@ public:
|
|||||||
if (_task->passwordLockEnabled()) {
|
if (_task->passwordLockEnabled()) {
|
||||||
_task->setNodeLockPassword("");
|
_task->setNodeLockPassword("");
|
||||||
the_mesh.savePrefs();
|
the_mesh.savePrefs();
|
||||||
_task->showAlert("PIN cleared", 900);
|
|
||||||
} else {
|
} else {
|
||||||
_edit_lock_pass = true;
|
_edit_lock_pass = true;
|
||||||
_lock_pass_first[0] = '\0';
|
_lock_pass_first[0] = '\0';
|
||||||
|
|||||||
@@ -384,7 +384,6 @@ public:
|
|||||||
if (res == PopupMenu::SELECTED && _reset_menu.selectedIndex() == 0) {
|
if (res == PopupMenu::SELECTED && _reset_menu.selectedIndex() == 0) {
|
||||||
diag::resetCounters();
|
diag::resetCounters();
|
||||||
_last_rx = 0;
|
_last_rx = 0;
|
||||||
_task->showAlert("Counters reset", 800);
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -271,7 +271,6 @@ private:
|
|||||||
}
|
}
|
||||||
void handleReset() {
|
void handleReset() {
|
||||||
_task->core().trail.reset();
|
_task->core().trail.reset();
|
||||||
_task->showAlert("Trail reset", 800);
|
|
||||||
}
|
}
|
||||||
void handleSave() {
|
void handleSave() {
|
||||||
TrailEngine::FileResult r = _task->core().trail.save();
|
TrailEngine::FileResult r = _task->core().trail.save();
|
||||||
|
|||||||
@@ -1553,9 +1553,6 @@ public:
|
|||||||
}
|
}
|
||||||
_task->clearFavouriteSlot(_pin_target_slot);
|
_task->clearFavouriteSlot(_pin_target_slot);
|
||||||
the_mesh.savePrefs();
|
the_mesh.savePrefs();
|
||||||
char alert[24];
|
|
||||||
snprintf(alert, sizeof(alert), "Unpinned (slot %d)", _pin_target_slot + 1);
|
|
||||||
_task->showAlert(alert, 800);
|
|
||||||
}
|
}
|
||||||
if (res != PopupMenu::NONE) _pin_target_slot = -1;
|
if (res != PopupMenu::NONE) _pin_target_slot = -1;
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user