Skip to content

feat: render degraded / overheat node status (#40) - #44

Merged
mottihoresh merged 1 commit into
mainfrom
feat/node-degraded-render
Jul 7, 2026
Merged

feat: render degraded / overheat node status (#40)#44
mottihoresh merged 1 commit into
mainfrom
feat/node-degraded-render

Conversation

@mottihoresh

Copy link
Copy Markdown
Contributor

What

Surfaces the #163 degraded path + overheat in the Connected nodes card, consuming the NODE_FAULT_CODES dictionary synced in #43.

Render

  • Status dot gains an amber state — nodeDotState(): offline (red) > overheat || degraded (amber) > healthy (green).
  • Degraded → amber badge with the short fault abbr (e.g. I2C) + native tooltip label — description. Unknown/reserved faultIdFault N fallback (the Partial<Record> type forces the guard).
  • Overheat → its own hotter treatment: 🔥 + gold-colored temperature reading (no separate text badge — the hot temp is the signal).

Layering

Main enriches each node in session.ts (alongside NODE_NAMES) with faultAbbr/faultLabel/faultDesc from NODE_FAULT_CODES. The renderer stays @shared/@renderer-only — never imports src/main. Pure display helpers (nodeDotState / nodeFaultTag / nodeFaultTooltip) live in shared/nodes.ts.

Tests

nodes.test.ts +6: dot precedence (offline wins), abbr + tooltip composition, unknown-id Fault N fallback. 57/57 vitest, typecheck + production build clean.

Verification note

No live screenshot — electron-vite dev is a desktop window (not a browsable server) and there's no degraded-node data without the hardware/DCS rig. The display logic is covered by the pure-helper unit tests; the firmware-side degraded path is bench-verified (OpenSkyhawk#224).

Closes #40

Surfaces the #163 degraded path + overheat in the Connected-nodes card, using
the NODE_FAULT_CODES dictionary synced in #43.

- Status dot gains an AMBER state — nodeDotState(): offline(red) > overheat ||
  degraded(amber) > healthy(green).
- Degraded → an amber badge showing the short fault abbr (e.g. "I2C") with a
  native tooltip of `label — description`. Unknown/reserved faultId falls back
  to `Fault N` (the Partial<Record> type forces the guard).
- Overheat → its own hotter treatment: 🔥 + gold-colored temperature reading
  (no separate text badge; the hot temp is the signal).
- Main enriches each node at session.ts (alongside NODE_NAMES) with
  faultAbbr/faultLabel/faultDesc from NODE_FAULT_CODES; the renderer stays
  @shared/@renderer-only (never imports src/main).
- Pure display helpers (nodeDotState / nodeFaultTag / nodeFaultTooltip) live in
  shared/nodes.ts and are unit-tested (dot precedence, abbr + tooltip, unknown-id
  fallback).

57/57 vitest, typecheck + production build clean.

Closes #40
@mottihoresh
mottihoresh merged commit 8cd068d into main Jul 7, 2026
4 checks passed
@mottihoresh
mottihoresh deleted the feat/node-degraded-render branch July 7, 2026 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Show DEGRADED node health in the CONNECTED NODES view

1 participant