feat(companion): follow live contacts — nav, geo-alert, ETA, quick-share

Builds on live location sharing:
- Nearby "Navigate" now follows a moving live target: the navigate view
  re-reads the shared position every second and re-locates the entry by
  name for non-contact senders, so it no longer freezes or drops out
  (previously only refreshed for stored contacts entered via detail).
- NavView gains a closing-speed / ETA line (EtaTracker), shown in the
  Nearby navigate view while approaching.
- Geo Alert target can be a live contact, not just a waypoint: the engine
  re-reads the contact's latest [LOC] position each evaluation (keyed by
  pubkey prefix) so the geofence follows a moving person; alert wording
  switches to Near/Away. The picker cycles waypoints + verified live
  contacts (shown with an '@' prefix). Schema bumped 0xC0DE0014 -> 0x15.
- Nearby marks a position-broadcasting node with the map's ♦ diamond
  (was a cryptic '*'/'~' prefix) and spells out "Sharing pos:" in detail.
- Home Map page Hold-Enter is a one-shot position share: pushes to the
  Live Share target while auto-sharing is on, else opens the picker.

Verified: WioTrackerL1_companion_solo_dual builds clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
MarekZegare4
2026-06-22 13:09:51 +02:00
co-authored by Claude Opus 4.8
parent 44e522eec9
commit dcc4379f63
8 changed files with 194 additions and 45 deletions
+8 -3
View File
@@ -244,9 +244,14 @@ struct NodePrefs { // persisted to file
uint8_t geo_alert_has_target; // 0=no target chosen yet, 1=target set
uint8_t geo_alert_radius_idx; // index into geoAlertRadiusMeters
uint8_t geo_alert_mode; // 0=arrive, 1=leave, 2=both
int32_t geo_alert_lat_1e6; // target latitude (1e6-scaled)
int32_t geo_alert_lon_1e6; // target longitude (1e6-scaled)
int32_t geo_alert_lat_1e6; // target latitude (1e6-scaled; last-known for a contact)
int32_t geo_alert_lon_1e6; // target longitude (1e6-scaled; last-known for a contact)
char geo_alert_label[12]; // target name for the alert text (WAYPOINT_LABEL_LEN)
// Target can be a static waypoint or a live contact: for a contact the engine
// re-reads the latest [LOC] position each evaluation (keyed by pubkey prefix),
// so the geofence follows a moving person ("alert when my friend is near").
uint8_t geo_alert_target_kind; // 0=waypoint (static), 1=live contact
uint8_t geo_alert_key[6]; // contact pubkey prefix when target_kind==1
// Trail auto-pause — when tracking, automatically freeze the trail (timer +
// sampling) after the device has sat still for this long, and resume on the
@@ -310,7 +315,7 @@ struct NodePrefs { // persisted to file
// adding/removing/reordering fields in DataStore::savePrefs/loadPrefsInt so
// older saves are detected on load and skipped (zero-init defaults kept).
// High 24 bits identify the file format; low byte is the schema revision.
static const uint32_t SCHEMA_SENTINEL = 0xC0DE0014;
static const uint32_t SCHEMA_SENTINEL = 0xC0DE0015;
// Bit-index for each home page. Used by page_order (entries store bit+1) and
// by home_pages_mask. Single source of truth — both HomeScreen::pageBit/bitToPage