fix(merge): unresolved conflicts compose to empty, not Ours (+ review nits)
All checks were successful
Changelog / changelog (push) Successful in 2s
Release / release (push) Successful in 43s

Code-review follow-ups before push:
- MergeFile.ResultText/Compose() fell back to Ours for unresolved conflicts while
  the editor seeds them empty — align both on empty so the public model matches the
  pane and Continue can't silently auto-accept Ours.
- Bound the gutter re-layout retry (was an unbounded Background re-post when the
  editor isn't laid out, e.g. minimized).
- Pluralize the readout ('1 conflict' not '1 conflicts'). Tests updated. Ui 128 green.
This commit is contained in:
Mika Kuns
2026-06-19 13:14:51 +02:00
parent 29a294b7f3
commit 23a93ce0bb
4 changed files with 18 additions and 10 deletions

View File

@@ -238,7 +238,7 @@ public class ConflictResolverViewModelTests
Assert.Equal("a\no\nz\n", file.OursText);
Assert.Equal("a\nt\nz\n", file.TheirsText);
Assert.Equal("a\no\nz\n", file.ResultText); // unresolved seeds Ours
Assert.Equal("a\nz\n", file.ResultText); // unresolved conflicts start empty
// After resolving: ResultText reflects the resolution
file.Conflicts[0].Resolution = "r\n";
@@ -286,7 +286,7 @@ public class ConflictResolverViewModelTests
// Switch to file B
vm.SelectFileCommand.Execute(vm.Files[1]);
Assert.Equal("b.cs", vm.ActiveFile!.Path);
Assert.Equal("ours-b\n", vm.ActiveResultText); // unresolved seeds Ours
Assert.Equal("", vm.ActiveResultText); // unresolved conflicts start empty
// Switch back to file A
vm.SelectFileCommand.Execute(vm.Files[0]);
@@ -303,11 +303,11 @@ public class ConflictResolverViewModelTests
await vm.OpenAsync("main");
// 1 conflict, 0 resolved
Assert.Equal("1 conflicts · 0 resolved", vm.PositionText);
Assert.Equal("1 conflict · 0 resolved", vm.PositionText);
vm.Current!.AcceptOursCommand.Execute(null);
// 1 conflict, 1 resolved
Assert.Equal("1 conflicts · 1 resolved", vm.PositionText);
Assert.Equal("1 conflict · 1 resolved", vm.PositionText);
}
}