diff --git a/app/MindWork AI Studio/Layout/MainLayout.razor b/app/MindWork AI Studio/Layout/MainLayout.razor index 7ed77410..f73bfb3b 100644 --- a/app/MindWork AI Studio/Layout/MainLayout.razor +++ b/app/MindWork AI Studio/Layout/MainLayout.razor @@ -102,4 +102,4 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/app/MindWork AI Studio/Layout/MainLayout.razor.cs b/app/MindWork AI Studio/Layout/MainLayout.razor.cs index a4d0c324..ca77acc7 100644 --- a/app/MindWork AI Studio/Layout/MainLayout.razor.cs +++ b/app/MindWork AI Studio/Layout/MainLayout.razor.cs @@ -144,7 +144,7 @@ public partial class MainLayout : LayoutComponentBase, IMessageBusReceiver, ILan // Send a message to start the plugin system: await this.MessageBus.SendMessage(this, Event.STARTUP_PLUGIN_SYSTEM); - await this.themeProvider.WatchSystemDarkModeAsync(this.SystemeThemeChanged); + await this.themeProvider.WatchSystemDarkModeAsync(this.SystemThemeChanged); await this.UpdateThemeConfiguration(); this.LoadNavItems(); this.LoadEmbeddingItem(); @@ -564,19 +564,28 @@ public partial class MainLayout : LayoutComponentBase, IMessageBusReceiver, ILan } } - private async Task SystemeThemeChanged(bool isDark) + /// + /// True, when the user wants AI Studio to follow the light or dark mode of the operating system. + /// + /// + /// This also decides whether the MudThemeProvider watches the operating system at all. On a system + /// change, the provider takes the new mode into its own state first and calls our handler only + /// afterward, so the handler cannot prevent it. Nor can a new render of this layout undo it: the + /// provider takes over its IsDarkMode parameter only when that value changes, and with a fixed theme, + /// it never does. Were the provider watching while the user chose a fixed theme, MudBlazor would show + /// the colors of the system from the next render on, while the rest of the app kept the chosen ones. + /// + private bool FollowSystemTheme => this.SettingsManager.ConfigurationData.App.PreferredTheme is Themes.SYSTEM; + + private async Task SystemThemeChanged(bool isDark) { this.Logger.LogInformation($"The system theme changed to {(isDark ? "dark" : "light")}."); - - if (this.SettingsManager.ConfigurationData.App.PreferredTheme is not Themes.SYSTEM) - return; - await this.UpdateThemeConfiguration(); } private async Task UpdateThemeConfiguration() { - if (this.SettingsManager.ConfigurationData.App.PreferredTheme is Themes.SYSTEM) + if (this.FollowSystemTheme) this.useDarkMode = await this.themeProvider.GetSystemDarkModeAsync(); else this.useDarkMode = this.SettingsManager.ConfigurationData.App.PreferredTheme == Themes.DARK; diff --git a/app/MindWork AI Studio/wwwroot/changelog/v26.9.1.md b/app/MindWork AI Studio/wwwroot/changelog/v26.9.1.md index f707ca40..da3085df 100644 --- a/app/MindWork AI Studio/wwwroot/changelog/v26.9.1.md +++ b/app/MindWork AI Studio/wwwroot/changelog/v26.9.1.md @@ -87,5 +87,6 @@ - Fixed AI Studio trying for minutes when a provider turns a request down for good. Such an answer does not change by asking a second time, so AI Studio now stops at the first one and tells you what the provider said about it. - Fixed errors about a provider arriving as two messages at once, the second of which spoke of several attempts that were never made. You now get the single message which names the cause. - Fixed the button in the chat toolbar that deletes the current chat and starts a new one doing so without asking. It now asks for your confirmation first, just like the chat list does, because a deleted chat cannot be brought back. The button shows a delete icon in red now, instead of one that looked like a reload. +- Fixed AI Studio following your system into light or dark mode even though you had chosen a fixed color theme in the app settings. - Upgraded the Visual Briefing assistant (in preview) from the prototype to the beta state. The assistant is now completely implemented and is undergoing a deeper testing phase in preparation for release. To try it, open the app settings, allow preview features down to beta, and then enable the Visual Briefing assistant there. - Upgraded the vector database behind local RAG (Qdrant Edge) to version 0.8.0.