feat(ui): conflict resolver shows why Continue is disabled
Continue was already gated on CanContinue (all files resolved); surface a footer hint counting the still-unresolved conflicts/files so the disabled state is explained, not just for binary files.
This commit is contained in:
@@ -103,9 +103,19 @@ public sealed partial class ConflictResolverViewModel : ObservableObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public string ContinueHint => HasBinaryFiles
|
public string ContinueHint
|
||||||
? "Binary conflicts must be resolved externally — abort and resolve in your editor."
|
{
|
||||||
: "";
|
get
|
||||||
|
{
|
||||||
|
if (HasBinaryFiles)
|
||||||
|
return "Binary conflicts must be resolved externally — abort and resolve in your editor.";
|
||||||
|
var openFiles = Files.Count(f => !f.AllResolved);
|
||||||
|
if (openFiles == 0) return "";
|
||||||
|
var openConflicts = _flat.Count(x => !x.Block.IsResolved);
|
||||||
|
return $"{openConflicts} {(openConflicts == 1 ? "conflict" : "conflicts")} in " +
|
||||||
|
$"{openFiles} {(openFiles == 1 ? "file" : "files")} still unresolved.";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private bool InRange => CurrentIndex >= 0 && CurrentIndex < _flat.Count;
|
private bool InRange => CurrentIndex >= 0 && CurrentIndex < _flat.Count;
|
||||||
|
|
||||||
@@ -188,6 +198,7 @@ public sealed partial class ConflictResolverViewModel : ObservableObject
|
|||||||
OnPropertyChanged(nameof(HasBinaryFiles));
|
OnPropertyChanged(nameof(HasBinaryFiles));
|
||||||
OnPropertyChanged(nameof(HasMultipleFiles));
|
OnPropertyChanged(nameof(HasMultipleFiles));
|
||||||
OnPropertyChanged(nameof(FilesSummary));
|
OnPropertyChanged(nameof(FilesSummary));
|
||||||
|
OnPropertyChanged(nameof(ContinueHint));
|
||||||
RecomputeCanContinue();
|
RecomputeCanContinue();
|
||||||
if (_flat.Count > 0)
|
if (_flat.Count > 0)
|
||||||
MoveTo(0); // also sets ActiveFile via MoveTo
|
MoveTo(0); // also sets ActiveFile via MoveTo
|
||||||
@@ -211,6 +222,7 @@ public sealed partial class ConflictResolverViewModel : ObservableObject
|
|||||||
OnPropertyChanged(nameof(PositionText));
|
OnPropertyChanged(nameof(PositionText));
|
||||||
OnPropertyChanged(nameof(ActiveResultText));
|
OnPropertyChanged(nameof(ActiveResultText));
|
||||||
OnPropertyChanged(nameof(FilesSummary));
|
OnPropertyChanged(nameof(FilesSummary));
|
||||||
|
OnPropertyChanged(nameof(ContinueHint));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -67,7 +67,7 @@
|
|||||||
<TextBlock Grid.Column="0" Classes="meta" VerticalAlignment="Center"
|
<TextBlock Grid.Column="0" Classes="meta" VerticalAlignment="Center"
|
||||||
Foreground="{DynamicResource BloodBrush}"
|
Foreground="{DynamicResource BloodBrush}"
|
||||||
Text="{Binding ContinueHint}"
|
Text="{Binding ContinueHint}"
|
||||||
IsVisible="{Binding HasBinaryFiles}"/>
|
IsVisible="{Binding ContinueHint, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"/>
|
||||||
<StackPanel Grid.Column="1" Orientation="Horizontal" Spacing="8">
|
<StackPanel Grid.Column="1" Orientation="Horizontal" Spacing="8">
|
||||||
<Button Classes="btn accent" Content="{loc:Tr conflictResolver.continue}"
|
<Button Classes="btn accent" Content="{loc:Tr conflictResolver.continue}"
|
||||||
Command="{Binding ContinueCommand}" IsEnabled="{Binding CanContinue}"/>
|
Command="{Binding ContinueCommand}" IsEnabled="{Binding CanContinue}"/>
|
||||||
|
|||||||
Reference in New Issue
Block a user