From 85f553b03447979a1446c84393e6f5f62542d7cb Mon Sep 17 00:00:00 2001 From: Mikkeli Date: Thu, 15 Oct 2026 20:20:09 +0900 Subject: [PATCH] Compass: a fix while standing still (no heading) is subdued, not the no-receiver alarm Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01DDwfd6Ki8UfG4hK6W5YpJz --- lib/widgets/gps_compass.dart | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/widgets/gps_compass.dart b/lib/widgets/gps_compass.dart index 3500256..dd5e024 100644 --- a/lib/widgets/gps_compass.dart +++ b/lib/widgets/gps_compass.dart @@ -16,6 +16,9 @@ class GpsCompass extends StatelessWidget { bool get _hasSignal => heading != null; bool get _isAcquiring => gpsState == 'acquiring'; + /// A fix but no heading: standing still, where GNSS cannot tell direction. Not a fault. + bool get _isStill => gpsState == 'fix' && !_hasSignal; + String get _displayHeading { if (!_hasSignal) return 'N/A'; return '${(heading! % 360).round()}'; @@ -50,8 +53,13 @@ class GpsCompass extends StatelessWidget { final theme = AppTheme.of(context); // No signal = subdued color, valid = foreground - // Heading: foreground; acquiring: caution; no receiver at all: alarm. - final iconColour = _hasSignal ? theme.foreground : (_isAcquiring ? theme.caution : theme.alarm); + // Heading: foreground; standing still with a fix: subdued; acquiring: caution; + // no receiver at all: alarm. + final iconColour = _hasSignal + ? theme.foreground + : (_isStill + ? theme.subdued + : (_isAcquiring ? theme.caution : theme.alarm)); // Convert to radians, 0 = no rotation when no signal final angle = _hasSignal ? (heading! * math.pi / 180.0) : 0.0; @@ -80,7 +88,7 @@ class GpsCompass extends StatelessWidget { child: Text( _hasSignal ? "$_displayHeading $_compassDirection" - : (_isAcquiring ? "ACQ" : "N/A"), + : (_isStill ? "—" : (_isAcquiring ? "ACQ" : "N/A")), style: TextStyle( fontSize: 80, color: theme.subdued, // less emphasis on text, let the icon have semantic colour