diff --git a/app/MindWork AI Studio/Assistants/AssistantBase.razor.cs b/app/MindWork AI Studio/Assistants/AssistantBase.razor.cs index b589f8f..8e5b60d 100644 --- a/app/MindWork AI Studio/Assistants/AssistantBase.razor.cs +++ b/app/MindWork AI Studio/Assistants/AssistantBase.razor.cs @@ -147,6 +147,8 @@ public abstract partial class AssistantBase : ComponentBase, IMessageBusReceiver #region Implementation of IMessageBusReceiver + public string ComponentName => nameof(AssistantBase); + public Task ProcessMessage(ComponentBase? sendingComponent, Event triggeredEvent, T? data) { switch (triggeredEvent) diff --git a/app/MindWork AI Studio/Components/AssistantBlock.razor.cs b/app/MindWork AI Studio/Components/AssistantBlock.razor.cs index f79b7bd..2d109c6 100644 --- a/app/MindWork AI Studio/Components/AssistantBlock.razor.cs +++ b/app/MindWork AI Studio/Components/AssistantBlock.razor.cs @@ -44,6 +44,8 @@ public partial class AssistantBlock : ComponentBase, IMessageBusReceiver, IDispo #region Implementation of IMessageBusReceiver + public string ComponentName => nameof(AssistantBlock); + public Task ProcessMessage(ComponentBase? sendingComponent, Event triggeredEvent, T? data) { switch (triggeredEvent) diff --git a/app/MindWork AI Studio/Components/ChatComponent.razor.cs b/app/MindWork AI Studio/Components/ChatComponent.razor.cs index 5ca0ebd..d9e597b 100644 --- a/app/MindWork AI Studio/Components/ChatComponent.razor.cs +++ b/app/MindWork AI Studio/Components/ChatComponent.razor.cs @@ -525,10 +525,20 @@ public partial class ChatComponent : MSGComponentBase, IAsyncDisposable this.isStreaming = false; this.hasUnsavedChanges = false; this.userInput = string.Empty; - this.currentWorkspaceId = this.ChatThread?.WorkspaceId ?? Guid.Empty; - this.currentWorkspaceName = this.ChatThread is null ? string.Empty : await WorkspaceBehaviour.LoadWorkspaceName(this.ChatThread.WorkspaceId); - this.WorkspaceName(this.currentWorkspaceName); - + + if (this.ChatThread is not null) + { + this.currentWorkspaceId = this.ChatThread.WorkspaceId; + this.currentWorkspaceName = await WorkspaceBehaviour.LoadWorkspaceName(this.ChatThread.WorkspaceId); + this.WorkspaceName(this.currentWorkspaceName); + } + else + { + this.currentWorkspaceId = Guid.Empty; + this.currentWorkspaceName = string.Empty; + this.WorkspaceName(this.currentWorkspaceName); + } + await this.SelectProviderWhenLoadingChat(); if (this.SettingsManager.ConfigurationData.Chat.ShowLatestMessageAfterLoading) { @@ -653,6 +663,8 @@ public partial class ChatComponent : MSGComponentBase, IAsyncDisposable #region Overrides of MSGComponentBase + public override string ComponentName => nameof(ChatComponent); + public override async Task ProcessIncomingMessage(ComponentBase? sendingComponent, Event triggeredEvent, T? data) where T : default { switch (triggeredEvent) @@ -692,6 +704,7 @@ public partial class ChatComponent : MSGComponentBase, IAsyncDisposable public async ValueTask DisposeAsync() { + this.MessageBus.Unregister(this); if(this.SettingsManager.ConfigurationData.Workspace.StorageBehavior is WorkspaceStorageBehavior.STORE_CHATS_AUTOMATICALLY) { await this.SaveThread(); diff --git a/app/MindWork AI Studio/Components/ConfidenceInfo.razor.cs b/app/MindWork AI Studio/Components/ConfidenceInfo.razor.cs index a541b27..97db85f 100644 --- a/app/MindWork AI Studio/Components/ConfidenceInfo.razor.cs +++ b/app/MindWork AI Studio/Components/ConfidenceInfo.razor.cs @@ -63,6 +63,8 @@ public partial class ConfidenceInfo : ComponentBase, IMessageBusReceiver, IDispo #region Implementation of IMessageBusReceiver + public string ComponentName => nameof(ConfidenceInfo); + public Task ProcessMessage(ComponentBase? sendingComponent, Event triggeredEvent, T? data) { switch (triggeredEvent) diff --git a/app/MindWork AI Studio/Components/ConfigurationBase.razor.cs b/app/MindWork AI Studio/Components/ConfigurationBase.razor.cs index 6951c5e..64217ff 100644 --- a/app/MindWork AI Studio/Components/ConfigurationBase.razor.cs +++ b/app/MindWork AI Studio/Components/ConfigurationBase.razor.cs @@ -57,6 +57,8 @@ public partial class ConfigurationBase : ComponentBase, IMessageBusReceiver, IDi #region Implementation of IMessageBusReceiver + public string ComponentName => nameof(ConfigurationBase); + public Task ProcessMessage(ComponentBase? sendingComponent, Event triggeredEvent, TMsg? data) { switch (triggeredEvent) diff --git a/app/MindWork AI Studio/Components/ConfigurationProviderSelection.razor.cs b/app/MindWork AI Studio/Components/ConfigurationProviderSelection.razor.cs index 7e93e76..debeae0 100644 --- a/app/MindWork AI Studio/Components/ConfigurationProviderSelection.razor.cs +++ b/app/MindWork AI Studio/Components/ConfigurationProviderSelection.razor.cs @@ -60,6 +60,8 @@ public partial class ConfigurationProviderSelection : ComponentBase, IMessageBus #region Implementation of IMessageBusReceiver + public string ComponentName => nameof(ConfigurationProviderSelection); + public async Task ProcessMessage(ComponentBase? sendingComponent, Event triggeredEvent, T? data) { switch (triggeredEvent) diff --git a/app/MindWork AI Studio/Components/InnerScrolling.razor.cs b/app/MindWork AI Studio/Components/InnerScrolling.razor.cs index 3b483c4..29f4847 100644 --- a/app/MindWork AI Studio/Components/InnerScrolling.razor.cs +++ b/app/MindWork AI Studio/Components/InnerScrolling.razor.cs @@ -50,6 +50,8 @@ public partial class InnerScrolling : MSGComponentBase #region Overrides of MSGComponentBase + public override string ComponentName => nameof(InnerScrolling); + public override Task ProcessIncomingMessage(ComponentBase? sendingComponent, Event triggeredEvent, T? data) where T : default { switch (triggeredEvent) diff --git a/app/MindWork AI Studio/Components/MSGComponentBase.cs b/app/MindWork AI Studio/Components/MSGComponentBase.cs index 940ec78..4dddb57 100644 --- a/app/MindWork AI Studio/Components/MSGComponentBase.cs +++ b/app/MindWork AI Studio/Components/MSGComponentBase.cs @@ -24,6 +24,8 @@ public abstract class MSGComponentBase : ComponentBase, IDisposable, IMessageBus #region Implementation of IMessageBusReceiver + public abstract string ComponentName { get; } + public Task ProcessMessage(ComponentBase? sendingComponent, Event triggeredEvent, T? data) { switch (triggeredEvent) diff --git a/app/MindWork AI Studio/Layout/MainLayout.razor.cs b/app/MindWork AI Studio/Layout/MainLayout.razor.cs index e18afe1..47a09be 100644 --- a/app/MindWork AI Studio/Layout/MainLayout.razor.cs +++ b/app/MindWork AI Studio/Layout/MainLayout.razor.cs @@ -136,6 +136,8 @@ public partial class MainLayout : LayoutComponentBase, IMessageBusReceiver, IDis #region Implementation of IMessageBusReceiver + public string ComponentName => nameof(MainLayout); + public async Task ProcessMessage(ComponentBase? sendingComponent, Event triggeredEvent, T? data) { switch (triggeredEvent) diff --git a/app/MindWork AI Studio/Pages/Chat.razor.cs b/app/MindWork AI Studio/Pages/Chat.razor.cs index 8546b64..1609a22 100644 --- a/app/MindWork AI Studio/Pages/Chat.razor.cs +++ b/app/MindWork AI Studio/Pages/Chat.razor.cs @@ -28,6 +28,8 @@ public partial class Chat : MSGComponentBase protected override async Task OnInitializedAsync() { + this.ApplyFilters([], [ Event.WORKSPACE_TOGGLE_OVERLAY ]); + this.splitterPosition = this.SettingsManager.ConfigurationData.Workspace.SplitterPosition; this.splitterSaveTimer.AutoReset = false; this.splitterSaveTimer.Elapsed += async (_, _) => @@ -74,6 +76,8 @@ public partial class Chat : MSGComponentBase #region Overrides of MSGComponentBase + public override string ComponentName => nameof(Chat); + public override Task ProcessIncomingMessage(ComponentBase? sendingComponent, Event triggeredEvent, T? data) where T : default { switch (triggeredEvent) diff --git a/app/MindWork AI Studio/Pages/Settings.razor.cs b/app/MindWork AI Studio/Pages/Settings.razor.cs index 6baf7f1..600f4e9 100644 --- a/app/MindWork AI Studio/Pages/Settings.razor.cs +++ b/app/MindWork AI Studio/Pages/Settings.razor.cs @@ -28,6 +28,8 @@ public partial class Settings : ComponentBase, IMessageBusReceiver, IDisposable #region Implementation of IMessageBusReceiver + public string ComponentName => nameof(Settings); + public Task ProcessMessage(ComponentBase? sendingComponent, Event triggeredEvent, TMsg? data) { switch (triggeredEvent) diff --git a/app/MindWork AI Studio/Pages/Writer.razor.cs b/app/MindWork AI Studio/Pages/Writer.razor.cs index 7b6a8cf..5816074 100644 --- a/app/MindWork AI Studio/Pages/Writer.razor.cs +++ b/app/MindWork AI Studio/Pages/Writer.razor.cs @@ -41,6 +41,8 @@ public partial class Writer : MSGComponentBase, IAsyncDisposable #region Overrides of MSGComponentBase + public override string ComponentName => nameof(Writer); + public override Task ProcessIncomingMessage(ComponentBase? sendingComponent, Event triggeredEvent, T? data) where T : default { return Task.CompletedTask; diff --git a/app/MindWork AI Studio/Tools/IMessageBusReceiver.cs b/app/MindWork AI Studio/Tools/IMessageBusReceiver.cs index 019ce11..044e425 100644 --- a/app/MindWork AI Studio/Tools/IMessageBusReceiver.cs +++ b/app/MindWork AI Studio/Tools/IMessageBusReceiver.cs @@ -4,6 +4,8 @@ namespace AIStudio.Tools; public interface IMessageBusReceiver { + public string ComponentName { get; } + public Task ProcessMessage(ComponentBase? sendingComponent, Event triggeredEvent, T? data); public Task ProcessMessageWithResult(ComponentBase? sendingComponent, Event triggeredEvent, TPayload? data); diff --git a/app/MindWork AI Studio/Tools/Services/UpdateService.cs b/app/MindWork AI Studio/Tools/Services/UpdateService.cs index 8de0690..bfabc7a 100644 --- a/app/MindWork AI Studio/Tools/Services/UpdateService.cs +++ b/app/MindWork AI Studio/Tools/Services/UpdateService.cs @@ -60,6 +60,8 @@ public sealed class UpdateService : BackgroundService, IMessageBusReceiver #region Implementation of IMessageBusReceiver + public string ComponentName => nameof(UpdateService); + public async Task ProcessMessage(ComponentBase? sendingComponent, Event triggeredEvent, T? data) { switch (triggeredEvent) diff --git a/app/MindWork AI Studio/wwwroot/changelog/v0.9.27.md b/app/MindWork AI Studio/wwwroot/changelog/v0.9.27.md index 13aac2b..d77bbc9 100644 --- a/app/MindWork AI Studio/wwwroot/changelog/v0.9.27.md +++ b/app/MindWork AI Studio/wwwroot/changelog/v0.9.27.md @@ -1,4 +1,6 @@ # v0.9.27, build 202 (2025-01-xx xx:xx UTC) - Improved the inner content scrolling to use the entire space available. +- Improved message process debugging. This helps to identify issues related to the message handling. - Fixed the hostname validation message for ERI v1 data sources. +- Fixed a memory leak in the chat component. - Removed the "send to" button from the ERI server assistant, since it is not supported. \ No newline at end of file