Skip to content
This repository was archived by the owner on May 29, 2026. It is now read-only.

Commit 4dc1450

Browse files
committed
Fix 'HW null' showing in node list by filtering HW_ prefixes and null values
1 parent 2bbf5fe commit 4dc1450

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

src/ui/components/NodesPanel.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ function NodeRow({ node, isSelected, terminalWidth = 100 }: NodeRowProps) {
163163

164164
const favStar = node.isFavorite ? "★" : " ";
165165
const hwModelName = node.hwModel !== undefined ? getHardwareModelName(node.hwModel) : "";
166-
const hwModel = hwModelName && hwModelName !== "Unknown" ? hwModelName.replace(/_/g, " ") : "";
166+
const hwModel = hwModelName && hwModelName !== "Unknown" && !hwModelName.startsWith("HW_") ? hwModelName.replace(/_/g, " ") : "";
167167
const role = formatRoleChar(node.role);
168168

169169
const hopsPadding = isCompact ? 2 : 4;
@@ -225,7 +225,10 @@ function NodeInspector({ node, allNodes, height }: { node?: NodeData; allNodes:
225225
<Text color={getRoleColor(node.role)}>{formatRole(node.role)}</Text>
226226
</>
227227
)}
228-
{node.hwModel !== undefined && getHardwareModelName(node.hwModel) !== "Unknown" && (
228+
{node.hwModel !== undefined && (() => {
229+
const hwName = getHardwareModelName(node.hwModel);
230+
return hwName !== "Unknown" && !hwName.startsWith("HW_");
231+
})() && (
229232
<>
230233
<Text color={theme.fg.muted}> Hardware: </Text>
231234
<Text color={theme.data.hardware}>{getHardwareModelName(node.hwModel)}</Text>

src/utils/hardware-models.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ const EXTENDED_HARDWARE_MODELS: Record<number, string> = {
127127
255: "PRIVATE_HW",
128128
};
129129

130-
export function getHardwareModelName(hwModel: number | undefined): string {
131-
if (hwModel === undefined || hwModel === 0) return "Unknown";
130+
export function getHardwareModelName(hwModel: number | undefined | null): string {
131+
if (hwModel === undefined || hwModel === null || hwModel === 0) return "Unknown";
132132
// Try protobuf enum first (may have additional models)
133133
const protoName = Mesh.HardwareModel[hwModel];
134134
if (protoName && protoName !== "null") return protoName;

0 commit comments

Comments
 (0)