GUI: impostazioni di modello ed effort in un riquadro in alto a destra

Modello ed effort lasciano il composer e passano in un riquadro a comparsa
aperto dal pulsante in alto a destra, simmetrico a quello della barra
laterale. Il composer resta con campo di testo e pulsante Invia sulla
stessa riga. Eliminati i suggerimenti della schermata iniziale. MVP.md e la
matrice di TESTING.md sono aggiornati di conseguenza.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
davideandClaude Sonnet 5.5 committed 2026-10-15 11:26:06 +02:00
1 parent 84fefda219
commit fee788134d
5 files changed
+43 -67

No files matched your search

-13
View File
@@ -66,19 +66,6 @@
<Setter Property="BorderBrush" Value="{DynamicResource Border}" />
<Setter Property="BorderThickness" Value="1" />
</Style>
<Style Selector="Button.chip">
<Setter Property="Background" Value="{DynamicResource Surface}" />
<Setter Property="BorderBrush" Value="{DynamicResource Border}" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="CornerRadius" Value="14" />
<Setter Property="Padding" Value="16,12" />
<Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="HorizontalContentAlignment" Value="Left" />
</Style>
<Style Selector="Button.chip:pointerover /template/ ContentPresenter">
<Setter Property="BorderBrush" Value="{DynamicResource Accent}" />
<Setter Property="Background" Value="{DynamicResource Muted}" />
</Style>
<Style Selector="Button.send">
<Setter Property="Width" Value="36" />
<Setter Property="Height" Value="36" />
-12
View File
@@ -21,8 +21,6 @@ class ChatItem(string id, string title, DateTime updated, bool active)
public bool IsActive { get; } = active;
}
record Suggestion(string Title, string Subtitle, string Prompt);
class MainViewModel : ObservableObject
{
static readonly ModelOption Default = new("Predefinito", "");
@@ -33,20 +31,11 @@ class MainViewModel : ObservableObject
public ModelOption[] ModelChoices { get; } = [Default, .. Catalog.Models, Custom];
public string[] EffortChoices { get; } = ["Predefinito", .. Catalog.Efforts];
public Suggestion[] Suggestions { get; } =
[
new("Spiega il progetto", "Panoramica e struttura", "Spiega cosa fa questo progetto e come è organizzato."),
new("Scrivi uno script", "PowerShell, Python, C#…", "Scrivi uno script PowerShell che "),
new("Rivedi del codice", "Bug, leggibilità, prestazioni", "Rivedi questo codice e suggerisci miglioramenti:\n\n"),
new("Riassumi un testo", "Punti chiave in breve", "Riassumi in modo chiaro questo testo:\n\n"),
];
public ICommand NewChatCommand => newChat;
public ICommand CopyCommand { get; }
public ICommand SendCommand { get; }
public ICommand OpenCommand { get; }
public ICommand DeleteCommand { get; }
public ICommand SuggestCommand { get; }
public ICommand ToggleSidebarCommand { get; }
/// <summary>Conferma di eliminazione, fornita dalla finestra.</summary>
@@ -75,7 +64,6 @@ class MainViewModel : ObservableObject
CopyCommand = new RelayCommand<string>(t => { if (t is not null) _ = CopyText(t); });
OpenCommand = new RelayCommand<ChatItem>(c => { if (c is not null) OpenChat(c.Id); });
DeleteCommand = new RelayCommand<ChatItem>(c => { if (c is not null) _ = DeleteAsync(c); });
SuggestCommand = new RelayCommand<Suggestion>(s => { if (s is not null) { Input = s.Prompt; FocusInput?.Invoke(); } });
ToggleSidebarCommand = new RelayCommand<object>(_ => SidebarOpen = !SidebarOpen);
Messages.CollectionChanged += (_, _) => { Raise(nameof(HasMessages)); Raise(nameof(ShowEmpty)); };
+35 -36
View File
@@ -77,22 +77,7 @@
</Viewbox>
</Border>
<TextBlock Text="Come posso aiutarti?" FontSize="28" FontWeight="SemiBold" HorizontalAlignment="Center" />
<TextBlock Text="Scrivi un messaggio oppure parti da uno di questi spunti." Foreground="{DynamicResource FgMuted}" HorizontalAlignment="Center" />
<ItemsControl ItemsSource="{Binding Suggestions}" Margin="0,16,0,0" Width="640">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate><UniformGrid Columns="2" /></ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate x:DataType="gui:Suggestion">
<Button Classes="chip" Margin="5" Command="{Binding $parent[ItemsControl].((gui:MainViewModel)DataContext).SuggestCommand}" CommandParameter="{Binding}">
<StackPanel>
<TextBlock Text="{Binding Title}" FontWeight="SemiBold" />
<TextBlock Text="{Binding Subtitle}" FontSize="12.5" Foreground="{DynamicResource FgMuted}" />
</StackPanel>
</Button>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<TextBlock Text="Scrivi un messaggio per iniziare." Foreground="{DynamicResource FgMuted}" HorizontalAlignment="Center" />
</StackPanel>
<!-- Conversazione -->
@@ -133,31 +118,45 @@
<Viewbox Width="16" Height="16"><Path Data="M4 6H20M4 12H20M4 18H20" Stroke="{DynamicResource Fg}" StrokeThickness="2" StrokeLineCap="Round" /></Viewbox>
</Button>
<!-- Composer -->
<StackPanel Grid.Row="1" MaxWidth="780" Margin="24,0,24,12">
<Border Classes="composer" Background="{DynamicResource Surface}" BorderBrush="{DynamicResource Border}" BorderThickness="1" CornerRadius="20" Padding="14,10">
<StackPanel Spacing="8">
<TextBox x:Name="InputBox" Classes="bare" Text="{Binding Input, Mode=TwoWay}" AcceptsReturn="True" TextWrapping="Wrap" MaxHeight="200"
PlaceholderText="Scrivi un messaggio a Claude…" BorderThickness="0" Background="Transparent"
AutomationProperties.Name="Messaggio" />
<Grid ColumnDefinitions="Auto,Auto,Auto,Auto,*,Auto">
<TextBlock Text="Modello" FontSize="13" Foreground="{DynamicResource FgMuted}" VerticalAlignment="Center" Margin="0,0,8,0" />
<ComboBox Grid.Column="1" ItemsSource="{Binding ModelChoices}" SelectedItem="{Binding SelectedModel}" MinWidth="150"
<!-- Impostazioni: modello ed effort -->
<Button Grid.Row="0" Classes="ghost" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="12" Padding="0" Width="36"
HorizontalContentAlignment="Center" AutomationProperties.Name="Impostazioni" ToolTip.Tip="Impostazioni">
<Button.Flyout>
<Flyout Placement="BottomEdgeAlignedRight">
<StackPanel Width="300" Spacing="6" Margin="4">
<TextBlock Text="Impostazioni" FontWeight="SemiBold" Margin="0,0,0,6" />
<TextBlock Text="Modello" FontSize="13" Foreground="{DynamicResource FgMuted}" />
<ComboBox ItemsSource="{Binding ModelChoices}" SelectedItem="{Binding SelectedModel}" HorizontalAlignment="Stretch"
AutomationProperties.Name="Modello">
<ComboBox.ItemTemplate>
<DataTemplate x:DataType="core:ModelOption"><TextBlock Text="{Binding Label}" /></DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<TextBox Grid.Column="2" Text="{Binding CustomModel}" IsVisible="{Binding IsCustomModel}" PlaceholderText="es. claude-opus-5-5" Width="190"
Margin="8,0,0,0" AutomationProperties.Name="ID modello personalizzato" />
<TextBlock Grid.Column="3" Text="Effort" FontSize="13" Foreground="{DynamicResource FgMuted}" VerticalAlignment="Center" Margin="16,0,8,0" />
<ComboBox Grid.Column="3" ItemsSource="{Binding EffortChoices}" SelectedItem="{Binding SelectedEffort}" MinWidth="130"
Margin="64,0,0,0" AutomationProperties.Name="Effort di ragionamento" />
<Button Grid.Column="5" Classes="send" Command="{Binding SendCommand}" AutomationProperties.Name="Invia messaggio">
<Viewbox Width="18" Height="18"><Path Data="M12 19V5M5 12L12 5L19 12" Stroke="{Binding $parent[Button].Foreground}" StrokeThickness="2.2" StrokeLineCap="Round" StrokeJoin="Round" /></Viewbox>
</Button>
</Grid>
</StackPanel>
<TextBox Text="{Binding CustomModel}" IsVisible="{Binding IsCustomModel}" PlaceholderText="es. claude-opus-5-5"
AutomationProperties.Name="ID modello personalizzato" />
<TextBlock Text="Effort" FontSize="13" Foreground="{DynamicResource FgMuted}" Margin="0,8,0,0" />
<ComboBox ItemsSource="{Binding EffortChoices}" SelectedItem="{Binding SelectedEffort}" HorizontalAlignment="Stretch"
AutomationProperties.Name="Effort di ragionamento" />
</StackPanel>
</Flyout>
</Button.Flyout>
<Viewbox Width="16" Height="16">
<Path Data="M4 7H11M17 7H20M4 17H7M13 17H20 M11 7A3 3 0 1 0 17 7A3 3 0 1 0 11 7Z M7 17A3 3 0 1 0 13 17A3 3 0 1 0 7 17Z"
Stroke="{DynamicResource Fg}" StrokeThickness="2" StrokeLineCap="Round" />
</Viewbox>
</Button>
<!-- Composer -->
<StackPanel Grid.Row="1" MaxWidth="780" Margin="24,0,24,12">
<Border Classes="composer" Background="{DynamicResource Surface}" BorderBrush="{DynamicResource Border}" BorderThickness="1" CornerRadius="20" Padding="14,10">
<Grid ColumnDefinitions="*,Auto">
<TextBox x:Name="InputBox" Classes="bare" Text="{Binding Input, Mode=TwoWay}" AcceptsReturn="True" TextWrapping="Wrap" MaxHeight="200"
PlaceholderText="Scrivi un messaggio a Claude…" BorderThickness="0" Background="Transparent"
VerticalContentAlignment="Center" AutomationProperties.Name="Messaggio" />
<Button Grid.Column="1" Classes="send" VerticalAlignment="Bottom" Margin="8,0,0,0" Command="{Binding SendCommand}" AutomationProperties.Name="Invia messaggio">
<Viewbox Width="18" Height="18"><Path Data="M12 19V5M5 12L12 5L19 12" Stroke="{Binding $parent[Button].Foreground}" StrokeThickness="2.2" StrokeLineCap="Round" StrokeJoin="Round" /></Viewbox>
</Button>
</Grid>
</Border>
<TextBlock Text="Invio per inviare · Maiusc+Invio per andare a capo" FontSize="12" Foreground="{DynamicResource FgMuted}"
HorizontalAlignment="Center" Margin="0,8,0,0" />