From 5c16aa1c2bbafa5871ec211a5db430a3012aca37 Mon Sep 17 00:00:00 2001 From: Rik Schreurs Date: Fri, 1 May 2026 19:40:08 +0200 Subject: [PATCH 1/2] Allow adding multiple projects at once in new-session modal Folder picker now multi-selects and best-effort adds each as a project, so building a fusion across N repos doesn't require N pick-trips. On partial failure the error banner summarises which were skipped and why. --- .../Views/Shell/NewSessionModal.axaml.cs | 32 ++++++++++++++----- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/src/Conclave.App/Views/Shell/NewSessionModal.axaml.cs b/src/Conclave.App/Views/Shell/NewSessionModal.axaml.cs index f5b2140..96731d9 100644 --- a/src/Conclave.App/Views/Shell/NewSessionModal.axaml.cs +++ b/src/Conclave.App/Views/Shell/NewSessionModal.axaml.cs @@ -56,22 +56,38 @@ private async void OnAddProject(object? sender, RoutedEventArgs e) if (top is null) return; var picked = await top.StorageProvider.OpenFolderPickerAsync(new FolderPickerOpenOptions { - Title = "Pick a git repository", - AllowMultiple = false, + Title = "Pick git repositories", + AllowMultiple = true, }); if (picked.Count == 0) return; - var path = picked[0].Path.LocalPath; ns.ErrorMessage = null; - try + + var failures = new List(); + int added = 0; + foreach (var folder in picked) { + var path = folder.Path.LocalPath; var name = Path.GetFileName(path.TrimEnd(Path.DirectorySeparatorChar)); if (string.IsNullOrEmpty(name)) name = path; - var p = shell.Manager.CreateProject(name, path); - ns.Project = p; + try + { + shell.Manager.CreateProject(name, path); + added++; + } + catch (Exception ex) + { + var first = ex.Message.Split('\n', 2)[0]; + failures.Add($"{name}: {first}"); + } } - catch (Exception ex) + + // Leave Project unset so the user can pick from the dropdown or start a fusion next. + ns.Project = null; + if (failures.Count > 0) { - ns.ErrorMessage = ex.Message; + ns.ErrorMessage = picked.Count == 1 + ? failures[0] + : $"Added {added} of {picked.Count}. Skipped:\n - {string.Join("\n - ", failures)}"; } } From e67e88bf7417d21c0f0c9368331aaccf6a2ed879 Mon Sep 17 00:00:00 2001 From: Rik Schreurs Date: Fri, 1 May 2026 20:39:19 +0200 Subject: [PATCH 2/2] Address review: keep prior selection on full-fail and preserve error hint - Guard `ns.Project = null` with `if (added > 0)` so a pick where every folder fails validation no longer silently clears whatever project the user had selected before. - Drop the `Split('\n', 2)[0]` on the failure message so the second-line hint from "Not a git repository" survives into the error banner. --- src/Conclave.App/Views/Shell/NewSessionModal.axaml.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Conclave.App/Views/Shell/NewSessionModal.axaml.cs b/src/Conclave.App/Views/Shell/NewSessionModal.axaml.cs index 96731d9..3d7e27a 100644 --- a/src/Conclave.App/Views/Shell/NewSessionModal.axaml.cs +++ b/src/Conclave.App/Views/Shell/NewSessionModal.axaml.cs @@ -76,13 +76,17 @@ private async void OnAddProject(object? sender, RoutedEventArgs e) } catch (Exception ex) { - var first = ex.Message.Split('\n', 2)[0]; - failures.Add($"{name}: {first}"); + // Preserve the full message — CreateProject's "Not a git repository" error + // puts the actionable hint on a second line, and stripping it would leave + // the user without guidance. + failures.Add($"{name}: {ex.Message}"); } } // Leave Project unset so the user can pick from the dropdown or start a fusion next. - ns.Project = null; + // Only reset when we actually added something — otherwise a fully-failed pick would + // silently clear whatever the user had selected before opening the picker. + if (added > 0) ns.Project = null; if (failures.Count > 0) { ns.ErrorMessage = picked.Count == 1