feat(ui): add merge-helper task selection dialog

This commit is contained in:
mika kuns
2026-07-24 14:21:26 +02:00
parent 5ba0c09d8f
commit 327ae2b69c
9 changed files with 440 additions and 0 deletions
@@ -0,0 +1,81 @@
<Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="using:ClaudeDo.Ui.ViewModels.Modals"
xmlns:ctl="using:ClaudeDo.Ui.Views.Controls"
xmlns:loc="using:ClaudeDo.Ui.Localization"
x:Class="ClaudeDo.Ui.Views.Modals.MergeHelperSelectionModal"
x:DataType="vm:MergeHelperSelectionModalViewModel"
Title="{loc:Tr modals.mergeHelper.windowTitle}"
Width="560" Height="480" MinWidth="420" MinHeight="320"
CanResize="True"
WindowDecorations="BorderOnly"
ExtendClientAreaToDecorationsHint="True"
ExtendClientAreaTitleBarHeightHint="-1"
WindowStartupLocation="CenterOwner"
Background="{DynamicResource SurfaceBrush}">
<Window.KeyBindings>
<KeyBinding Gesture="Escape" Command="{Binding CancelCommand}"/>
</Window.KeyBindings>
<ctl:ModalShell Title="{loc:Tr modals.mergeHelper.title}" CloseCommand="{Binding CancelCommand}">
<ctl:ModalShell.Footer>
<StackPanel Orientation="Horizontal" Spacing="8" HorizontalAlignment="Right"
VerticalAlignment="Center">
<Button Classes="btn" Content="{loc:Tr modals.mergeHelper.cancel}" Command="{Binding CancelCommand}" MinWidth="90"/>
<Button Content="{loc:Tr modals.mergeHelper.confirm}" Command="{Binding ConfirmCommand}"
IsEnabled="{Binding CanConfirm}" MinWidth="140" Classes="primary"/>
</StackPanel>
</ctl:ModalShell.Footer>
<!-- Body: scope + select-all/none toolbar, headers, checkbox rows -->
<DockPanel>
<Grid DockPanel.Dock="Top" ColumnDefinitions="*,Auto,Auto" Margin="20,12,20,6">
<TextBlock Grid.Column="0" Classes="meta" Text="{Binding ScopeLabel}" VerticalAlignment="Center"/>
<Button Grid.Column="1" Classes="btn" Content="{loc:Tr modals.mergeHelper.selectAll}"
Command="{Binding SelectAllCommand}" IsEnabled="{Binding HasTasks}"/>
<Button Grid.Column="2" Classes="btn" Content="{loc:Tr modals.mergeHelper.selectNone}"
Command="{Binding SelectNoneCommand}" IsEnabled="{Binding HasTasks}" Margin="8,0,0,0"/>
</Grid>
<!-- Column headers -->
<Grid DockPanel.Dock="Top" ColumnDefinitions="32,*,120,120" Margin="20,0,20,4"
IsVisible="{Binding HasTasks}">
<TextBlock Grid.Column="1" Classes="eyebrow" Text="{loc:Tr modals.mergeHelper.columnTask}"/>
<TextBlock Grid.Column="2" Classes="eyebrow" Text="{loc:Tr modals.mergeHelper.columnStatus}"/>
<TextBlock Grid.Column="3" Classes="eyebrow" Text="{loc:Tr modals.mergeHelper.columnList}"
IsVisible="{Binding IsGlobal}"/>
</Grid>
<ScrollViewer Padding="20,2,20,8">
<StackPanel>
<TextBlock Classes="meta" Margin="0,8"
Text="{loc:Tr modals.mergeHelper.empty}"
IsVisible="{Binding !HasTasks}"/>
<ItemsControl ItemsSource="{Binding Tasks}">
<ItemsControl.ItemTemplate>
<DataTemplate DataType="vm:MergeHelperTaskRowViewModel">
<Grid ColumnDefinitions="32,*,120,120" Margin="0,1">
<CheckBox Grid.Column="0" MinWidth="0"
IsChecked="{Binding IsSelected, Mode=TwoWay}"
VerticalAlignment="Center"/>
<TextBlock Classes="body" Grid.Column="1" Text="{Binding Title}"
VerticalAlignment="Center" Margin="4,0,0,0"
TextTrimming="CharacterEllipsis"/>
<Border Grid.Column="2" Classes="chip"
HorizontalAlignment="Left" VerticalAlignment="Center">
<TextBlock Text="{Binding StatusText}"/>
</Border>
<TextBlock Classes="meta" Grid.Column="3" Text="{Binding ListName}"
VerticalAlignment="Center" Margin="8,0,0,0"
TextTrimming="CharacterEllipsis"
IsVisible="{Binding $parent[Window].((vm:MergeHelperSelectionModalViewModel)DataContext).IsGlobal}"/>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
</ScrollViewer>
</DockPanel>
</ctl:ModalShell>
</Window>