11import * as Dialog from "../../components/ui/Dialog" ;
22import { ConnectionTraceId } from "./ConnectionTraceId" ;
33import { SymbolView } from "../../components/ui/AppSymbol" ;
4- import { hasSavedBearerRoute , hostFreezeNotice } from "@t3tools/client-runtime/connection" ;
4+ import {
5+ type EnvironmentConnectionPresentation ,
6+ hasSavedBearerRoute ,
7+ hostFreezeNotice ,
8+ } from "@t3tools/client-runtime/connection" ;
59import type { AtomCommandResult } from "@t3tools/client-runtime/state/runtime" ;
610import { type EnvironmentId , resolveEnvironmentMachineKind } from "@t3tools/contracts" ;
711import { useAtomValue } from "@effect/atom-react" ;
@@ -25,15 +29,20 @@ import { ConnectionFormField } from "./ConnectionFormField";
2529import { ConnectionStatusDot } from "./ConnectionStatusDot" ;
2630import { environmentStatusText } from "./environmentStatusText" ;
2731
28- function connectionStatusLabel ( environment : ConnectedEnvironmentSummary ) : string | null {
32+ function connectionStatusLabel (
33+ environment : ConnectedEnvironmentSummary ,
34+ connection : EnvironmentConnectionPresentation | undefined ,
35+ ) : string | null {
2936 if ( ! environment . isEnabled && environment . connectionState !== "unsupported" ) {
3037 return "Off" ;
3138 }
32- return environmentStatusText ( {
33- phase : environment . connectionState ,
34- error : environment . connectionError ,
35- traceId : environment . connectionErrorTraceId ,
36- } ) ;
39+ return environmentStatusText (
40+ connection ?? {
41+ phase : environment . connectionState ,
42+ error : environment . connectionError ,
43+ traceId : environment . connectionErrorTraceId ,
44+ } ,
45+ ) ;
3746}
3847
3948export function ConnectionEnvironmentRow ( props : {
@@ -64,7 +73,7 @@ export function ConnectionEnvironmentRow(props: {
6473 presentation ,
6574 ) ;
6675 const enabled = props . environment . isEnabled && ! unsupported ;
67- const statusLabel = connectionStatusLabel ( props . environment ) ;
76+ const statusLabel = connectionStatusLabel ( props . environment , presentation ?. connection ) ;
6877 const statusTraceId = enabled ? props . environment . connectionErrorTraceId : null ;
6978 const hasConnectionFailure = enabled && props . environment . connectionError !== null ;
7079 const freeze = enabled
0 commit comments