Replace fileAttachments with chatDocumentPaths for consistency and cleanup.

This commit is contained in:
hart_s3 2025-12-09 15:10:51 +01:00
parent 4fdad99652
commit 3f2dc26cab

View File

@ -57,7 +57,6 @@ public partial class ChatComponent : MSGComponentBase, IAsyncDisposable
private string currentWorkspaceName = string.Empty; private string currentWorkspaceName = string.Empty;
private Guid currentWorkspaceId = Guid.Empty; private Guid currentWorkspaceId = Guid.Empty;
private CancellationTokenSource? cancellationTokenSource; private CancellationTokenSource? cancellationTokenSource;
private List<string> fileAttachments = new();
private HashSet<string> chatDocumentPaths = []; private HashSet<string> chatDocumentPaths = [];
// Unfortunately, we need the input field reference to blur the focus away. Without // Unfortunately, we need the input field reference to blur the focus away. Without
@ -464,7 +463,7 @@ public partial class ChatComponent : MSGComponentBase, IAsyncDisposable
lastUserPrompt = new ContentText lastUserPrompt = new ContentText
{ {
Text = this.userInput, Text = this.userInput,
FileAttachments = this.fileAttachments.ToList(), // Create a copy FileAttachments = this.chatDocumentPaths.ToList(), // Create a copy
}; };
// //
@ -510,7 +509,7 @@ public partial class ChatComponent : MSGComponentBase, IAsyncDisposable
// Clear the input field: // Clear the input field:
await this.inputField.FocusAsync(); await this.inputField.FocusAsync();
this.userInput = string.Empty; this.userInput = string.Empty;
this.fileAttachments.Clear(); this.chatDocumentPaths.Clear();
await this.inputField.BlurAsync(); await this.inputField.BlurAsync();
// Enable the stream state for the chat component: // Enable the stream state for the chat component: