feat(ui): Home-Ordner als Sitzungsziel in Mission Control

Erster Eintrag im Sitzungsmenue, fuer schnelle allgemeine Fragen, die zu
keinem Projekt gehoeren.
This commit is contained in:
mika kuns
2026-09-07 08:17:37 +02:00
parent 23491d3b49
commit 48d3633b05
2 changed files with 12 additions and 5 deletions
@@ -179,7 +179,14 @@ public sealed partial class MissionControlViewModel : ViewModelBase, IDisposable
internal async System.Threading.Tasks.Task RefreshSessionTargetsAsync()
{
SessionTargets.Clear();
// Browse goes in first so the menu stays usable even if the list query below fails.
// Home + browse go in first so the menu stays usable even if the list query below fails.
// Home is the target for quick general questions that belong to no project.
var home = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
SessionTargets.Add(new SessionTargetViewModel
{
Label = Loc.T("missionControl.homeFolder"),
StartCommand = new RelayCommand(() => _ = OpenAdHocConPtySessionAsync(home)),
});
SessionTargets.Add(new SessionTargetViewModel
{
Label = Loc.T("missionControl.browseForFolder"),
@@ -254,11 +254,11 @@ public class MissionControlViewModelTests : IDisposable
await vm.RefreshSessionTargetsAsync();
// Browse first (survives a failing list query), then the lists in sort order.
Assert.Equal(3, vm.SessionTargets.Count);
Assert.Equal(new[] { "Beta", "Alpha" }, vm.SessionTargets.Skip(1).Select(t => t.Label).ToArray());
// Home + browse first (they survive a failing list query), then the lists in sort order.
Assert.Equal(4, vm.SessionTargets.Count);
Assert.Equal(new[] { "Beta", "Alpha" }, vm.SessionTargets.Skip(2).Select(t => t.Label).ToArray());
vm.SessionTargets[0].StartCommand.Execute(null);
vm.SessionTargets[1].StartCommand.Execute(null);
Assert.True(browsed);
}