mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-17 01:58:38 +00:00
Locked changes to a chat while an answer is being written (#1058)
This commit is contained in:
1 parent
88d1f4d96a
commit
fbb65fd72d
19 files changed
+841
-59
No files matched your search
@@ -32,7 +32,7 @@
|
||||
</MudStack>
|
||||
|
||||
<CascadingValue Value="Components.CHAT">
|
||||
<ProviderSelection @bind-ProviderSettings="@this.providerSettings"/>
|
||||
<ProviderSelection @bind-ProviderSettings="@this.providerSettings" Disabled="@this.isAnswerBeingWritten"/>
|
||||
</CascadingValue>
|
||||
@if (this.AreWorkspacesVisible)
|
||||
{
|
||||
@@ -97,6 +97,7 @@
|
||||
<ChatComponent
|
||||
@bind-ChatThread="@this.chatThread"
|
||||
@bind-Provider="@this.providerSettings"
|
||||
IsAnswerBeingWrittenChanged="@(isBeingWritten => this.isAnswerBeingWritten = isBeingWritten)"
|
||||
ComposerState="@this.composerState"
|
||||
Workspaces="@this.workspaces"
|
||||
WorkspaceName="name => this.UpdateWorkspaceName(name)"/>
|
||||
@@ -124,6 +125,7 @@
|
||||
<ChatComponent
|
||||
@bind-ChatThread="@this.chatThread"
|
||||
@bind-Provider="@this.providerSettings"
|
||||
IsAnswerBeingWrittenChanged="@(isBeingWritten => this.isAnswerBeingWritten = isBeingWritten)"
|
||||
ComposerState="@this.composerState"
|
||||
Workspaces="@this.workspaces"
|
||||
WorkspaceName="name => this.UpdateWorkspaceName(name)"/>
|
||||
@@ -135,6 +137,7 @@
|
||||
<ChatComponent
|
||||
@bind-ChatThread="@this.chatThread"
|
||||
@bind-Provider="@this.providerSettings"
|
||||
IsAnswerBeingWrittenChanged="@(isBeingWritten => this.isAnswerBeingWritten = isBeingWritten)"
|
||||
ComposerState="@this.composerState"
|
||||
Workspaces="@this.workspaces"
|
||||
WorkspaceName="name => this.UpdateWorkspaceName(name)"/>
|
||||
|
||||
@@ -22,6 +22,17 @@ public partial class Chat : MSGComponentBase
|
||||
|
||||
private ChatThread? chatThread;
|
||||
private AIStudio.Settings.Provider providerSettings = AIStudio.Settings.Provider.NONE;
|
||||
|
||||
/// <summary>
|
||||
/// Whether an answer is being written for the open chat, as the chat component last told.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The provider selection is locked meanwhile. Another provider would not reach the answer, which
|
||||
/// keeps the one it started with, but the chat would show the other one while the answer is still
|
||||
/// being written.
|
||||
/// </remarks>
|
||||
private bool isAnswerBeingWritten;
|
||||
|
||||
private bool workspaceOverlayVisible;
|
||||
private bool workspaceSearchVisible;
|
||||
private string currentWorkspaceName = string.Empty;
|
||||
|
||||
Reference in new issue
Block a user