feat(lanes): pick Claude Code or Codex when adding a lane

This commit is contained in:
2026-08-27 10:49:08 +07:00
parent 02050ac0ad
commit 810c28cdf6
4 changed files with 74 additions and 1 deletions
+21 -1
View File
@@ -24,7 +24,7 @@ import { CwdAutocomplete } from "../run/RunSetup";
import { FolderBrowseModal } from "./FolderBrowseModal";
import { api } from "../../lib/api";
import type { CwdSuggestion } from "../../lib/api";
import type { Lane } from "../../lib/types";
import type { Lane, LaneTool } from "../../lib/types";
/** Polls the lane until the background `git worktree add` finishes (status
* leaves "provisioning"), or gives up after `timeoutMs`. Returns the final
@@ -95,6 +95,7 @@ export function AddLaneModal({
const [pipeline, setPipeline] = useState("default");
const [pipelines, setPipelines] = useState<{ id: string; name: string; nodes: unknown[] }[]>([]);
const [branchesError, setBranchesError] = useState<string | null>(null);
const [tool, setTool] = useState<LaneTool>("claude");
const [busy, setBusy] = useState(false);
const [error, setError] = useState<string | null>(null);
const [browseOpen, setBrowseOpen] = useState(false);
@@ -112,6 +113,7 @@ export function AddLaneModal({
setBranches(null);
setBase("");
setPipeline("default");
setTool("claude");
setBranchesError(null);
setError(null);
setBusy(false);
@@ -187,6 +189,7 @@ export function AddLaneModal({
cwd: repo,
title: name || undefined,
pipeline,
tool,
});
onAdded(result.lane);
reset();
@@ -206,6 +209,7 @@ export function AddLaneModal({
base: base || undefined,
branch: branch.trim(),
pipeline,
tool,
});
onAdded(result.lane);
@@ -307,6 +311,22 @@ export function AddLaneModal({
/>
</div>
<div>
<label className="mb-1 block text-xs text-fg-secondary">{t("addLaneToolHint")}</label>
<div className="flex items-center rounded-md border border-border bg-surface-2 p-0.5">
<Seg
active={tool === "claude"}
label={t("addLaneToolClaude")}
onClick={() => setTool("claude")}
/>
<Seg
active={tool === "codex"}
label={t("addLaneToolCodex")}
onClick={() => setTool("codex")}
/>
</div>
</div>
<div>
<label className="mb-1 block text-xs text-fg-secondary" htmlFor="add-lane-repo">
{mode === "repo" ? t("addLaneRepoLabelAdopt") : t("addLaneRepoLabel")}