authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-09-05 00:09:26-07:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-09-05 00:09:26-07:00
log1782a2af44a7630f184a05dbcf788e6121da2554
treea807f2fdd0f77d0221216379849c1f8ab28374e9
parentc1e279eca52e02ee3fb9c8d133057a30526f282c
signature Signed by PGP key B5690EEEBB952194

refactor(client-runtime): remove unused connection phase message (#9972)


2 files changed, 1 insertions(+), 28 deletions(-)

packages/client-runtime/src/connection/presentation.test.ts-5
......@@ -10,7 +10,6 @@ import {
1010} from "./model.ts";
1111import {
1212 connectionCatalogDisplayUrl,
13 connectionPhaseMessage,
1413 connectionStatusText,
1514 connectionStatusTitle,
1615 presentEnvironmentConnection,
......@@ -119,10 +118,6 @@ describe("connection presentation", () => {
119118 });
120119 });
121120
122 it("gives offline status precedence in global messaging", () => {
123 expect(connectionPhaseMessage("connected", TARGET.label, "offline")).toBe("You are offline");
124 });
125
126121 it("combines reconnect progress with the latest failure", () => {
127122 const connection = {
128123 phase: "reconnecting",
packages/client-runtime/src/connection/presentation.ts+1-23
......@@ -2,7 +2,7 @@ import type { ServerConfig } from "@t3tools/contracts";
22import * as Option from "effect/Option";
33
44import type { ConnectionCatalogEntry } from "./catalog.ts";
5import type { NetworkStatus, SupervisorConnectionState } from "./model.ts";
5import type { SupervisorConnectionState } from "./model.ts";
66
77export type EnvironmentConnectionPhase =
88 | "available"
......@@ -105,25 +105,3 @@ export function connectionCatalogDisplayUrl(entry: ConnectionCatalogEntry): stri
105105 : null;
106106 }
107107}
108
109export function connectionPhaseMessage(
110 phase: EnvironmentConnectionPhase,
111 label: string,
112 networkStatus: NetworkStatus,
113): string {
114 if (networkStatus === "offline" || phase === "offline") {
115 return "You are offline";
116 }
117 switch (phase) {
118 case "available":
119 return "Available";
120 case "connecting":
121 return `Connecting to ${label}...`;
122 case "reconnecting":
123 return `Reconnecting to ${label}...`;
124 case "connected":
125 return "Connected";
126 case "error":
127 return "Connection failed";
128 }
129}