mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-08-24 20:52:11 +00:00
Fixed the spellchecking of the visual briefing text fields
This commit is contained in:
parent
5973e0e463
commit
8e45af9a04
@ -94,13 +94,13 @@
|
|||||||
<MudPaper Outlined="true" Class="pa-4 mb-4">
|
<MudPaper Outlined="true" Class="pa-4 mb-4">
|
||||||
<MudGrid>
|
<MudGrid>
|
||||||
<MudItem xs="12" md="7">
|
<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>
|
||||||
<MudItem xs="12" md="5">
|
<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>
|
</MudItem>
|
||||||
</MudGrid>
|
</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"
|
<EnumSelection T="VisualBriefingProtectionLevel"
|
||||||
NameFunc="@this.ProtectionLevelName"
|
NameFunc="@this.ProtectionLevelName"
|
||||||
|
|||||||
@ -127,6 +127,9 @@ public partial class VisualBriefingAssistant : MSGComponentBase
|
|||||||
/// <summary>Stores whether this component instance has already left the renderer.</summary>
|
/// <summary>Stores whether this component instance has already left the renderer.</summary>
|
||||||
private bool isDisposed;
|
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>
|
/// <summary>
|
||||||
/// Defines <c>IsCurrentBusy</c> for the visual briefing feature.
|
/// Defines <c>IsCurrentBusy</c> for the visual briefing feature.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -169,6 +172,16 @@ public partial class VisualBriefingAssistant : MSGComponentBase
|
|||||||
await this.ResumeSelectedBuildAsync();
|
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>
|
/// <summary>
|
||||||
/// Defines <c>DisposeResources</c> for the visual briefing feature.
|
/// Defines <c>DisposeResources</c> for the visual briefing feature.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -234,7 +247,12 @@ public partial class VisualBriefingAssistant : MSGComponentBase
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (triggeredEvent is Event.CONFIGURATION_CHANGED)
|
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();
|
this.StateHasChanged();
|
||||||
|
}
|
||||||
|
|
||||||
await base.ProcessIncomingMessage(sendingComponent, triggeredEvent, data);
|
await base.ProcessIncomingMessage(sendingComponent, triggeredEvent, data);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user