diff --git a/app/MindWork AI Studio/Components/Pages/Chat.razor b/app/MindWork AI Studio/Components/Pages/Chat.razor index f9367ad..1feff68 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 5607260..738b435 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 5335beb..66a2739 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 465ebe6..1c629b8 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 50765cd..4353056 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