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"
|
<Window xmlns="https://github.com/avaloniaui"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:vm="using:ClaudeDo.Ui.ViewModels.Planning"
|
xmlns:vm="using:ClaudeDo.Ui.ViewModels.Planning"
|
||||||
|
xmlns:ctl="using:ClaudeDo.Ui.Views.Controls"
|
||||||
x:DataType="vm:ConflictResolutionViewModel"
|
x:DataType="vm:ConflictResolutionViewModel"
|
||||||
x:Class="ClaudeDo.Ui.Views.Planning.ConflictResolutionView"
|
x:Class="ClaudeDo.Ui.Views.Planning.ConflictResolutionView"
|
||||||
Title="Merge conflict"
|
Title="Merge conflict"
|
||||||
@@ -8,58 +9,42 @@
|
|||||||
WindowDecorations="None"
|
WindowDecorations="None"
|
||||||
ExtendClientAreaToDecorationsHint="True"
|
ExtendClientAreaToDecorationsHint="True"
|
||||||
WindowStartupLocation="CenterOwner"
|
WindowStartupLocation="CenterOwner"
|
||||||
Background="{StaticResource SurfaceBrush}">
|
Background="{DynamicResource SurfaceBrush}">
|
||||||
|
|
||||||
<Window.KeyBindings>
|
<Window.KeyBindings>
|
||||||
<KeyBinding Gesture="Escape" Command="{Binding AbortCommand}"/>
|
<KeyBinding Gesture="Escape" Command="{Binding AbortCommand}"/>
|
||||||
</Window.KeyBindings>
|
</Window.KeyBindings>
|
||||||
|
|
||||||
<Border Background="{StaticResource SurfaceBrush}"
|
<ctl:ModalShell Title="MERGE CONFLICT" CloseCommand="{Binding AbortCommand}">
|
||||||
BorderBrush="{StaticResource LineBrush}"
|
<ctl:ModalShell.Footer>
|
||||||
BorderThickness="1">
|
<StackPanel Orientation="Horizontal" Spacing="8"
|
||||||
<Grid RowDefinitions="36,*">
|
HorizontalAlignment="Right" VerticalAlignment="Center"
|
||||||
|
Margin="16,0">
|
||||||
<!-- Title bar / drag handle -->
|
<Button Content="Open all in VS Code" Command="{Binding OpenInVsCodeCommand}"/>
|
||||||
<Border Grid.Row="0"
|
<Button Content="I've resolved — continue" Command="{Binding ContinueCommand}"/>
|
||||||
x:Name="TitleBar"
|
<Button Content="Abort this merge" Command="{Binding AbortCommand}"/>
|
||||||
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>
|
|
||||||
|
|
||||||
<!-- Content -->
|
|
||||||
<StackPanel Grid.Row="1" Spacing="12" Margin="16" MinWidth="520">
|
|
||||||
<TextBlock FontWeight="SemiBold" FontSize="16"
|
|
||||||
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"/>
|
|
||||||
</DataTemplate>
|
|
||||||
</ItemsControl.ItemTemplate>
|
|
||||||
</ItemsControl>
|
|
||||||
<TextBlock Text="{Binding VsCodeError}" Foreground="OrangeRed"
|
|
||||||
IsVisible="{Binding VsCodeError, Converter={x:Static ObjectConverters.IsNotNull}}"
|
|
||||||
TextWrapping="Wrap"/>
|
|
||||||
<TextBlock Text="{Binding ActionError}" Foreground="OrangeRed"
|
|
||||||
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>
|
</StackPanel>
|
||||||
|
</ctl:ModalShell.Footer>
|
||||||
|
|
||||||
</Grid>
|
<!-- Content -->
|
||||||
</Border>
|
<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="{DynamicResource MonoFont}"/>
|
||||||
|
</DataTemplate>
|
||||||
|
</ItemsControl.ItemTemplate>
|
||||||
|
</ItemsControl>
|
||||||
|
<TextBlock Text="{Binding VsCodeError}" Foreground="{DynamicResource BloodBrush}"
|
||||||
|
IsVisible="{Binding VsCodeError, Converter={x:Static ObjectConverters.IsNotNull}}"
|
||||||
|
TextWrapping="Wrap"/>
|
||||||
|
<TextBlock Text="{Binding ActionError}" Foreground="{DynamicResource BloodBrush}"
|
||||||
|
IsVisible="{Binding ActionError, Converter={x:Static ObjectConverters.IsNotNull}}"
|
||||||
|
TextWrapping="Wrap"/>
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
</ctl:ModalShell>
|
||||||
</Window>
|
</Window>
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Input;
|
|
||||||
using ClaudeDo.Ui.ViewModels.Planning;
|
using ClaudeDo.Ui.ViewModels.Planning;
|
||||||
|
|
||||||
namespace ClaudeDo.Ui.Views.Planning;
|
namespace ClaudeDo.Ui.Views.Planning;
|
||||||
@@ -17,10 +16,4 @@ public partial class ConflictResolutionView : Window
|
|||||||
if (DataContext is ConflictResolutionViewModel vm)
|
if (DataContext is ConflictResolutionViewModel vm)
|
||||||
vm.CloseRequested = Close;
|
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