From f481e3669fb2699b373ff6b34c9b849999f7f3c1 Mon Sep 17 00:00:00 2001 From: MarekZegare4 Date: Wed, 24 Jun 2026 17:08:03 +0200 Subject: [PATCH] feat(ui): add a status-bar indicator for active Live Share MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Live Share was the only "leave it on and forget" broadcast mode with no at-a-glance cue, unlike auto-advert/trail/repeater which all blink in the top bar. Reuses the diamond already used for a live-tracked contact on the map, so the glyph already means "sharing position" elsewhere in the UI. Also fixes the Tools-list "Live Share" row to use ICON_GPS instead of ICON_ADVERT (which collided with the Auto-Advert row) — currently inert since per-row icons are disabled there, but correct for whenever they're re-enabled. Co-Authored-By: Claude Sonnet 4.6 --- examples/companion_radio/ui-new/ToolsScreen.h | 2 +- examples/companion_radio/ui-new/UITask.cpp | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/examples/companion_radio/ui-new/ToolsScreen.h b/examples/companion_radio/ui-new/ToolsScreen.h index 3fd06b38..a066d3b4 100644 --- a/examples/companion_radio/ui-new/ToolsScreen.h +++ b/examples/companion_radio/ui-new/ToolsScreen.h @@ -111,7 +111,7 @@ public: const ToolsScreen::Tool ToolsScreen::LOCATION_TOOLS[] = { { "Nearby Nodes", &ICON_MAP_CONTACT, ACT_NEARBY }, - { "Live Share", &ICON_ADVERT, ACT_LIVESHARE }, + { "Live Share", &ICON_GPS, ACT_LIVESHARE }, { "Trail", &ICON_TRAIL, ACT_TRAIL }, { "Locator", &ICON_MAP_WAYPOINT, ACT_LOCATOR }, { "Compass", &ICON_MAP_NORTH, ACT_COMPASS }, diff --git a/examples/companion_radio/ui-new/UITask.cpp b/examples/companion_radio/ui-new/UITask.cpp index 8013e2bd..4dccbb67 100644 --- a/examples/companion_radio/ui-new/UITask.cpp +++ b/examples/companion_radio/ui-new/UITask.cpp @@ -475,6 +475,16 @@ class HomeScreen : public UIScreen { leftmostX = aX - 1; } + // Live location sharing active. Same blink convention — another + // "leave it on and forget" broadcast, like auto-advert above. Reuses + // the diamond the map uses for a live-tracked contact, so the glyph + // already means "sharing position" elsewhere in the UI. + if (_node_prefs && _node_prefs->loc_share_enabled) { + int lsX = leftmostX - ind; + if (blinkOn()) drawBoxedIcon(display, lsX, ind, ind_h, ICON_MAP_CONTACT); + leftmostX = lsX - 1; + } + // GPS trail logging active. Same blink convention. if (_task->trail().isActive()) { int gX = leftmostX - ind; @@ -1210,8 +1220,10 @@ public: // Any blinking status-bar indicator needs a 1 s refresh to animate evenly — // but the status bar (and its icons) is hidden on the CLOCK page, so don't // pay the 1 s cadence there for icons that aren't drawn. - bool repeating = _node_prefs && _node_prefs->client_repeat; - bool need_blink = (_page != HomePage::CLOCK) && (auto_adv || _task->trail().isActive() || repeating); + bool repeating = _node_prefs && _node_prefs->client_repeat; + bool loc_sharing = _node_prefs && _node_prefs->loc_share_enabled; + bool need_blink = (_page != HomePage::CLOCK) && + (auto_adv || _task->trail().isActive() || repeating || loc_sharing); if (Features::IS_EINK) { // slow display: poll every 30 s; inbound msgs force immediate refresh via notify() return Features::HOME_REFRESH_MS;