feat(NearbyScreen): waypoint/navigate from list, TIME filter, addWaypoint helper

NearbyScreen:
- Hold Enter on a list row now shows Navigate and Save waypoint directly,
  without entering the detail view first
- TIME added as the last filter slot (LEFT/RIGHT cycles Fav→ALL→…→Snsr→TIME);
  time-sort shows age in right column and sorts by last-heard descending
- Save waypoint also available from detail view Options menu

UITask:
- Extract addWaypoint() helper (two overloads: with/without explicit timestamp)
  consolidating the full()+add()+saveWaypoints()+alert pattern; TrailScreen
  and QuickMsgScreen updated to use it

Fixes:
- SoundNotifier.h: correct NodePrefs.h include path (../NodePrefs.h)
- kbAddSensorPlaceholders: dereference _kb pointer in SettingsScreen,
  QuickMsgScreen and BotScreen (signature changed to KeyboardWidget&)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Jakub
2026-06-09 15:09:57 +02:00
parent 5c86b85ec3
commit e6f8fb99c7
8 changed files with 91 additions and 43 deletions

View File

@@ -468,13 +468,7 @@ private:
char label[WAYPOINT_LABEL_LEN];
if (_add_label[0]) { strncpy(label, _add_label, sizeof(label) - 1); label[sizeof(label) - 1] = '\0'; }
else snprintf(label, sizeof(label), "WP%d", _task->waypoints().count() + 1);
if (_task->waypoints().add(lat, lon, (uint32_t)rtc_clock.getCurrentTime(), label)) {
_task->saveWaypoints();
_task->showAlert("Waypoint saved", 800);
_wp_mode = WP_OFF;
} else {
_task->showAlert("Waypoints full", 1000);
}
if (_task->addWaypoint(lat, lon, label)) { _wp_mode = WP_OFF; }
}
void renderAddForm(DisplayDriver& display) {
@@ -511,12 +505,7 @@ private:
snprintf(auto_lbl, sizeof(auto_lbl), "WP%d", _task->waypoints().count() + 1);
buf = auto_lbl;
}
if (_task->waypoints().add(_mark_lat, _mark_lon, _mark_ts, buf)) {
_task->saveWaypoints();
_task->showAlert("Waypoint saved", 800);
} else {
_task->showAlert("Waypoints full", 1000);
}
_task->addWaypoint(_mark_lat, _mark_lon, _mark_ts, buf);
}
void renderWpList(DisplayDriver& display) {