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 {...@@ -10,7 +10,6 @@ import {
10} from "./model.ts";10} from "./model.ts";
11import {11import {
12 connectionCatalogDisplayUrl,12 connectionCatalogDisplayUrl,
13 connectionPhaseMessage,
14 connectionStatusText,13 connectionStatusText,
15 connectionStatusTitle,14 connectionStatusTitle,
16 presentEnvironmentConnection,15 presentEnvironmentConnection,
...@@ -119,10 +118,6 @@ describe("connection presentation", () => {...@@ -119,10 +118,6 @@ describe("connection presentation", () => {
119 });118 });
120 });119 });
121120
122 it("gives offline status precedence in global messaging", () => {
123 expect(connectionPhaseMessage("connected", TARGET.label, "offline")).toBe("You are offline");
124 });
125
126 it("combines reconnect progress with the latest failure", () => {121 it("combines reconnect progress with the latest failure", () => {
127 const connection = {122 const connection = {
128 phase: "reconnecting",123 phase: "reconnecting",
packages/client-runtime/src/connection/presentation.ts+1-23
...@@ -2,7 +2,7 @@ import type { ServerConfig } from "@t3tools/contracts";...@@ -2,7 +2,7 @@ import type { ServerConfig } from "@t3tools/contracts";
2import * as Option from "effect/Option";2import * as Option from "effect/Option";
33
4import type { ConnectionCatalogEntry } from "./catalog.ts";4import type { ConnectionCatalogEntry } from "./catalog.ts";
5import type { NetworkStatus, SupervisorConnectionState } from "./model.ts";5import type { SupervisorConnectionState } from "./model.ts";
66
7export type EnvironmentConnectionPhase =7export type EnvironmentConnectionPhase =
8 | "available"8 | "available"
...@@ -105,25 +105,3 @@ export function connectionCatalogDisplayUrl(entry: ConnectionCatalogEntry): stri...@@ -105,25 +105,3 @@ export function connectionCatalogDisplayUrl(entry: ConnectionCatalogEntry): stri
105 : null;105 : null;
106 }106 }
107}107}
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}