Skip to content

Commit bb79977

Browse files
t3dotggclaude
andauthored
fix(web): thread panel shows the remote machine a thread runs on (pingdotgg#14972)
Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
1 parent 8ed276c commit bb79977

1 file changed

Lines changed: 17 additions & 3 deletions

File tree

‎apps/web/src/components/chat/ThreadDetailsPanel.tsx‎

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ import { AlertTriangleIcon, XIcon } from "lucide-react";
99

1010
import type { DraftId } from "../../composerDraftStore";
1111
import { 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";
1317
import { BranchToolbar } from "../BranchToolbar";
1418
import { BranchToolbarEnvironmentSelector } from "../BranchToolbarEnvironmentSelector";
1519
import 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

Comments
 (0)