fix(ui): warn and block save when a list's working dir isn't a git repo

Reuses RepoScanner.IsRepo (now public) to validate WorkingDir whenever it
changes in ListSettingsModalViewModel — Browse or typing. A missing folder
or a non-repo folder shows an inline warning and gates Save via the same
CanExecute pattern the load-failure gate already uses; an empty WorkingDir
is untouched. Previously this only surfaced as a Failed task deep in
WorktreeManager on first run.

Also localizes the two hardcoded EN strings in the same file (delete
confirm, planning-sessions block) into vm.listSettings.* keys.
This commit is contained in:
mika kuns
2026-09-10 13:32:52 +02:00
parent 752cf0926b
commit 3348736e9d
6 changed files with 69 additions and 7 deletions
+1 -1
View File
@@ -69,5 +69,5 @@ public static class RepoScanner
// A real clone has .git as a directory. Worktrees and submodules have it as a file
// ("gitdir: ...") — those are not standalone repos and would flood the list.
private static bool IsRepo(string dir) => Directory.Exists(Path.Combine(dir, ".git"));
public static bool IsRepo(string dir) => Directory.Exists(Path.Combine(dir, ".git"));
}