From 1782a2af44a7630f184a05dbcf788e6121da2554 Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Sat, 5 Sep 2026 00:09:26 -0700 Subject: [PATCH] refactor(client-runtime): remove unused connection phase message (#9972) --- .../src/connection/presentation.test.ts | 5 ---- .../src/connection/presentation.ts | 24 +------------------ 2 files changed, 1 insertion(+), 28 deletions(-) diff --git a/packages/client-runtime/src/connection/presentation.test.ts b/packages/client-runtime/src/connection/presentation.test.ts index e13638a2b41fc41a85d0ebf1a851c2babaff3a92..80ce8a374a9cb1ecc58f4a7969caf812e1b2ed17 100644 --- a/packages/client-runtime/src/connection/presentation.test.ts +++ b/packages/client-runtime/src/connection/presentation.test.ts @@ -10,7 +10,6 @@ import { } from "./model.ts"; import { connectionCatalogDisplayUrl, - connectionPhaseMessage, connectionStatusText, connectionStatusTitle, presentEnvironmentConnection, @@ -119,10 +118,6 @@ describe("connection presentation", () => { }); }); - it("gives offline status precedence in global messaging", () => { - expect(connectionPhaseMessage("connected", TARGET.label, "offline")).toBe("You are offline"); - }); - it("combines reconnect progress with the latest failure", () => { const connection = { phase: "reconnecting", diff --git a/packages/client-runtime/src/connection/presentation.ts b/packages/client-runtime/src/connection/presentation.ts index 168443deceb44ce696846291c682d13717ed042a..4093167d333cf6b851bc45f9101f04dd857bcd73 100644 --- a/packages/client-runtime/src/connection/presentation.ts +++ b/packages/client-runtime/src/connection/presentation.ts @@ -2,7 +2,7 @@ import type { ServerConfig } from "@t3tools/contracts"; import * as Option from "effect/Option"; import type { ConnectionCatalogEntry } from "./catalog.ts"; -import type { NetworkStatus, SupervisorConnectionState } from "./model.ts"; +import type { SupervisorConnectionState } from "./model.ts"; export type EnvironmentConnectionPhase = | "available" @@ -105,25 +105,3 @@ export function connectionCatalogDisplayUrl(entry: ConnectionCatalogEntry): stri : null; } } - -export function connectionPhaseMessage( - phase: EnvironmentConnectionPhase, - label: string, - networkStatus: NetworkStatus, -): string { - if (networkStatus === "offline" || phase === "offline") { - return "You are offline"; - } - switch (phase) { - case "available": - return "Available"; - case "connecting": - return `Connecting to ${label}...`; - case "reconnecting": - return `Reconnecting to ${label}...`; - case "connected": - return "Connected"; - case "error": - return "Connection failed"; - } -} -- 2.54.0