chore(ui): remove IWorkerClient.MergeProgressEvent forwarder

Group C of the operation-feedback batch is fully merged; the two consumers
(DetailsIslandViewModel.ApproveReviewAsync, MergeModalViewModel) now handle
the verifying phase from the generic OperationProgressEvent handler instead
of a separate forwarder event.
This commit is contained in:
mika kuns
2026-09-10 13:33:57 +02:00
parent 2a34d2453f
commit cfda3e9044
8 changed files with 26 additions and 69 deletions
@@ -170,14 +170,6 @@ public class DetailsIslandReviewActionsTests : IDisposable
public override Task<MergeResultDto?> ApproveReviewAsync(string taskId, string targetBranch) => Gate.Task;
}
private static int MergeProgressSubscriberCount(StubWorkerClient worker)
{
var field = typeof(StubWorkerClient).GetField("MergeProgressEvent",
System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
var del = (Delegate?)field!.GetValue(worker);
return del?.GetInvocationList().Length ?? 0;
}
[Fact]
public async Task ApproveReview_SetsIsRunning_AndLocksTheButton_WhileThePendingCallIsInFlight()
{
@@ -209,10 +201,10 @@ public class DetailsIslandReviewActionsTests : IDisposable
var approve = vm.ApproveReviewCommand.ExecuteAsync(null);
var merging = vm.ApproveOp.Label;
worker.RaiseMergeProgress("some-other-task", "verifying", 30);
worker.RaiseOperationProgress("some-other-task", "verifying", 30, 0);
Assert.Equal(merging, vm.ApproveOp.Label);
worker.RaiseMergeProgress("task-approve-2", "verifying", 30);
worker.RaiseOperationProgress("task-approve-2", "verifying", 30, 0);
Assert.NotEqual(merging, vm.ApproveOp.Label);
worker.Gate.SetResult(new MergeResultDto("merged", new List<string>(), null));
@@ -220,7 +212,7 @@ public class DetailsIslandReviewActionsTests : IDisposable
}
[Fact]
public async Task ApproveReview_UnsubscribesFromMergeProgress_AfterTheCallCompletes()
public async Task ApproveReview_UnsubscribesFromOperationProgress_AfterTheCallCompletes()
{
var worker = new BlockingApproveWorkerClient();
var vm = BuildVm(worker);
@@ -228,12 +220,12 @@ public class DetailsIslandReviewActionsTests : IDisposable
vm.Monitor.ApplyState(TaskStatus.WaitingForReview);
var approve = vm.ApproveReviewCommand.ExecuteAsync(null);
Assert.Equal(1, MergeProgressSubscriberCount(worker));
Assert.Equal(1, OperationProgressSubscriberCount(worker));
worker.Gate.SetResult(new MergeResultDto("merged", new List<string>(), null));
await approve;
Assert.Equal(0, MergeProgressSubscriberCount(worker));
Assert.Equal(0, OperationProgressSubscriberCount(worker));
}
private static int OperationProgressSubscriberCount(StubWorkerClient worker)
@@ -255,8 +247,7 @@ public class DetailsIslandReviewActionsTests : IDisposable
var approve = vm.ApproveReviewCommand.ExecuteAsync(null);
var merging = vm.ApproveOp.Label;
// The rebase phase needs the branch total, which only rides OperationProgress
// (MergeProgressEvent forwards elapsed-seconds only) — ignored for other tasks.
// The rebase phase needs the branch total — ignored for other tasks.
worker.RaiseOperationProgress("some-other-task", "rebasing", 1, 3);
Assert.Equal(merging, vm.ApproveOp.Label);