Improved file attachment handling in assistants & dialogs (#840)

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2026-07-06 20:27:25 +02:00
1 parent 423330f1b9
commit 4a15ff2665
19 files changed
+350 -293

No files matched your search

@@ -1,19 +1,13 @@
@attribute [Route(Routes.ASSISTANT_CODING)]
@inherits AssistantBaseCore<AIStudio.Dialogs.Settings.SettingsDialogCoding>
<MudExpansionPanels Class="mb-3">
@for (var contextIndex = 0; contextIndex < this.codingContexts.Count; contextIndex++)
{
var codingContext = this.codingContexts[contextIndex];
var index = contextIndex;
<ExpansionPanel HeaderText="@codingContext.Id" HeaderIcon="@Icons.Material.Filled.Code" ShowEndButton="@true" EndButtonColor="Color.Error" EndButtonIcon="@Icons.Material.Filled.Delete" EndButtonTooltip="@T("Delete context")" EndButtonClickAsync="@(() => this.DeleteContext(index))">
<CodingContextItem @bind-CodingContext="@codingContext"/>
</ExpansionPanel>
}
</MudExpansionPanels>
<MudButton Variant="Variant.Filled" OnClick="() => this.AddCodingContext()" Class="mb-3">
@T("Add context")
</MudButton>
<MudText Typo="Typo.h5" Class="mb-1 mt-3">@T("Context")</MudText>
<MudJustifiedText Typo="Typo.body1" Class="mb-2">
@T("You can attach source files as optional context for your coding question.")
</MudJustifiedText>
<div class="mb-3">
<AttachDocuments Name="Coding Source Files" Layer="@DropLayers.ASSISTANTS" @bind-DocumentPaths="@this.loadedDocumentPaths" CatchAllDocuments="true" UseSmallForm="false" Provider="@this.ProviderSettings"/>
</div>
<MudStack Row="@false" Class="mb-3">
<MudTextSwitch Label="@T("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")" />
@@ -24,4 +18,4 @@
</MudStack>
<MudTextField T="string" @bind-Text="@this.questions" Validation="@this.ValidateQuestions" AdornmentIcon="@Icons.Material.Filled.QuestionMark" Adornment="Adornment.Start" Label="@T("Your question(s)")" Variant="Variant.Outlined" Lines="6" AutoGrow="@true" MaxLines="12" Class="mb-3" UserAttributes="@USER_INPUT_ATTRIBUTES"/>
<ProviderSelection @bind-ProviderSettings="@this.ProviderSettings" ValidateProvider="@this.ValidatingProvider"/>
<ProviderSelection @bind-ProviderSettings="@this.ProviderSettings" ValidateProvider="@this.ValidatingProvider"/>