fix(web): thread panel shows the remote machine a thread runs on (#14972)
Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
1 parent
8ed276c246
commit
bb7997709d
1 file changed
+17
-3
@@ -9,7 +9,11 @@ import { AlertTriangleIcon, XIcon } from "lucide-react";
|
||||
|
||||
import type { DraftId } from "../../composerDraftStore";
|
||||
import { useT3ProjectFileScripts } from "../../hooks/useT3ProjectFileScripts";
|
||||
import type { EnvMode, EnvironmentOption } from "../BranchToolbar.logic";
|
||||
import {
|
||||
shouldShowEnvironmentIndicator,
|
||||
type EnvMode,
|
||||
type EnvironmentOption,
|
||||
} from "../BranchToolbar.logic";
|
||||
import { BranchToolbar } from "../BranchToolbar";
|
||||
import { BranchToolbarEnvironmentSelector } from "../BranchToolbarEnvironmentSelector";
|
||||
import GitActionsControl from "../GitActionsControl";
|
||||
@@ -78,6 +82,14 @@ export function ThreadDetailsPanel(props: ThreadDetailsPanelProps) {
|
||||
props.environmentId,
|
||||
props.activeProjectScripts ? props.gitCwd : null,
|
||||
);
|
||||
// Same rule as the composer strip: a lone remote machine still gets a row,
|
||||
// shown as a static label because there is nothing to pick.
|
||||
const canPickEnvironment = props.availableEnvironments.length > 1;
|
||||
const showEnvironment = shouldShowEnvironmentIndicator({
|
||||
activeEnvironment:
|
||||
props.availableEnvironments.find((env) => env.environmentId === props.environmentId) ?? null,
|
||||
canPickEnvironment,
|
||||
});
|
||||
const branchToolbarProps = {
|
||||
showGitControls: props.isGitRepo,
|
||||
environmentId: props.environmentId,
|
||||
@@ -138,7 +150,7 @@ export function ThreadDetailsPanel(props: ThreadDetailsPanelProps) {
|
||||
) : null}
|
||||
|
||||
<div className="flex flex-col">
|
||||
{density === "full" && props.availableEnvironments.length > 1 ? (
|
||||
{density === "full" && showEnvironment ? (
|
||||
<BranchToolbarEnvironmentSelector
|
||||
displayMode="panel"
|
||||
autoEnvironmentLabel={props.autoEnvironmentLabel}
|
||||
@@ -146,7 +158,9 @@ export function ThreadDetailsPanel(props: ThreadDetailsPanelProps) {
|
||||
envLocked={props.envLocked}
|
||||
environmentId={props.environmentId}
|
||||
availableEnvironments={props.availableEnvironments}
|
||||
onEnvironmentChange={props.onEnvironmentChange}
|
||||
{...(canPickEnvironment
|
||||
? { onEnvironmentChange: props.onEnvironmentChange }
|
||||
: {})}
|
||||
/>
|
||||
) : null}
|
||||
|
||||
|
||||
Reference in new issue
Block a user