mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-02-05 14:49:06 +00:00
Fixed the bug where the user input was not cleared in the chat (#134)
This commit is contained in:
parent
a5bdb3267b
commit
54588fc92d
@ -47,9 +47,8 @@ public partial class Chat : MSGComponentBase, IAsyncDisposable
|
||||
private bool mustScrollToBottomAfterRender;
|
||||
private byte scrollRenderCountdown;
|
||||
|
||||
// Unfortunately, we need the input field reference to clear it after sending a message.
|
||||
// This is necessary because we have to handle the key events ourselves. Otherwise,
|
||||
// the clearing would be done automatically.
|
||||
// Unfortunately, we need the input field reference to blur the focus away. Without
|
||||
// this, we cannot clear the input field.
|
||||
private MudTextField<string> inputField = null!;
|
||||
|
||||
#region Overrides of ComponentBase
|
||||
@ -142,6 +141,10 @@ public partial class Chat : MSGComponentBase, IAsyncDisposable
|
||||
if (!this.IsProviderSelected)
|
||||
return;
|
||||
|
||||
// We need to blur the focus away from the input field
|
||||
// to be able to clear the field:
|
||||
await this.inputField.BlurAsync();
|
||||
|
||||
// Create a new chat thread if necessary:
|
||||
var threadName = this.ExtractThreadName(this.userInput);
|
||||
|
||||
@ -210,7 +213,6 @@ public partial class Chat : MSGComponentBase, IAsyncDisposable
|
||||
});
|
||||
|
||||
// Clear the input field:
|
||||
await this.inputField.Clear();
|
||||
this.userInput = string.Empty;
|
||||
|
||||
// Enable the stream state for the chat component:
|
||||
@ -358,7 +360,7 @@ public partial class Chat : MSGComponentBase, IAsyncDisposable
|
||||
};
|
||||
}
|
||||
|
||||
await this.inputField.Clear();
|
||||
this.userInput = string.Empty;
|
||||
}
|
||||
|
||||
private async Task MoveChatToWorkspace()
|
||||
@ -427,8 +429,8 @@ public partial class Chat : MSGComponentBase, IAsyncDisposable
|
||||
this.userInput = string.Empty;
|
||||
this.currentWorkspaceId = this.chatThread?.WorkspaceId ?? Guid.Empty;
|
||||
this.currentWorkspaceName = this.chatThread is null ? string.Empty : await this.workspaces.LoadWorkspaceName(this.chatThread.WorkspaceId);
|
||||
|
||||
await this.inputField.Clear();
|
||||
|
||||
this.userInput = string.Empty;
|
||||
if (this.SettingsManager.ConfigurationData.Chat.ShowLatestMessageAfterLoading)
|
||||
{
|
||||
this.mustScrollToBottomAfterRender = true;
|
||||
|
@ -5,6 +5,7 @@
|
||||
- Added the possibility to preselect any of your profiles as the default profile for the entire app or configure individual profiles for assistants and chats.
|
||||
- Added an introductory description to the provider settings.
|
||||
- Added an indicator for the current and maximal length of the provider instance name.
|
||||
- Fixed the annoying bug that input made in the chat interface was not cleared when sending the message using hotkeys.
|
||||
- Fixed the bug that the model name for Fireworks was not loaded when editing the provider settings.
|
||||
- Fixed a bug where it was possible that the chat interface was not scrolling to the bottom when new messages were added.
|
||||
- Improved hyphenation for continuous text so that the rules of the respective language are taken into account where possible.
|
||||
|
Loading…
Reference in New Issue
Block a user