From 2089e75ef1e973f3e04aa6cc448211db35d95848 Mon Sep 17 00:00:00 2001 From: Anso Date: Mon, 6 Apr 2026 01:43:52 -0400 Subject: [PATCH] fix(fleet): filter invalid version strings from UI display (#399) Treat 'unknown' and '0.0.0-dev' as absent versions in the node switcher, fleet overview, and capability gate. Remote nodes running older Docker images that return these fallback values now show a clean label instead of "vunknown". --- CHANGELOG.md | 6 ++++++ frontend/src/components/CapabilityGate.tsx | 3 ++- frontend/src/components/EditorLayout.tsx | 2 +- frontend/src/components/FleetView.tsx | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c05020dd..c4c776d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Fixed + +* **fleet:** node switcher and fleet overview no longer display "vunknown" for remote nodes running older images; invalid version strings are filtered from the UI + ## [0.39.1](https://github.com/AnsoCode/Sencho/compare/v0.39.0...v0.39.1) (2026-04-06) diff --git a/frontend/src/components/CapabilityGate.tsx b/frontend/src/components/CapabilityGate.tsx index 0d7069cc..a68a6b87 100644 --- a/frontend/src/components/CapabilityGate.tsx +++ b/frontend/src/components/CapabilityGate.tsx @@ -15,7 +15,8 @@ export function CapabilityGate({ capability, featureName = 'This feature', child if (hasCapability(capability)) return <>{children}; const nodeName = activeNode?.name ?? 'this node'; - const versionHint = activeNodeMeta?.version + const hasValidVersion = activeNodeMeta?.version && activeNodeMeta.version !== 'unknown' && activeNodeMeta.version !== '0.0.0-dev'; + const versionHint = hasValidVersion ? `${nodeName} is running v${activeNodeMeta.version}` : `${nodeName} does not support this capability`; diff --git a/frontend/src/components/EditorLayout.tsx b/frontend/src/components/EditorLayout.tsx index 2536d9c1..81acce5d 100644 --- a/frontend/src/components/EditorLayout.tsx +++ b/frontend/src/components/EditorLayout.tsx @@ -1350,7 +1350,7 @@ export default function EditorLayout() { node.status === 'offline' ? 'bg-red-500' : 'bg-gray-400' }`} /> {node.name} - {meta?.version && ( + {meta?.version && meta.version !== 'unknown' && meta.version !== '0.0.0-dev' && ( v{meta.version} diff --git a/frontend/src/components/FleetView.tsx b/frontend/src/components/FleetView.tsx index 10921038..a434f2a9 100644 --- a/frontend/src/components/FleetView.tsx +++ b/frontend/src/components/FleetView.tsx @@ -1218,7 +1218,7 @@ export function FleetView({ onNavigateToNode }: FleetViewProps) { {/* Current version */} - {s.version ? `v${s.version}` : unknown} + {s.version && s.version !== 'unknown' && s.version !== '0.0.0-dev' ? `v${s.version}` : unknown} {/* Latest version */}