refactor(ui): migrate PlanningDiffView to ModalShell
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:Class="ClaudeDo.Ui.Views.Planning.PlanningDiffView"
|
x:Class="ClaudeDo.Ui.Views.Planning.PlanningDiffView"
|
||||||
x:DataType="vm:PlanningDiffViewModel"
|
x:DataType="vm:PlanningDiffViewModel"
|
||||||
Title="Planning — Combined diff"
|
Title="Planning — Combined diff"
|
||||||
@@ -14,32 +15,11 @@
|
|||||||
<KeyBinding Gesture="Escape" Command="{Binding CloseCommand}"/>
|
<KeyBinding Gesture="Escape" Command="{Binding CloseCommand}"/>
|
||||||
</Window.KeyBindings>
|
</Window.KeyBindings>
|
||||||
|
|
||||||
<Border Background="{DynamicResource SurfaceBrush}"
|
<ctl:ModalShell Title="PLANNING — COMBINED DIFF" CloseCommand="{Binding CloseCommand}">
|
||||||
BorderBrush="{DynamicResource LineBrush}"
|
|
||||||
BorderThickness="1">
|
|
||||||
<Grid RowDefinitions="36,Auto,*">
|
|
||||||
|
|
||||||
<!-- Title bar / drag handle -->
|
<!-- Toolbar row -->
|
||||||
<Border Grid.Row="0"
|
<DockPanel>
|
||||||
x:Name="TitleBar"
|
<StackPanel DockPanel.Dock="Top"
|
||||||
Background="{DynamicResource Surface2Brush}"
|
|
||||||
BorderBrush="{DynamicResource LineBrush}"
|
|
||||||
BorderThickness="0,0,0,1"
|
|
||||||
PointerPressed="TitleBar_PointerPressed">
|
|
||||||
<Grid ColumnDefinitions="*,Auto" Margin="14,0">
|
|
||||||
<TextBlock Classes="title" Text="Planning — Combined diff"
|
|
||||||
VerticalAlignment="Center"/>
|
|
||||||
<Button Grid.Column="1"
|
|
||||||
Classes="icon-btn"
|
|
||||||
Content="✕"
|
|
||||||
FontSize="{StaticResource FontSizeBody}"
|
|
||||||
Command="{Binding CloseCommand}"
|
|
||||||
VerticalAlignment="Center"/>
|
|
||||||
</Grid>
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
<!-- Toolbar row -->
|
|
||||||
<StackPanel Grid.Row="1"
|
|
||||||
Orientation="Horizontal"
|
Orientation="Horizontal"
|
||||||
Spacing="8"
|
Spacing="8"
|
||||||
Margin="8,6">
|
Margin="8,6">
|
||||||
@@ -54,7 +34,7 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<!-- Two-pane body -->
|
<!-- Two-pane body -->
|
||||||
<Grid Grid.Row="2" ColumnDefinitions="240,*">
|
<Grid ColumnDefinitions="240,*">
|
||||||
|
|
||||||
<!-- Subtask list (left pane) -->
|
<!-- Subtask list (left pane) -->
|
||||||
<Border Grid.Column="0"
|
<Border Grid.Column="0"
|
||||||
@@ -95,6 +75,7 @@
|
|||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</DockPanel>
|
||||||
</Border>
|
|
||||||
|
</ctl:ModalShell>
|
||||||
</Window>
|
</Window>
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Input;
|
|
||||||
using CommunityToolkit.Mvvm.Input;
|
|
||||||
using ClaudeDo.Ui.ViewModels.Planning;
|
using ClaudeDo.Ui.ViewModels.Planning;
|
||||||
|
|
||||||
namespace ClaudeDo.Ui.Views.Planning;
|
namespace ClaudeDo.Ui.Views.Planning;
|
||||||
@@ -18,10 +16,4 @@ public partial class PlanningDiffView : Window
|
|||||||
if (DataContext is PlanningDiffViewModel vm)
|
if (DataContext is PlanningDiffViewModel vm)
|
||||||
vm.CloseAction = Close;
|
vm.CloseAction = Close;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void TitleBar_PointerPressed(object? sender, PointerPressedEventArgs e)
|
|
||||||
{
|
|
||||||
if (e.GetCurrentPoint(this).Properties.IsLeftButtonPressed)
|
|
||||||
BeginMoveDrag(e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user