Renamed the settings of AI tasks (#1239)

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2026-11-27 12:08:00 +01:00
1 parent d19d3d431b
commit a117074972
109 files changed
+3929 -538

No files matched your search

@@ -3,7 +3,7 @@
@if (!this.SettingsManager.ConfigurationData.Translation.HideWebContentReader)
{
<ReadWebContent @bind-Content="@this.inputText" @bind-URL="@this.webContentURL" ProviderSettings="@this.ProviderSettings" @bind-AgentIsRunning="@this.isAgentRunning" @bind-Preselect="@this.showWebContentReader" @bind-PreselectContentCleanerAgent="@this.useContentCleanerAgent"/>
<ReadWebContent @bind-Content="@this.inputText" @bind-URL="@this.webContentURL" ProviderSettings="@this.ProviderSettings" @bind-CleanerIsRunning="@this.isCleanerRunning" @bind-Preselect="@this.showWebContentReader" @bind-PreselectContentCleaner="@this.useContentCleaner"/>
}
<ReadFileContent @bind-FileContent="@this.inputText" EnableDragDrop="true" CatchAllDocuments="true"/>
@@ -11,12 +11,12 @@
<MudTextSwitch Label="@T("Live translation")" @bind-Value="@this.liveTranslation" LabelOn="@T("Live translation")" LabelOff="@T("No live translation")"/>
@if (this.liveTranslation)
{
<DebouncedTextField Disabled="@this.isAgentRunning" @bind-Text="@this.inputText" ValidationFunc="@this.ValidatingText" Icon="@AppIcons.INPUT_TEXT" Label="@TA("Your input")" Lines="6" MaxLines="12" DebounceTime="@TimeSpan.FromMilliseconds(this.SettingsManager.ConfigurationData.Translation.DebounceIntervalMilliseconds)" WhenTextChangedAsync="async _ => await this.TranslateText(force: false)" Attributes="@USER_INPUT_ATTRIBUTES"/>
<DebouncedTextField Disabled="@this.isCleanerRunning" @bind-Text="@this.inputText" ValidationFunc="@this.ValidatingText" Icon="@AppIcons.INPUT_TEXT" Label="@TA("Your input")" Lines="6" MaxLines="12" DebounceTime="@TimeSpan.FromMilliseconds(this.SettingsManager.ConfigurationData.Translation.DebounceIntervalMilliseconds)" WhenTextChangedAsync="async _ => await this.TranslateText(force: false)" Attributes="@USER_INPUT_ATTRIBUTES"/>
}
else
{
@* Bound by its value, the field shows no issue before you type, also when you switch the live translation off. It checks your text again shortly after you stop typing, see TextFieldDefaults: *@
<MudTextField T="string" Disabled="@this.isAgentRunning" @bind-Value="@this.inputText" Validation="@this.ValidatingText" DebounceInterval="@TextFieldDefaults.VALIDATION_DEBOUNCE_MILLISECONDS" AdornmentIcon="@AppIcons.INPUT_TEXT" Adornment="Adornment.Start" Label="@TA("Your input")" Variant="Variant.Outlined" Lines="6" Sizing="InputSizing.Auto" MaxLines="12" Class="mb-3" UserAttributes="@USER_INPUT_ATTRIBUTES"/>
<MudTextField T="string" Disabled="@this.isCleanerRunning" @bind-Value="@this.inputText" Validation="@this.ValidatingText" DebounceInterval="@TextFieldDefaults.VALIDATION_DEBOUNCE_MILLISECONDS" AdornmentIcon="@AppIcons.INPUT_TEXT" Adornment="Adornment.Start" Label="@TA("Your input")" Variant="Variant.Outlined" Lines="6" Sizing="InputSizing.Auto" MaxLines="12" Class="mb-3" UserAttributes="@USER_INPUT_ATTRIBUTES"/>
}
<EnumSelection T="CommonLanguages" NameFunc="@(language => language.NameSelecting)" @bind-Value="@this.selectedTargetLanguage" ValidateSelection="@this.ValidatingTargetLanguage" Icon="@AppIcons.LANGUAGE" Label="@T("Target language")" AllowOther="@true" OtherValue="CommonLanguages.OTHER" @bind-OtherInput="@this.customTargetLanguage" ValidateOther="@this.ValidateCustomLanguage" LabelOther="@T("Custom target language")" />
@@ -56,7 +56,7 @@ public partial class AssistantTranslation : AssistantBaseCore<SettingsDialogTran
protected override Func<Task> SubmitAction => () => this.TranslateText(true);
protected override bool SubmitDisabled => this.isAgentRunning;
protected override bool SubmitDisabled => this.isCleanerRunning;
protected override string SendToChatVisibleUserPromptText =>
$"""
@@ -73,7 +73,7 @@ public partial class AssistantTranslation : AssistantBaseCore<SettingsDialogTran
if (!this.MightPreselectValues())
{
this.showWebContentReader = false;
this.useContentCleanerAgent = false;
this.useContentCleaner = false;
this.liveTranslation = false;
this.selectedTargetLanguage = CommonLanguages.AS_IS;
this.customTargetLanguage = string.Empty;
@@ -85,7 +85,7 @@ public partial class AssistantTranslation : AssistantBaseCore<SettingsDialogTran
if (this.SettingsManager.ConfigurationData.Translation.PreselectOptions)
{
this.showWebContentReader = this.SettingsManager.ConfigurationData.Translation.PreselectWebContentReader;
this.useContentCleanerAgent = this.SettingsManager.ConfigurationData.Translation.PreselectContentCleanerAgent;
this.useContentCleaner = this.SettingsManager.ConfigurationData.Translation.PreselectContentCleaner;
this.liveTranslation = this.SettingsManager.ConfigurationData.Translation.PreselectLiveTranslation;
this.selectedTargetLanguage = this.SettingsManager.ConfigurationData.Translation.PreselectedTargetLanguage;
this.customTargetLanguage = this.SettingsManager.ConfigurationData.Translation.PreselectOtherLanguage;
@@ -96,18 +96,18 @@ public partial class AssistantTranslation : AssistantBaseCore<SettingsDialogTran
}
private bool showWebContentReader;
private bool useContentCleanerAgent;
private bool useContentCleaner;
private bool liveTranslation;
private bool isAgentRunning;
private bool isCleanerRunning;
private string webContentURL = string.Empty;
private string inputText = string.Empty;
private string inputTextLastTranslation = string.Empty;
private CommonLanguages selectedTargetLanguage;
private string customTargetLanguage = string.Empty;
private static readonly AssistantSessionStateKey<bool> SHOW_WEB_CONTENT_READER_STATE_KEY = new(nameof(showWebContentReader));
private static readonly AssistantSessionStateKey<bool> USE_CONTENT_CLEANER_AGENT_STATE_KEY = new(nameof(useContentCleanerAgent));
private static readonly AssistantSessionStateKey<bool> USE_CONTENT_CLEANER_STATE_KEY = new(nameof(useContentCleaner));
private static readonly AssistantSessionStateKey<bool> LIVE_TRANSLATION_STATE_KEY = new(nameof(liveTranslation));
private static readonly AssistantSessionStateKey<bool> IS_AGENT_RUNNING_STATE_KEY = new(nameof(isAgentRunning));
private static readonly AssistantSessionStateKey<bool> IS_CLEANER_RUNNING_STATE_KEY = new(nameof(isCleanerRunning));
private static readonly AssistantSessionStateKey<string> WEB_CONTENT_URL_STATE_KEY = new(nameof(webContentURL));
private static readonly AssistantSessionStateKey<string> INPUT_TEXT_STATE_KEY = new(nameof(inputText));
private static readonly AssistantSessionStateKey<string> INPUT_TEXT_LAST_TRANSLATION_STATE_KEY = new(nameof(inputTextLastTranslation));
@@ -118,9 +118,9 @@ public partial class AssistantTranslation : AssistantBaseCore<SettingsDialogTran
protected override void CaptureCustomAssistantSessionState(AssistantSessionStateWriter state)
{
state.Set(SHOW_WEB_CONTENT_READER_STATE_KEY, this.showWebContentReader);
state.Set(USE_CONTENT_CLEANER_AGENT_STATE_KEY, this.useContentCleanerAgent);
state.Set(USE_CONTENT_CLEANER_STATE_KEY, this.useContentCleaner);
state.Set(LIVE_TRANSLATION_STATE_KEY, this.liveTranslation);
state.Set(IS_AGENT_RUNNING_STATE_KEY, this.isAgentRunning);
state.Set(IS_CLEANER_RUNNING_STATE_KEY, this.isCleanerRunning);
state.Set(WEB_CONTENT_URL_STATE_KEY, this.webContentURL);
state.Set(INPUT_TEXT_STATE_KEY, this.inputText);
state.Set(INPUT_TEXT_LAST_TRANSLATION_STATE_KEY, this.inputTextLastTranslation);
@@ -132,9 +132,9 @@ public partial class AssistantTranslation : AssistantBaseCore<SettingsDialogTran
protected override void RestoreCustomAssistantSessionState(AssistantSessionStateReader state)
{
state.Restore(SHOW_WEB_CONTENT_READER_STATE_KEY, value => this.showWebContentReader = value);
state.Restore(USE_CONTENT_CLEANER_AGENT_STATE_KEY, value => this.useContentCleanerAgent = value);
state.Restore(USE_CONTENT_CLEANER_STATE_KEY, value => this.useContentCleaner = value);
state.Restore(LIVE_TRANSLATION_STATE_KEY, value => this.liveTranslation = value);
state.Restore(IS_AGENT_RUNNING_STATE_KEY, value => this.isAgentRunning = value);
state.Restore(IS_CLEANER_RUNNING_STATE_KEY, value => this.isCleanerRunning = value);
state.Restore(WEB_CONTENT_URL_STATE_KEY, value => this.webContentURL = value);
state.Restore(INPUT_TEXT_STATE_KEY, value => this.inputText = value);
state.Restore(INPUT_TEXT_LAST_TRANSLATION_STATE_KEY, value => this.inputTextLastTranslation = value);