diff --git a/app/MindWork AI Studio/Components/Pages/Chat.razor b/app/MindWork AI Studio/Components/Pages/Chat.razor index f9367ad8..1feff68a 100644 --- a/app/MindWork AI Studio/Components/Pages/Chat.razor +++ b/app/MindWork AI Studio/Components/Pages/Chat.razor @@ -22,6 +22,6 @@ - + \ No newline at end of file diff --git a/app/MindWork AI Studio/Components/Pages/Chat.razor.cs b/app/MindWork AI Studio/Components/Pages/Chat.razor.cs index 56072606..738b4353 100644 --- a/app/MindWork AI Studio/Components/Pages/Chat.razor.cs +++ b/app/MindWork AI Studio/Components/Pages/Chat.razor.cs @@ -20,6 +20,8 @@ public partial class Chat : ComponentBase [Inject] public Random RNG { get; set; } = null!; + + private static readonly Dictionary USER_INPUT_ATTRIBUTES = new(); private AIStudio.Settings.Provider selectedProvider; private ChatThread? chatThread; @@ -38,6 +40,9 @@ public partial class Chat : ComponentBase // Ensure that the settings are loaded: await this.SettingsManager.LoadSettings(); + // Configure the spellchecking for the user input: + this.SettingsManager.InjectSpellchecking(USER_INPUT_ATTRIBUTES); + // For now, we just create a new chat thread. // Later we want the chats to be persisted // across page loads and organize them in diff --git a/app/MindWork AI Studio/Components/Pages/Settings.razor b/app/MindWork AI Studio/Components/Pages/Settings.razor index 5335beb1..66a2739f 100644 --- a/app/MindWork AI Studio/Components/Pages/Settings.razor +++ b/app/MindWork AI Studio/Components/Pages/Settings.razor @@ -51,6 +51,7 @@ Options + diff --git a/app/MindWork AI Studio/Settings/Data.cs b/app/MindWork AI Studio/Settings/Data.cs index 465ebe6e..1c629b80 100644 --- a/app/MindWork AI Studio/Settings/Data.cs +++ b/app/MindWork AI Studio/Settings/Data.cs @@ -31,4 +31,9 @@ public sealed class Data /// Shortcuts to send the input to the AI. /// public SendBehavior ShortcutSendBehavior { get; set; } = SendBehavior.MODIFER_ENTER_IS_SENDING; + + /// + /// Should we enable spellchecking for all input fields? + /// + public bool EnableSpellchecking { get; set; } } \ No newline at end of file diff --git a/app/MindWork AI Studio/Settings/SettingsManager.cs b/app/MindWork AI Studio/Settings/SettingsManager.cs index 50765cd2..4353056e 100644 --- a/app/MindWork AI Studio/Settings/SettingsManager.cs +++ b/app/MindWork AI Studio/Settings/SettingsManager.cs @@ -121,4 +121,6 @@ public sealed class SettingsManager var settingsJson = JsonSerializer.Serialize(this.ConfigurationData); await File.WriteAllTextAsync(settingsPath, settingsJson); } + + public void InjectSpellchecking(Dictionary attributes) => attributes["spellcheck"] = this.ConfigurationData.EnableSpellchecking ? "true" : "false"; } \ No newline at end of file