From e15f1ce54e54c87490bb6780ed67ced559069a82 Mon Sep 17 00:00:00 2001 From: Thorsten Sommer Date: Sat, 14 Mar 2026 10:37:31 +0100 Subject: [PATCH] Fixed "Send to" options based on assistant visibility (#695) --- AGENTS.md | 25 ++++++++++++++++--- .../Assistants/AssistantBase.razor | 23 +++++++++-------- .../Assistants/AssistantBase.razor.cs | 22 +++++++++++++++- .../wwwroot/changelog/v26.3.1.md | 3 ++- 4 files changed, 58 insertions(+), 15 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 02078f06..49524e17 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -144,7 +144,7 @@ Multi-level confidence scheme allows users to control which providers see which **Rust:** - Tauri 1.8 - Desktop application framework -- Rocket 0.5 - HTTPS API server +- Rocket - HTTPS API server - tokio - Async runtime - keyring - OS keyring integration - pdfium-render - PDF text extraction @@ -152,7 +152,7 @@ Multi-level confidence scheme allows users to control which providers see which **.NET:** - Blazor Server - UI framework -- MudBlazor 8.12 - Component library +- MudBlazor - Component library - LuaCSharp - Lua scripting engine - HtmlAgilityPack - HTML parsing - ReverseMarkdown - HTML to Markdown conversion @@ -168,7 +168,7 @@ Multi-level confidence scheme allows users to control which providers see which 1. Create changelog file: `app/MindWork AI Studio/wwwroot/changelog/vX.Y.Z.md` 2. Commit changelog -3. Run from `app/Build`: `dotnet run release --action ` +3. Run from `app/Build`: `dotnet run release --action ` 4. Create PR with version bump and changes 5. After PR merge, maintainer creates git tag: `vX.Y.Z` 6. GitHub Actions builds release binaries for all platforms @@ -183,3 +183,22 @@ Multi-level confidence scheme allows users to control which providers see which - **MudBlazor** - Component library requires DI setup in Program.cs - **Encryption** - Initialized before Rust service is marked ready - **Message Bus** - Singleton event bus for cross-component communication inside the .NET app + +## Changelogs +Changelogs are located in `app/MindWork AI Studio/wwwroot/changelog/` with filenames `vX.Y.Z.md`. These changelogs are meant to be for normal end-users +and should be written in a non-technical way, focusing on user-facing changes and improvements. Additionally, changes made regarding the plugin system +should be included in the changelog, especially if they affect how users can configure the app or if they introduce new capabilities for plugins. Plugin +developers should also be informed about these changes, as they might need to update their plugins accordingly. When adding entries to the changelog, +please ensure they are clear and concise, avoiding technical jargon where possible. Each entry starts with a dash and a space (`- `) and one of the +following words: + +- Added +- Improved +- Changed +- Fixed +- Updated +- Removed +- Downgraded +- Upgraded + +The entire changelog is sorted by these categories in the order shown above. The language used for the changelog is US English. \ No newline at end of file diff --git a/app/MindWork AI Studio/Assistants/AssistantBase.razor b/app/MindWork AI Studio/Assistants/AssistantBase.razor index 5fee5f0a..781bceaa 100644 --- a/app/MindWork AI Studio/Assistants/AssistantBase.razor +++ b/app/MindWork AI Studio/Assistants/AssistantBase.razor @@ -80,10 +80,10 @@ @if (!this.FooterButtons.Any(x => x.Type is ButtonTypes.SEND_TO)) { - @if (this.ShowSendTo) + @if (this.ShowSendTo && this.VisibleSendToAssistants.Count > 0) { - @foreach (var assistant in Enum.GetValues().Where(n => n.AllowSendTo()).OrderBy(n => n.Name().Length)) + @foreach (var assistant in this.VisibleSendToAssistants) { @assistant.Name() @@ -112,14 +112,17 @@ break; case SendToButton sendToButton: - - @foreach (var assistant in Enum.GetValues().Where(n => n.AllowSendTo()).OrderBy(n => n.Name().Length)) - { - - @assistant.Name() - - } - + @if (this.VisibleSendToAssistants.Count > 0) + { + + @foreach (var assistant in this.VisibleSendToAssistants) + { + + @assistant.Name() + + } + + } break; } } diff --git a/app/MindWork AI Studio/Assistants/AssistantBase.razor.cs b/app/MindWork AI Studio/Assistants/AssistantBase.razor.cs index a91f2b57..632722ab 100644 --- a/app/MindWork AI Studio/Assistants/AssistantBase.razor.cs +++ b/app/MindWork AI Studio/Assistants/AssistantBase.razor.cs @@ -105,6 +105,13 @@ public abstract partial class AssistantBase : AssistantLowerBase wher protected override async Task OnInitializedAsync() { await base.OnInitializedAsync(); + + if (!this.SettingsManager.IsAssistantVisible(this.Component, assistantName: this.Title)) + { + this.Logger.LogInformation("Assistant '{AssistantTitle}' is hidden. Redirecting to the assistants overview.", this.Title); + this.NavigationManager.NavigateTo(Routes.ASSISTANTS); + return; + } this.formChangeTimer.AutoReset = false; this.formChangeTimer.Elapsed += async (_, _) => @@ -142,6 +149,11 @@ public abstract partial class AssistantBase : AssistantLowerBase wher private string TB(string fallbackEN) => this.T(fallbackEN, typeof(AssistantBase).Namespace, nameof(AssistantBase)); private string SubmitButtonStyle => this.SettingsManager.ConfigurationData.LLMProviders.ShowProviderConfidence ? this.providerSettings.UsedLLMProvider.GetConfidence(this.SettingsManager).StyleBorder(this.SettingsManager) : string.Empty; + + private IReadOnlyList VisibleSendToAssistants => Enum.GetValues() + .Where(this.CanSendToAssistant) + .OrderBy(component => component.Name().Length) + .ToArray(); protected string? ValidatingProvider(AIStudio.Settings.Provider provider) { @@ -339,7 +351,7 @@ public abstract partial class AssistantBase : AssistantLowerBase wher protected Task SendToAssistant(Tools.Components destination, SendToButton sendToButton) { - if (!destination.AllowSendTo()) + if (!this.CanSendToAssistant(destination)) return Task.CompletedTask; var contentToSend = sendToButton == default ? string.Empty : sendToButton.UseResultingContentBlockData switch @@ -369,6 +381,14 @@ public abstract partial class AssistantBase : AssistantLowerBase wher this.NavigationManager.NavigateTo(sendToData.Route); return Task.CompletedTask; } + + private bool CanSendToAssistant(Tools.Components component) + { + if (!component.AllowSendTo()) + return false; + + return this.SettingsManager.IsAssistantVisible(component, withLogging: false); + } private async Task InnerResetForm() { diff --git a/app/MindWork AI Studio/wwwroot/changelog/v26.3.1.md b/app/MindWork AI Studio/wwwroot/changelog/v26.3.1.md index 1fc66926..6cf09bdc 100644 --- a/app/MindWork AI Studio/wwwroot/changelog/v26.3.1.md +++ b/app/MindWork AI Studio/wwwroot/changelog/v26.3.1.md @@ -9,4 +9,5 @@ - Improved the logbook reliability by significantly reducing duplicate log entries. - Improved file attachments in chats: configuration and project files such as `Dockerfile`, `Caddyfile`, `Makefile`, or `Jenkinsfile` are now included more reliably when you send them to the AI. - Improved the validation of additional API parameters in the advanced provider settings to help catch formatting mistakes earlier. -- Fixed an issue where the app could turn white or appear invisible in certain chats after HTML-like content was shown. Thanks Inga for reporting this issue and providing some context on how to reproduce it. \ No newline at end of file +- Fixed an issue where assistants hidden via configuration plugins still appear in "Send to ..." menus. Thanks, Gunnar, for reporting this issue. +- Fixed an issue where the app could turn white or appear invisible in certain chats after HTML-like content was shown. Thanks, Inga, for reporting this issue and providing some context on how to reproduce it. \ No newline at end of file