feat(ui): pick up a task's session in a terminal
This commit is contained in:
@@ -751,6 +751,7 @@ public sealed partial class DetailsIslandViewModel : ViewModelBase, IDisposable
|
||||
Merge.SyncTaskContext(Task?.Id, Task?.Title, Task?.IsPlanningParent == true);
|
||||
NotifySessionSections();
|
||||
OnPropertyChanged(nameof(CanAcceptDrop));
|
||||
OnPropertyChanged(nameof(CanPickUpInTerminal));
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
@@ -892,6 +893,24 @@ public sealed partial class DetailsIslandViewModel : ViewModelBase, IDisposable
|
||||
catch { /* offline */ }
|
||||
}
|
||||
|
||||
// Pick up in a terminal only where a session + worktree reliably still exist (parked
|
||||
// for review or failed mid-run); the worker reports a clear error otherwise.
|
||||
public bool CanPickUpInTerminal => Task is not null
|
||||
&& Task.Status is ClaudeDo.Data.Models.TaskStatus.WaitingForReview
|
||||
or ClaudeDo.Data.Models.TaskStatus.Failed;
|
||||
|
||||
[RelayCommand]
|
||||
private async System.Threading.Tasks.Task PickUpInTerminalAsync()
|
||||
{
|
||||
if (Task is null) return;
|
||||
ClaudeDo.Ui.Services.ForegroundHelper.AllowAny();
|
||||
try { await _worker.ResumeTaskInTerminalAsync(Task.Id); }
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
if (ShowErrorAsync != null) await ShowErrorAsync(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
[RelayCommand(CanExecute = nameof(CanEnqueue))]
|
||||
private async System.Threading.Tasks.Task EnqueueAsync()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user