feat(ui): add ListSettingsModalView
This commit is contained in:
80
src/ClaudeDo.Ui/Views/Modals/ListSettingsModalView.axaml
Normal file
80
src/ClaudeDo.Ui/Views/Modals/ListSettingsModalView.axaml
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
<Window xmlns="https://github.com/avaloniaui"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:vm="clr-namespace:ClaudeDo.Ui.ViewModels.Modals"
|
||||||
|
x:Class="ClaudeDo.Ui.Views.Modals.ListSettingsModalView"
|
||||||
|
x:DataType="vm:ListSettingsModalViewModel"
|
||||||
|
Title="List settings"
|
||||||
|
Width="520" Height="600"
|
||||||
|
WindowStartupLocation="CenterOwner"
|
||||||
|
CanResize="False">
|
||||||
|
<DockPanel Margin="16">
|
||||||
|
<StackPanel DockPanel.Dock="Bottom" Orientation="Horizontal" HorizontalAlignment="Right" Spacing="8" Margin="0,16,0,0">
|
||||||
|
<Button Content="Cancel" Command="{Binding CancelCommand}" />
|
||||||
|
<Button Content="Save" Command="{Binding SaveCommand}" Classes="accent" />
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
<ScrollViewer>
|
||||||
|
<StackPanel Spacing="16">
|
||||||
|
<TextBlock Text="General" FontSize="16" FontWeight="SemiBold" />
|
||||||
|
|
||||||
|
<StackPanel Spacing="4">
|
||||||
|
<TextBlock Text="Name" />
|
||||||
|
<TextBox Text="{Binding Name}" />
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
<StackPanel Spacing="4">
|
||||||
|
<TextBlock Text="Working directory" />
|
||||||
|
<Grid ColumnDefinitions="*,Auto">
|
||||||
|
<TextBox Grid.Column="0" Text="{Binding WorkingDir}" Watermark="(none)" />
|
||||||
|
<Button Grid.Column="1" Content="Browse..." Margin="8,0,0,0" Click="BrowseClicked" />
|
||||||
|
</Grid>
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
<StackPanel Spacing="4">
|
||||||
|
<TextBlock Text="Default commit type" />
|
||||||
|
<ComboBox ItemsSource="{Binding CommitTypeOptions}"
|
||||||
|
SelectedItem="{Binding DefaultCommitType, Mode=TwoWay}"
|
||||||
|
HorizontalAlignment="Left" MinWidth="160" />
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
<Separator Margin="0,8,0,8" />
|
||||||
|
|
||||||
|
<Grid ColumnDefinitions="*,Auto">
|
||||||
|
<TextBlock Grid.Column="0" Text="Agent" FontSize="16" FontWeight="SemiBold" />
|
||||||
|
<Button Grid.Column="1" Content="Reset agent settings"
|
||||||
|
Command="{Binding ResetAgentSettingsCommand}" />
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
<StackPanel Spacing="4">
|
||||||
|
<TextBlock Text="Model" />
|
||||||
|
<ComboBox ItemsSource="{Binding ModelOptions}"
|
||||||
|
SelectedItem="{Binding SelectedModel, Mode=TwoWay}"
|
||||||
|
HorizontalAlignment="Left" MinWidth="160" />
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
<StackPanel Spacing="4">
|
||||||
|
<TextBlock Text="System prompt (appended)" />
|
||||||
|
<TextBox Text="{Binding SystemPrompt, Mode=TwoWay}"
|
||||||
|
AcceptsReturn="True" TextWrapping="Wrap"
|
||||||
|
MinHeight="80" />
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
<StackPanel Spacing="4">
|
||||||
|
<TextBlock Text="Agent file" />
|
||||||
|
<ComboBox ItemsSource="{Binding Agents}"
|
||||||
|
SelectedItem="{Binding SelectedAgent, Mode=TwoWay}"
|
||||||
|
HorizontalAlignment="Left" MinWidth="240">
|
||||||
|
<ComboBox.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<StackPanel>
|
||||||
|
<TextBlock Text="{Binding Name}" />
|
||||||
|
<TextBlock Text="{Binding Description}" Opacity="0.6" FontSize="11" />
|
||||||
|
</StackPanel>
|
||||||
|
</DataTemplate>
|
||||||
|
</ComboBox.ItemTemplate>
|
||||||
|
</ComboBox>
|
||||||
|
</StackPanel>
|
||||||
|
</StackPanel>
|
||||||
|
</ScrollViewer>
|
||||||
|
</DockPanel>
|
||||||
|
</Window>
|
||||||
31
src/ClaudeDo.Ui/Views/Modals/ListSettingsModalView.axaml.cs
Normal file
31
src/ClaudeDo.Ui/Views/Modals/ListSettingsModalView.axaml.cs
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
using Avalonia.Controls;
|
||||||
|
using Avalonia.Interactivity;
|
||||||
|
using Avalonia.Platform.Storage;
|
||||||
|
using ClaudeDo.Ui.ViewModels.Modals;
|
||||||
|
|
||||||
|
namespace ClaudeDo.Ui.Views.Modals;
|
||||||
|
|
||||||
|
public partial class ListSettingsModalView : Window
|
||||||
|
{
|
||||||
|
public ListSettingsModalView()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void BrowseClicked(object? sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (DataContext is not ListSettingsModalViewModel vm) return;
|
||||||
|
var top = TopLevel.GetTopLevel(this);
|
||||||
|
if (top is null) return;
|
||||||
|
|
||||||
|
var folders = await top.StorageProvider.OpenFolderPickerAsync(new FolderPickerOpenOptions
|
||||||
|
{
|
||||||
|
Title = "Choose working directory",
|
||||||
|
AllowMultiple = false,
|
||||||
|
});
|
||||||
|
if (folders.Count > 0)
|
||||||
|
{
|
||||||
|
vm.WorkingDir = folders[0].Path.LocalPath;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user