feat(worker): add generic OperationProgress channel, port MergeProgress onto it
Merge/verify phases now broadcast over a generic (opKey, phase, current, total) Hub event instead of a merge-specific one, so future producers (worktree cleanup, startup recovery, planning integration) can reuse it. IWorkerClient.MergeProgressEvent stays as a thin forwarder for existing consumers (elapsed seconds riding in the generic "current" slot).
This commit is contained in:
@@ -64,6 +64,7 @@ public partial class WorkerClient : ObservableObject, IAsyncDisposable, IWorkerC
|
||||
|
||||
public event Action<UsageSnapshotDto>? UsageUpdatedEvent;
|
||||
|
||||
public event Action<string, string, int, int>? OperationProgressEvent;
|
||||
public event Action<string, string, int>? MergeProgressEvent;
|
||||
|
||||
public event Action<string, string>? PlanningMergeStartedEvent;
|
||||
@@ -174,9 +175,13 @@ public partial class WorkerClient : ObservableObject, IAsyncDisposable, IWorkerC
|
||||
WorkerLogReceivedEvent?.Invoke(new WorkerLogEntry(message, level, timestampUtc)));
|
||||
});
|
||||
|
||||
_hub.On<string, string, int>("MergeProgress", (taskId, phase, elapsedSeconds) =>
|
||||
_hub.On<string, string, int, int>("OperationProgress", (opKey, phase, current, total) =>
|
||||
{
|
||||
Dispatcher.UIThread.Post(() => MergeProgressEvent?.Invoke(taskId, phase, elapsedSeconds));
|
||||
Dispatcher.UIThread.Post(() =>
|
||||
{
|
||||
OperationProgressEvent?.Invoke(opKey, phase, current, total);
|
||||
MergeProgressEvent?.Invoke(opKey, phase, current);
|
||||
});
|
||||
});
|
||||
|
||||
_hub.On<string, string>("PlanningMergeStarted", (planningTaskId, targetBranch) =>
|
||||
|
||||
Reference in New Issue
Block a user