feat(maestro): live directory autocomplete in spawn form (NAP-329)
ci / rust (push) Failing after 5m3s

Adds api.listDir + a reusable dirAutocomplete widget (live dropdown,
Tab/Enter completion, /-drill-in, per-(daemon,dir) cache) wired onto the
cwd and worktree base-repo fields, with matching dropdown styling.
This commit is contained in:
2026-06-15 21:20:36 +00:00
parent 498cb471b7
commit 3aedd7a0a5
5 changed files with 88 additions and 2 deletions
+16 -1
View File
@@ -1,4 +1,5 @@
import { createSession } from "./api.js";
import { attachDirAutocomplete } from "./dirAutocomplete.js";
import type { CreateSessionRequest, DaemonInfo } from "./types.js";
export function openSpawnModal(daemons: Map<string, DaemonInfo>): void {
@@ -97,7 +98,21 @@ export function openSpawnModal(daemons: Map<string, DaemonInfo>): void {
select.addEventListener("change", applyHomeDir);
applyHomeDir();
const close = () => host.remove();
// Live directory autocomplete (NAP-329) on the path fields, scoped to the
// currently-selected daemon — re-reading `select.value` per query means it
// tracks host changes for free.
const baseRepoInput = host.querySelector(
"input[name=worktree_base_repo]",
) as HTMLInputElement;
const autocompletes = [
attachDirAutocomplete(cwdInput, () => select.value),
attachDirAutocomplete(baseRepoInput, () => select.value),
];
const close = () => {
autocompletes.forEach((a) => a.destroy());
host.remove();
};
host.querySelector(".close")?.addEventListener("click", close);
host.querySelector(".cancel")?.addEventListener("click", close);
host.addEventListener("click", (e) => {