Improved chat options by moving it to the chat interface (#473)

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2025-05-21 20:23:44 +02:00
1 parent 206706f77a
commit 35eebc08a5
13 files changed
+288 -233

No files matched your search

+14 -10
View File
@@ -4,16 +4,20 @@
<div class="inner-scrolling-context">
<MudText Typo="Typo.h3" Class="mb-2 mr-3">
@if (this.chatThread is not null && this.chatThread.WorkspaceId != Guid.Empty)
{
@(T("Chat in Workspace") + $" \"{this.currentWorkspaceName}\"")
}
else
{
@(T("Disappearing Chat"))
}
</MudText>
<MudStack Row="true" AlignItems="AlignItems.Center" Class="mb-2 mr-3" StretchItems="StretchItems.Start">
<MudText Typo="Typo.h3">
@if (this.chatThread is not null && this.chatThread.WorkspaceId != Guid.Empty)
{
@(T("Chat in Workspace") + $" \"{this.currentWorkspaceName}\"")
}
else
{
@T("Disappearing Chat")
}
</MudText>
<MudIconButton Variant="Variant.Text" Icon="@Icons.Material.Filled.Settings" Color="Color.Default" OnClick="@this.OpenSettingsDialog"/>
</MudStack>
<ProviderSelection @bind-ProviderSettings="@this.providerSettings"/>
@if (this.AreWorkspacesVisible)
@@ -1,8 +1,10 @@
using AIStudio.Chat;
using AIStudio.Components;
using AIStudio.Dialogs.Settings;
using AIStudio.Settings.DataModel;
using Microsoft.AspNetCore.Components;
using DialogOptions = AIStudio.Dialogs.DialogOptions;
using Timer = System.Timers.Timer;
@@ -15,6 +17,9 @@ public partial class Chat : MSGComponentBase
{
private const Placement TOOLBAR_TOOLTIP_PLACEMENT = Placement.Bottom;
[Inject]
private IDialogService DialogService { get; init; } = null!;
private ChatThread? chatThread;
private AIStudio.Settings.Provider providerSettings;
private bool workspaceOverlayVisible;
@@ -80,6 +85,13 @@ public partial class Chat : MSGComponentBase
this.StateHasChanged();
}
private async Task OpenSettingsDialog()
{
var dialogParameters = new DialogParameters();
await this.DialogService.ShowAsync<SettingsDialogChat>(T("Open Chat Options"), dialogParameters, DialogOptions.FULLSCREEN);
}
#region Overrides of MSGComponentBase
protected override Task ProcessIncomingMessage<T>(ComponentBase? sendingComponent, Event triggeredEvent, T? data) where T : default
@@ -17,7 +17,6 @@
<SettingsPanelProfiles AvailableLLMProvidersFunc="() => this.availableLLMProviders"/>
<SettingsPanelApp AvailableLLMProvidersFunc="() => this.availableLLMProviders"/>
<SettingsPanelChat AvailableLLMProvidersFunc="() => this.availableLLMProviders"/>
<SettingsPanelWorkspaces AvailableLLMProvidersFunc="() => this.availableLLMProviders"/>
@if (PreviewFeatures.PRE_RAG_2024.IsEnabled(this.SettingsManager))