chore(claude-do): merge [C4] Rebase-after-Merge sichtbar machen + WorktreeMaintenanc

ClaudeDo-Task: 0a64e32d-6308-4f2d-a69e-fb8b3cabd01a
This commit is contained in:
mika kuns
2026-08-21 13:51:01 +02:00
8 changed files with 183 additions and 9 deletions
@@ -1290,7 +1290,15 @@ public sealed partial class DetailsIslandViewModel : ViewModelBase, IDisposable
if (progressTaskId != taskId || phase != MergePhaseVerifying) return;
ApproveOp.Report(Loc.T("ops.merge.verifying", FormatElapsed(elapsedSeconds)));
}
// Separate event: MergeProgressEvent forwards elapsed-seconds-only (verifying), but the
// rebase phase needs the branch count too, which only rides the untrimmed OperationProgress.
void OnOperationProgress(string opKey, string phase, int current, int total)
{
if (opKey != taskId || phase != MergePhaseRebasing) return;
ApproveOp.Report(FormatRebasing(current, total));
}
_worker.MergeProgressEvent += OnMergeProgress;
_worker.OperationProgressEvent += OnOperationProgress;
try
{
var hasChildren = Subtasks.Count > 0 || ChildOutcomes.Count > 0;
@@ -1314,15 +1322,24 @@ public sealed partial class DetailsIslandViewModel : ViewModelBase, IDisposable
finally
{
_worker.MergeProgressEvent -= OnMergeProgress;
_worker.OperationProgressEvent -= OnOperationProgress;
}
}
/// Mirrors TaskMergeService.PhaseVerifying — a hub payload token, not a display string.
private const string MergePhaseVerifying = "verifying";
/// Mirrors TaskMergeService.PhaseRebasing — a hub payload token, not a display string.
private const string MergePhaseRebasing = "rebasing";
private static string FormatElapsed(int seconds) =>
TimeSpan.FromSeconds(Math.Max(0, seconds)).ToString(@"mm\:ss");
private static string FormatRebasing(int current, int total) =>
total > 0
? $"{Loc.T("ops.worker.rebasingAfterMerge")} ({current}/{total})"
: Loc.T("ops.worker.rebasingAfterMerge");
// Force the diff to have been opened before a merge can happen — but only when
// there is actually something to inspect (a childless sandbox run with no worktree
// has no diff, so it approves straight through).