refactor(ui): migrate WorktreesOverviewModal to ModalShell
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:vm="using:ClaudeDo.Ui.ViewModels.Modals"
|
xmlns:vm="using:ClaudeDo.Ui.ViewModels.Modals"
|
||||||
xmlns:converters="using:ClaudeDo.Ui.Converters"
|
xmlns:converters="using:ClaudeDo.Ui.Converters"
|
||||||
|
xmlns:ctl="using:ClaudeDo.Ui.Views.Controls"
|
||||||
x:Class="ClaudeDo.Ui.Views.Modals.WorktreesOverviewModalView"
|
x:Class="ClaudeDo.Ui.Views.Modals.WorktreesOverviewModalView"
|
||||||
x:DataType="vm:WorktreesOverviewModalViewModel"
|
x:DataType="vm:WorktreesOverviewModalViewModel"
|
||||||
Title="{Binding Title}"
|
Title="{Binding Title}"
|
||||||
@@ -9,9 +10,8 @@
|
|||||||
CanResize="True"
|
CanResize="True"
|
||||||
WindowStartupLocation="CenterOwner"
|
WindowStartupLocation="CenterOwner"
|
||||||
Background="{DynamicResource SurfaceBrush}"
|
Background="{DynamicResource SurfaceBrush}"
|
||||||
WindowDecorations="BorderOnly"
|
WindowDecorations="None"
|
||||||
ExtendClientAreaToDecorationsHint="True"
|
ExtendClientAreaToDecorationsHint="True">
|
||||||
ExtendClientAreaTitleBarHeightHint="-1">
|
|
||||||
|
|
||||||
<Window.Resources>
|
<Window.Resources>
|
||||||
<converters:WorktreeStateColorConverter x:Key="WorktreeStateColor"/>
|
<converters:WorktreeStateColorConverter x:Key="WorktreeStateColor"/>
|
||||||
@@ -53,7 +53,7 @@
|
|||||||
CommandParameter="{Binding}"/>
|
CommandParameter="{Binding}"/>
|
||||||
<Separator/>
|
<Separator/>
|
||||||
<MenuItem Header="Force remove"
|
<MenuItem Header="Force remove"
|
||||||
Foreground="#EF5350"
|
Foreground="{DynamicResource StatusErrorBrush}"
|
||||||
Command="{Binding $parent[Window].((vm:WorktreesOverviewModalViewModel)DataContext).ForceRemoveCommand}"
|
Command="{Binding $parent[Window].((vm:WorktreesOverviewModalViewModel)DataContext).ForceRemoveCommand}"
|
||||||
CommandParameter="{Binding}"/>
|
CommandParameter="{Binding}"/>
|
||||||
</ContextMenu>
|
</ContextMenu>
|
||||||
@@ -62,25 +62,25 @@
|
|||||||
<StackPanel Grid.Column="0" Orientation="Vertical" Spacing="2">
|
<StackPanel Grid.Column="0" Orientation="Vertical" Spacing="2">
|
||||||
<TextBlock Text="{Binding TaskTitle}" FontWeight="SemiBold"/>
|
<TextBlock Text="{Binding TaskTitle}" FontWeight="SemiBold"/>
|
||||||
<StackPanel Orientation="Horizontal" Spacing="4">
|
<StackPanel Orientation="Horizontal" Spacing="4">
|
||||||
<TextBlock Text="{Binding TaskStatus}" FontSize="10"
|
<TextBlock Text="{Binding TaskStatus}" FontSize="{StaticResource FontSizeEyebrow}"
|
||||||
Foreground="{DynamicResource TextFaintBrush}"/>
|
Foreground="{DynamicResource TextFaintBrush}"/>
|
||||||
<TextBlock Text="•" FontSize="10" Foreground="{DynamicResource TextFaintBrush}"
|
<TextBlock Text="•" FontSize="{StaticResource FontSizeEyebrow}" Foreground="{DynamicResource TextFaintBrush}"
|
||||||
IsVisible="{Binding !PathExistsOnDisk}"/>
|
IsVisible="{Binding !PathExistsOnDisk}"/>
|
||||||
<TextBlock Text="phantom" FontSize="10" Foreground="#EF5350"
|
<TextBlock Text="phantom" FontSize="{StaticResource FontSizeEyebrow}" Foreground="{DynamicResource StatusErrorBrush}"
|
||||||
IsVisible="{Binding !PathExistsOnDisk}"
|
IsVisible="{Binding !PathExistsOnDisk}"
|
||||||
ToolTip.Tip="Directory missing on disk"/>
|
ToolTip.Tip="Directory missing on disk"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<Border Grid.Column="1" CornerRadius="3" Padding="6,2" VerticalAlignment="Center"
|
<Border Grid.Column="1" CornerRadius="3" Padding="6,2" VerticalAlignment="Center"
|
||||||
Background="{Binding State, Converter={StaticResource WorktreeStateColor}}">
|
Background="{Binding State, Converter={StaticResource WorktreeStateColor}}">
|
||||||
<TextBlock Text="{Binding State}" FontSize="10" Foreground="White"
|
<TextBlock Text="{Binding State}" FontSize="{StaticResource FontSizeEyebrow}" Foreground="{DynamicResource TextBrush}"
|
||||||
HorizontalAlignment="Center"/>
|
HorizontalAlignment="Center"/>
|
||||||
</Border>
|
</Border>
|
||||||
<TextBlock Grid.Column="2" Text="{Binding DiffStat}" VerticalAlignment="Center"
|
<TextBlock Grid.Column="2" Text="{Binding DiffStat}" VerticalAlignment="Center"
|
||||||
FontFamily="{DynamicResource MonoFont}" FontSize="11"
|
FontFamily="{DynamicResource MonoFont}" FontSize="{StaticResource FontSizeMono}"
|
||||||
Foreground="{DynamicResource TextDimBrush}"/>
|
Foreground="{DynamicResource TextDimBrush}"/>
|
||||||
<TextBlock Grid.Column="3" Text="{Binding AgeText}" VerticalAlignment="Center"
|
<TextBlock Grid.Column="3" Text="{Binding AgeText}" VerticalAlignment="Center"
|
||||||
FontSize="11" Foreground="{DynamicResource TextDimBrush}"/>
|
FontSize="{StaticResource FontSizeMono}" Foreground="{DynamicResource TextDimBrush}"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
@@ -109,35 +109,18 @@
|
|||||||
</Style>
|
</Style>
|
||||||
</Window.Styles>
|
</Window.Styles>
|
||||||
|
|
||||||
<Grid RowDefinitions="36,Auto,*,52">
|
<ctl:ModalShell Title="{Binding Title}" CloseCommand="{Binding CloseCommand}">
|
||||||
|
<ctl:ModalShell.Footer>
|
||||||
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="12,2">
|
||||||
|
<Button Content="Close" Command="{Binding CloseCommand}"/>
|
||||||
|
</StackPanel>
|
||||||
|
</ctl:ModalShell.Footer>
|
||||||
|
|
||||||
<!-- Title bar -->
|
<!-- Body: toolbar + content -->
|
||||||
<Border Grid.Row="0"
|
<DockPanel>
|
||||||
Background="{DynamicResource DeepBrush}"
|
|
||||||
BorderBrush="{DynamicResource LineBrush}"
|
|
||||||
BorderThickness="0,0,0,1"
|
|
||||||
PointerPressed="OnTitleBarPressed">
|
|
||||||
<Grid ColumnDefinitions="*,Auto">
|
|
||||||
<TextBlock Grid.Column="0"
|
|
||||||
Text="{Binding Title}"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Margin="14,0,0,0"
|
|
||||||
FontSize="12"
|
|
||||||
FontWeight="SemiBold"
|
|
||||||
Foreground="{DynamicResource TextBrush}"/>
|
|
||||||
<Button Grid.Column="1"
|
|
||||||
Content="✕"
|
|
||||||
Command="{Binding CloseCommand}"
|
|
||||||
Margin="0,0,8,0"
|
|
||||||
Width="28" Height="28"
|
|
||||||
FontSize="11"
|
|
||||||
HorizontalContentAlignment="Center"
|
|
||||||
VerticalContentAlignment="Center"/>
|
|
||||||
</Grid>
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
<!-- Toolbar -->
|
<!-- Toolbar -->
|
||||||
<Border Grid.Row="1"
|
<Border DockPanel.Dock="Top"
|
||||||
Background="{DynamicResource DeepBrush}"
|
Background="{DynamicResource DeepBrush}"
|
||||||
BorderBrush="{DynamicResource LineBrush}"
|
BorderBrush="{DynamicResource LineBrush}"
|
||||||
BorderThickness="0,0,0,1"
|
BorderThickness="0,0,0,1"
|
||||||
@@ -151,21 +134,21 @@
|
|||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
<!-- Content -->
|
<!-- Content -->
|
||||||
<ScrollViewer Grid.Row="2" Padding="12,8">
|
<ScrollViewer Padding="12,8">
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
<!-- Column headers -->
|
<!-- Column headers -->
|
||||||
<Grid ColumnDefinitions="*,90,80,80" Margin="12,0,12,4">
|
<Grid ColumnDefinitions="*,90,80,80" Margin="12,0,12,4">
|
||||||
<TextBlock Grid.Column="0" Text="TASK"
|
<TextBlock Grid.Column="0" Text="TASK"
|
||||||
FontFamily="{DynamicResource MonoFont}" FontSize="10" LetterSpacing="1.4"
|
FontFamily="{DynamicResource MonoFont}" FontSize="{StaticResource FontSizeEyebrow}" LetterSpacing="1.4"
|
||||||
Foreground="{DynamicResource TextFaintBrush}"/>
|
Foreground="{DynamicResource TextFaintBrush}"/>
|
||||||
<TextBlock Grid.Column="1" Text="STATE"
|
<TextBlock Grid.Column="1" Text="STATE"
|
||||||
FontFamily="{DynamicResource MonoFont}" FontSize="10" LetterSpacing="1.4"
|
FontFamily="{DynamicResource MonoFont}" FontSize="{StaticResource FontSizeEyebrow}" LetterSpacing="1.4"
|
||||||
Foreground="{DynamicResource TextFaintBrush}"/>
|
Foreground="{DynamicResource TextFaintBrush}"/>
|
||||||
<TextBlock Grid.Column="2" Text="DIFF"
|
<TextBlock Grid.Column="2" Text="DIFF"
|
||||||
FontFamily="{DynamicResource MonoFont}" FontSize="10" LetterSpacing="1.4"
|
FontFamily="{DynamicResource MonoFont}" FontSize="{StaticResource FontSizeEyebrow}" LetterSpacing="1.4"
|
||||||
Foreground="{DynamicResource TextFaintBrush}"/>
|
Foreground="{DynamicResource TextFaintBrush}"/>
|
||||||
<TextBlock Grid.Column="3" Text="AGE"
|
<TextBlock Grid.Column="3" Text="AGE"
|
||||||
FontFamily="{DynamicResource MonoFont}" FontSize="10" LetterSpacing="1.4"
|
FontFamily="{DynamicResource MonoFont}" FontSize="{StaticResource FontSizeEyebrow}" LetterSpacing="1.4"
|
||||||
Foreground="{DynamicResource TextFaintBrush}"/>
|
Foreground="{DynamicResource TextFaintBrush}"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Border Height="1" Background="{DynamicResource LineBrush}" Margin="0,0,0,8"/>
|
<Border Height="1" Background="{DynamicResource LineBrush}" Margin="0,0,0,8"/>
|
||||||
@@ -198,16 +181,7 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
|
|
||||||
<!-- Footer -->
|
</DockPanel>
|
||||||
<Border Grid.Row="3"
|
|
||||||
Background="{DynamicResource DeepBrush}"
|
|
||||||
BorderBrush="{DynamicResource LineBrush}"
|
|
||||||
BorderThickness="0,1,0,0"
|
|
||||||
Padding="12,10">
|
|
||||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
|
|
||||||
<Button Content="Close" Command="{Binding CloseCommand}"/>
|
|
||||||
</StackPanel>
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
</Grid>
|
</ctl:ModalShell>
|
||||||
</Window>
|
</Window>
|
||||||
|
|||||||
@@ -17,9 +17,5 @@ public partial class WorktreesOverviewModalView : Window
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnTitleBarPressed(object? sender, PointerPressedEventArgs e)
|
|
||||||
{
|
|
||||||
if (e.GetCurrentPoint(this).Properties.IsLeftButtonPressed)
|
|
||||||
BeginMoveDrag(e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user