{/* Header row */}
{activeNonDefaultWorkspace && workspace
? workspaceModeLabel(workspace.mode)
: configuredWorkspaceLabel(currentSelection, selectedReusableExecutionWorkspace)}
{workspace ? statusBadge(workspace.status) : statusBadge("idle")}
{!livePreview && editing ? (
<>
Cancel
Save
>
) : !livePreview ? (
setEditing(true)}
>
Edit
) : null}
{/* Read-only info */}
{!showEditingControls && (
{workspace?.branchName && (
)}
{workspace?.cwd && (
)}
{workspace?.repoUrl && (
Repo:
)}
{!workspace && (
{currentSelection === "isolated_workspace"
? "A fresh isolated workspace will be created when this issue runs."
: currentSelection === "reuse_existing"
? "This issue will reuse an existing workspace when it runs."
: "This issue will use the project default workspace configuration when it runs."}
)}
{currentSelection === "reuse_existing" && selectedReusableExecutionWorkspace && (
Reusing:{" "}
{selectedReusableWorkspaceLink ? (
) : (
)}
)}
{workspace && currentWorkspaceLink && (
View workspace details →
)}
)}
{/* Editing controls */}
{showEditingControls && (
{
const nextMode = e.target.value;
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(e.target.value);
}}
>
Choose an existing workspace
{deduplicatedReusableWorkspaces.map((w) => (
{w.name} · {w.status} · {w.branchName ?? w.cwd ?? w.id.slice(0, 8)}
))}
)}
{/* Current workspace summary when editing */}
{workspace && (
Current:{" "}
{currentWorkspaceLink ? (
) : (
)}
{" · "}
{workspace.status}
)}
)}
);
}