fix(maestro): second-review findings across daemon, tui and web
Ten findings from reviewing the accumulated blitz/spawn-v2 diff. The two that could wedge a repo: - The cleanup guard refused any worktree whose commits were on no other ref, which is every ordinary unpushed branch. Paths are deterministic now, so the leftover tree blocked the next spawn and each branch became a one-shot. `worktree remove` keeps refs/heads/<branch>, so committed work is never at risk: guard on an unclean working tree alone. - A worktree whose directory had vanished failed the git probe and was reported as unsaved work, stranding the registration forever. Prune it instead, and prune before `worktree add` tests the target path. Also: - The CLI hardcoded create_branch: true, so the daemon's existing-branch path was unreachable. Added --existing-branch. - Pastes were forwarded without their DECSET 2004 markers, so a remote shell ran a multi-line paste line by line. - spawnForm emitted before its seed was restored and after destroy(), so a rebuilt draft blanked its cwd and a dead form clobbered the live one. - showRawCwd and the probe's worktree untick never reached the leaf. - A late autocomplete fetch reopened the popup under a blurred input. - The "remove worktree when killed" checkbox promised something the daemon no longer honours; removed.
This commit is contained in:
@@ -109,6 +109,14 @@ export function attachDirAutocomplete(input: HTMLInputElement): DirAutocompleteH
|
||||
}
|
||||
|
||||
function applyFilter(entries: string[], prefix: string): void {
|
||||
// A fetch can outlive the dismissal that was meant to close this popup
|
||||
// (Tab-commit re-arms a refresh, then blur dismisses 120ms later). Showing
|
||||
// it now would anchor a dropdown under an unfocused input that nothing
|
||||
// closes until the next interaction.
|
||||
if (dismissed || document.activeElement !== input) {
|
||||
close();
|
||||
return;
|
||||
}
|
||||
const lower = prefix.toLowerCase();
|
||||
filtered = entries.filter((e) => e.toLowerCase().startsWith(lower));
|
||||
highlight = filtered.length > 0 ? 0 : -1;
|
||||
|
||||
Reference in New Issue
Block a user