inject spell checking into text fields of dynamic assistant

This commit is contained in:
Nils Kruthoff 2026-07-06 17:48:07 +02:00
parent 5ea2d35dcd
commit 87721686c6
No known key found for this signature in database
GPG Key ID: A5C0151B4DDB172C
2 changed files with 5 additions and 0 deletions

View File

@ -74,6 +74,7 @@ else
var autoGrow = !textArea.IsSingleLine;
<MudTextField T="string"
UserAttributes="@SPELLCHECK_ATTRIBUTES"
Text="@this.assistantState.Text[textArea.Name]"
TextChanged="@(value => this.assistantState.Text[textArea.Name] = value)"
Label="@textArea.Label"

View File

@ -50,6 +50,7 @@ public partial class AssistantDynamic : AssistantBaseCore<NoSettingsPanel>
private string securityMessage = string.Empty;
private bool isSecurityBlocked;
private const string ASSISTANT_QUERY_KEY = "assistantId";
private static readonly Dictionary<string, object?> SPELLCHECK_ATTRIBUTES = new();
private static readonly AssistantSessionStateKey<string> TITLE_STATE_KEY = new(nameof(title));
private static readonly AssistantSessionStateKey<string> DESCRIPTION_STATE_KEY = new(nameof(description));
private static readonly AssistantSessionStateKey<string> SYSTEM_PROMPT_STATE_KEY = new(nameof(systemPrompt));
@ -110,6 +111,9 @@ public partial class AssistantDynamic : AssistantBaseCore<NoSettingsPanel>
protected override void OnInitialized()
{
// Configure the spellchecking for the instance name input:
this.SettingsManager.InjectSpellchecking(SPELLCHECK_ATTRIBUTES);
var pluginAssistant = this.ResolveAssistantPlugin();
if (pluginAssistant is null)
{