From 0ccd39624ebe12dd75856e389db71e78d4295860 Mon Sep 17 00:00:00 2001 From: Omar Crespo Date: Sun, 16 Aug 2026 17:35:42 -0500 Subject: [PATCH] feat(web): show server version on saved connections MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Display connected server version (including nightly suffixes) in connection metadata - Show "Last seen v…" when disconnected but a cached version is available --- .../settings/ConnectionsSettings.logic.test.ts | 17 +++++++++++++++++ .../settings/ConnectionsSettings.logic.ts | 9 +++++++++ .../components/settings/ConnectionsSettings.tsx | 5 +++++ 3 files changed, 31 insertions(+) diff --git a/apps/web/src/components/settings/ConnectionsSettings.logic.test.ts b/apps/web/src/components/settings/ConnectionsSettings.logic.test.ts index 290e2daa12b..9d0c632fda0 100644 --- a/apps/web/src/components/settings/ConnectionsSettings.logic.test.ts +++ b/apps/web/src/components/settings/ConnectionsSettings.logic.test.ts @@ -3,6 +3,7 @@ import { describe, expect, it, vi } from "vite-plus/test"; import { applyWslEnableSelection, isQrShareableEndpoint, + remoteEnvironmentVersionLabel, selectQrEndpointOption, } from "./ConnectionsSettings.logic"; @@ -15,6 +16,22 @@ const baseWslState: DesktopWslState = { preflightError: null, }; +describe("remoteEnvironmentVersionLabel", () => { + it("shows the complete connected server version, including nightly suffixes", () => { + expect(remoteEnvironmentVersionLabel("0.0.33-nightly.20260816", true)).toBe( + "v0.0.33-nightly.20260816", + ); + }); + + it("marks a cached disconnected version as last seen", () => { + expect(remoteEnvironmentVersionLabel("0.0.32", false)).toBe("Last seen v0.0.32"); + }); + + it("omits the label before a server version is known", () => { + expect(remoteEnvironmentVersionLabel(null, true)).toBeNull(); + }); +}); + describe("applyWslEnableSelection", () => { it("clears WSL-only and updates the distro before enabling both backends", async () => { const calls: Array = []; diff --git a/apps/web/src/components/settings/ConnectionsSettings.logic.ts b/apps/web/src/components/settings/ConnectionsSettings.logic.ts index faa0cb6c754..9788e2bcf47 100644 --- a/apps/web/src/components/settings/ConnectionsSettings.logic.ts +++ b/apps/web/src/components/settings/ConnectionsSettings.logic.ts @@ -2,6 +2,15 @@ import type { AdvertisedEndpoint, DesktopBridge, DesktopWslState } from "@t3tool type WslEnableBridge = Pick; +export function remoteEnvironmentVersionLabel( + serverVersion: string | null, + isConnected: boolean, +): string | null { + if (serverVersion === null) return null; + const version = `v${serverVersion}`; + return isConnected ? version : `Last seen ${version}`; +} + /** * A QR code encoding a loopback URL makes the scanning device dial itself, so * loopback endpoints stay copyable from the endpoint menu but are never diff --git a/apps/web/src/components/settings/ConnectionsSettings.tsx b/apps/web/src/components/settings/ConnectionsSettings.tsx index 18d1b0f1c92..8dd754b80e2 100644 --- a/apps/web/src/components/settings/ConnectionsSettings.tsx +++ b/apps/web/src/components/settings/ConnectionsSettings.tsx @@ -43,6 +43,7 @@ import { resolveDesktopPairingUrl, resolveHostedPairingUrl } from "./pairingUrls import { applyWslEnableSelection, isQrShareableEndpoint, + remoteEnvironmentVersionLabel, selectQrEndpointOption, } from "./ConnectionsSettings.logic"; import { @@ -1413,6 +1414,10 @@ function SavedBackendListRow({ const metadataBits = [ sshTarget ? `SSH ${formatDesktopSshTarget(sshTarget)}` : null, environment.relayManaged ? "T3 Connect" : null, + remoteEnvironmentVersionLabel( + environment.serverConfig?.environment.serverVersion ?? null, + isConnected, + ), ].filter((value): value is string => value !== null); // The WSL backend is a desktop-managed local backend (it surfaces as a bearer