fix(merge): pass the stash consent to the conflict resolver so it opens on a dirty target

The resolver restarts the merge via StartConflictMerge, which had no autostash.
After a stash-retry approve reported 'conflict', the restart hit the same dirty
target, got 'dirty_target' and the resolver silently never opened. Thread the
consent through the hub, client, coordinator and resolver; surface a refusal in
the footer instead of dropping it.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
mika kuns
2026-10-02 17:25:52 +02:00
co-authored by Claude Sonnet 5.5
parent ff7197c410
commit feb0afa33a
16 changed files with 173 additions and 20 deletions
+5 -3
View File
@@ -14,8 +14,10 @@ namespace ClaudeDo.Ui.Services;
public sealed class MergeCoordinator
{
/// Set once at composition to the shell's resolver entry. Null (headless/tests) ⇒ no-op.
public Func<string, string, Task>? Handler { get; set; }
public Func<string, string, bool, Task>? Handler { get; set; }
public Task ResolveConflictAsync(string taskId, string targetBranch) =>
Handler?.Invoke(taskId, targetBranch) ?? Task.CompletedTask;
/// <summary>Opens the resolver for <paramref name="taskId"/>; <paramref name="autostash"/> is the
/// caller's stash consent, repeated because the resolver restarts the merge on its own.</summary>
public Task ResolveConflictAsync(string taskId, string targetBranch, bool autostash = false) =>
Handler?.Invoke(taskId, targetBranch, autostash) ?? Task.CompletedTask;
}