refactor(ui): migrate ConflictResolutionView to ModalShell and use dynamic resources
Replace manual titlebar/drag handler with ModalShell, move action buttons to footer, convert StaticResource token attrs to DynamicResource, replace OrangeRed with BloodBrush, and use MonoFont DynamicResource. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<Window xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:ClaudeDo.Ui.ViewModels.Planning"
|
||||
xmlns:ctl="using:ClaudeDo.Ui.Views.Controls"
|
||||
x:DataType="vm:ConflictResolutionViewModel"
|
||||
x:Class="ClaudeDo.Ui.Views.Planning.ConflictResolutionView"
|
||||
Title="Merge conflict"
|
||||
@@ -8,58 +9,42 @@
|
||||
WindowDecorations="None"
|
||||
ExtendClientAreaToDecorationsHint="True"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
Background="{StaticResource SurfaceBrush}">
|
||||
Background="{DynamicResource SurfaceBrush}">
|
||||
|
||||
<Window.KeyBindings>
|
||||
<KeyBinding Gesture="Escape" Command="{Binding AbortCommand}"/>
|
||||
</Window.KeyBindings>
|
||||
|
||||
<Border Background="{StaticResource SurfaceBrush}"
|
||||
BorderBrush="{StaticResource LineBrush}"
|
||||
BorderThickness="1">
|
||||
<Grid RowDefinitions="36,*">
|
||||
|
||||
<!-- Title bar / drag handle -->
|
||||
<Border Grid.Row="0"
|
||||
x:Name="TitleBar"
|
||||
Background="{StaticResource Surface2Brush}"
|
||||
BorderBrush="{StaticResource LineBrush}"
|
||||
BorderThickness="0,0,0,1"
|
||||
PointerPressed="TitleBar_PointerPressed">
|
||||
<Grid ColumnDefinitions="*,Auto" Margin="14,0">
|
||||
<TextBlock Text="Merge conflict"
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="{StaticResource MonoFamily}"
|
||||
FontSize="12"
|
||||
Foreground="{StaticResource TextDimBrush}"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
<ctl:ModalShell Title="MERGE CONFLICT" CloseCommand="{Binding AbortCommand}">
|
||||
<ctl:ModalShell.Footer>
|
||||
<StackPanel Orientation="Horizontal" Spacing="8"
|
||||
HorizontalAlignment="Right" VerticalAlignment="Center"
|
||||
Margin="16,0">
|
||||
<Button Content="Open all in VS Code" Command="{Binding OpenInVsCodeCommand}"/>
|
||||
<Button Content="I've resolved — continue" Command="{Binding ContinueCommand}"/>
|
||||
<Button Content="Abort this merge" Command="{Binding AbortCommand}"/>
|
||||
</StackPanel>
|
||||
</ctl:ModalShell.Footer>
|
||||
|
||||
<!-- Content -->
|
||||
<StackPanel Grid.Row="1" Spacing="12" Margin="16" MinWidth="520">
|
||||
<TextBlock FontWeight="SemiBold" FontSize="16"
|
||||
<StackPanel Spacing="12" Margin="16" MinWidth="520">
|
||||
<TextBlock FontWeight="SemiBold" FontSize="{StaticResource FontSizeH3}"
|
||||
Text="{Binding SubtaskTitle, StringFormat='Conflicts in subtask: {0}'}"/>
|
||||
<TextBlock Text="{Binding TargetBranch, StringFormat='Merging into: {0}'}" Opacity="0.7"/>
|
||||
<ItemsControl ItemsSource="{Binding ConflictedFiles}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding}" FontFamily="Consolas,Menlo,monospace"/>
|
||||
<TextBlock Text="{Binding}" FontFamily="{DynamicResource MonoFont}"/>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
<TextBlock Text="{Binding VsCodeError}" Foreground="OrangeRed"
|
||||
<TextBlock Text="{Binding VsCodeError}" Foreground="{DynamicResource BloodBrush}"
|
||||
IsVisible="{Binding VsCodeError, Converter={x:Static ObjectConverters.IsNotNull}}"
|
||||
TextWrapping="Wrap"/>
|
||||
<TextBlock Text="{Binding ActionError}" Foreground="OrangeRed"
|
||||
<TextBlock Text="{Binding ActionError}" Foreground="{DynamicResource BloodBrush}"
|
||||
IsVisible="{Binding ActionError, Converter={x:Static ObjectConverters.IsNotNull}}"
|
||||
TextWrapping="Wrap"/>
|
||||
<StackPanel Orientation="Horizontal" Spacing="8" HorizontalAlignment="Right" Margin="0,4,0,4">
|
||||
<Button Content="Open all in VS Code" Command="{Binding OpenInVsCodeCommand}"/>
|
||||
<Button Content="I've resolved — continue" Command="{Binding ContinueCommand}"/>
|
||||
<Button Content="Abort this merge" Command="{Binding AbortCommand}"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
|
||||
</Grid>
|
||||
</Border>
|
||||
</ctl:ModalShell>
|
||||
</Window>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Input;
|
||||
using ClaudeDo.Ui.ViewModels.Planning;
|
||||
|
||||
namespace ClaudeDo.Ui.Views.Planning;
|
||||
@@ -17,10 +16,4 @@ public partial class ConflictResolutionView : Window
|
||||
if (DataContext is ConflictResolutionViewModel vm)
|
||||
vm.CloseRequested = Close;
|
||||
}
|
||||
|
||||
private void TitleBar_PointerPressed(object? sender, PointerPressedEventArgs e)
|
||||
{
|
||||
if (e.GetCurrentPoint(this).Properties.IsLeftButtonPressed)
|
||||
BeginMoveDrag(e);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user