refactor(ui): migrate SettingsModal to ModalShell
This commit is contained in:
@@ -22,257 +22,200 @@
|
|||||||
<conv:TimeSpanToHhmmConverter x:Key="TimeSpanToHhmm"/>
|
<conv:TimeSpanToHhmmConverter x:Key="TimeSpanToHhmm"/>
|
||||||
</Window.Resources>
|
</Window.Resources>
|
||||||
|
|
||||||
<Window.Styles>
|
<ctl:ModalShell Title="SETTINGS" CloseCommand="{Binding CancelCommand}">
|
||||||
<Style Selector="TextBlock.section-label">
|
<ctl:ModalShell.Footer>
|
||||||
<Setter Property="FontFamily" Value="{DynamicResource MonoFont}"/>
|
<StackPanel Orientation="Horizontal" Spacing="8"
|
||||||
<Setter Property="FontSize" Value="10"/>
|
HorizontalAlignment="Right" VerticalAlignment="Center"
|
||||||
<Setter Property="LetterSpacing" Value="1.4"/>
|
Margin="16,0">
|
||||||
<Setter Property="Foreground" Value="{DynamicResource TextFaintBrush}"/>
|
<Button Content="Cancel" Command="{Binding CancelCommand}" MinWidth="90"/>
|
||||||
<Setter Property="Margin" Value="4,0,0,6"/>
|
<Button Content="Save" Classes="primary"
|
||||||
</Style>
|
Command="{Binding SaveCommand}"
|
||||||
<Style Selector="TextBlock.field-label">
|
IsEnabled="{Binding !IsBusy}" MinWidth="90"/>
|
||||||
<Setter Property="FontSize" Value="11"/>
|
</StackPanel>
|
||||||
<Setter Property="Foreground" Value="{DynamicResource TextDimBrush}"/>
|
</ctl:ModalShell.Footer>
|
||||||
<Setter Property="Margin" Value="0,0,0,4"/>
|
|
||||||
</Style>
|
|
||||||
<Style Selector="TextBlock.path-mono">
|
|
||||||
<Setter Property="FontFamily" Value="{DynamicResource MonoFont}"/>
|
|
||||||
<Setter Property="FontSize" Value="11"/>
|
|
||||||
<Setter Property="Foreground" Value="{DynamicResource TextDimBrush}"/>
|
|
||||||
<Setter Property="TextTrimming" Value="CharacterEllipsis"/>
|
|
||||||
</Style>
|
|
||||||
<Style Selector="Button.danger">
|
|
||||||
<Setter Property="Background" Value="{DynamicResource BloodBrush}"/>
|
|
||||||
<Setter Property="Foreground" Value="White"/>
|
|
||||||
</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>
|
|
||||||
|
|
||||||
<Border Background="{DynamicResource SurfaceBrush}"
|
<!-- Body: tabs + bottom validation/status strip -->
|
||||||
BorderBrush="{DynamicResource LineBrush}"
|
<DockPanel>
|
||||||
BorderThickness="1">
|
<StackPanel DockPanel.Dock="Bottom" Margin="20,0,20,8" Spacing="2">
|
||||||
<Grid RowDefinitions="36,*,52">
|
<TextBlock Text="{Binding ValidationError}"
|
||||||
|
Foreground="{DynamicResource BloodBrush}" FontSize="{StaticResource FontSizeBody}"
|
||||||
|
IsVisible="{Binding ValidationError, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"/>
|
||||||
|
<TextBlock Text="{Binding StatusMessage}"
|
||||||
|
Foreground="{DynamicResource TextDimBrush}" FontSize="{StaticResource FontSizeBody}"
|
||||||
|
IsVisible="{Binding StatusMessage, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"/>
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
<!-- Title bar -->
|
<TabControl Padding="20,12" TabStripPlacement="Top">
|
||||||
<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="SETTINGS"
|
|
||||||
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>
|
|
||||||
|
|
||||||
<!-- Body: tabs + bottom validation/status strip -->
|
<TabItem Header="General">
|
||||||
<DockPanel Grid.Row="1">
|
<ScrollViewer>
|
||||||
<StackPanel DockPanel.Dock="Bottom" Margin="20,0,20,8" Spacing="2">
|
<StackPanel Spacing="12" Margin="0,8,0,0">
|
||||||
<TextBlock Text="{Binding ValidationError}"
|
<StackPanel Spacing="4">
|
||||||
Foreground="{DynamicResource BloodBrush}" FontSize="11"
|
<TextBlock Classes="field-label" Text="Default instructions"/>
|
||||||
IsVisible="{Binding ValidationError, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"/>
|
<TextBox AcceptsReturn="True" TextWrapping="Wrap" Height="110"
|
||||||
<TextBlock Text="{Binding StatusMessage}"
|
PlaceholderText="Baseline instructions applied to every task"
|
||||||
Foreground="{DynamicResource TextDimBrush}" FontSize="11"
|
Text="{Binding General.DefaultClaudeInstructions, Mode=TwoWay}"/>
|
||||||
IsVisible="{Binding StatusMessage, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"/>
|
|
||||||
</StackPanel>
|
|
||||||
|
|
||||||
<TabControl Padding="20,12" TabStripPlacement="Top">
|
|
||||||
|
|
||||||
<TabItem Header="General">
|
|
||||||
<ScrollViewer>
|
|
||||||
<StackPanel Spacing="12" Margin="0,8,0,0">
|
|
||||||
<StackPanel Spacing="4">
|
|
||||||
<TextBlock Classes="field-label" Text="Default instructions"/>
|
|
||||||
<TextBox AcceptsReturn="True" TextWrapping="Wrap" Height="110"
|
|
||||||
PlaceholderText="Baseline instructions applied to every task"
|
|
||||||
Text="{Binding General.DefaultClaudeInstructions, Mode=TwoWay}"/>
|
|
||||||
</StackPanel>
|
|
||||||
<Grid ColumnDefinitions="*,12,*,12,*">
|
|
||||||
<StackPanel Grid.Column="0" Spacing="4">
|
|
||||||
<TextBlock Classes="field-label" Text="Model"/>
|
|
||||||
<ComboBox ItemsSource="{Binding General.Models}"
|
|
||||||
SelectedItem="{Binding General.DefaultModel, Mode=TwoWay}"
|
|
||||||
HorizontalAlignment="Stretch"/>
|
|
||||||
</StackPanel>
|
|
||||||
<StackPanel Grid.Column="2" Spacing="4">
|
|
||||||
<TextBlock Classes="field-label" Text="Max turns"/>
|
|
||||||
<NumericUpDown Value="{Binding General.DefaultMaxTurns, Mode=TwoWay}"
|
|
||||||
Minimum="1" Maximum="200" Increment="1" FormatString="0"/>
|
|
||||||
</StackPanel>
|
|
||||||
<StackPanel Grid.Column="4" Spacing="4">
|
|
||||||
<TextBlock Classes="field-label" Text="Permission"/>
|
|
||||||
<ComboBox ItemsSource="{Binding General.PermissionModes}"
|
|
||||||
SelectedItem="{Binding General.DefaultPermissionMode, Mode=TwoWay}"
|
|
||||||
HorizontalAlignment="Stretch"/>
|
|
||||||
</StackPanel>
|
|
||||||
</Grid>
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</ScrollViewer>
|
<Grid ColumnDefinitions="*,12,*,12,*">
|
||||||
</TabItem>
|
<StackPanel Grid.Column="0" Spacing="4">
|
||||||
|
<TextBlock Classes="field-label" Text="Model"/>
|
||||||
<TabItem Header="Worktrees">
|
<ComboBox ItemsSource="{Binding General.Models}"
|
||||||
<ScrollViewer>
|
SelectedItem="{Binding General.DefaultModel, Mode=TwoWay}"
|
||||||
<StackPanel Spacing="12" Margin="0,8,0,0">
|
HorizontalAlignment="Stretch"/>
|
||||||
<Grid ColumnDefinitions="*,12,2*">
|
|
||||||
<StackPanel Grid.Column="0" Spacing="4">
|
|
||||||
<TextBlock Classes="field-label" Text="Strategy"/>
|
|
||||||
<ComboBox ItemsSource="{Binding Worktrees.WorktreeStrategies}"
|
|
||||||
SelectedItem="{Binding Worktrees.WorktreeStrategy, Mode=TwoWay}"
|
|
||||||
HorizontalAlignment="Stretch"/>
|
|
||||||
</StackPanel>
|
|
||||||
<StackPanel Grid.Column="2" Spacing="4">
|
|
||||||
<TextBlock Classes="field-label" Text="Central worktree root"/>
|
|
||||||
<TextBox Text="{Binding Worktrees.CentralWorktreeRoot, Mode=TwoWay}"
|
|
||||||
PlaceholderText="e.g. C:\worktrees"/>
|
|
||||||
</StackPanel>
|
|
||||||
</Grid>
|
|
||||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
|
||||||
<CheckBox IsChecked="{Binding Worktrees.WorktreeAutoCleanupEnabled, Mode=TwoWay}"
|
|
||||||
Content="Auto-cleanup finished worktrees after"
|
|
||||||
VerticalAlignment="Center"/>
|
|
||||||
<NumericUpDown Value="{Binding Worktrees.WorktreeAutoCleanupDays, Mode=TwoWay}"
|
|
||||||
Width="130" Minimum="1" Maximum="365" Increment="1" FormatString="0"
|
|
||||||
IsEnabled="{Binding Worktrees.WorktreeAutoCleanupEnabled}"/>
|
|
||||||
<TextBlock Text="days" VerticalAlignment="Center" Foreground="{DynamicResource TextDimBrush}"/>
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<Border BorderBrush="{DynamicResource LineBrush}" BorderThickness="0,1,0,0" Margin="0,4,0,0"/>
|
<StackPanel Grid.Column="2" Spacing="4">
|
||||||
<StackPanel Spacing="8">
|
<TextBlock Classes="field-label" Text="Max turns"/>
|
||||||
<Button Content="Cleanup finished worktrees"
|
<NumericUpDown Value="{Binding General.DefaultMaxTurns, Mode=TwoWay}"
|
||||||
Command="{Binding Worktrees.CleanupWorktreesCommand}"
|
Minimum="1" Maximum="200" Increment="1" FormatString="0"/>
|
||||||
HorizontalAlignment="Left"/>
|
</StackPanel>
|
||||||
<StackPanel>
|
<StackPanel Grid.Column="4" Spacing="4">
|
||||||
<Button Content="Force-remove all worktrees" Classes="danger"
|
<TextBlock Classes="field-label" Text="Permission"/>
|
||||||
Command="{Binding Worktrees.RequestResetConfirmCommand}"
|
<ComboBox ItemsSource="{Binding General.PermissionModes}"
|
||||||
HorizontalAlignment="Left"
|
SelectedItem="{Binding General.DefaultPermissionMode, Mode=TwoWay}"
|
||||||
IsVisible="{Binding !Worktrees.ShowResetConfirm}"/>
|
HorizontalAlignment="Stretch"/>
|
||||||
<Border BorderBrush="{DynamicResource BloodBrush}" BorderThickness="1"
|
</StackPanel>
|
||||||
CornerRadius="6" Padding="12,10"
|
</Grid>
|
||||||
IsVisible="{Binding Worktrees.ShowResetConfirm}">
|
</StackPanel>
|
||||||
<StackPanel Spacing="8">
|
</ScrollViewer>
|
||||||
<TextBlock Text="Remove ALL worktrees? Uncommitted work will be lost."
|
</TabItem>
|
||||||
Foreground="{DynamicResource TextBrush}" TextWrapping="Wrap"/>
|
|
||||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
<TabItem Header="Worktrees">
|
||||||
<Button Content="Cancel" Command="{Binding Worktrees.CancelResetConfirmCommand}"/>
|
<ScrollViewer>
|
||||||
<Button Content="Remove All" Classes="danger"
|
<StackPanel Spacing="12" Margin="0,8,0,0">
|
||||||
Command="{Binding Worktrees.ConfirmResetAllCommand}"/>
|
<Grid ColumnDefinitions="*,12,2*">
|
||||||
</StackPanel>
|
<StackPanel Grid.Column="0" Spacing="4">
|
||||||
|
<TextBlock Classes="field-label" Text="Strategy"/>
|
||||||
|
<ComboBox ItemsSource="{Binding Worktrees.WorktreeStrategies}"
|
||||||
|
SelectedItem="{Binding Worktrees.WorktreeStrategy, Mode=TwoWay}"
|
||||||
|
HorizontalAlignment="Stretch"/>
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel Grid.Column="2" Spacing="4">
|
||||||
|
<TextBlock Classes="field-label" Text="Central worktree root"/>
|
||||||
|
<TextBox Text="{Binding Worktrees.CentralWorktreeRoot, Mode=TwoWay}"
|
||||||
|
PlaceholderText="e.g. C:\worktrees"/>
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||||
|
<CheckBox IsChecked="{Binding Worktrees.WorktreeAutoCleanupEnabled, Mode=TwoWay}"
|
||||||
|
Content="Auto-cleanup finished worktrees after"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
<NumericUpDown Value="{Binding Worktrees.WorktreeAutoCleanupDays, Mode=TwoWay}"
|
||||||
|
Width="130" Minimum="1" Maximum="365" Increment="1" FormatString="0"
|
||||||
|
IsEnabled="{Binding Worktrees.WorktreeAutoCleanupEnabled}"/>
|
||||||
|
<TextBlock Text="days" VerticalAlignment="Center" Foreground="{DynamicResource TextDimBrush}"/>
|
||||||
|
</StackPanel>
|
||||||
|
<Border BorderBrush="{DynamicResource LineBrush}" BorderThickness="0,1,0,0" Margin="0,4,0,0"/>
|
||||||
|
<StackPanel Spacing="8">
|
||||||
|
<Button Content="Cleanup finished worktrees"
|
||||||
|
Command="{Binding Worktrees.CleanupWorktreesCommand}"
|
||||||
|
HorizontalAlignment="Left"/>
|
||||||
|
<StackPanel>
|
||||||
|
<Button Content="Force-remove all worktrees" Classes="danger"
|
||||||
|
Command="{Binding Worktrees.RequestResetConfirmCommand}"
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
IsVisible="{Binding !Worktrees.ShowResetConfirm}"/>
|
||||||
|
<Border BorderBrush="{DynamicResource BloodBrush}" BorderThickness="1"
|
||||||
|
CornerRadius="6" Padding="12,10"
|
||||||
|
IsVisible="{Binding Worktrees.ShowResetConfirm}">
|
||||||
|
<StackPanel Spacing="8">
|
||||||
|
<TextBlock Text="Remove ALL worktrees? Uncommitted work will be lost."
|
||||||
|
Foreground="{DynamicResource TextBrush}" TextWrapping="Wrap"/>
|
||||||
|
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||||
|
<Button Content="Cancel" Command="{Binding Worktrees.CancelResetConfirmCommand}"/>
|
||||||
|
<Button Content="Remove All" Classes="danger"
|
||||||
|
Command="{Binding Worktrees.ConfirmResetAllCommand}"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
</StackPanel>
|
||||||
|
</Border>
|
||||||
|
</StackPanel>
|
||||||
|
</StackPanel>
|
||||||
|
<TextBlock Text="{Binding Worktrees.StatusMessage}"
|
||||||
|
Foreground="{DynamicResource TextDimBrush}" FontSize="{StaticResource FontSizeBody}"
|
||||||
|
IsVisible="{Binding Worktrees.StatusMessage, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"/>
|
||||||
|
</StackPanel>
|
||||||
|
</ScrollViewer>
|
||||||
|
</TabItem>
|
||||||
|
|
||||||
|
<TabItem Header="Files">
|
||||||
|
<ScrollViewer>
|
||||||
|
<StackPanel Spacing="14" Margin="0,8,0,0">
|
||||||
|
<StackPanel Spacing="6">
|
||||||
|
<TextBlock Classes="section-label" Text="AGENTS"/>
|
||||||
|
<TextBlock Text="Restore bundled default agents. Existing files are not overwritten."
|
||||||
|
FontSize="{StaticResource FontSizeBody}" TextWrapping="Wrap"
|
||||||
|
Foreground="{DynamicResource TextDimBrush}"/>
|
||||||
|
<Button Content="Restore default agents"
|
||||||
|
Command="{Binding Files.RestoreDefaultAgentsCommand}"
|
||||||
|
IsEnabled="{Binding !Files.IsBusy}"
|
||||||
|
HorizontalAlignment="Left"/>
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel Spacing="6">
|
||||||
|
<TextBlock Classes="section-label" Text="PROMPTS"/>
|
||||||
|
<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="1" Classes="path-mono" Text="{Binding Files.SystemPromptPath}" VerticalAlignment="Center"/>
|
||||||
|
<Button Grid.Row="0" Grid.Column="2" Content="Open in editor"
|
||||||
|
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="1" Classes="path-mono" Text="{Binding Files.PlanningPromptPath}" VerticalAlignment="Center"/>
|
||||||
|
<Button Grid.Row="1" Grid.Column="2" Content="Open in editor"
|
||||||
|
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="1" Classes="path-mono" Text="{Binding Files.AgentPromptPath}" VerticalAlignment="Center"/>
|
||||||
|
<Button Grid.Row="2" Grid.Column="2" Content="Open in editor"
|
||||||
|
Command="{Binding Files.OpenPromptCommand}" CommandParameter="Agent"/>
|
||||||
|
</Grid>
|
||||||
|
</StackPanel>
|
||||||
|
<TextBlock Text="{Binding Files.StatusMessage}"
|
||||||
|
Foreground="{DynamicResource TextDimBrush}" FontSize="{StaticResource FontSizeBody}"
|
||||||
|
IsVisible="{Binding Files.StatusMessage, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"/>
|
||||||
|
</StackPanel>
|
||||||
|
</ScrollViewer>
|
||||||
|
</TabItem>
|
||||||
|
|
||||||
|
<TabItem Header="Prime Claude">
|
||||||
|
<ScrollViewer>
|
||||||
|
<StackPanel Spacing="12" Margin="0,8,0,0">
|
||||||
|
<TextBlock TextWrapping="Wrap" FontSize="{StaticResource FontSizeBody}"
|
||||||
|
Foreground="{DynamicResource TextDimBrush}"
|
||||||
|
Text="Prime your Claude usage window each morning by firing a single non-interactive ping at a chosen time. Only runs while ClaudeDo is open. If the app starts within 30 minutes of the target time, the ping fires immediately."/>
|
||||||
|
<ItemsControl ItemsSource="{Binding Prime.Rows}">
|
||||||
|
<ItemsControl.ItemTemplate>
|
||||||
|
<DataTemplate x:DataType="settings:PrimeScheduleRowViewModel">
|
||||||
|
<Border BorderBrush="{DynamicResource LineBrush}" BorderThickness="1"
|
||||||
|
CornerRadius="6" Padding="10,8" Margin="0,0,0,8"
|
||||||
|
Background="{DynamicResource DeepBrush}">
|
||||||
|
<Grid ColumnDefinitions="Auto,*,Auto,Auto,Auto,Auto" ColumnSpacing="8">
|
||||||
|
<CheckBox Grid.Column="0" IsChecked="{Binding Enabled, Mode=TwoWay}" VerticalAlignment="Center"/>
|
||||||
|
<ctl:ThemedDatePicker Grid.Column="1"
|
||||||
|
IsRange="True"
|
||||||
|
StartDate="{Binding StartDate, Mode=TwoWay, Converter={StaticResource DateOnlyToDateTime}}"
|
||||||
|
EndDate="{Binding EndDate, Mode=TwoWay, Converter={StaticResource DateOnlyToDateTime}}"
|
||||||
|
Watermark="Pick a range"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
<TextBox Grid.Column="2" Width="64"
|
||||||
|
Text="{Binding TimeOfDay, Mode=TwoWay, Converter={StaticResource TimeSpanToHhmm}}"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
<CheckBox Grid.Column="3" Content="Mon–Fri"
|
||||||
|
IsChecked="{Binding WorkdaysOnly, Mode=TwoWay}" VerticalAlignment="Center"/>
|
||||||
|
<TextBlock Grid.Column="4" Text="{Binding LastRunLabel}" VerticalAlignment="Center"
|
||||||
|
Foreground="{DynamicResource TextDimBrush}" FontSize="{StaticResource FontSizeBody}"
|
||||||
|
MinWidth="80"/>
|
||||||
|
<Button Grid.Column="5" Content="✕"
|
||||||
|
Command="{Binding $parent[ItemsControl].((vm:SettingsModalViewModel)DataContext).Prime.RemoveScheduleCommand}"
|
||||||
|
CommandParameter="{Binding}"/>
|
||||||
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
</StackPanel>
|
</DataTemplate>
|
||||||
</StackPanel>
|
</ItemsControl.ItemTemplate>
|
||||||
<TextBlock Text="{Binding Worktrees.StatusMessage}"
|
</ItemsControl>
|
||||||
Foreground="{DynamicResource TextDimBrush}" FontSize="11"
|
<Button Content="+ Add schedule" Command="{Binding Prime.AddScheduleCommand}" HorizontalAlignment="Left"/>
|
||||||
IsVisible="{Binding Worktrees.StatusMessage, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"/>
|
</StackPanel>
|
||||||
</StackPanel>
|
</ScrollViewer>
|
||||||
</ScrollViewer>
|
</TabItem>
|
||||||
</TabItem>
|
|
||||||
|
|
||||||
<TabItem Header="Files">
|
</TabControl>
|
||||||
<ScrollViewer>
|
</DockPanel>
|
||||||
<StackPanel Spacing="14" Margin="0,8,0,0">
|
|
||||||
<StackPanel Spacing="6">
|
|
||||||
<TextBlock Classes="section-label" Text="AGENTS"/>
|
|
||||||
<TextBlock Text="Restore bundled default agents. Existing files are not overwritten."
|
|
||||||
FontSize="11" TextWrapping="Wrap"
|
|
||||||
Foreground="{DynamicResource TextDimBrush}"/>
|
|
||||||
<Button Content="Restore default agents"
|
|
||||||
Command="{Binding Files.RestoreDefaultAgentsCommand}"
|
|
||||||
IsEnabled="{Binding !Files.IsBusy}"
|
|
||||||
HorizontalAlignment="Left"/>
|
|
||||||
</StackPanel>
|
|
||||||
<StackPanel Spacing="6">
|
|
||||||
<TextBlock Classes="section-label" Text="PROMPTS"/>
|
|
||||||
<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="1" Classes="path-mono" Text="{Binding Files.SystemPromptPath}" VerticalAlignment="Center"/>
|
|
||||||
<Button Grid.Row="0" Grid.Column="2" Content="Open in editor"
|
|
||||||
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="1" Classes="path-mono" Text="{Binding Files.PlanningPromptPath}" VerticalAlignment="Center"/>
|
|
||||||
<Button Grid.Row="1" Grid.Column="2" Content="Open in editor"
|
|
||||||
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="1" Classes="path-mono" Text="{Binding Files.AgentPromptPath}" VerticalAlignment="Center"/>
|
|
||||||
<Button Grid.Row="2" Grid.Column="2" Content="Open in editor"
|
|
||||||
Command="{Binding Files.OpenPromptCommand}" CommandParameter="Agent"/>
|
|
||||||
</Grid>
|
|
||||||
</StackPanel>
|
|
||||||
<TextBlock Text="{Binding Files.StatusMessage}"
|
|
||||||
Foreground="{DynamicResource TextDimBrush}" FontSize="11"
|
|
||||||
IsVisible="{Binding Files.StatusMessage, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"/>
|
|
||||||
</StackPanel>
|
|
||||||
</ScrollViewer>
|
|
||||||
</TabItem>
|
|
||||||
|
|
||||||
<TabItem Header="Prime Claude">
|
</ctl:ModalShell>
|
||||||
<ScrollViewer>
|
|
||||||
<StackPanel Spacing="12" Margin="0,8,0,0">
|
|
||||||
<TextBlock TextWrapping="Wrap" FontSize="11"
|
|
||||||
Foreground="{DynamicResource TextDimBrush}"
|
|
||||||
Text="Prime your Claude usage window each morning by firing a single non-interactive ping at a chosen time. Only runs while ClaudeDo is open. If the app starts within 30 minutes of the target time, the ping fires immediately."/>
|
|
||||||
<ItemsControl ItemsSource="{Binding Prime.Rows}">
|
|
||||||
<ItemsControl.ItemTemplate>
|
|
||||||
<DataTemplate x:DataType="settings:PrimeScheduleRowViewModel">
|
|
||||||
<Border BorderBrush="{DynamicResource LineBrush}" BorderThickness="1"
|
|
||||||
CornerRadius="6" Padding="10,8" Margin="0,0,0,8"
|
|
||||||
Background="{DynamicResource DeepBrush}">
|
|
||||||
<Grid ColumnDefinitions="Auto,*,Auto,Auto,Auto,Auto" ColumnSpacing="8">
|
|
||||||
<CheckBox Grid.Column="0" IsChecked="{Binding Enabled, Mode=TwoWay}" VerticalAlignment="Center"/>
|
|
||||||
<ctl:ThemedDatePicker Grid.Column="1"
|
|
||||||
IsRange="True"
|
|
||||||
StartDate="{Binding StartDate, Mode=TwoWay, Converter={StaticResource DateOnlyToDateTime}}"
|
|
||||||
EndDate="{Binding EndDate, Mode=TwoWay, Converter={StaticResource DateOnlyToDateTime}}"
|
|
||||||
Watermark="Pick a range"
|
|
||||||
VerticalAlignment="Center"/>
|
|
||||||
<TextBox Grid.Column="2" Width="64"
|
|
||||||
Text="{Binding TimeOfDay, Mode=TwoWay, Converter={StaticResource TimeSpanToHhmm}}"
|
|
||||||
VerticalAlignment="Center"/>
|
|
||||||
<CheckBox Grid.Column="3" Content="Mon–Fri"
|
|
||||||
IsChecked="{Binding WorkdaysOnly, Mode=TwoWay}" VerticalAlignment="Center"/>
|
|
||||||
<TextBlock Grid.Column="4" Text="{Binding LastRunLabel}" VerticalAlignment="Center"
|
|
||||||
Foreground="{DynamicResource TextDimBrush}" FontSize="11"
|
|
||||||
MinWidth="80"/>
|
|
||||||
<Button Grid.Column="5" Content="✕"
|
|
||||||
Command="{Binding $parent[ItemsControl].((vm:SettingsModalViewModel)DataContext).Prime.RemoveScheduleCommand}"
|
|
||||||
CommandParameter="{Binding}"/>
|
|
||||||
</Grid>
|
|
||||||
</Border>
|
|
||||||
</DataTemplate>
|
|
||||||
</ItemsControl.ItemTemplate>
|
|
||||||
</ItemsControl>
|
|
||||||
<Button Content="+ Add schedule" Command="{Binding Prime.AddScheduleCommand}" HorizontalAlignment="Left"/>
|
|
||||||
</StackPanel>
|
|
||||||
</ScrollViewer>
|
|
||||||
</TabItem>
|
|
||||||
|
|
||||||
</TabControl>
|
|
||||||
</DockPanel>
|
|
||||||
|
|
||||||
<!-- 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="Save" Classes="primary"
|
|
||||||
Command="{Binding SaveCommand}"
|
|
||||||
IsEnabled="{Binding !IsBusy}" MinWidth="90"/>
|
|
||||||
</StackPanel>
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
</Grid>
|
|
||||||
</Border>
|
|
||||||
</Window>
|
</Window>
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Input;
|
|
||||||
using ClaudeDo.Ui.ViewModels.Modals;
|
using ClaudeDo.Ui.ViewModels.Modals;
|
||||||
|
|
||||||
namespace ClaudeDo.Ui.Views.Modals;
|
namespace ClaudeDo.Ui.Views.Modals;
|
||||||
@@ -17,10 +16,4 @@ public partial class SettingsModalView : Window
|
|||||||
if (DataContext is SettingsModalViewModel vm)
|
if (DataContext is SettingsModalViewModel 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