@@ -9,7 +9,11 @@ import { AlertTriangleIcon, XIcon } from "lucide-react";
99
1010import type { DraftId } from "../../composerDraftStore" ;
1111import { useT3ProjectFileScripts } from "../../hooks/useT3ProjectFileScripts" ;
12- import type { EnvMode , EnvironmentOption } from "../BranchToolbar.logic" ;
12+ import {
13+ shouldShowEnvironmentIndicator ,
14+ type EnvMode ,
15+ type EnvironmentOption ,
16+ } from "../BranchToolbar.logic" ;
1317import { BranchToolbar } from "../BranchToolbar" ;
1418import { BranchToolbarEnvironmentSelector } from "../BranchToolbarEnvironmentSelector" ;
1519import GitActionsControl from "../GitActionsControl" ;
@@ -78,6 +82,14 @@ export function ThreadDetailsPanel(props: ThreadDetailsPanelProps) {
7882 props . environmentId ,
7983 props . activeProjectScripts ? props . gitCwd : null ,
8084 ) ;
85+ // Same rule as the composer strip: a lone remote machine still gets a row,
86+ // shown as a static label because there is nothing to pick.
87+ const canPickEnvironment = props . availableEnvironments . length > 1 ;
88+ const showEnvironment = shouldShowEnvironmentIndicator ( {
89+ activeEnvironment :
90+ props . availableEnvironments . find ( ( env ) => env . environmentId === props . environmentId ) ?? null ,
91+ canPickEnvironment,
92+ } ) ;
8193 const branchToolbarProps = {
8294 showGitControls : props . isGitRepo ,
8395 environmentId : props . environmentId ,
@@ -138,15 +150,17 @@ export function ThreadDetailsPanel(props: ThreadDetailsPanelProps) {
138150 ) : null }
139151
140152 < div className = "flex flex-col" >
141- { density === "full" && props . availableEnvironments . length > 1 ? (
153+ { density === "full" && showEnvironment ? (
142154 < BranchToolbarEnvironmentSelector
143155 displayMode = "panel"
144156 autoEnvironmentLabel = { props . autoEnvironmentLabel }
145157 onAutoEnvironment = { props . onAutoEnvironment }
146158 envLocked = { props . envLocked }
147159 environmentId = { props . environmentId }
148160 availableEnvironments = { props . availableEnvironments }
149- onEnvironmentChange = { props . onEnvironmentChange }
161+ { ...( canPickEnvironment
162+ ? { onEnvironmentChange : props . onEnvironmentChange }
163+ : { } ) }
150164 />
151165 ) : null }
152166
0 commit comments