refactor(ui): move trail Min-dist setting out of Settings into the tool itself

Per-tool config belongs in the tool, matching Auto-Advert's pattern.
SettingsScreen drops:
- TRAIL_MIN_DELTA enum entry + the entire SECTION_GPS gate (it was its
  only remaining item after GPS upd / Trail int were removed)
- Render and input handler blocks

TrailScreen gains a small modal popup opened with Hold Enter (the
KEY_CONTEXT_MENU input). Enter cycles through the four min-dist values
(5/10/25/100 m), Esc closes the popup. The popup overlays whichever
view is active; savePrefs runs on each cycle so the value persists.

NodePrefs::trail_min_delta_idx and the TrailStore::MIN_DELTA_* helpers
are unchanged — only the entry point shifted.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Jakub
2026-05-25 12:54:51 +02:00
co-authored by Claude Sonnet 4.6
parent 178a34d1ec
commit 08c09163ca
2 changed files with 50 additions and 23 deletions
@@ -56,11 +56,6 @@ class SettingsScreen : public UIScreen {
SECTION_SYSTEM,
TIMEZONE,
LOW_BAT,
#if ENV_INCLUDE_GPS == 1
// GPS section
SECTION_GPS,
TRAIL_MIN_DELTA,
#endif
// Contacts section
SECTION_CONTACTS, DM_FILTER, ROOM_FILTER,
// Messages section
@@ -406,12 +401,6 @@ class SettingsScreen : public UIScreen {
display.print("AutoLock");
display.setCursor(display.valCol(), y);
display.print((p && p->auto_lock) ? "ON" : "OFF");
#if ENV_INCLUDE_GPS == 1
} else if (item == TRAIL_MIN_DELTA) {
display.print("Trail dist");
display.setCursor(display.valCol(), y);
display.print(TrailStore::minDeltaLabel(p ? p->trail_min_delta_idx : 0));
#endif
} else if (item == TIMEZONE) {
display.print("TimeZone");
char buf[8];
@@ -636,16 +625,6 @@ public:
_dirty = true;
return true;
}
#if ENV_INCLUDE_GPS == 1
if (_selected == TRAIL_MIN_DELTA && p && (left || right)) {
int idx = p->trail_min_delta_idx;
if (idx >= TrailStore::MIN_DELTA_COUNT) idx = 0;
idx = (idx + (right ? 1 : TrailStore::MIN_DELTA_COUNT - 1)) % TrailStore::MIN_DELTA_COUNT;
p->trail_min_delta_idx = (uint8_t)idx;
_dirty = true;
return true;
}
#endif
if (_selected == TIMEZONE && p) {
if (right && p->tz_offset_hours < 14) { p->tz_offset_hours++; _dirty = true; return true; }
if (left && p->tz_offset_hours > -12) { p->tz_offset_hours--; _dirty = true; return true; }