fix: clarify conflict pane roles and status indicators

Use Resolution and Other version borders, omit branch/path metadata,
and show unsaved output state only on the writable pane. Track native
explorer conflict C from authoritative jj state across draft/check/error
transitions and clear it only after confirmed resolution.

Focused resolver and save tests pass; live terminal labels and explorer
verified without saving the mock conflicts. Full library run: 795 pass,
one unrelated async plugin fixture_barrier startup failure.
This commit is contained in:
Valdemar Lorenzen
2026-10-15 10:50:22 +02:00
parent 168e12160a
commit 5396968b08
5 changed files with 265 additions and 66 deletions
+11 -3
View File
@@ -359,8 +359,8 @@ impl DiffState {
}
pub(crate) fn set_resolver_paths(&mut self, root: PathBuf, paths: Vec<PathBuf>, file: usize) {
let comparison = self.comparison.get_or_insert_with(|| Comparison {
before: "Draft".into(),
after: "Alternative".into(),
before: "Resolution".into(),
after: "Other version".into(),
files: Vec::new(),
root: root.clone(),
editable_paths: BTreeSet::new(),
@@ -432,7 +432,7 @@ impl DiffState {
self.loading = false;
self.pending = None;
self.request_kind = None;
self.side_labels = ["Draft", "Alternative"];
self.side_labels = ["Resolution", "Other version"];
self.comparison_id = Some(self.comparison_id.unwrap_or(0).wrapping_add(1));
self.live_files.clear();
let file = &mut self.comparison.as_mut().unwrap().files[self.file];
@@ -2465,6 +2465,12 @@ mod tests {
files.entries().nth(files.selected).unwrap().path,
Path::new("first.txt")
);
assert!(!files.is_conflicted(Path::new("first.txt")));
state
.files
.as_mut()
.unwrap()
.set_conflicted(Path::new("first.txt"), true);
state.set_resolver_paths(
PathBuf::new(),
vec!["binary.bin".into(), "first.txt".into(), "second.txt".into()],
@@ -2475,6 +2481,8 @@ mod tests {
files.entries().nth(files.selected).unwrap().path,
Path::new("second.txt")
);
assert!(files.is_conflicted(Path::new("first.txt")));
assert!(!files.is_conflicted(Path::new("second.txt")));
}
fn excerpt_state(len: usize, changed: &[usize]) -> DiffState {