refactor(ui): normalize buttons/footer/padding in SettingsModal

This commit is contained in:
mika kuns
2026-05-30 18:49:49 +02:00
parent 0a719568ea
commit 187fb641fe

View File

@@ -25,9 +25,8 @@
<ctl:ModalShell Title="SETTINGS" CloseCommand="{Binding CancelCommand}"> <ctl:ModalShell Title="SETTINGS" CloseCommand="{Binding CancelCommand}">
<ctl:ModalShell.Footer> <ctl:ModalShell.Footer>
<StackPanel Orientation="Horizontal" Spacing="8" <StackPanel Orientation="Horizontal" Spacing="8"
HorizontalAlignment="Right" VerticalAlignment="Center" HorizontalAlignment="Right" VerticalAlignment="Center">
Margin="16,0"> <Button Classes="btn" Content="Cancel" Command="{Binding CancelCommand}" MinWidth="90"/>
<Button Content="Cancel" Command="{Binding CancelCommand}" MinWidth="90"/>
<Button Content="Save" Classes="primary" <Button Content="Save" Classes="primary"
Command="{Binding SaveCommand}" Command="{Binding SaveCommand}"
IsEnabled="{Binding !IsBusy}" MinWidth="90"/> IsEnabled="{Binding !IsBusy}" MinWidth="90"/>
@@ -44,7 +43,7 @@
IsVisible="{Binding StatusMessage, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"/> IsVisible="{Binding StatusMessage, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"/>
</StackPanel> </StackPanel>
<TabControl Padding="20,12" TabStripPlacement="Top"> <TabControl Padding="20,16" TabStripPlacement="Top">
<TabItem Header="General"> <TabItem Header="General">
<ScrollViewer> <ScrollViewer>
@@ -105,7 +104,7 @@
</StackPanel> </StackPanel>
<Border BorderBrush="{DynamicResource LineBrush}" BorderThickness="0,1,0,0" Margin="0,4,0,0"/> <Border BorderBrush="{DynamicResource LineBrush}" BorderThickness="0,1,0,0" Margin="0,4,0,0"/>
<StackPanel Spacing="8"> <StackPanel Spacing="8">
<Button Content="Cleanup finished worktrees" <Button Classes="btn" Content="Cleanup finished worktrees"
Command="{Binding Worktrees.CleanupWorktreesCommand}" Command="{Binding Worktrees.CleanupWorktreesCommand}"
HorizontalAlignment="Left"/> HorizontalAlignment="Left"/>
<StackPanel> <StackPanel>
@@ -119,7 +118,7 @@
<TextBlock Text="Remove ALL worktrees? Uncommitted work will be lost." <TextBlock Text="Remove ALL worktrees? Uncommitted work will be lost."
Foreground="{DynamicResource TextBrush}" TextWrapping="Wrap"/> Foreground="{DynamicResource TextBrush}" TextWrapping="Wrap"/>
<StackPanel Orientation="Horizontal" Spacing="8"> <StackPanel Orientation="Horizontal" Spacing="8">
<Button Content="Cancel" Command="{Binding Worktrees.CancelResetConfirmCommand}"/> <Button Classes="btn" Content="Cancel" Command="{Binding Worktrees.CancelResetConfirmCommand}"/>
<Button Content="Remove All" Classes="danger" <Button Content="Remove All" Classes="danger"
Command="{Binding Worktrees.ConfirmResetAllCommand}"/> Command="{Binding Worktrees.ConfirmResetAllCommand}"/>
</StackPanel> </StackPanel>
@@ -135,12 +134,12 @@
<TabItem Header="Files"> <TabItem Header="Files">
<ScrollViewer> <ScrollViewer>
<StackPanel Spacing="14" Margin="0,8,0,0"> <StackPanel Spacing="12" Margin="0,8,0,0">
<StackPanel Spacing="6"> <StackPanel Spacing="6">
<TextBlock Classes="section-label" Text="AGENTS"/> <TextBlock Classes="section-label" Text="AGENTS"/>
<TextBlock Classes="meta" Text="Restore bundled default agents. Existing files are not overwritten." <TextBlock Classes="meta" Text="Restore bundled default agents. Existing files are not overwritten."
TextWrapping="Wrap"/> TextWrapping="Wrap"/>
<Button Content="Restore default agents" <Button Classes="btn" Content="Restore default agents"
Command="{Binding Files.RestoreDefaultAgentsCommand}" Command="{Binding Files.RestoreDefaultAgentsCommand}"
IsEnabled="{Binding !Files.IsBusy}" IsEnabled="{Binding !Files.IsBusy}"
HorizontalAlignment="Left"/> HorizontalAlignment="Left"/>
@@ -150,15 +149,15 @@
<Grid RowDefinitions="Auto,Auto,Auto" ColumnDefinitions="90,*,Auto" RowSpacing="8"> <Grid RowDefinitions="Auto,Auto,Auto" ColumnDefinitions="90,*,Auto" RowSpacing="8">
<TextBlock Grid.Row="0" Grid.Column="0" Classes="field-label" Text="System" VerticalAlignment="Center"/> <TextBlock Grid.Row="0" Grid.Column="0" Classes="field-label" Text="System" VerticalAlignment="Center"/>
<TextBlock Grid.Row="0" Grid.Column="1" Classes="path-mono" Text="{Binding Files.SystemPromptPath}" VerticalAlignment="Center"/> <TextBlock Grid.Row="0" Grid.Column="1" Classes="path-mono" Text="{Binding Files.SystemPromptPath}" VerticalAlignment="Center"/>
<Button Grid.Row="0" Grid.Column="2" Content="Open in editor" <Button Classes="btn" Grid.Row="0" Grid.Column="2" Content="Open in editor"
Command="{Binding Files.OpenPromptCommand}" CommandParameter="System"/> Command="{Binding Files.OpenPromptCommand}" CommandParameter="System"/>
<TextBlock Grid.Row="1" Grid.Column="0" Classes="field-label" Text="Planning" VerticalAlignment="Center"/> <TextBlock Grid.Row="1" Grid.Column="0" Classes="field-label" Text="Planning" VerticalAlignment="Center"/>
<TextBlock Grid.Row="1" Grid.Column="1" Classes="path-mono" Text="{Binding Files.PlanningPromptPath}" VerticalAlignment="Center"/> <TextBlock Grid.Row="1" Grid.Column="1" Classes="path-mono" Text="{Binding Files.PlanningPromptPath}" VerticalAlignment="Center"/>
<Button Grid.Row="1" Grid.Column="2" Content="Open in editor" <Button Classes="btn" Grid.Row="1" Grid.Column="2" Content="Open in editor"
Command="{Binding Files.OpenPromptCommand}" CommandParameter="Planning"/> Command="{Binding Files.OpenPromptCommand}" CommandParameter="Planning"/>
<TextBlock Grid.Row="2" Grid.Column="0" Classes="field-label" Text="Agent" VerticalAlignment="Center"/> <TextBlock Grid.Row="2" Grid.Column="0" Classes="field-label" Text="Agent" VerticalAlignment="Center"/>
<TextBlock Grid.Row="2" Grid.Column="1" Classes="path-mono" Text="{Binding Files.AgentPromptPath}" VerticalAlignment="Center"/> <TextBlock Grid.Row="2" Grid.Column="1" Classes="path-mono" Text="{Binding Files.AgentPromptPath}" VerticalAlignment="Center"/>
<Button Grid.Row="2" Grid.Column="2" Content="Open in editor" <Button Classes="btn" Grid.Row="2" Grid.Column="2" Content="Open in editor"
Command="{Binding Files.OpenPromptCommand}" CommandParameter="Agent"/> Command="{Binding Files.OpenPromptCommand}" CommandParameter="Agent"/>
</Grid> </Grid>
</StackPanel> </StackPanel>
@@ -194,7 +193,7 @@
IsChecked="{Binding WorkdaysOnly, Mode=TwoWay}" VerticalAlignment="Center"/> IsChecked="{Binding WorkdaysOnly, Mode=TwoWay}" VerticalAlignment="Center"/>
<TextBlock Classes="meta" Grid.Column="4" Text="{Binding LastRunLabel}" VerticalAlignment="Center" <TextBlock Classes="meta" Grid.Column="4" Text="{Binding LastRunLabel}" VerticalAlignment="Center"
MinWidth="80"/> MinWidth="80"/>
<Button Grid.Column="5" Content="✕" <Button Classes="icon-btn" Grid.Column="5" Content="✕"
Command="{Binding $parent[ItemsControl].((vm:SettingsModalViewModel)DataContext).Prime.RemoveScheduleCommand}" Command="{Binding $parent[ItemsControl].((vm:SettingsModalViewModel)DataContext).Prime.RemoveScheduleCommand}"
CommandParameter="{Binding}"/> CommandParameter="{Binding}"/>
</Grid> </Grid>
@@ -202,7 +201,7 @@
</DataTemplate> </DataTemplate>
</ItemsControl.ItemTemplate> </ItemsControl.ItemTemplate>
</ItemsControl> </ItemsControl>
<Button Content="+ Add schedule" Command="{Binding Prime.AddScheduleCommand}" HorizontalAlignment="Left"/> <Button Classes="btn" Content="+ Add schedule" Command="{Binding Prime.AddScheduleCommand}" HorizontalAlignment="Left"/>
</StackPanel> </StackPanel>
</ScrollViewer> </ScrollViewer>
</TabItem> </TabItem>