feat: render degraded / overheat node status (#40) - #44
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Surfaces the #163 degraded path + overheat in the Connected nodes card, consuming the
NODE_FAULT_CODESdictionary synced in #43.Render
nodeDotState():offline (red) > overheat || degraded (amber) > healthy (green).I2C) + native tooltiplabel — description. Unknown/reservedfaultId→Fault Nfallback (thePartial<Record>type forces the guard).Layering
Main enriches each node in
session.ts(alongsideNODE_NAMES) withfaultAbbr/faultLabel/faultDescfromNODE_FAULT_CODES. The renderer stays@shared/@renderer-only — never importssrc/main. Pure display helpers (nodeDotState/nodeFaultTag/nodeFaultTooltip) live inshared/nodes.ts.Tests
nodes.test.ts+6: dot precedence (offline wins), abbr + tooltip composition, unknown-idFault Nfallback. 57/57 vitest, typecheck + production build clean.Verification note
No live screenshot —
electron-vite devis 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