From fc1cfe59ec7a4891aba00a95d9908bdcfc40851e Mon Sep 17 00:00:00 2001 From: Mika Kuns Date: Wed, 22 Apr 2026 13:18:16 +0200 Subject: [PATCH] feat(ui): WorkerClient supports list/task agent settings + ListUpdated event --- src/ClaudeDo.Ui/Services/WorkerClient.cs | 30 ++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/ClaudeDo.Ui/Services/WorkerClient.cs b/src/ClaudeDo.Ui/Services/WorkerClient.cs index d2d5eec..1740a04 100644 --- a/src/ClaudeDo.Ui/Services/WorkerClient.cs +++ b/src/ClaudeDo.Ui/Services/WorkerClient.cs @@ -45,6 +45,7 @@ public partial class WorkerClient : ObservableObject, IAsyncDisposable public event Action? TaskUpdatedEvent; public event Action? WorktreeUpdatedEvent; public event Action? RunNowRequestedEvent; + public event Action? ListUpdatedEvent; public WorkerClient(string signalRUrl) { @@ -110,6 +111,11 @@ public partial class WorkerClient : ObservableObject, IAsyncDisposable { Dispatcher.UIThread.Post(() => WorktreeUpdatedEvent?.Invoke(taskId)); }); + + _hub.On("ListUpdated", listId => + { + Dispatcher.UIThread.Post(() => ListUpdatedEvent?.Invoke(listId)); + }); } public Task StartAsync() @@ -271,6 +277,26 @@ public partial class WorkerClient : ObservableObject, IAsyncDisposable await _hub.InvokeAsync("UpdateAppSettings", dto); } + public async Task UpdateListAsync(UpdateListDto dto) + { + await _hub.InvokeAsync("UpdateList", dto); + } + + public async Task UpdateListConfigAsync(UpdateListConfigDto dto) + { + await _hub.InvokeAsync("UpdateListConfig", dto); + } + + public async Task GetListConfigAsync(string listId) + { + return await _hub.InvokeAsync("GetListConfig", listId); + } + + public async Task UpdateTaskAgentSettingsAsync(UpdateTaskAgentSettingsDto dto) + { + await _hub.InvokeAsync("UpdateTaskAgentSettings", dto); + } + public async Task CleanupFinishedWorktreesAsync() { try @@ -318,3 +344,7 @@ public sealed record WorktreeCleanupDto(int Removed); public sealed record WorktreeResetDto(int Removed, int TasksAffected, bool Blocked, int RunningTasks); public record MergeResultDto(string Status, IReadOnlyList ConflictFiles, string? ErrorMessage); public record MergeTargetsDto(string DefaultBranch, IReadOnlyList LocalBranches); +public sealed record UpdateListDto(string Id, string Name, string? WorkingDir, string DefaultCommitType); +public sealed record UpdateListConfigDto(string ListId, string? Model, string? SystemPrompt, string? AgentPath); +public sealed record UpdateTaskAgentSettingsDto(string TaskId, string? Model, string? SystemPrompt, string? AgentPath); +public sealed record ListConfigDto(string? Model, string? SystemPrompt, string? AgentPath);