feat(ui): show dequeue affordance on planning parents with queued children

Planning parents stay in Planning/Planned status while their children are
Queued/Waiting, so the existing IsQueued-only visibility rule hid the dequeue
button. Add HasQueuedSubtasks tracking and a CanRemoveFromQueue helper; the
parent-row dequeue cascades to all queued/waiting children. Also attach the
'agent' tag on explicit enqueue so the queue picker accepts the task.
This commit is contained in:
Mika Kuns
2026-04-27 10:16:40 +02:00
parent 2d7f825ff3
commit bdb709b264
3 changed files with 59 additions and 7 deletions

View File

@@ -26,6 +26,7 @@ public sealed partial class TaskRowViewModel : ViewModelBase
[ObservableProperty] private string? _parentTaskId;
[ObservableProperty] private bool _isExpanded = true;
[ObservableProperty] private bool _hasPlanningChildren;
[ObservableProperty] private bool _hasQueuedSubtasks;
public DateTime CreatedAt { get; init; }
public string CreatedAtFormatted => CreatedAt == default ? "—" : $"Created {CreatedAt:MMM d}";
@@ -58,6 +59,7 @@ public sealed partial class TaskRowViewModel : ViewModelBase
public bool IsRunning => Status == TaskStatus.Running;
public bool IsQueued => Status == TaskStatus.Queued;
public bool IsWaiting => Status == TaskStatus.Waiting;
public bool CanRemoveFromQueue => IsQueued || HasQueuedSubtasks;
public bool HasSchedule => ScheduledFor.HasValue;
public bool HasLiveTail => IsRunning && !string.IsNullOrEmpty(LiveTail);
@@ -87,8 +89,12 @@ public sealed partial class TaskRowViewModel : ViewModelBase
OnPropertyChanged(nameof(IsDraft));
OnPropertyChanged(nameof(CanOpenPlanningSession));
OnPropertyChanged(nameof(CanResumeOrDiscardPlanning));
OnPropertyChanged(nameof(CanRemoveFromQueue));
}
partial void OnHasQueuedSubtasksChanged(bool value)
=> OnPropertyChanged(nameof(CanRemoveFromQueue));
partial void OnParentTaskIdChanged(string? value)
{
OnPropertyChanged(nameof(IsChild));