feat(worker): surface rebase and worktree-maintenance progress on OperationProgress
RebaseOthersAfterMergeAsync now broadcasts a "rebasing" phase with i/n over the WaitingForReview branches it checks, so the merge/continue_merge callers stop showing the stalled "Merging…" phase while the best-effort rebase loop runs (rebase still runs before the verify gate; a failed rebase still leaves the merge itself successful). WorktreeMaintenanceService gained an optional HubBroadcaster to report the same i/n shape per worktree during cleanup/reset, with no new UI surface (deliberately out of scope). Both review-action viewmodels now also listen on OperationProgressEvent (which carries the total that the elapsed-seconds-only MergeProgressEvent drops) to render "Rebasing other worktrees… (i/n)".
This commit is contained in:
@@ -119,4 +119,26 @@ public class MergeModalViewModelTests
|
||||
|
||||
Assert.Null(vm.ProgressMessage);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Submit_shows_the_rebase_phase_with_branch_count_instead_of_stalled_merging()
|
||||
{
|
||||
var (vm, worker) = Build();
|
||||
await vm.InitializeAsync("task-1", "do the thing");
|
||||
worker.BlockMerge = true;
|
||||
|
||||
var submit = vm.SubmitCommand.ExecuteAsync(null);
|
||||
var merging = vm.ProgressMessage;
|
||||
|
||||
// Needs the branch total, which only rides OperationProgress (MergeProgressEvent
|
||||
// forwards elapsed-seconds only) -- and must not be clobbered by that other forwarder.
|
||||
worker.RaiseOperationProgress("task-1", "rebasing", 1, 2);
|
||||
Assert.NotEqual(merging, vm.ProgressMessage);
|
||||
Assert.Contains("(1/2)", vm.ProgressMessage);
|
||||
|
||||
worker.MergeGate.SetResult(new MergeResultDto("merged", new List<string>(), null));
|
||||
await submit;
|
||||
|
||||
Assert.Null(vm.ProgressMessage);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user