fix(ui): block delete on interactive-session tasks, clear ghost selection
Delete (row context menu + detail header) now gates on HasInteractiveSession the same way SendToQueue already does, so an open ConPTY session's claude process can't be orphaned by deleting its task out from under it. Row removal (in-UI delete and the delta-refresh path for externally deleted tasks) now clears SelectedTask via SelectFrom(null, "row-removed") when the removed row was selected, so the detail pane no longer keeps showing a deleted task with live buttons.
This commit is contained in:
@@ -110,6 +110,21 @@ public class DetailsIslandDeleteTaskTests : IDisposable
|
||||
Assert.False(vm.DeleteTaskCommand.CanExecute(null));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void DeleteTask_WhenTaskHasInteractiveSession_CommandIsDisabled()
|
||||
{
|
||||
var worker = new RecordingWorkerClient();
|
||||
var vm = BuildVm(worker);
|
||||
var row = new TaskRowViewModel { Id = "task-del-5", Status = TaskStatus.Idle };
|
||||
vm.Bind(row);
|
||||
|
||||
Assert.True(vm.DeleteTaskCommand.CanExecute(null));
|
||||
|
||||
row.HasInteractiveSession = true;
|
||||
|
||||
Assert.False(vm.DeleteTaskCommand.CanExecute(null));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task DeleteTask_WhenWorkerThrowsInvalidOperationException_SurfacesErrorAndKeepsDetailOpen()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user