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:
@@ -179,7 +179,14 @@ public sealed partial class MissionControlViewModel : ViewModelBase, IDisposable
|
|||||||
internal async System.Threading.Tasks.Task RefreshSessionTargetsAsync()
|
internal async System.Threading.Tasks.Task RefreshSessionTargetsAsync()
|
||||||
{
|
{
|
||||||
SessionTargets.Clear();
|
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
|
SessionTargets.Add(new SessionTargetViewModel
|
||||||
{
|
{
|
||||||
Label = Loc.T("missionControl.browseForFolder"),
|
Label = Loc.T("missionControl.browseForFolder"),
|
||||||
|
|||||||
@@ -254,11 +254,11 @@ public class MissionControlViewModelTests : IDisposable
|
|||||||
|
|
||||||
await vm.RefreshSessionTargetsAsync();
|
await vm.RefreshSessionTargetsAsync();
|
||||||
|
|
||||||
// Browse first (survives a failing list query), then the lists in sort order.
|
// Home + browse first (they survive a failing list query), then the lists in sort order.
|
||||||
Assert.Equal(3, vm.SessionTargets.Count);
|
Assert.Equal(4, vm.SessionTargets.Count);
|
||||||
Assert.Equal(new[] { "Beta", "Alpha" }, vm.SessionTargets.Skip(1).Select(t => t.Label).ToArray());
|
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);
|
Assert.True(browsed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user