{/* Header row */}
{activeNonDefaultWorkspace && workspace
? workspaceModeLabel(workspace.mode)
: configuredWorkspaceLabel(currentSelection, selectedReusableExecutionWorkspace)}
{workspace ? statusBadge(workspace.status) : statusBadge("idle")}
{workspaceIsolationControlsVisible && (
{showEditingControls ? (
<>
Cancel
Save
>
) : (
setEditing(true)}
>
Edit
)}
)}
{/* Read-only info */}
{!showEditingControls && (
{workspace?.branchName && (
)}
{workspace?.cwd && !hideHostPaths && (
)}
{workspace?.repoUrl && (
Repo:
)}
{environmentsEnabled && currentEnvironmentId && (
Environment: {currentEnvironment?.name ?? currentEnvironmentId}
{currentSelection === "reuse_existing" && currentReusableEnvironmentId === currentEnvironmentId
? " · reused workspace"
: !issue.executionWorkspaceSettings?.environmentId && projectEnvironmentId === currentEnvironmentId
? " · project default"
: null}
)}
{!workspace && (
{currentSelection === "isolated_workspace"
? "A fresh isolated workspace will be created when this task runs."
: currentSelection === "reuse_existing"
? "This task will reuse an existing workspace when it runs."
: "This task will use the project default workspace configuration when it runs."}
)}
{currentSelection === "reuse_existing" && selectedReusableExecutionWorkspace && (
Reusing:{" "}
{selectedReusableWorkspaceLink ? (
) : (
)}
)}
{workspace && currentWorkspaceLink && (
View workspace details →
)}
)}
{/* Editing controls */}
{editing && workspaceIsolationControlsVisible && (
{
const nextMode = e.target.value as typeof draftSelection;
setDraftSelection(nextMode);
if (nextMode !== "reuse_existing") {
setDraftExecutionWorkspaceId("");
} else if (!draftExecutionWorkspaceId && issue.executionWorkspaceId) {
setDraftExecutionWorkspaceId(issue.executionWorkspaceId);
}
}}
>
{EXECUTION_WORKSPACE_OPTIONS.map((option) => (
{option.value === "reuse_existing" && configuredReusableWorkspace?.mode === "isolated_workspace"
? "Existing isolated workspace"
: option.label}
))}
{draftSelection === "reuse_existing" && (
setDraftExecutionWorkspaceId(workspaceId)}
loading={reusableExecutionWorkspacesLoading}
error={reusableExecutionWorkspacesError}
/>
)}
{/* Current workspace summary when editing */}
{workspace && (
Current:{" "}
{currentWorkspaceLink ? (
) : (
)}
{" · "}
{workspace.status}
)}
)}
{/* Workspace file discovery — calm row under the workspace identity. */}
{!showEditingControls && onBrowseFiles && (
Browse files…
Open file by path…
)}
);
}