refactor(ui): redesign list settings and merge modals with custom chrome
Both modals now use SystemDecorations=None with a draggable title bar, sectioned layout matching the rest of the island shell, Escape-to-cancel, and themed brushes instead of hard-coded colours. ListSettings adds a Browse... button that reads agent frontmatter from arbitrary .md files.
This commit is contained in:
@@ -4,77 +4,135 @@
|
||||
x:Class="ClaudeDo.Ui.Views.Modals.MergeModalView"
|
||||
x:DataType="vm:MergeModalViewModel"
|
||||
Title="Merge worktree"
|
||||
Width="560" Height="420"
|
||||
Width="560" Height="460"
|
||||
CanResize="False"
|
||||
WindowStartupLocation="CenterOwner">
|
||||
<Grid Margin="20" RowDefinitions="Auto,Auto,Auto,Auto,Auto,*,Auto">
|
||||
SystemDecorations="None"
|
||||
ExtendClientAreaToDecorationsHint="True"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
Background="{DynamicResource SurfaceBrush}">
|
||||
|
||||
<TextBlock Grid.Row="0"
|
||||
Text="{Binding TaskTitle, StringFormat='Merging: {0}'}"
|
||||
FontWeight="SemiBold" Margin="0,0,0,12" />
|
||||
<Window.KeyBindings>
|
||||
<KeyBinding Gesture="Escape" Command="{Binding CancelCommand}"/>
|
||||
</Window.KeyBindings>
|
||||
|
||||
<StackPanel Grid.Row="1" Orientation="Vertical" Margin="0,0,0,8">
|
||||
<TextBlock Text="Target branch" Margin="0,0,0,4" />
|
||||
<ComboBox ItemsSource="{Binding Branches}"
|
||||
SelectedItem="{Binding SelectedBranch}"
|
||||
HorizontalAlignment="Stretch"
|
||||
IsEnabled="{Binding !IsBusy}" />
|
||||
</StackPanel>
|
||||
<Window.Styles>
|
||||
<Style Selector="TextBlock.field-label">
|
||||
<Setter Property="FontSize" Value="11"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource TextDimBrush}"/>
|
||||
<Setter Property="Margin" Value="0,0,0,4"/>
|
||||
</Style>
|
||||
<Style Selector="Button.primary">
|
||||
<Setter Property="Background" Value="{DynamicResource AccentBrush}"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource DeepBrush}"/>
|
||||
<Setter Property="FontWeight" Value="SemiBold"/>
|
||||
</Style>
|
||||
</Window.Styles>
|
||||
|
||||
<CheckBox Grid.Row="2"
|
||||
Content="Remove worktree after merge"
|
||||
IsChecked="{Binding RemoveWorktree}"
|
||||
IsEnabled="{Binding !IsBusy}"
|
||||
Margin="0,0,0,8" />
|
||||
<Border Background="{DynamicResource SurfaceBrush}"
|
||||
BorderBrush="{DynamicResource LineBrush}"
|
||||
BorderThickness="1">
|
||||
<Grid RowDefinitions="36,*,52">
|
||||
|
||||
<StackPanel Grid.Row="3" Orientation="Vertical" Margin="0,0,0,8">
|
||||
<TextBlock Text="Commit message" Margin="0,0,0,4" />
|
||||
<TextBox Text="{Binding CommitMessage}"
|
||||
AcceptsReturn="True"
|
||||
TextWrapping="Wrap"
|
||||
Height="70"
|
||||
IsEnabled="{Binding !IsBusy}" />
|
||||
</StackPanel>
|
||||
<!-- Title bar -->
|
||||
<Border Grid.Row="0"
|
||||
x:Name="TitleBar"
|
||||
Background="{DynamicResource DeepBrush}"
|
||||
BorderBrush="{DynamicResource LineBrush}"
|
||||
BorderThickness="0,0,0,1"
|
||||
PointerPressed="TitleBar_PointerPressed">
|
||||
<Grid ColumnDefinitions="*,Auto" Margin="14,0">
|
||||
<TextBlock Text="MERGE WORKTREE"
|
||||
FontFamily="{DynamicResource MonoFont}"
|
||||
FontSize="11"
|
||||
LetterSpacing="1.4"
|
||||
Foreground="{DynamicResource TextBrush}"
|
||||
VerticalAlignment="Center"/>
|
||||
<Button Grid.Column="1"
|
||||
Classes="icon-btn"
|
||||
Content="✕"
|
||||
FontSize="12"
|
||||
Command="{Binding CancelCommand}"
|
||||
VerticalAlignment="Center"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<TextBlock Grid.Row="4"
|
||||
Text="{Binding ErrorMessage}"
|
||||
Foreground="IndianRed"
|
||||
TextWrapping="Wrap"
|
||||
IsVisible="{Binding ErrorMessage, Converter={x:Static ObjectConverters.IsNotNull}}"
|
||||
Margin="0,0,0,8" />
|
||||
<!-- Body -->
|
||||
<ScrollViewer Grid.Row="1" Padding="20,16">
|
||||
<StackPanel Spacing="12">
|
||||
|
||||
<Border Grid.Row="5"
|
||||
BorderBrush="IndianRed"
|
||||
BorderThickness="1"
|
||||
Padding="8"
|
||||
IsVisible="{Binding HasConflict}">
|
||||
<StackPanel>
|
||||
<TextBlock Text="Conflicted files:" FontWeight="SemiBold" Margin="0,0,0,4" />
|
||||
<ItemsControl ItemsSource="{Binding ConflictFiles}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding}" />
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
<TextBlock Text="{Binding TaskTitle, StringFormat='Merging: {0}'}"
|
||||
FontWeight="SemiBold"
|
||||
Foreground="{DynamicResource TextBrush}" />
|
||||
|
||||
<StackPanel Grid.Row="6" Orientation="Horizontal"
|
||||
HorizontalAlignment="Right" Margin="0,12,0,0">
|
||||
<TextBlock Text="{Binding SuccessMessage}"
|
||||
Foreground="SeaGreen"
|
||||
VerticalAlignment="Center"
|
||||
Margin="0,0,12,0"
|
||||
IsVisible="{Binding SuccessMessage, Converter={x:Static ObjectConverters.IsNotNull}}" />
|
||||
<Button Content="Cancel"
|
||||
Command="{Binding CancelCommand}"
|
||||
Margin="0,0,8,0" />
|
||||
<Button Content="Merge"
|
||||
Command="{Binding SubmitCommand}"
|
||||
IsDefault="True"
|
||||
Classes="accent" />
|
||||
</StackPanel>
|
||||
<StackPanel Spacing="4">
|
||||
<TextBlock Classes="field-label" Text="Target branch"/>
|
||||
<ComboBox ItemsSource="{Binding Branches}"
|
||||
SelectedItem="{Binding SelectedBranch}"
|
||||
HorizontalAlignment="Stretch"
|
||||
IsEnabled="{Binding !IsBusy}" />
|
||||
</StackPanel>
|
||||
|
||||
</Grid>
|
||||
<CheckBox Content="Remove worktree after merge"
|
||||
IsChecked="{Binding RemoveWorktree}"
|
||||
IsEnabled="{Binding !IsBusy}" />
|
||||
|
||||
<StackPanel Spacing="4">
|
||||
<TextBlock Classes="field-label" Text="Commit message"/>
|
||||
<TextBox Text="{Binding CommitMessage}"
|
||||
AcceptsReturn="True"
|
||||
TextWrapping="Wrap"
|
||||
Height="70"
|
||||
IsEnabled="{Binding !IsBusy}" />
|
||||
</StackPanel>
|
||||
|
||||
<TextBlock Text="{Binding ErrorMessage}"
|
||||
Foreground="{DynamicResource BloodBrush}"
|
||||
TextWrapping="Wrap"
|
||||
IsVisible="{Binding ErrorMessage, Converter={x:Static ObjectConverters.IsNotNull}}" />
|
||||
|
||||
<Border BorderBrush="{DynamicResource BloodBrush}"
|
||||
BorderThickness="1"
|
||||
CornerRadius="6"
|
||||
Padding="12,10"
|
||||
IsVisible="{Binding HasConflict}">
|
||||
<StackPanel Spacing="4">
|
||||
<TextBlock Text="Conflicted files:"
|
||||
FontWeight="SemiBold"
|
||||
Foreground="{DynamicResource TextBrush}" />
|
||||
<ItemsControl ItemsSource="{Binding ConflictFiles}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding}"
|
||||
FontFamily="{DynamicResource MonoFont}"
|
||||
FontSize="11"
|
||||
Foreground="{DynamicResource TextDimBrush}" />
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<TextBlock Text="{Binding SuccessMessage}"
|
||||
Foreground="{DynamicResource MossBrightBrush}"
|
||||
IsVisible="{Binding SuccessMessage, Converter={x:Static ObjectConverters.IsNotNull}}" />
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
|
||||
<!-- Footer -->
|
||||
<Border Grid.Row="2"
|
||||
Background="{DynamicResource DeepBrush}"
|
||||
BorderBrush="{DynamicResource LineBrush}"
|
||||
BorderThickness="0,1,0,0">
|
||||
<StackPanel Orientation="Horizontal" Spacing="8"
|
||||
HorizontalAlignment="Right" VerticalAlignment="Center"
|
||||
Margin="16,0">
|
||||
<Button Content="Cancel" Command="{Binding CancelCommand}" MinWidth="90"/>
|
||||
<Button Content="Merge" Classes="primary"
|
||||
Command="{Binding SubmitCommand}"
|
||||
IsDefault="True" MinWidth="90"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
</Grid>
|
||||
</Border>
|
||||
</Window>
|
||||
|
||||
Reference in New Issue
Block a user