feat(ui): default to the Git tab for manual and interactive tasks
A hand-driven task produces no streamed agent output, so the Output tab opened empty. Bind now selects git for manual/interactive rows and resets to output for autonomous ones.
This commit is contained in:
@@ -601,6 +601,10 @@ public sealed partial class DetailsIslandViewModel : ViewModelBase, IDisposable
|
||||
return;
|
||||
}
|
||||
|
||||
// A hand-driven task (manual reminder or a live ConPTY session) produces no streamed
|
||||
// agent output, so the Output tab would open empty -- its work shows up as git changes.
|
||||
SelectedTab = row.IsManual || row.HasInteractiveSession ? "git" : "output";
|
||||
|
||||
_ = BindAsync(row, ct);
|
||||
}
|
||||
|
||||
|
||||
@@ -80,4 +80,37 @@ public class DetailsIslandTabsTests : IDisposable
|
||||
Assert.True(vm.IsOutputTab);
|
||||
Assert.False(vm.IsGitTab);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Bind_manual_task_defaults_to_git_tab()
|
||||
{
|
||||
var vm = NewVm();
|
||||
|
||||
vm.Bind(new TaskRowViewModel { Id = Guid.NewGuid().ToString("N"), IsManual = true });
|
||||
|
||||
Assert.True(vm.IsGitTab);
|
||||
Assert.False(vm.IsOutputTab);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Bind_interactive_task_defaults_to_git_tab()
|
||||
{
|
||||
var vm = NewVm();
|
||||
|
||||
vm.Bind(new TaskRowViewModel { Id = Guid.NewGuid().ToString("N"), HasInteractiveSession = true });
|
||||
|
||||
Assert.True(vm.IsGitTab);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Bind_autonomous_task_defaults_to_output_tab()
|
||||
{
|
||||
var vm = NewVm();
|
||||
vm.SelectTabCommand.Execute("git");
|
||||
|
||||
vm.Bind(new TaskRowViewModel { Id = Guid.NewGuid().ToString("N") });
|
||||
|
||||
Assert.True(vm.IsOutputTab);
|
||||
Assert.False(vm.IsGitTab);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user