feat(ui): planning commands and expand/collapse in TasksIslandViewModel
- Add IWorkerClient interface; WorkerClient implements it - TasksIslandViewModel accepts IWorkerClient? and gains OpenPlanningSession, ResumePlanningSession, DiscardPlanningSession, FinalizePlanningSession, and ToggleExpand commands - Regroup() is hierarchy-aware: children of collapsed planning parents are hidden - InternalsVisibleTo ClaudeDo.Worker.Tests for Regroup() - 4 new unit tests covering collapse/expand and guard logic Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
10
src/ClaudeDo.Ui/Services/IWorkerClient.cs
Normal file
10
src/ClaudeDo.Ui/Services/IWorkerClient.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
namespace ClaudeDo.Ui.Services;
|
||||
|
||||
public interface IWorkerClient
|
||||
{
|
||||
Task WakeQueueAsync();
|
||||
Task StartPlanningSessionAsync(string taskId, CancellationToken ct = default);
|
||||
Task ResumePlanningSessionAsync(string taskId, CancellationToken ct = default);
|
||||
Task DiscardPlanningSessionAsync(string taskId, CancellationToken ct = default);
|
||||
Task FinalizePlanningSessionAsync(string taskId, bool queueAgentTasks = true, CancellationToken ct = default);
|
||||
}
|
||||
@@ -25,7 +25,7 @@ sealed class IndefiniteRetryPolicy : IRetryPolicy
|
||||
_delays[Math.Min(retryContext.PreviousRetryCount, _delays.Length - 1)];
|
||||
}
|
||||
|
||||
public partial class WorkerClient : ObservableObject, IAsyncDisposable
|
||||
public partial class WorkerClient : ObservableObject, IAsyncDisposable, IWorkerClient
|
||||
{
|
||||
private readonly HubConnection _hub;
|
||||
private CancellationTokenSource? _startCts;
|
||||
@@ -362,6 +362,16 @@ public partial class WorkerClient : ObservableObject, IAsyncDisposable
|
||||
public async Task<int> GetPendingDraftCountAsync(string taskId, CancellationToken ct = default)
|
||||
=> await _hub.InvokeAsync<int>("GetPendingDraftCountAsync", taskId, ct);
|
||||
|
||||
// IWorkerClient explicit implementations (drop typed return values)
|
||||
async Task IWorkerClient.StartPlanningSessionAsync(string taskId, CancellationToken ct)
|
||||
=> await StartPlanningSessionAsync(taskId, ct);
|
||||
async Task IWorkerClient.ResumePlanningSessionAsync(string taskId, CancellationToken ct)
|
||||
=> await ResumePlanningSessionAsync(taskId, ct);
|
||||
async Task IWorkerClient.DiscardPlanningSessionAsync(string taskId, CancellationToken ct)
|
||||
=> await DiscardPlanningSessionAsync(taskId, ct);
|
||||
async Task IWorkerClient.FinalizePlanningSessionAsync(string taskId, bool queueAgentTasks, CancellationToken ct)
|
||||
=> await FinalizePlanningSessionAsync(taskId, queueAgentTasks, ct);
|
||||
|
||||
// DTOs for deserializing hub responses
|
||||
private sealed class ActiveTaskDto
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user