fix(maestro): spawn similar preselects the cloned project
Spawn similar dropped the session's cwd into the free-text directory hatch, so the project picker showed nothing selected. For a worktree session that cwd was the daemon-made checkout, and the worktree toggle defaulted on, so the clone asked for a worktree of a worktree. It now seeds the picker: the cloned project's box selected, the same worktree decision, base repo plus '+ new' when the source had a worktree. A seeded path that matches no project falls back to the raw input showing that path instead of an empty picker.
This commit is contained in:
@@ -589,7 +589,10 @@ export function createSpawnForm(opts: SpawnFormOptions): SpawnFormHandle {
|
||||
cwd = seedCwd;
|
||||
cwdRaw.value = seedCwd;
|
||||
// Restoring must not touch the worktree toggle — the seed carries it.
|
||||
if (!restoreSelection(seedCwd)) clearProjectSelection();
|
||||
// A path no box matches (the project is gone, or the scan never saw
|
||||
// it) falls back to the raw input showing that path: an empty picker
|
||||
// with an invisible cwd reads as a form that lost the directory.
|
||||
if (!restoreSelection(seedCwd)) showRawCwd(seedCwd, false);
|
||||
} else {
|
||||
showRawCwd(seedCwd, false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user