Fixed text fields which kept showing an issue while you typed (#1212)

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2026-11-20 12:47:40 +01:00
1 parent 1db0f85898
commit fb8f51dec4
28 files changed
+249 -46

No files matched your search

+1
View File
@@ -39,6 +39,7 @@ Key structure:
- **JSON contracts** - The contracts of all JSON which AI Studio reads or writes are generated while compiling. Each kind of options names the `JsonSerializerContext` which knows its types, with `GenerationMode = Metadata`, as its `TypeInfoResolver` and ends with `.AsReadOnly()`; only `VisualBriefingJson.Canonical` leaves that out, see MWAIS0010. A new JSON type goes into the context of the options it is read or written with, and into `JsonTestRoots` in `app/Tests/Serialization/`, whose contract, defaults, and coverage tests then check it. Give JSON types `set` instead of `init`, because the source generator of .NET 10 drops the initializer of an `init` property which the JSON leaves out, and write a record or a `JsonObject` instead of an anonymous type. Never call System.Text.Json without options, nor with `JsonSerializerOptions.Default`, `.Web`, or a `DefaultJsonTypeInfoResolver`: each of them builds the contracts by reflection, whose code a published build may lack. MWAIS0015 refuses them while compiling, `JsonOptionsResolverTests` checks the resolvers of all options of the app, and the trim smoke test of `dotnet run verify` builds the contract of every type of their contexts in a trimmed build. Reflection itself stays switched on, because Blazor Server needs it for JSON of its own, see `Trimming.props`.
- **Long menus** - MudBlazor keeps a `MudSelect` inside the window by itself, but never a `MudMenu`: a menu taller than the window runs past its edge, and its lower entries cannot be reached. Give every `MudMenu` whose entries come from data, such as the assistants or the profiles, `MaxHeight="@MenuDefaults.MAX_HEIGHT"`, so that it scrolls.
- **Growing popovers** - Since version 9, MudBlazor places an open popover again whenever its content changes size. Content which unfolds later, such as a `MudCollapse` or an `ExpansionPanel` inside a `MudPopover`, therefore stays inside the window and needs no code of its own.
- **Validated text fields** - Without `Immediate` or a `DebounceInterval`, a `MudTextField` passes its text on only when the user leaves it, so an issue stays visible while the user types the text which resolves it. Give every `MudTextField` with a `Validation` which takes typing `DebounceInterval="@TextFieldDefaults.VALIDATION_DEBOUNCE_MILLISECONDS"` and bind its `Value`, not its `Text`: bound by its text, the field also delays the texts its parent sets, e.g., by a reset, and checks them although nobody touched it. `Immediate="@true"` works as well, but renders the parent with every keystroke. `ValidatedTextFieldTests` checks this rule.
- **Encryption** - Initialized before Rust service is marked ready
- **Access to the app server** - Only the app window gets into the Blazor server. `AppAccessMiddleware` runs first in `Program.cs`, right after the host filter, and refuses every request without the session cookie of the window or with an origin other than the app's own. Add no exception for any path, not even for static files: `AppAccessPipelineTests` checks the order in `Program.cs`. Since nothing but the window holds the cookie, the app never sends a request to its own server: read files below `wwwroot/` through `WebRootFiles`. The system browser gets no cookie either, so never open a URL of the app server there; offer a save dialog through `RustService` instead, as the ERI Server assistant does for its specification. `runtime/AGENTS.md` describes the runtime side.
- **Debug environment** - Reads `startup.env` file with IPC credentials
@@ -1,8 +1,8 @@
@attribute [Route(Routes.ASSISTANT_AGENDA)]
@inherits AssistantBaseCore<AIStudio.Dialogs.Settings.SettingsDialogAgenda>
<MudTextField T="string" @bind-Text="@this.inputName" Validation="@this.ValidateName" Label="@T("Meeting Name")" Adornment="Adornment.Start" AdornmentIcon="@AppIcons.NAME" Variant="Variant.Outlined" Margin="Margin.Dense" UserAttributes="@USER_INPUT_ATTRIBUTES" HelperText="@TA("Name the meeting, seminar, etc.")" Placeholder="@T("Weekly jour fixe")" Class="mb-3"/>
<MudTextField T="string" @bind-Text="@this.inputTopic" Validation="@this.ValidateTopic" Label="@T("Topic")" Adornment="Adornment.Start" AdornmentIcon="@AppIcons.MEETING_TOPIC" Variant="Variant.Outlined" Margin="Margin.Dense" UserAttributes="@USER_INPUT_ATTRIBUTES" HelperText="@TA("Describe the topic of the meeting, seminar, etc. Is it about quantum computing, software engineering, or is it a general business meeting?")" Placeholder="@T("Project meeting")" Class="mb-3"/>
<MudTextField T="string" @bind-Value="@this.inputName" Validation="@this.ValidateName" DebounceInterval="@TextFieldDefaults.VALIDATION_DEBOUNCE_MILLISECONDS" Label="@T("Meeting Name")" Adornment="Adornment.Start" AdornmentIcon="@AppIcons.NAME" Variant="Variant.Outlined" Margin="Margin.Dense" UserAttributes="@USER_INPUT_ATTRIBUTES" HelperText="@TA("Name the meeting, seminar, etc.")" Placeholder="@T("Weekly jour fixe")" Class="mb-3"/>
<MudTextField T="string" @bind-Value="@this.inputTopic" Validation="@this.ValidateTopic" DebounceInterval="@TextFieldDefaults.VALIDATION_DEBOUNCE_MILLISECONDS" Label="@T("Topic")" Adornment="Adornment.Start" AdornmentIcon="@AppIcons.MEETING_TOPIC" Variant="Variant.Outlined" Margin="Margin.Dense" UserAttributes="@USER_INPUT_ATTRIBUTES" HelperText="@TA("Describe the topic of the meeting, seminar, etc. Is it about quantum computing, software engineering, or is it a general business meeting?")" Placeholder="@T("Project meeting")" Class="mb-3"/>
<ReadFileContent Text="@T("Load the content list from file")" FileContent="@this.inputContent" FileContentChanged="@this.ContentLoadedFromFile" EnableDragDrop="true"/>
<DebouncedTextField @bind-Text="@this.inputContent" ValidationFunc="@this.ValidateContent" DebounceTime="TimeSpan.FromSeconds(1)" Label="@T("Content list")" Lines="6" Attributes="@USER_INPUT_ATTRIBUTES" HelpText="@TA("Bullet list the content of the meeting, seminar, etc. roughly. Use dashes (-) to separate the items.")" Placeholder="@PLACEHOLDER_CONTENT" WhenTextCanged="@this.OnContentChanged" Icon="@AppIcons.LIST"/>
<MudSelect T="string" Label="@T("(Optional) What topics should be the focus?")" MultiSelection="@true" @bind-SelectedValues="@this.selectedFoci" Variant="Variant.Outlined" Class="mb-3" Adornment="Adornment.Start" AdornmentIcon="@AppIcons.LIST">
@@ -29,10 +29,10 @@
}
</MudSelect>
<MudTextField T="string" @bind-Text="@this.inputObjective" Validation="@this.ValidateObjective" Label="@T("Objective")" Adornment="Adornment.Start" AdornmentIcon="@AppIcons.OBJECTIVE" Variant="Variant.Outlined" Lines="3" Margin="Margin.Dense" UserAttributes="@USER_INPUT_ATTRIBUTES" HelperText="@TA("Describe the objective(s) of the meeting, seminar, etc. What should be achieved?")" Placeholder="@TA("Discuss the current project status and plan the next steps.")" Class="mb-3"/>
<MudTextField T="string" @bind-Text="@this.inputModerator" Validation="@this.ValidateModerator" Label="@T("Moderator")" Adornment="Adornment.Start" AdornmentIcon="@AppIcons.MODERATOR" Variant="Variant.Outlined" Margin="Margin.Dense" UserAttributes="@USER_INPUT_ATTRIBUTES" HelperText="@T("Who will moderate the meeting, seminar, etc.?")" Placeholder="Jane Doe" Class="mb-3" />
<MudTextField T="string" @bind-Text="@this.inputDuration" Validation="@this.ValidateDuration" Label="@T("Duration")" Adornment="Adornment.Start" AdornmentIcon="@AppIcons.TIME" Variant="Variant.Outlined" Margin="Margin.Dense" UserAttributes="@USER_INPUT_ATTRIBUTES" HelperText="@T("How long will the meeting, seminar, etc. last? E.g., '2 hours', or '2 days (first day 8 hours, then 4 hours)', etc.")" Placeholder="@T("2 hours")" Class="mb-3"/>
<MudTextField T="string" @bind-Text="@this.inputStartTime" Validation="@this.ValidateStartTime" Label="@T("Start time")" Adornment="Adornment.Start" AdornmentIcon="@AppIcons.TIME" Variant="Variant.Outlined" Margin="Margin.Dense" UserAttributes="@USER_INPUT_ATTRIBUTES" HelperText="@TA("When will the meeting, seminar, etc. start? E.g., '9:00 AM', or '9:00 AM (CET)', etc. When the meeting is a multi-day event, specify the start time for each day.")" Placeholder="@T("9:00 AM")" Class="mb-3"/>
<MudTextField T="string" @bind-Value="@this.inputObjective" Validation="@this.ValidateObjective" DebounceInterval="@TextFieldDefaults.VALIDATION_DEBOUNCE_MILLISECONDS" Label="@T("Objective")" Adornment="Adornment.Start" AdornmentIcon="@AppIcons.OBJECTIVE" Variant="Variant.Outlined" Lines="3" Margin="Margin.Dense" UserAttributes="@USER_INPUT_ATTRIBUTES" HelperText="@TA("Describe the objective(s) of the meeting, seminar, etc. What should be achieved?")" Placeholder="@TA("Discuss the current project status and plan the next steps.")" Class="mb-3"/>
<MudTextField T="string" @bind-Value="@this.inputModerator" Validation="@this.ValidateModerator" DebounceInterval="@TextFieldDefaults.VALIDATION_DEBOUNCE_MILLISECONDS" Label="@T("Moderator")" Adornment="Adornment.Start" AdornmentIcon="@AppIcons.MODERATOR" Variant="Variant.Outlined" Margin="Margin.Dense" UserAttributes="@USER_INPUT_ATTRIBUTES" HelperText="@T("Who will moderate the meeting, seminar, etc.?")" Placeholder="Jane Doe" Class="mb-3" />
<MudTextField T="string" @bind-Value="@this.inputDuration" Validation="@this.ValidateDuration" DebounceInterval="@TextFieldDefaults.VALIDATION_DEBOUNCE_MILLISECONDS" Label="@T("Duration")" Adornment="Adornment.Start" AdornmentIcon="@AppIcons.TIME" Variant="Variant.Outlined" Margin="Margin.Dense" UserAttributes="@USER_INPUT_ATTRIBUTES" HelperText="@T("How long will the meeting, seminar, etc. last? E.g., '2 hours', or '2 days (first day 8 hours, then 4 hours)', etc.")" Placeholder="@T("2 hours")" Class="mb-3"/>
<MudTextField T="string" @bind-Value="@this.inputStartTime" Validation="@this.ValidateStartTime" DebounceInterval="@TextFieldDefaults.VALIDATION_DEBOUNCE_MILLISECONDS" Label="@T("Start time")" Adornment="Adornment.Start" AdornmentIcon="@AppIcons.TIME" Variant="Variant.Outlined" Margin="Margin.Dense" UserAttributes="@USER_INPUT_ATTRIBUTES" HelperText="@TA("When will the meeting, seminar, etc. start? E.g., '9:00 AM', or '9:00 AM (CET)', etc. When the meeting is a multi-day event, specify the start time for each day.")" Placeholder="@T("9:00 AM")" Class="mb-3"/>
<MudTextField T="string" @bind-Text="@this.inputWhoIsPresenting" Label="@T("(Optional) Who is presenting?")" Variant="Variant.Outlined" Lines="6" Margin="Margin.Dense" UserAttributes="@USER_INPUT_ATTRIBUTES" HelperText="@TA("(Optional) List the persons who will present at the meeting, seminar, etc. Use dashes (-) to separate the items.")" Placeholder="@PLACEHOLDER_WHO_IS_PRESENTING" Class="mb-3"/>
<MudTextSwitch Label="@T("Do the participants need to get to know each other first?")" @bind-Value="@this.introduceParticipants" LabelOn="@T("Yes, introduce participants")" LabelOff="@T("No, participants know each other")" />
<EnumSelection T="NumberParticipants" @bind-Value="@this.numberParticipants" NameFunc="@(participants => participants.Name)" Icon="@AppIcons.PARTICIPANTS" Label="@T("Number of participants")" ValidateSelection="@this.ValidateNumberParticipants"/>
@@ -41,7 +41,7 @@
@if (!this.isMeetingVirtual)
{
<MudPaper Class="pa-3 mb-8 border-dashed border rounded-lg">
<MudTextField T="string" @bind-Text="@this.inputLocation" Validation="@this.ValidateLocation" Label="@T("Location")" Adornment="Adornment.Start" AdornmentIcon="@AppIcons.LOCATION" Variant="Variant.Outlined" Margin="Margin.Dense" UserAttributes="@USER_INPUT_ATTRIBUTES" HelperText="@T("Where will the meeting, seminar, etc. take place?")" Placeholder="@T("Hamburg, Germany")" Class="mb-3"/>
<MudTextField T="string" @bind-Value="@this.inputLocation" Validation="@this.ValidateLocation" DebounceInterval="@TextFieldDefaults.VALIDATION_DEBOUNCE_MILLISECONDS" Label="@T("Location")" Adornment="Adornment.Start" AdornmentIcon="@AppIcons.LOCATION" Variant="Variant.Outlined" Margin="Margin.Dense" UserAttributes="@USER_INPUT_ATTRIBUTES" HelperText="@T("Where will the meeting, seminar, etc. take place?")" Placeholder="@T("Hamburg, Germany")" Class="mb-3"/>
<MudTextSwitch Label="@T("Should there be a joint dinner?")" @bind-Value="@this.goingToDinner" LabelOn="@T("Yes, there should be a joint dinner")" LabelOff="@T("No, there should be no joint dinner")" />
<MudTextSwitch Label="@T("Should there be a social activity?")" @bind-Value="@this.doingSocialActivity" LabelOn="@T("Yes, there should be a social activity")" LabelOff="@T("No, there should be no social activity")" />
<MudTextSwitch Label="@T("Do participants need to arrive and depart?")" @bind-Value="@this.needToArriveAndDepart" LabelOn="@T("Yes, participants need to arrive and depart")" LabelOff="@T("No, participants do not need to arrive and depart")" />
@@ -57,6 +57,7 @@ else if (this.HasPublicDetails)
HelperText="@field.Hint"
MaxLength="@field.Kind.MaxLength"
Validation="@this.ValidationOf(field)"
DebounceInterval="@TextFieldDefaults.VALIDATION_DEBOUNCE_MILLISECONDS"
Disabled="@this.Disabled"
Adornment="@AdornmentOf(field)"
AdornmentIcon="@PUBLIC_DETAIL_ICON"
@@ -59,6 +59,7 @@
Label="@T("Value")"
MaxLength="@BflCardSort.MAX_NAME_LENGTH"
Validation="@this.NameValidation"
DebounceInterval="@TextFieldDefaults.VALIDATION_DEBOUNCE_MILLISECONDS"
Disabled="@this.Disabled"
Variant="Variant.Outlined"
Style="flex: 1 1 0;"/>
@@ -9,7 +9,7 @@
@if (this.step is BuilderStep.DESCRIBE)
{
<ReadFileContent Text="@T("Load description from file")" @bind-FileContent="@this.assistantDescription" EnableDragDrop="true" CatchAllDocuments="true"/>
<MudTextField T="string" @bind-Text="@this.assistantDescription" Validation="@this.ValidateAssistantDescription" AdornmentIcon="@AppIcons.GENERATE" Adornment="Adornment.Start" Label="@TA("Describe your assistant")" HelperText="@TA("Describe the task, inputs, and desired output in your own words. The model will infer all the plugin details.")" Placeholder="@T("I need an assistant that turns meeting notes into clear tasks with owners and deadlines.")" Variant="Variant.Outlined" Lines="8" Sizing="InputSizing.Auto" MaxLines="18" Class="mb-3" UserAttributes="@USER_INPUT_ATTRIBUTES"/>
<MudTextField T="string" @bind-Value="@this.assistantDescription" Validation="@this.ValidateAssistantDescription" DebounceInterval="@TextFieldDefaults.VALIDATION_DEBOUNCE_MILLISECONDS" AdornmentIcon="@AppIcons.GENERATE" Adornment="Adornment.Start" Label="@TA("Describe your assistant")" HelperText="@TA("Describe the task, inputs, and desired output in your own words. The model will infer all the plugin details.")" Placeholder="@T("I need an assistant that turns meeting notes into clear tasks with owners and deadlines.")" Variant="Variant.Outlined" Lines="8" Sizing="InputSizing.Auto" MaxLines="18" Class="mb-3" UserAttributes="@USER_INPUT_ATTRIBUTES"/>
@* This switch chooses between the two kinds of assistant the Builder can create, so it stays
outside the advanced options. Its fields are required, and a collapsed panel would hide
@@ -13,9 +13,9 @@
<MudTextSwitch Label="@TA("Do you want to provide compiler messages?")" @bind-Value="@this.provideCompilerMessages" LabelOn="@T("Yes, provide compiler messages")" LabelOff="@T("No, there are no compiler messages")" />
@if (this.provideCompilerMessages)
{
<MudTextField T="string" @bind-Text="@this.compilerMessages" Validation="@this.ValidatingCompilerMessages" AdornmentIcon="@AppIcons.COMPILER_MESSAGES" Adornment="Adornment.Start" Label="@T("Compiler messages")" Variant="Variant.Outlined" Lines="6" Sizing="InputSizing.Auto" MaxLines="12" Class="mb-3" UserAttributes="@USER_INPUT_ATTRIBUTES"/>
<MudTextField T="string" @bind-Value="@this.compilerMessages" Validation="@this.ValidatingCompilerMessages" DebounceInterval="@TextFieldDefaults.VALIDATION_DEBOUNCE_MILLISECONDS" AdornmentIcon="@AppIcons.COMPILER_MESSAGES" Adornment="Adornment.Start" Label="@T("Compiler messages")" Variant="Variant.Outlined" Lines="6" Sizing="InputSizing.Auto" MaxLines="12" Class="mb-3" UserAttributes="@USER_INPUT_ATTRIBUTES"/>
}
</MudStack>
<MudTextField T="string" @bind-Text="@this.questions" Validation="@this.ValidateQuestions" AdornmentIcon="@AppIcons.QUESTIONS" Adornment="Adornment.Start" Label="@TA("Your question(s)")" Variant="Variant.Outlined" Lines="6" Sizing="InputSizing.Auto" MaxLines="12" Class="mb-3" UserAttributes="@USER_INPUT_ATTRIBUTES"/>
<MudTextField T="string" @bind-Value="@this.questions" Validation="@this.ValidateQuestions" DebounceInterval="@TextFieldDefaults.VALIDATION_DEBOUNCE_MILLISECONDS" AdornmentIcon="@AppIcons.QUESTIONS" Adornment="Adornment.Start" Label="@TA("Your question(s)")" Variant="Variant.Outlined" Lines="6" Sizing="InputSizing.Auto" MaxLines="12" Class="mb-3" UserAttributes="@USER_INPUT_ATTRIBUTES"/>
<ProviderSelection @bind-ProviderSettings="@this.ProviderSettings" ValidateProvider="@this.ValidatingProvider"/>
@@ -5,7 +5,7 @@
@if (this.provideHistory)
{
<MudPaper Class="pa-3 mb-8 border-dashed border rounded-lg">
<MudTextField T="string" @bind-Text="@this.inputHistory" Validation="@this.ValidateHistory" Label="@T("Previous conversation")" Variant="Variant.Outlined" Lines="6" Sizing="InputSizing.Auto" MaxLines="12" Margin="Margin.Dense" UserAttributes="@USER_INPUT_ATTRIBUTES" HelperText="@TA("Provide the previous conversation, e.g., the last e-mail, the last chat, etc.")" Class="mb-3" Adornment="Adornment.Start" AdornmentIcon="@AppIcons.INPUT_TEXT"/>
<MudTextField T="string" @bind-Value="@this.inputHistory" Validation="@this.ValidateHistory" DebounceInterval="@TextFieldDefaults.VALIDATION_DEBOUNCE_MILLISECONDS" Label="@T("Previous conversation")" Variant="Variant.Outlined" Lines="6" Sizing="InputSizing.Auto" MaxLines="12" Margin="Margin.Dense" UserAttributes="@USER_INPUT_ATTRIBUTES" HelperText="@TA("Provide the previous conversation, e.g., the last e-mail, the last chat, etc.")" Class="mb-3" Adornment="Adornment.Start" AdornmentIcon="@AppIcons.INPUT_TEXT"/>
</MudPaper>
}
@@ -103,7 +103,7 @@ else
</MudSelect>
@if (this.selectedProgrammingLanguage is ProgrammingLanguages.OTHER)
{
<MudTextField Disabled="@this.IsERIInputDisabled" T="string" @bind-Text="@this.otherProgrammingLanguage" Validation="@this.ValidateOtherLanguage" Label="@T("Other language")" Variant="Variant.Outlined" Margin="Margin.Dense" UserAttributes="@USER_INPUT_ATTRIBUTES"/>
<MudTextField Disabled="@this.IsERIInputDisabled" T="string" @bind-Value="@this.otherProgrammingLanguage" Validation="@this.ValidateOtherLanguage" DebounceInterval="@TextFieldDefaults.VALIDATION_DEBOUNCE_MILLISECONDS" Label="@T("Other language")" Variant="Variant.Outlined" Margin="Margin.Dense" UserAttributes="@USER_INPUT_ATTRIBUTES"/>
}
</MudStack>
@@ -136,20 +136,20 @@ else
</MudSelect>
@if (this.selectedDataSource is DataSources.CUSTOM)
{
<MudTextField Disabled="@this.IsERIInputDisabled" T="string" @bind-Text="@this.otherDataSource" Validation="@this.ValidateOtherDataSource" Label="@TA("Describe your data source")" Variant="Variant.Outlined" Margin="Margin.Normal" Lines="3" Sizing="InputSizing.Auto" MaxLines="6" UserAttributes="@USER_INPUT_ATTRIBUTES"/>
<MudTextField Disabled="@this.IsERIInputDisabled" T="string" @bind-Value="@this.otherDataSource" Validation="@this.ValidateOtherDataSource" DebounceInterval="@TextFieldDefaults.VALIDATION_DEBOUNCE_MILLISECONDS" Label="@TA("Describe your data source")" Variant="Variant.Outlined" Margin="Margin.Normal" Lines="3" Sizing="InputSizing.Auto" MaxLines="6" UserAttributes="@USER_INPUT_ATTRIBUTES"/>
}
</MudStack>
@if(this.selectedDataSource > DataSources.FILE_SYSTEM)
{
<MudTextField Disabled="@this.IsERIInputDisabled" T="string" @bind-Text="@this.dataSourceProductName" Label="@T("Data source: product name")" Validation="@this.ValidateDataSourceProductName" Variant="Variant.Outlined" Margin="Margin.Dense" UserAttributes="@USER_INPUT_ATTRIBUTES" Class="mb-3"/>
<MudTextField Disabled="@this.IsERIInputDisabled" T="string" @bind-Value="@this.dataSourceProductName" Label="@T("Data source: product name")" Validation="@this.ValidateDataSourceProductName" DebounceInterval="@TextFieldDefaults.VALIDATION_DEBOUNCE_MILLISECONDS" Variant="Variant.Outlined" Margin="Margin.Dense" UserAttributes="@USER_INPUT_ATTRIBUTES" Class="mb-3"/>
}
@if (this.NeedHostnamePort())
{
<div class="mb-3">
<MudStack Row="@true">
<MudTextField Disabled="@this.IsERIInputDisabled" T="string" @bind-Text="@this.dataSourceHostname" Label="@T("Data source: hostname")" Validation="@this.ValidateHostname" Variant="Variant.Outlined" Margin="Margin.Dense" UserAttributes="@USER_INPUT_ATTRIBUTES"/>
<MudTextField Disabled="@this.IsERIInputDisabled" T="string" @bind-Value="@this.dataSourceHostname" Label="@T("Data source: hostname")" Validation="@this.ValidateHostname" DebounceInterval="@TextFieldDefaults.VALIDATION_DEBOUNCE_MILLISECONDS" Variant="Variant.Outlined" Margin="Margin.Dense" UserAttributes="@USER_INPUT_ATTRIBUTES"/>
<MudNumericField Disabled="@this.IsERIInputDisabled" Label="@T("Data source: port")" Immediate="@true" Min="1" Max="65535" Validation="@this.ValidatePort" @bind-Value="@this.dataSourcePort" Variant="Variant.Outlined" Margin="Margin.Dense" OnKeyUp="() => this.DataSourcePortWasTyped()"/>
</MudStack>
@if (this.dataSourcePort < 1024)
@@ -185,7 +185,7 @@ else
</MudSelectItemExtended>
}
</MudSelectExtended>
<MudTextField Disabled="@this.IsERIInputDisabled" T="string" @bind-Text="@this.authDescription" Label="@this.AuthDescriptionTitle()" Validation="@this.ValidateAuthDescription" Variant="Variant.Outlined" Margin="Margin.Normal" Lines="3" Sizing="InputSizing.Auto" MaxLines="6" UserAttributes="@USER_INPUT_ATTRIBUTES"/>
<MudTextField Disabled="@this.IsERIInputDisabled" T="string" @bind-Value="@this.authDescription" Label="@this.AuthDescriptionTitle()" Validation="@this.ValidateAuthDescription" DebounceInterval="@TextFieldDefaults.VALIDATION_DEBOUNCE_MILLISECONDS" Variant="Variant.Outlined" Margin="Margin.Normal" Lines="3" Sizing="InputSizing.Auto" MaxLines="6" UserAttributes="@USER_INPUT_ATTRIBUTES"/>
</MudStack>
@if (this.selectedAuthenticationMethods.Contains(Auth.KERBEROS))
@@ -2,6 +2,6 @@
@inherits AssistantBaseCore<AIStudio.Dialogs.Settings.SettingsDialogGrammarSpelling>
<ReadFileContent Text="@T("Load text from file")" @bind-FileContent="@this.inputText" EnableDragDrop="true" CatchAllDocuments="true"/>
<MudTextField T="string" @bind-Text="@this.inputText" Validation="@this.ValidateText" AdornmentIcon="@AppIcons.INPUT_TEXT" Adornment="Adornment.Start" Label="@TA("Your input to check")" Variant="Variant.Outlined" Lines="6" Sizing="InputSizing.Auto" MaxLines="12" Class="mb-3" UserAttributes="@USER_INPUT_ATTRIBUTES"/>
<MudTextField T="string" @bind-Value="@this.inputText" Validation="@this.ValidateText" DebounceInterval="@TextFieldDefaults.VALIDATION_DEBOUNCE_MILLISECONDS" AdornmentIcon="@AppIcons.INPUT_TEXT" Adornment="Adornment.Start" Label="@TA("Your input to check")" Variant="Variant.Outlined" Lines="6" Sizing="InputSizing.Auto" MaxLines="12" Class="mb-3" UserAttributes="@USER_INPUT_ATTRIBUTES"/>
<EnumSelection T="CommonLanguages" NameFunc="@(language => language.NameSelectingOptional)" @bind-Value="@this.selectedTargetLanguage" Icon="@AppIcons.LANGUAGE" Label="@T("Language")" AllowOther="@true" OtherValue="CommonLanguages.OTHER" @bind-OtherInput="@this.customTargetLanguage" ValidateOther="@this.ValidateCustomLanguage" LabelOther="@T("Custom language")" />
<ProviderSelection @bind-ProviderSettings="@this.ProviderSettings" ValidateProvider="@this.ValidatingProvider"/>
@@ -1,7 +1,7 @@
@attribute [Route(Routes.ASSISTANT_ICON_FINDER)]
@inherits AssistantBaseCore<AIStudio.Dialogs.Settings.SettingsDialogIconFinder>
<MudTextField T="string" @bind-Text="@this.inputContext" Validation="@this.ValidatingContext" AdornmentIcon="@AppIcons.DESCRIPTION" Adornment="Adornment.Start" Label="@TA("Your context")" Variant="Variant.Outlined" Lines="3" Sizing="InputSizing.Auto" MaxLines="12" Class="mb-3" UserAttributes="@USER_INPUT_ATTRIBUTES"/>
<MudTextField T="string" @bind-Value="@this.inputContext" Validation="@this.ValidatingContext" DebounceInterval="@TextFieldDefaults.VALIDATION_DEBOUNCE_MILLISECONDS" AdornmentIcon="@AppIcons.DESCRIPTION" Adornment="Adornment.Start" Label="@TA("Your context")" Variant="Variant.Outlined" Lines="3" Sizing="InputSizing.Auto" MaxLines="12" Class="mb-3" UserAttributes="@USER_INPUT_ATTRIBUTES"/>
<MudStack Row="@true" AlignItems="AlignItems.Center" Class="mb-3">
<MudSelect T="IconSources" @bind-Value="@this.selectedIconSource" AdornmentIcon="@AppIcons.ICON_SOURCE" Adornment="Adornment.Start" Label="@TA("Your icon source")" Variant="Variant.Outlined" Margin="Margin.Dense">
@@ -2,12 +2,12 @@
@inherits AssistantBaseCore<AIStudio.Dialogs.Settings.SettingsDialogJobPostings>
<MudTextField T="string" @bind-Text="@this.inputCompanyName" Label="@T("(Optional) The company name")" Adornment="Adornment.Start" AdornmentIcon="@AppIcons.COMPANY" Variant="Variant.Outlined" Margin="Margin.Dense" UserAttributes="@USER_INPUT_ATTRIBUTES" Class="mb-3"/>
<MudTextField T="string" @bind-Text="@this.inputCountryLegalFramework" Label="@TA("Provide the country, where the company is located")" Validation="@this.ValidateCountryLegalFramework" Adornment="Adornment.Start" AdornmentIcon="@AppIcons.COUNTRY" Variant="Variant.Outlined" Margin="Margin.Dense" UserAttributes="@USER_INPUT_ATTRIBUTES" Class="mb-3" HelperText="@T("This is important to consider the legal framework of the country.")"/>
<MudTextField T="string" @bind-Value="@this.inputCountryLegalFramework" Label="@TA("Provide the country, where the company is located")" Validation="@this.ValidateCountryLegalFramework" DebounceInterval="@TextFieldDefaults.VALIDATION_DEBOUNCE_MILLISECONDS" Adornment="Adornment.Start" AdornmentIcon="@AppIcons.COUNTRY" Variant="Variant.Outlined" Margin="Margin.Dense" UserAttributes="@USER_INPUT_ATTRIBUTES" Class="mb-3" HelperText="@T("This is important to consider the legal framework of the country.")"/>
@* Four zones, so no default target: every drop has to be aimed at the field it belongs to. *@
<ReadFileContent Text="@T("Load the mandatory information from file")" @bind-FileContent="@this.inputMandatoryInformation" EnableDragDrop="true"/>
<MudTextField T="string" @bind-Text="@this.inputMandatoryInformation" Label="@T("(Optional) Provide mandatory information")" Adornment="Adornment.Start" AdornmentIcon="@AppIcons.JOB_DETAILS" Variant="Variant.Outlined" Lines="6" Sizing="InputSizing.Auto" MaxLines="12" Class="mb-3" UserAttributes="@USER_INPUT_ATTRIBUTES" HelperText="@TA("Mandatory information that your company requires for all job postings. This can include the company description, etc.")" />
<ReadFileContent Text="@T("Load the job description from file")" @bind-FileContent="@this.inputJobDescription" EnableDragDrop="true"/>
<MudTextField T="string" @bind-Text="@this.inputJobDescription" Label="@T("Job description")" Validation="@this.ValidateJobDescription" Adornment="Adornment.Start" AdornmentIcon="@AppIcons.JOB_DETAILS" Variant="Variant.Outlined" Lines="6" Sizing="InputSizing.Auto" MaxLines="12" Class="mb-3" UserAttributes="@USER_INPUT_ATTRIBUTES" HelperText="@TA("Describe what the person is supposed to do in the company. This might be just short bullet points.")" />
<MudTextField T="string" @bind-Value="@this.inputJobDescription" Label="@T("Job description")" Validation="@this.ValidateJobDescription" DebounceInterval="@TextFieldDefaults.VALIDATION_DEBOUNCE_MILLISECONDS" Adornment="Adornment.Start" AdornmentIcon="@AppIcons.JOB_DETAILS" Variant="Variant.Outlined" Lines="6" Sizing="InputSizing.Auto" MaxLines="12" Class="mb-3" UserAttributes="@USER_INPUT_ATTRIBUTES" HelperText="@TA("Describe what the person is supposed to do in the company. This might be just short bullet points.")" />
<ReadFileContent Text="@T("Load the qualifications from file")" @bind-FileContent="@this.inputQualifications" EnableDragDrop="true"/>
<MudTextField T="string" @bind-Text="@this.inputQualifications" Label="@T("(Optional) Provide necessary job qualifications")" Adornment="Adornment.Start" AdornmentIcon="@AppIcons.JOB_DETAILS" Variant="Variant.Outlined" Lines="6" Sizing="InputSizing.Auto" MaxLines="12" Class="mb-3" UserAttributes="@USER_INPUT_ATTRIBUTES" HelperText="@TA("Describe what the person should bring to the table. This might be just short bullet points.")" />
<ReadFileContent Text="@T("Load the responsibilities from file")" @bind-FileContent="@this.inputResponsibilities" EnableDragDrop="true"/>
@@ -8,8 +8,8 @@
@* Two zones, so no default target: the user has to aim at the one they mean. *@
<ReadFileContent Text="@T("Load the legal document from file")" @bind-FileContent="@this.inputLegalDocument" EnableDragDrop="true"/>
<MudTextField T="string" Disabled="@this.isAgentRunning" @bind-Text="@this.inputLegalDocument" Validation="@this.ValidatingLegalDocument" AdornmentIcon="@AppIcons.INPUT_TEXT" Adornment="Adornment.Start" Label="@T("Legal document")" Variant="Variant.Outlined" Lines="12" Sizing="InputSizing.Auto" MaxLines="24" Class="mb-3" UserAttributes="@USER_INPUT_ATTRIBUTES"/>
<MudTextField T="string" Disabled="@this.isAgentRunning" @bind-Value="@this.inputLegalDocument" Validation="@this.ValidatingLegalDocument" DebounceInterval="@TextFieldDefaults.VALIDATION_DEBOUNCE_MILLISECONDS" AdornmentIcon="@AppIcons.INPUT_TEXT" Adornment="Adornment.Start" Label="@T("Legal document")" Variant="Variant.Outlined" Lines="12" Sizing="InputSizing.Auto" MaxLines="24" Class="mb-3" UserAttributes="@USER_INPUT_ATTRIBUTES"/>
<ReadFileContent Text="@TA("Load your questions from file")" @bind-FileContent="@this.inputQuestions" EnableDragDrop="true"/>
<MudTextField T="string" Disabled="@this.isAgentRunning" @bind-Text="@this.inputQuestions" Validation="@this.ValidatingQuestions" AdornmentIcon="@AppIcons.QUESTIONS" Adornment="Adornment.Start" Label="@TA("Your questions")" Variant="Variant.Outlined" Lines="6" Sizing="InputSizing.Auto" MaxLines="12" Class="mb-3" UserAttributes="@USER_INPUT_ATTRIBUTES"/>
<MudTextField T="string" Disabled="@this.isAgentRunning" @bind-Value="@this.inputQuestions" Validation="@this.ValidatingQuestions" DebounceInterval="@TextFieldDefaults.VALIDATION_DEBOUNCE_MILLISECONDS" AdornmentIcon="@AppIcons.QUESTIONS" Adornment="Adornment.Start" Label="@TA("Your questions")" Variant="Variant.Outlined" Lines="6" Sizing="InputSizing.Auto" MaxLines="12" Class="mb-3" UserAttributes="@USER_INPUT_ATTRIBUTES"/>
<ProviderSelection @bind-ProviderSettings="@this.ProviderSettings" ValidateProvider="@this.ValidatingProvider"/>
@@ -69,7 +69,7 @@
<MudJustifiedText Typo="Typo.body1" Class="mb-2">
@ModelComparisonTexts.WhatTheModelsReceive
</MudJustifiedText>
<MudTextField T="string" @bind-Text="@this.inputQuestion" Validation="@this.ValidatingQuestion" AdornmentIcon="@AppIcons.QUESTIONS" Adornment="Adornment.Start" Label="@TA("Your question or task")" Variant="Variant.Outlined" Lines="3" Sizing="InputSizing.Auto" MaxLines="12" Class="mb-3" UserAttributes="@USER_INPUT_ATTRIBUTES"/>
<MudTextField T="string" @bind-Value="@this.inputQuestion" Validation="@this.ValidatingQuestion" DebounceInterval="@TextFieldDefaults.VALIDATION_DEBOUNCE_MILLISECONDS" AdornmentIcon="@AppIcons.QUESTIONS" Adornment="Adornment.Start" Label="@TA("Your question or task")" Variant="Variant.Outlined" Lines="3" Sizing="InputSizing.Auto" MaxLines="12" Class="mb-3" UserAttributes="@USER_INPUT_ATTRIBUTES"/>
<MudText Typo="Typo.h6" Class="mb-1 mt-3">@T("Material (optional)")</MudText>
<MudJustifiedText Typo="Typo.body1" Class="mb-2">
@@ -2,7 +2,7 @@
@inherits AssistantBaseCore<AIStudio.Dialogs.Settings.SettingsDialogMyTasks>
<ProfileFormSelection Validation="@this.ValidateProfile" @bind-Profile="@this.CurrentProfile"/>
<MudTextField T="string" @bind-Text="@this.inputText" Validation="@this.ValidatingText" AdornmentIcon="@AppIcons.INPUT_TEXT" Adornment="Adornment.Start" Label="@T("Text or email")" Variant="Variant.Outlined" Lines="12" Sizing="InputSizing.Auto" MaxLines="24" Class="mb-3" UserAttributes="@USER_INPUT_ATTRIBUTES"/>
<MudTextField T="string" @bind-Value="@this.inputText" Validation="@this.ValidatingText" DebounceInterval="@TextFieldDefaults.VALIDATION_DEBOUNCE_MILLISECONDS" AdornmentIcon="@AppIcons.INPUT_TEXT" Adornment="Adornment.Start" Label="@T("Text or email")" Variant="Variant.Outlined" Lines="12" Sizing="InputSizing.Auto" MaxLines="24" Class="mb-3" UserAttributes="@USER_INPUT_ATTRIBUTES"/>
<MudText Typo="Typo.h6" Class="mb-1 mt-1">@T("Attach documents")</MudText>
<MudJustifiedText Typo="Typo.body1" Class="mb-2">
@TA("You can enter text, attach one or more documents, or use both. At least one input is required.")
@@ -5,8 +5,9 @@
to be aimed at the one it belongs to. *@
<ReadFileContent Text="@T("Load the prompt from file")" @bind-FileContent="@this.inputPrompt" EnableDragDrop="true"/>
<MudTextField T="string"
@bind-Text="@this.inputPrompt"
@bind-Value="@this.inputPrompt"
Validation="@this.ValidateInputPrompt"
DebounceInterval="@TextFieldDefaults.VALIDATION_DEBOUNCE_MILLISECONDS"
AdornmentIcon="@AppIcons.ASSISTANT_PROMPT_OPTIMIZER"
Adornment="Adornment.Start"
Label="@T("Prompt or prompt description")"
@@ -2,7 +2,7 @@
@inherits AssistantBaseCore<AIStudio.Dialogs.Settings.SettingsDialogRewrite>
<ReadFileContent Text="@T("Load text from file")" @bind-FileContent="@this.inputText" EnableDragDrop="true" CatchAllDocuments="true"/>
<MudTextField T="string" @bind-Text="@this.inputText" Validation="@this.ValidateText" AdornmentIcon="@AppIcons.INPUT_TEXT" Adornment="Adornment.Start" Label="@TA("Your input to improve")" Variant="Variant.Outlined" Lines="6" Sizing="InputSizing.Auto" MaxLines="12" Class="mb-3" UserAttributes="@USER_INPUT_ATTRIBUTES"/>
<MudTextField T="string" @bind-Value="@this.inputText" Validation="@this.ValidateText" DebounceInterval="@TextFieldDefaults.VALIDATION_DEBOUNCE_MILLISECONDS" AdornmentIcon="@AppIcons.INPUT_TEXT" Adornment="Adornment.Start" Label="@TA("Your input to improve")" Variant="Variant.Outlined" Lines="6" Sizing="InputSizing.Auto" MaxLines="12" Class="mb-3" UserAttributes="@USER_INPUT_ATTRIBUTES"/>
<EnumSelection T="CommonLanguages" NameFunc="@(language => language.NameSelectingOptional)" @bind-Value="@this.selectedTargetLanguage" Icon="@AppIcons.LANGUAGE" Label="@T("Language")" AllowOther="@true" OtherValue="CommonLanguages.OTHER" @bind-OtherInput="@this.customTargetLanguage" ValidateOther="@this.ValidateCustomLanguage" LabelOther="@T("Custom language")" />
<EnumSelection T="WritingStyles" NameFunc="@(style => style.Name)" @bind-Value="@this.selectedWritingStyle" Icon="@AppIcons.WRITING_STYLE" Label="@T("Writing style")" AllowOther="@false" />
<EnumSelection T="SentenceStructure" NameFunc="@(voice => voice.Name)" @bind-Value="@this.selectedSentenceStructure" Icon="@AppIcons.SENTENCE_STRUCTURE" Label="@T("Sentence structure")" />
@@ -14,13 +14,13 @@
<MudText Typo="Typo.h5" Class="mb-3">
@T("Input")
</MudText>
<MudTextField T="string" Disabled="@this.isAgentRunning" @bind-Text="@this.inputText" Validation="@this.ValidatingText" AdornmentIcon="@AppIcons.INPUT_TEXT" Adornment="Adornment.Start" Label="@T("Subject of analysis")" Variant="Variant.Outlined" Lines="6" Sizing="InputSizing.Auto" MaxLines="12" Class="mb-3" UserAttributes="@USER_INPUT_ATTRIBUTES"/>
<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="@T("Subject of analysis")" Variant="Variant.Outlined" Lines="6" Sizing="InputSizing.Auto" MaxLines="12" Class="mb-3" UserAttributes="@USER_INPUT_ATTRIBUTES"/>
<ReadFileContent @bind-FileContent="@this.inputText" MediaImportTargetId="swot-analysis-subject" EnableDragDrop="true" CatchAllDocuments="true"/>
<MudText Typo="Typo.h5" Class="mb-3 mt-6">
@T("Analysis Options")
</MudText>
<MudTextField T="string" Disabled="@this.isAgentRunning" @bind-Text="@this.analysisGoal" Validation="@this.ValidatingAnalysisGoal" AdornmentIcon="@AppIcons.ANALYSIS_GOAL" Adornment="Adornment.Start" Label="@T("Analysis goal")" Variant="Variant.Outlined" Lines="4" Sizing="InputSizing.Auto" Class="mb-3"/>
<MudTextField T="string" Disabled="@this.isAgentRunning" @bind-Value="@this.analysisGoal" Validation="@this.ValidatingAnalysisGoal" DebounceInterval="@TextFieldDefaults.VALIDATION_DEBOUNCE_MILLISECONDS" AdornmentIcon="@AppIcons.ANALYSIS_GOAL" Adornment="Adornment.Start" Label="@T("Analysis goal")" Variant="Variant.Outlined" Lines="4" Sizing="InputSizing.Auto" Class="mb-3"/>
<ReadFileContent @bind-FileContent="@this.analysisGoal" MediaImportTargetId="swot-analysis-goal" EnableDragDrop="true"/>
<MudTextField T="string" Disabled="@this.isAgentRunning" @bind-Text="@this.importantAspects" AdornmentIcon="@AppIcons.IMPORTANT_ASPECTS" Adornment="Adornment.Start" Label="@T("(Optional) Analysis focus")" HelperText="@TA("Specify topics the SWOT analysis should pay particular attention to.")" Variant="Variant.Outlined" Lines="4" Sizing="InputSizing.Auto" Class="mb-3"/>
<ReadFileContent @bind-FileContent="@this.importantAspects" MediaImportTargetId="swot-analysis-focus" EnableDragDrop="true"/>
@@ -8,7 +8,7 @@
<MudJustifiedText Typo="Typo.body1" Class="mb-2">
@TA("You can enter text, use one or more documents or images, or use both. At least one of these options is required.")
</MudJustifiedText>
<MudTextField T="string" @bind-Text="@this.inputContent" Validation="@this.ValidatingContext" Adornment="Adornment.Start" Lines="6" MaxLines="12" Sizing="InputSizing.Fixed" Label="@T("Text content")" Variant="Variant.Outlined" Class="mb-3" UserAttributes="@USER_INPUT_ATTRIBUTES"/>
<MudTextField T="string" @bind-Value="@this.inputContent" Validation="@this.ValidatingContext" DebounceInterval="@TextFieldDefaults.VALIDATION_DEBOUNCE_MILLISECONDS" Adornment="Adornment.Start" Lines="6" MaxLines="12" Sizing="InputSizing.Fixed" Label="@T("Text content")" Variant="Variant.Outlined" Class="mb-3" UserAttributes="@USER_INPUT_ATTRIBUTES"/>
@* Side by side where the window is wide enough; each column ends with its zone, so both zones line up below explanations of different length: *@
<MudGrid Class="mt-1">
@@ -54,7 +54,7 @@
<MudJustifiedText Typo="Typo.body1" Class="mb-2">
@TA("Please enter a title for the presentation. This will help the LLM to select more relevant content.")
</MudJustifiedText>
<MudTextField T="string" @bind-Text="@this.inputTitle" Validation="@this.ValidatingTitle" Adornment="Adornment.Start" Label="@T("Presentation title")" Variant="Variant.Outlined" Class="mb-1" UserAttributes="@USER_INPUT_ATTRIBUTES"/>
<MudTextField T="string" @bind-Value="@this.inputTitle" Validation="@this.ValidatingTitle" DebounceInterval="@TextFieldDefaults.VALIDATION_DEBOUNCE_MILLISECONDS" Adornment="Adornment.Start" Label="@T("Presentation title")" Variant="Variant.Outlined" Class="mb-1" UserAttributes="@USER_INPUT_ATTRIBUTES"/>
<MudText Typo="Typo.h6" Class="mb-1 mt-3"> @T("Important Aspects")</MudText>
<MudJustifiedText Typo="Typo.body1" Class="mb-2">
@@ -1,7 +1,7 @@
@attribute [Route(Routes.ASSISTANT_SYNONYMS)]
@inherits AssistantBaseCore<AIStudio.Dialogs.Settings.SettingsDialogSynonyms>
<MudTextField T="string" @bind-Text="@this.inputText" Validation="@this.ValidatingText" AdornmentIcon="@AppIcons.WORD_OR_PHRASE" Adornment="Adornment.Start" Label="@TA("Your word or phrase")" Variant="Variant.Outlined" Class="mb-3" UserAttributes="@USER_INPUT_ATTRIBUTES"/>
<MudTextField T="string" @bind-Value="@this.inputText" Validation="@this.ValidatingText" DebounceInterval="@TextFieldDefaults.VALIDATION_DEBOUNCE_MILLISECONDS" AdornmentIcon="@AppIcons.WORD_OR_PHRASE" Adornment="Adornment.Start" Label="@TA("Your word or phrase")" Variant="Variant.Outlined" Class="mb-3" UserAttributes="@USER_INPUT_ATTRIBUTES"/>
<MudTextField T="string" @bind-Text="@this.inputContext" AdornmentIcon="@AppIcons.DESCRIPTION" Adornment="Adornment.Start" Lines="2" Sizing="InputSizing.Fixed" Label="@T("(Optional) The context for the given word or phrase")" Variant="Variant.Outlined" Class="mb-3" UserAttributes="@USER_INPUT_ATTRIBUTES"/>
<EnumSelection T="CommonLanguages" NameFunc="@(language => language.NameSelectingOptional)" @bind-Value="@this.selectedLanguage" Icon="@AppIcons.LANGUAGE" Label="@T("Language")" AllowOther="@true" OtherValue="CommonLanguages.OTHER" @bind-OtherInput="@this.customTargetLanguage" ValidateOther="@this.ValidateCustomLanguage" LabelOther="@T("Custom target language")" />
@@ -7,7 +7,7 @@
}
<ReadFileContent @bind-FileContent="@this.inputText" EnableDragDrop="true" CatchAllDocuments="true"/>
<MudTextField T="string" Disabled="@this.isAgentRunning" @bind-Text="@this.inputText" Validation="@this.ValidatingText" 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.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"/>
<EnumSelection T="CommonLanguages" NameFunc="@(language => language.Name)" @bind-Value="@this.selectedTargetLanguage" Icon="@AppIcons.LANGUAGE" Label="@T("Target language")" AllowOther="@true" @bind-OtherInput="@this.customTargetLanguage" OtherValue="CommonLanguages.OTHER" LabelOther="@T("Custom target language")" ValidateOther="@this.ValidateCustomLanguage" />
<EnumSelection T="Complexity" NameFunc="@(complexity => complexity.Name)" @bind-Value="@this.selectedComplexity" Icon="@AppIcons.TEXT_COMPLEXITY" Label="@T("Target complexity")" AllowOther="@true" @bind-OtherInput="@this.expertInField" OtherValue="Complexity.SCIENTIFIC_LANGUAGE_OTHER_EXPERTS" LabelOther="@TA("Your expertise")" ValidateOther="@this.ValidateExpertInField" />
<MudTextField T="string" Sizing="InputSizing.Auto" Lines="2" @bind-Text="@this.importantAspects" class="mb-3" Label="@T("(Optional) Important Aspects")" HelperText="@TA("(Optional) Specify aspects for the LLM to focus on when generating a summary, such as summary length or specific topics to emphasize.")" ShrinkLabel="true" Variant="Variant.Outlined" AdornmentIcon="@AppIcons.IMPORTANT_ASPECTS" Adornment="Adornment.Start"/>
@@ -15,8 +15,8 @@
}
else
{
@* Bound by its value, the field shows no issue before you type, also when you switch the live translation off: *@
<MudTextField T="string" Disabled="@this.isAgentRunning" @bind-Value="@this.inputText" Validation="@this.ValidatingText" 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"/>
@* 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"/>
}
<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")" />
@@ -0,0 +1,18 @@
namespace AIStudio.Components;
/// <summary>
/// Settings every text field of AI Studio shares.
/// </summary>
public static class TextFieldDefaults
{
/// <summary>
/// The time in milliseconds after the last keystroke when a text field with a validation checks its text again.
/// </summary>
/// <remarks>
/// Without Immediate or a DebounceInterval, a MudTextField passes its text on only when the user leaves it, so an
/// issue stays visible while the user types the text which resolves it. A text field with a validation therefore
/// sets DebounceInterval to this value and binds its Value, not its Text: bound by its text, the field would delay
/// the texts its parent sets as well, e.g., by a reset, and check them without having been touched.
/// </remarks>
public const double VALIDATION_DEBOUNCE_MILLISECONDS = 500;
}
@@ -24,9 +24,9 @@
@* The dashed frame shows that these fields belong together: they describe one
chat the launcher tile opens. *@
<MudPaper Class="pa-3 border-dashed border rounded-lg">
<MudTextField T="string" @bind-Text="@this.pluginName" Validation="@this.ValidatePluginName" AdornmentIcon="@AppIcons.PLUGIN" Adornment="Adornment.Start" IconSize="Size.Small" Label="@T("Plugin name")" HelperText="@T("The name shown on the plugins page.")" Variant="Variant.Outlined" Margin="Margin.Dense" Class="mb-3" Disabled="@this.IsBusy"/>
<MudTextField T="string" @bind-Text="@this.title" Validation="@this.ValidateTitle" AdornmentIcon="@AppIcons.NAME" Adornment="Adornment.Start" IconSize="Size.Small" Label="@T("Tile title")" HelperText="@T("The title shown on the tile.")" Variant="Variant.Outlined" Margin="Margin.Dense" Class="mb-3" Disabled="@this.IsBusy"/>
<MudTextField T="string" @bind-Text="@this.description" Validation="@this.ValidateDescription" AdornmentIcon="@AppIcons.DESCRIPTION" Adornment="Adornment.Start" IconSize="Size.Small" Label="@T("Description")" HelperText="@T("Shown on the tile and on the plugins page.")" Variant="Variant.Outlined" Margin="Margin.Dense" Lines="2" Sizing="InputSizing.Auto" MaxLines="6" Class="mb-3" Disabled="@this.IsBusy"/>
<MudTextField T="string" @bind-Value="@this.pluginName" Validation="@this.ValidatePluginName" DebounceInterval="@TextFieldDefaults.VALIDATION_DEBOUNCE_MILLISECONDS" AdornmentIcon="@AppIcons.PLUGIN" Adornment="Adornment.Start" IconSize="Size.Small" Label="@T("Plugin name")" HelperText="@T("The name shown on the plugins page.")" Variant="Variant.Outlined" Margin="Margin.Dense" Class="mb-3" Disabled="@this.IsBusy"/>
<MudTextField T="string" @bind-Value="@this.title" Validation="@this.ValidateTitle" DebounceInterval="@TextFieldDefaults.VALIDATION_DEBOUNCE_MILLISECONDS" AdornmentIcon="@AppIcons.NAME" Adornment="Adornment.Start" IconSize="Size.Small" Label="@T("Tile title")" HelperText="@T("The title shown on the tile.")" Variant="Variant.Outlined" Margin="Margin.Dense" Class="mb-3" Disabled="@this.IsBusy"/>
<MudTextField T="string" @bind-Value="@this.description" Validation="@this.ValidateDescription" DebounceInterval="@TextFieldDefaults.VALIDATION_DEBOUNCE_MILLISECONDS" AdornmentIcon="@AppIcons.DESCRIPTION" Adornment="Adornment.Start" IconSize="Size.Small" Label="@T("Description")" HelperText="@T("Shown on the tile and on the plugins page.")" Variant="Variant.Outlined" Margin="Margin.Dense" Lines="2" Sizing="InputSizing.Auto" MaxLines="6" Class="mb-3" Disabled="@this.IsBusy"/>
<DirectChatLauncherForm @bind-WorkspaceName="@this.workspaceName"
@bind-ProviderId="@this.providerId"
@bind-ProfileId="@this.profileId"
@@ -47,7 +47,7 @@
{
<MudTextField
T="string"
@bind-Text="@this.DataHostname"
@bind-Value="@this.DataHostname"
Label="@T("Hostname")"
Class="mb-3"
Adornment="Adornment.Start"
@@ -55,6 +55,7 @@
AdornmentColor="Color.Info"
Disabled="@this.IsEnterpriseConfiguration"
Validation="@this.providerValidation.ValidatingHostname"
DebounceInterval="@TextFieldDefaults.VALIDATION_DEBOUNCE_MILLISECONDS"
UserAttributes="@SPELLCHECK_ATTRIBUTES"/>
}
@@ -194,11 +195,12 @@
<MudStack Row="@true" Spacing="3" Class="mb-3" StretchItems="StretchItems.None" AlignItems="AlignItems.Center">
<MudTextField
T="string"
Text="@this.dataFilePath"
TextChanged="@this.OnDataFilePathChanged"
Value="@this.dataFilePath"
ValueChanged="@this.OnDataFilePathChanged"
Label="@T("Selected file path for the custom tokenizer")"
Disabled="@this.IsEnterpriseConfiguration"
Validation="@this.providerValidation.ValidatingCustomTokenizer"
DebounceInterval="@TextFieldDefaults.VALIDATION_DEBOUNCE_MILLISECONDS"
Adornment="Adornment.Start"
AdornmentIcon="@AppIcons.FILE"
UserAttributes="@SPELLCHECK_ATTRIBUTES"
@@ -49,7 +49,7 @@
{
<MudTextField
T="string"
@bind-Text="@this.DataHostname"
@bind-Value="@this.DataHostname"
Label="@T("Hostname")"
Class="mb-3"
Adornment="Adornment.Start"
@@ -57,6 +57,7 @@
AdornmentColor="Color.Info"
Disabled="@this.IsEnterpriseConfiguration"
Validation="@this.providerValidation.ValidatingHostname"
DebounceInterval="@TextFieldDefaults.VALIDATION_DEBOUNCE_MILLISECONDS"
UserAttributes="@SPELLCHECK_ATTRIBUTES"/>
}
@@ -104,13 +105,14 @@
</MudButton>
<MudTextField
T="string"
@bind-Text="@this.dataManuallyModel"
@bind-Value="@this.dataManuallyModel"
Label="@T("Model")"
Adornment="Adornment.Start"
AdornmentIcon="@AppIcons.MODEL"
AdornmentColor="Color.Info"
Disabled="@this.IsEnterpriseConfiguration"
Validation="@this.ValidateManuallyModel"
DebounceInterval="@TextFieldDefaults.VALIDATION_DEBOUNCE_MILLISECONDS"
UserAttributes="@SPELLCHECK_ATTRIBUTES"
HelperText="@TA("Currently, we cannot query the models for the selected provider and/or host. Therefore, please enter the model name manually.")"
/>
@@ -322,11 +324,12 @@
<MudStack Row="@true" Spacing="3" Class="mb-3" StretchItems="StretchItems.None" AlignItems="AlignItems.Center">
<MudTextField
T="string"
Text="@this.dataFilePath"
TextChanged="@this.OnDataFilePathChanged"
Value="@this.dataFilePath"
ValueChanged="@this.OnDataFilePathChanged"
Label="@T("Selected file path for the custom tokenizer")"
Disabled="@this.IsEnterpriseConfiguration"
Validation="@this.providerValidation.ValidatingCustomTokenizer"
DebounceInterval="@TextFieldDefaults.VALIDATION_DEBOUNCE_MILLISECONDS"
Adornment="Adornment.Start"
AdornmentIcon="@AppIcons.FILE"
UserAttributes="@SPELLCHECK_ATTRIBUTES"
@@ -47,7 +47,7 @@
{
<MudTextField
T="string"
@bind-Text="@this.DataHostname"
@bind-Value="@this.DataHostname"
Label="@T("Hostname")"
Class="mb-3"
Adornment="Adornment.Start"
@@ -55,6 +55,7 @@
AdornmentColor="Color.Info"
Disabled="@this.IsEnterpriseConfiguration"
Validation="@this.providerValidation.ValidatingHostname"
DebounceInterval="@TextFieldDefaults.VALIDATION_DEBOUNCE_MILLISECONDS"
UserAttributes="@SPELLCHECK_ATTRIBUTES"/>
}
@@ -20,4 +20,5 @@
- Fixed the Assistant Builder, which ignored the category you chose for your assistant. You can now also name a category of your own.
- Fixed assistant plugins which wrote numbers and dates according to the region settings of your computer. Plugins now show them the same way on every computer: a decimal number such as `12.5` keeps its point, and the `DateTime` helper writes the names of months in English.
- Fixed the translation, agenda, and e-mail assistants checking your input again and again in the background, about once a second, even while you weren't typing.
- Fixed the translation assistant complaining about a missing text before you had typed anything, e.g., right after you switched the live translation on or off.
- Fixed the translation assistant complaining about a missing text before you had typed anything, e.g., right after you switched the live translation on or off.
- Fixed text fields in assistants and dialogs which kept showing a missing or invalid input while you typed, until you left the field. They now check your input again half a second after you stop typing.
@@ -0,0 +1,174 @@
using System.Runtime.CompilerServices;
using System.Text.RegularExpressions;
using AIStudio.Components;
namespace AIStudio.Tests.Components;
/// <summary>
/// Checks that every text field with a validation checks its text again while the user types.
/// </summary>
/// <remarks>
/// Without Immediate or a DebounceInterval, a MudTextField passes its text on only when the user leaves it, so an
/// issue stays visible while the user types the text which resolves it. A field with a DebounceInterval binds its
/// Value, not its Text: bound by its text, it would delay the texts its parent sets as well, e.g., by a reset, and
/// check them without having been touched, see TextFieldDefaults. A read-only field takes no typing and needs neither.
/// </remarks>
[TestFixture]
public sealed partial class ValidatedTextFieldTests
{
private const string CHECKS_ON_LEAVING = "checks its text only when the user leaves it";
private const string DEBOUNCED_BY_TEXT = "binds its text, so it delays and checks the texts its parent sets as well";
[TestCase("""<MudTextField T="string" @bind-Value="@this.input" Validation="@this.Validate" DebounceInterval="@TextFieldDefaults.VALIDATION_DEBOUNCE_MILLISECONDS"/>""", ExpectedResult = "")]
[TestCase("""<MudTextField T="string" @bind-Text="@this.input" Validation="@this.Validate" Immediate="@true"/>""", ExpectedResult = "")]
[TestCase("""<MudTextField T="string" Text="@this.input" ReadOnly="@true" Validation="@this.Validate"/>""", ExpectedResult = "")]
[TestCase("""<MudTextField T="string" @bind-Text="@this.input" Label="@T("Name")"/>""", ExpectedResult = "")]
[TestCase("""<MudTextField T="string" @bind-Text="@this.input" Validation="@this.Validate"/>""", ExpectedResult = "1: " + CHECKS_ON_LEAVING)]
[TestCase("""<MudTextField T="string" @bind-Value="@this.input" Validation="@this.Validate" Immediate="@false"/>""", ExpectedResult = "1: " + CHECKS_ON_LEAVING)]
[TestCase("""<MudTextField T="string" @bind-Text="@this.input" Validation="@this.Validate" DebounceInterval="500"/>""", ExpectedResult = "1: " + DEBOUNCED_BY_TEXT)]
[TestCase("""<MudTextField T="string" Text="@this.input" TextChanged="@this.Set" Validation="@this.Validate" DebounceInterval="500"/>""", ExpectedResult = "1: " + DEBOUNCED_BY_TEXT)]
[TestCase("""<MudTextField T="string" Value="@this.input" ValueChanged="@(value => this.SetAsync(value))" OnKeyUp="() => this.Changed()" Sizing="@(this.MaxLines > this.Lines ? InputSizing.Auto : InputSizing.Fixed)" Label="@T("Name (a > b)")" Validation="@this.Validate"/>""", ExpectedResult = "1: " + CHECKS_ON_LEAVING)]
[TestCase("""
<MudTextField T="string"
@bind-Value="@this.first"
Validation="@this.Validate"
DebounceInterval="@TextFieldDefaults.VALIDATION_DEBOUNCE_MILLISECONDS"/>
<MudTextFieldExtended T="string" @bind-Text="@this.other" Validation="@this.Validate"/>
<MudTextField T="string" @bind-Text="@this.second" Validation="@this.Validate"/>
""", ExpectedResult = "6: " + CHECKS_ON_LEAVING)]
public string AValidatedTextFieldIsJudgedByHowItChecksWhileTheUserTypes(string razor) => string.Join(" | ", ValidatedTextFields(razor).SelectMany(field => IssuesOf(field).Select(issue => $"{field.Line}: {issue}")));
[Test]
public void EveryValidatedTextFieldChecksWhileTheUserTypes()
{
var appDirectory = AppSourceDirectory();
var fields = 0;
var issues = new List<string>();
foreach (var file in RazorFiles(appDirectory))
{
foreach (var field in ValidatedTextFields(File.ReadAllText(file)))
{
fields++;
issues.AddRange(IssuesOf(field).Select(issue => $"{Path.GetRelativePath(appDirectory, file)}:{field.Line}: {issue}"));
}
}
Assert.That(fields, Is.GreaterThan(50), "The test found too few text fields with a validation, so it probably misreads the Razor files.");
Assert.That(issues, Is.Empty, $"Give these text fields DebounceInterval=\"@{nameof(TextFieldDefaults)}.{nameof(TextFieldDefaults.VALIDATION_DEBOUNCE_MILLISECONDS)}\" and bind their Value:\n{string.Join('\n', issues)}");
}
/// <summary>
/// A MudTextField of a Razor source, from its opening angle bracket to its closing one.
/// </summary>
/// <param name="Line">The line on which the field starts, counted from 1.</param>
/// <param name="Source">The markup of the field.</param>
private sealed record TextFieldTag(int Line, string Source);
/// <summary>
/// Finds every MudTextField with a validation which takes typing, i.e., which is not read-only.
/// </summary>
private static IEnumerable<TextFieldTag> ValidatedTextFields(string razor)
{
foreach (Match start in TextFieldStartRegex().Matches(razor))
{
var tag = razor[start.Index..(TagEnd(razor, start.Index + start.Length) + 1)];
if (!ValidationRegex().IsMatch(tag) || ReadOnlyRegex().IsMatch(tag))
continue;
yield return new TextFieldTag(razor[..start.Index].Count(character => character == '\n') + 1, tag);
}
}
private static IEnumerable<string> IssuesOf(TextFieldTag field)
{
var isDebounced = DebounceRegex().IsMatch(field.Source);
if (!isDebounced && !ImmediateRegex().IsMatch(field.Source))
yield return CHECKS_ON_LEAVING;
if (isDebounced && TextBindingRegex().IsMatch(field.Source))
yield return DEBOUNCED_BY_TEXT;
}
/// <summary>
/// Finds the angle bracket which closes a tag.
/// </summary>
/// <remarks>
/// An attribute value may hold an angle bracket of its own, e.g., in a lambda or a comparison, and the C# code
/// inside its parentheses may hold strings with quotes, as @T("…") does. So the search skips attribute values,
/// counts parentheses, and skips the strings inside them.
/// </remarks>
private static int TagEnd(string razor, int position)
{
var depth = 0;
var isInsideValue = false;
for (; position < razor.Length; position++)
{
var character = razor[position];
if (depth > 0 && character == '"')
{
position = StringEnd(razor, position);
continue;
}
switch (character)
{
case '(' or '[' or '{':
depth++;
break;
case ')' or ']' or '}':
depth--;
break;
case '"' when depth == 0:
isInsideValue = !isInsideValue;
break;
case '>' when depth == 0 && !isInsideValue:
return position;
}
}
throw new InvalidOperationException("A MudTextField has no end.");
}
/// <summary>
/// Finds the quote which closes a C# string, skipping escaped characters.
/// </summary>
private static int StringEnd(string razor, int openingQuote)
{
for (var position = openingQuote + 1; position < razor.Length; position++)
{
if (razor[position] == '\\')
position++;
else if (razor[position] == '"')
return position;
}
throw new InvalidOperationException("A string inside a MudTextField has no end.");
}
private static IEnumerable<string> RazorFiles(string appDirectory) => Directory.EnumerateFiles(appDirectory, "*.razor", SearchOption.AllDirectories)
.Where(path => Path.GetRelativePath(appDirectory, path).Split(Path.DirectorySeparatorChar)[0] is not ("bin" or "obj" or "wwwroot"));
[GeneratedRegex(@"<MudTextField\b")]
private static partial Regex TextFieldStartRegex();
[GeneratedRegex(@"\sValidation=""")]
private static partial Regex ValidationRegex();
[GeneratedRegex(@"\sReadOnly=""@?true""")]
private static partial Regex ReadOnlyRegex();
[GeneratedRegex(@"\sImmediate=""(?!@?false"")")]
private static partial Regex ImmediateRegex();
[GeneratedRegex(@"\sDebounceInterval=""")]
private static partial Regex DebounceRegex();
[GeneratedRegex(@"(@bind-Text|\sText|\sTextChanged)=""")]
private static partial Regex TextBindingRegex();
private static string AppSourceDirectory([CallerFilePath] string sourceFilePath = "") => Path.GetFullPath(Path.Combine(Path.GetDirectoryName(sourceFilePath)!, "..", "..", "MindWork AI Studio"));
}