fix(flights): read a 359.6° track as 0° in the voice context, not 360°

The voice context records for a selected flight or military contact
rounded the track without wrapping, so a contact on 359.5° or more was
described to the assistant as heading "360°". Both now wrap after
rounding: 359.6° reads "0°", 359.4° still reads "359°".
This commit is contained in:
Aditya committed 2026-10-28 18:11:42 +05:30
1 parent a4d3701c3c
commit ac0e124a67
5 files changed
+52 -3

No files matched your search

+2 -1
View File
@@ -125,8 +125,9 @@ export function createTracking({
speed: Number.isFinite(described.velocityMps)
? `${Math.round(described.velocityMps * 1.944)} kt`
: '',
// 359.5° and above rounds to north; modulo keeps it from reading 360°.
heading: Number.isFinite(described.track)
? `${Math.round(described.track)}°`
? `${Math.round(described.track) % 360}°`
: '',
route: route || '',
icao24,