Fixed the spellchecking of the visual briefing text fields

This commit is contained in:
Thorsten Sommer 2026-08-03 19:30:12 +02:00
parent 5973e0e463
commit 8e45af9a04
Signed by untrusted user who does not match committer: tsommer
GPG Key ID: 371BBA77A02C0108
2 changed files with 21 additions and 3 deletions

View File

@ -94,13 +94,13 @@
<MudPaper Outlined="true" Class="pa-4 mb-4">
<MudGrid>
<MudItem xs="12" md="7">
<MudTextField T="string" @bind-Text="@this.editor.Name" Label="@T("Briefing name")" Validation="@this.ValidateProjectName" Immediate="@true" Variant="Variant.Outlined" Disabled="@this.IsCurrentBusy"/>
<MudTextField T="string" @bind-Text="@this.editor.Name" Label="@T("Briefing name")" Validation="@this.ValidateProjectName" Immediate="@true" Variant="Variant.Outlined" Disabled="@this.IsCurrentBusy" UserAttributes="@USER_INPUT_ATTRIBUTES"/>
</MudItem>
<MudItem xs="12" md="5">
<MudTextField T="string" @bind-Text="@this.editor.Author" Label="@T("Author (optional)")" Variant="Variant.Outlined" Disabled="@this.IsCurrentBusy"/>
<MudTextField T="string" @bind-Text="@this.editor.Author" Label="@T("Author (optional)")" Variant="Variant.Outlined" Disabled="@this.IsCurrentBusy" UserAttributes="@USER_INPUT_ATTRIBUTES"/>
</MudItem>
</MudGrid>
<MudTextField T="string" @bind-Text="@this.editor.Instruction" Label="@T("Briefing scope, notes, or current change instruction (optional)")" Variant="Variant.Outlined" AutoGrow="true" Lines="3" Class="mt-3" Disabled="@this.IsCurrentBusy"/>
<MudTextField T="string" @bind-Text="@this.editor.Instruction" Label="@T("Briefing scope, notes, or current change instruction (optional)")" Variant="Variant.Outlined" AutoGrow="true" Lines="3" Class="mt-3" Disabled="@this.IsCurrentBusy" UserAttributes="@USER_INPUT_ATTRIBUTES"/>
<EnumSelection T="VisualBriefingProtectionLevel"
NameFunc="@this.ProtectionLevelName"

View File

@ -127,6 +127,9 @@ public partial class VisualBriefingAssistant : MSGComponentBase
/// <summary>Stores whether this component instance has already left the renderer.</summary>
private bool isDisposed;
/// <summary>Carries the spellchecking configuration to every text input of this assistant.</summary>
private static readonly Dictionary<string, object?> USER_INPUT_ATTRIBUTES = new();
/// <summary>
/// Defines <c>IsCurrentBusy</c> for the visual briefing feature.
/// </summary>
@ -169,6 +172,16 @@ public partial class VisualBriefingAssistant : MSGComponentBase
await this.ResumeSelectedBuildAsync();
}
/// <summary>
/// Defines <c>OnParametersSetAsync</c> for the visual briefing feature.
/// </summary>
protected override async Task OnParametersSetAsync()
{
// Configure the spellchecking for the user input:
this.SettingsManager.InjectSpellchecking(USER_INPUT_ATTRIBUTES);
await base.OnParametersSetAsync();
}
/// <summary>
/// Defines <c>DisposeResources</c> for the visual briefing feature.
/// </summary>
@ -234,7 +247,12 @@ public partial class VisualBriefingAssistant : MSGComponentBase
}
if (triggeredEvent is Event.CONFIGURATION_CHANGED)
{
// The spellchecking setting might have changed. Since this page is not re-parameterized
// while the user stays on it, we have to read the setting again here:
this.SettingsManager.InjectSpellchecking(USER_INPUT_ATTRIBUTES);
this.StateHasChanged();
}
await base.ProcessIncomingMessage(sendingComponent, triggeredEvent, data);
}