fix(ui): offline SignalIndicator is plain grey, no amber slash
The amber diagonal slash on offline devices was too loud on the Fleet list. Offline now renders all arcs unlit in the neutral dim colour. The amber "?" for online-but-no-rssi (legacy v1 firmware) is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -4,10 +4,9 @@
|
||||
//
|
||||
// Props:
|
||||
// rssi — number | null | undefined — signal strength in dBm (e.g. -62). null/undefined = unknown.
|
||||
// isOnline — boolean | undefined — when explicitly false, renders a dimmed amber
|
||||
// glyph with a diagonal slash overlay regardless of rssi, so a stale
|
||||
// last-known reading from an offline device never reads as a live
|
||||
// "full signal". When true (or undefined) but rssi is null/undefined,
|
||||
// isOnline — boolean | undefined — when explicitly false, renders a fully grey
|
||||
// (unlit) glyph regardless of rssi, so a stale last-known reading from
|
||||
// an offline device never reads as a live "full signal". When true (or undefined) but rssi is null/undefined,
|
||||
// renders an amber "?" instead — legacy v1-firmware devices report a
|
||||
// heartbeat with no rssi field at all (see API Reference: legacy
|
||||
// heartbeats predate rssi/state/ok), so "online with unknown signal"
|
||||
@@ -51,7 +50,7 @@ export default function SignalIndicator({ rssi, isOnline, size = 'md', className
|
||||
const unsupported = !offline && !known && isOnline === true
|
||||
const muted = offline || unsupported
|
||||
const level = known ? rssiToLevel(rssi) : 0
|
||||
const color = muted ? 'var(--color-warning)' : rssiToColor(known ? rssi : null)
|
||||
const color = unsupported ? 'var(--color-warning)' : rssiToColor(known ? rssi : null)
|
||||
const { box, strokeWidth } = SIZES[size] || SIZES.md
|
||||
const label = offline
|
||||
? 'Signal strength unavailable — device offline'
|
||||
@@ -101,15 +100,6 @@ export default function SignalIndicator({ rssi, isOnline, size = 'md', className
|
||||
strokeLinecap="round"
|
||||
style={{ transition: 'stroke 0.2s' }}
|
||||
/>
|
||||
{/* Offline overlay — amber diagonal slash, standard "no signal" convention */}
|
||||
{offline && (
|
||||
<path
|
||||
d="M3 21L21 3"
|
||||
stroke={color}
|
||||
strokeWidth={strokeWidth}
|
||||
strokeLinecap="round"
|
||||
/>
|
||||
)}
|
||||
{/* Unsupported overlay — amber "?", device is online but its firmware never reports rssi (v1 API) */}
|
||||
{unsupported && (
|
||||
<text
|
||||
|
||||
Reference in New Issue
Block a user