Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions src/cascadia/TerminalSettingsEditor/AIAgents.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,9 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
const auto customModelsHeader = RS_(L"AIAgents_CustomModels/Header");
const auto customModelsCaption = RS_(L"AIAgents_CustomModels/HelpText");
const auto customModelsLearnMore = RS_(L"AIAgents_CustomModelsLearnMore");
EmptyCustomModelsHeaderText().Text(customModelsHeader);
EmptyCustomModelsCaptionPrefix().Text(customModelsCaption);
EmptyCustomModelsCaptionLink().Text(customModelsLearnMore);
CustomModelsHeaderText().Text(customModelsHeader);
CustomModelsCaptionPrefix().Text(customModelsCaption);
CustomModelsCaptionLink().Text(customModelsLearnMore);
Automation::AutomationProperties::SetName(EmptyCustomModelProviders(), customModelsHeader);
Automation::AutomationProperties::SetName(CustomModelProvidersExpander(), customModelsHeader);

// Auto-error-detection caption + inline "supported shells" hyperlink.
Expand Down
69 changes: 16 additions & 53 deletions src/cascadia/TerminalSettingsEditor/AIAgents.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -189,58 +189,14 @@
</Grid>
</local:SettingContainer>

<Grid x:Name="EmptyCustomModelProviders"
Margin="0,4,0,0"
Padding="16,0,8,0"
HorizontalAlignment="Stretch"
Background="{ThemeResource ExpanderHeaderBackground}"
BorderBrush="{ThemeResource ExpanderHeaderBorderBrush}"
BorderThickness="{ThemeResource ExpanderHeaderBorderThickness}"
CornerRadius="{ThemeResource ControlCornerRadius}"
MaxWidth="1000"
MinHeight="64"
MinWidth="{ThemeResource FlyoutThemeMinWidth}"
Visibility="{x:Bind mtu:Converters.InvertedBooleanToVisibility(ViewModel.ShowCustomModelProvidersExpander), Mode=OneWay}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0"
Padding="0,12,0,12"
VerticalAlignment="Center">
<TextBlock x:Name="EmptyCustomModelsHeaderText"
Style="{StaticResource SettingsPageItemHeaderStyle}" />
<TextBlock Style="{StaticResource CaptionTextBlockStyle}"
TextWrapping="Wrap">
<Run x:Name="EmptyCustomModelsCaptionPrefix"
Foreground="{ThemeResource TextFillColorSecondaryBrush}" /><Hyperlink NavigateUri="https://github.com/microsoft/intelligent-terminal#custom-providers-byok">
<Run x:Name="EmptyCustomModelsCaptionLink" />
</Hyperlink>
</TextBlock>
</StackPanel>
<Button Grid.Column="1"
x:Uid="AIAgents_CustomProviderAdd"
Margin="0,12,0,12"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Click="{x:Bind ViewModel.AddCustomModelProvider}"
Style="{StaticResource AccentButtonStyle}" />
</Grid>

<muxc:Expander x:Name="CustomModelProvidersExpander"
Margin="0,4,0,0"
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Stretch"
IsExpanded="{x:Bind ViewModel.IsCustomModelProvidersExpanded, Mode=TwoWay}"
Visibility="{x:Bind ViewModel.ShowCustomModelProvidersExpander, Mode=OneWay}">
IsExpanded="{x:Bind ViewModel.IsCustomModelProvidersExpanded, Mode=TwoWay}">
Comment thread
DDKinger marked this conversation as resolved.
<muxc:Expander.Header>
<Grid MinHeight="64">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0"
VerticalAlignment="Center">
<StackPanel VerticalAlignment="Center">
<TextBlock x:Name="CustomModelsHeaderText"
Style="{StaticResource SettingsPageItemHeaderStyle}" />
<TextBlock Style="{StaticResource CaptionTextBlockStyle}"
Expand All @@ -251,14 +207,11 @@
</Hyperlink>
</TextBlock>
</StackPanel>
<Button Grid.Column="1"
x:Uid="AIAgents_CustomProviderAdd"
VerticalAlignment="Center"
Click="{x:Bind ViewModel.AddCustomModelProvider}"
Style="{StaticResource AccentButtonStyle}" />
</Grid>
</muxc:Expander.Header>
<StackPanel>
<!-- Offset WinUI's default vertical Expander content padding so each
provider and Add New occupy one visually centered row. -->
<StackPanel Margin="0,-16,0,-16">
<TextBlock Margin="0,12,0,0"
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
Text="{x:Bind ViewModel.CustomModelProviderUnsupportedMessage, Mode=OneWay}"
Expand All @@ -267,7 +220,9 @@
<ItemsControl ItemsSource="{x:Bind ViewModel.CustomModelProviders, Mode=OneWay}">
<ItemsControl.ItemTemplate>
<DataTemplate x:DataType="local:CustomModelProviderEntry">
<Border Padding="0,4">
<Border Padding="0,4"
BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}"
BorderThickness="0,0,0,1">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
Expand Down Expand Up @@ -315,6 +270,14 @@
</ItemsControl.ItemTemplate>
</ItemsControl>

<Border Padding="0,4"
Visibility="{x:Bind mtu:Converters.InvertedBooleanToVisibility(ViewModel.IsAddingCustomModelProvider), Mode=OneWay}">
<Button x:Uid="AIAgents_CustomProviderAdd"
HorizontalAlignment="Right"
Click="{x:Bind ViewModel.AddCustomModelProvider}"
Style="{StaticResource AccentButtonStyle}" />
</Border>

<Border Padding="0,8,0,16"
Visibility="{x:Bind ViewModel.IsAddingCustomModelProvider, Mode=OneWay}">
<StackPanel Spacing="12">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3009,7 +3009,7 @@
</data>
<data name="AIAgents_CustomProviderAdd.Content" xml:space="preserve">
<value>Endpunkt hinzufügen</value>
<comment>Button that starts adding a custom model provider endpoint.</comment>
<comment>Button in the final custom provider row that reveals the fields for adding another endpoint.</comment>
</data>
<data name="AIAgents_CustomProviderSave.Content" xml:space="preserve">
<value>Hinzufügen und auswählen</value>
Expand All @@ -3021,7 +3021,7 @@
</data>
<data name="AIAgents_CustomProviderCancel.Content" xml:space="preserve">
<value>Abbrechen</value>
<comment>Button that cancels adding a provider.</comment>
<comment>Button that cancels adding a provider and restores the Add New row.</comment>
</data>
<data name="AIAgents_BYOKModelDisplayName" xml:space="preserve">
<value>{} (BYOK)</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3120,8 +3120,8 @@ In this context, "agent" refers to an AI agent (e.g. Copilot, Claude, Gemini), n
<comment>{Locked="API"} Hint below the optional custom provider credential input. Use the established localized product name for Windows Credential Manager.</comment>
</data>
<data name="AIAgents_CustomProviderAdd.Content" xml:space="preserve">
<value>Add endpoint</value>
<comment>Button that starts adding a custom model provider endpoint.</comment>
<value>Add New</value>
<comment>Button in the final custom provider row that reveals the fields for adding another endpoint.</comment>
</data>
<data name="AIAgents_CustomProviderSave.Content" xml:space="preserve">
<value>Add and Select</value>
Expand All @@ -3133,7 +3133,7 @@ In this context, "agent" refers to an AI agent (e.g. Copilot, Claude, Gemini), n
</data>
<data name="AIAgents_CustomProviderCancel.Content" xml:space="preserve">
<value>Cancel</value>
<comment>Button that cancels adding a provider.</comment>
<comment>Button that cancels adding a provider and restores the Add New row.</comment>
</data>
<data name="AIAgents_BYOKModelDisplayName" xml:space="preserve">
<value>{} (BYOK)</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3009,7 +3009,7 @@
</data>
<data name="AIAgents_CustomProviderAdd.Content" xml:space="preserve">
<value>Agregar punto de conexión</value>
<comment>Button that starts adding a custom model provider endpoint.</comment>
<comment>Button in the final custom provider row that reveals the fields for adding another endpoint.</comment>
</data>
<data name="AIAgents_CustomProviderSave.Content" xml:space="preserve">
<value>Agregar y seleccionar</value>
Expand All @@ -3021,7 +3021,7 @@
</data>
<data name="AIAgents_CustomProviderCancel.Content" xml:space="preserve">
<value>Cancelar</value>
<comment>Button that cancels adding a provider.</comment>
<comment>Button that cancels adding a provider and restores the Add New row.</comment>
</data>
<data name="AIAgents_BYOKModelDisplayName" xml:space="preserve">
<value>{} (BYOK)</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3010,7 +3010,7 @@
</data>
<data name="AIAgents_CustomProviderAdd.Content" xml:space="preserve">
<value>Ajouter un point de terminaison</value>
<comment>Button that starts adding a custom model provider endpoint.</comment>
<comment>Button in the final custom provider row that reveals the fields for adding another endpoint.</comment>
</data>
<data name="AIAgents_CustomProviderSave.Content" xml:space="preserve">
<value>Ajouter et sélectionner</value>
Expand All @@ -3022,7 +3022,7 @@
</data>
<data name="AIAgents_CustomProviderCancel.Content" xml:space="preserve">
<value>Annuler</value>
<comment>Button that cancels adding a provider.</comment>
<comment>Button that cancels adding a provider and restores the Add New row.</comment>
</data>
<data name="AIAgents_BYOKModelDisplayName" xml:space="preserve">
<value>{} (BYOK)</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3009,7 +3009,7 @@
</data>
<data name="AIAgents_CustomProviderAdd.Content" xml:space="preserve">
<value>Aggiungi endpoint</value>
<comment>Button that starts adding a custom model provider endpoint.</comment>
<comment>Button in the final custom provider row that reveals the fields for adding another endpoint.</comment>
</data>
<data name="AIAgents_CustomProviderSave.Content" xml:space="preserve">
<value>Aggiungi e seleziona</value>
Expand All @@ -3021,7 +3021,7 @@
</data>
<data name="AIAgents_CustomProviderCancel.Content" xml:space="preserve">
<value>Annulla</value>
<comment>Button that cancels adding a provider.</comment>
<comment>Button that cancels adding a provider and restores the Add New row.</comment>
</data>
<data name="AIAgents_BYOKModelDisplayName" xml:space="preserve">
<value>{} (BYOK)</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3009,7 +3009,7 @@
</data>
<data name="AIAgents_CustomProviderAdd.Content" xml:space="preserve">
<value>エンドポイントの追加</value>
<comment>Button that starts adding a custom model provider endpoint.</comment>
<comment>Button in the final custom provider row that reveals the fields for adding another endpoint.</comment>
</data>
<data name="AIAgents_CustomProviderSave.Content" xml:space="preserve">
<value>追加して選択</value>
Expand All @@ -3021,7 +3021,7 @@
</data>
<data name="AIAgents_CustomProviderCancel.Content" xml:space="preserve">
<value>キャンセル</value>
<comment>Button that cancels adding a provider.</comment>
<comment>Button that cancels adding a provider and restores the Add New row.</comment>
</data>
<data name="AIAgents_BYOKModelDisplayName" xml:space="preserve">
<value>{} (BYOK)</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3069,7 +3069,7 @@
</data>
<data name="AIAgents_CustomProviderAdd.Content" xml:space="preserve">
<value>엔드포인트 추가</value>
<comment>Button that starts adding a custom model provider endpoint.</comment>
<comment>Button in the final custom provider row that reveals the fields for adding another endpoint.</comment>
</data>
<data name="AIAgents_CustomProviderSave.Content" xml:space="preserve">
<value>추가 및 선택</value>
Expand All @@ -3081,7 +3081,7 @@
</data>
<data name="AIAgents_CustomProviderCancel.Content" xml:space="preserve">
<value>취소</value>
<comment>Button that cancels adding a provider.</comment>
<comment>Button that cancels adding a provider and restores the Add New row.</comment>
</data>
<data name="AIAgents_BYOKModelDisplayName" xml:space="preserve">
<value>{} (BYOK)</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3052,7 +3052,7 @@
</data>
<data name="AIAgents_CustomProviderAdd.Content" xml:space="preserve">
<value>Adicionar ponto de extremidade</value>
<comment>Button that starts adding a custom model provider endpoint.</comment>
<comment>Button in the final custom provider row that reveals the fields for adding another endpoint.</comment>
</data>
<data name="AIAgents_CustomProviderSave.Content" xml:space="preserve">
<value>Adicionar e selecionar</value>
Expand All @@ -3064,7 +3064,7 @@
</data>
<data name="AIAgents_CustomProviderCancel.Content" xml:space="preserve">
<value>Cancelar</value>
<comment>Button that cancels adding a provider.</comment>
<comment>Button that cancels adding a provider and restores the Add New row.</comment>
</data>
<data name="AIAgents_BYOKModelDisplayName" xml:space="preserve">
<value>{} (BYOK)</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2999,8 +2999,8 @@
<comment>{Locked="API"} Hint below the optional custom provider credential input. Use the established localized product name for Windows Credential Manager.</comment>
</data>
<data name="AIAgents_CustomProviderAdd.Content" xml:space="preserve">
<value>Add endpoint</value>
<comment>Button that starts adding a custom model provider endpoint.</comment>
<value>Add New</value>
<comment>Button in the final custom provider row that reveals the fields for adding another endpoint.</comment>
</data>
<data name="AIAgents_CustomProviderSave.Content" xml:space="preserve">
<value>Add and Select</value>
Expand All @@ -3012,7 +3012,7 @@
</data>
<data name="AIAgents_CustomProviderCancel.Content" xml:space="preserve">
<value>Cancel</value>
<comment>Button that cancels adding a provider.</comment>
<comment>Button that cancels adding a provider and restores the Add New row.</comment>
</data>
<data name="AIAgents_BYOKModelDisplayName" xml:space="preserve">
<value>{} (BYOK)</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2999,8 +2999,8 @@
<comment>{Locked="API"} Hint below the optional custom provider credential input. Use the established localized product name for Windows Credential Manager.</comment>
</data>
<data name="AIAgents_CustomProviderAdd.Content" xml:space="preserve">
<value>Add endpoint</value>
<comment>Button that starts adding a custom model provider endpoint.</comment>
<value>Add New</value>
<comment>Button in the final custom provider row that reveals the fields for adding another endpoint.</comment>
</data>
<data name="AIAgents_CustomProviderSave.Content" xml:space="preserve">
<value>Add and Select</value>
Expand All @@ -3012,7 +3012,7 @@
</data>
<data name="AIAgents_CustomProviderCancel.Content" xml:space="preserve">
<value>Cancel</value>
<comment>Button that cancels adding a provider.</comment>
<comment>Button that cancels adding a provider and restores the Add New row.</comment>
</data>
<data name="AIAgents_BYOKModelDisplayName" xml:space="preserve">
<value>{} (BYOK)</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2999,8 +2999,8 @@
<comment>{Locked="API"} Hint below the optional custom provider credential input. Use the established localized product name for Windows Credential Manager.</comment>
</data>
<data name="AIAgents_CustomProviderAdd.Content" xml:space="preserve">
<value>Add endpoint</value>
<comment>Button that starts adding a custom model provider endpoint.</comment>
<value>Add New</value>
<comment>Button in the final custom provider row that reveals the fields for adding another endpoint.</comment>
</data>
<data name="AIAgents_CustomProviderSave.Content" xml:space="preserve">
<value>Add and Select</value>
Expand All @@ -3012,7 +3012,7 @@
</data>
<data name="AIAgents_CustomProviderCancel.Content" xml:space="preserve">
<value>Cancel</value>
<comment>Button that cancels adding a provider.</comment>
<comment>Button that cancels adding a provider and restores the Add New row.</comment>
</data>
<data name="AIAgents_BYOKModelDisplayName" xml:space="preserve">
<value>{} (BYOK)</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3052,7 +3052,7 @@
</data>
<data name="AIAgents_CustomProviderAdd.Content" xml:space="preserve">
<value>Добавить конечную точку</value>
<comment>Button that starts adding a custom model provider endpoint.</comment>
<comment>Button in the final custom provider row that reveals the fields for adding another endpoint.</comment>
</data>
<data name="AIAgents_CustomProviderSave.Content" xml:space="preserve">
<value>Добавить и выбрать</value>
Expand All @@ -3064,7 +3064,7 @@
</data>
<data name="AIAgents_CustomProviderCancel.Content" xml:space="preserve">
<value>Отменить</value>
<comment>Button that cancels adding a provider.</comment>
<comment>Button that cancels adding a provider and restores the Add New row.</comment>
</data>
<data name="AIAgents_BYOKModelDisplayName" xml:space="preserve">
<value>{} (BYOK)</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3067,7 +3067,7 @@
</data>
<data name="AIAgents_CustomProviderAdd.Content" xml:space="preserve">
<value>Додај крајњу тачку</value>
<comment>Button that starts adding a custom model provider endpoint.</comment>
<comment>Button in the final custom provider row that reveals the fields for adding another endpoint.</comment>
</data>
<data name="AIAgents_CustomProviderSave.Content" xml:space="preserve">
<value>Додај и изабери</value>
Expand All @@ -3079,7 +3079,7 @@
</data>
<data name="AIAgents_CustomProviderCancel.Content" xml:space="preserve">
<value>Откажи</value>
<comment>Button that cancels adding a provider.</comment>
<comment>Button that cancels adding a provider and restores the Add New row.</comment>
</data>
<data name="AIAgents_BYOKModelDisplayName" xml:space="preserve">
<value>{} (BYOK)</value>
Expand Down
Loading
Loading