mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-08-24 20:52:11 +00:00
Refined activity indicators and color consistency
This commit is contained in:
parent
c158494637
commit
f12ddfcdd8
@ -60,7 +60,7 @@ public partial class AssistantBlock<TSettings> : MSGComponentBase where TSetting
|
|||||||
await this.DialogService.ShowAsync<TSettings>(T("Open Settings"), dialogParameters, DialogOptions.FULLSCREEN);
|
await this.DialogService.ShowAsync<TSettings>(T("Open Settings"), dialogParameters, DialogOptions.FULLSCREEN);
|
||||||
}
|
}
|
||||||
|
|
||||||
private string BorderColor => this.HasActiveSession ? this.ColorTheme.GetCurrentPalette(this.SettingsManager).Warning.Value : this.SettingsManager.IsDarkMode switch
|
private string BorderColor => this.HasActiveSession ? this.ColorTheme.GetActivityIndicatorColor(this.SettingsManager) : this.SettingsManager.IsDarkMode switch
|
||||||
{
|
{
|
||||||
true => this.ColorTheme.GetCurrentPalette(this.SettingsManager).GrayLight,
|
true => this.ColorTheme.GetCurrentPalette(this.SettingsManager).GrayLight,
|
||||||
false => this.ColorTheme.GetCurrentPalette(this.SettingsManager).Primary.Value,
|
false => this.ColorTheme.GetCurrentPalette(this.SettingsManager).Primary.Value,
|
||||||
|
|||||||
@ -347,18 +347,26 @@ public partial class MainLayout : LayoutComponentBase, IMessageBusReceiver, ILan
|
|||||||
private IEnumerable<NavBarItem> GetNavItems()
|
private IEnumerable<NavBarItem> GetNavItems()
|
||||||
{
|
{
|
||||||
var palette = this.ColorTheme.GetCurrentPalette(this.SettingsManager);
|
var palette = this.ColorTheme.GetCurrentPalette(this.SettingsManager);
|
||||||
|
var activityIndicatorLightColor = this.ColorTheme.GetActivityIndicatorLightColor();
|
||||||
|
var activityIndicatorDarkColor = this.ColorTheme.GetActivityIndicatorDarkColor();
|
||||||
|
var defaultLightColor = palette.DarkLighten;
|
||||||
|
var defaultDarkColor = palette.GrayLight;
|
||||||
|
var chatLightColor = this.AIJobService.HasActiveJobs ? activityIndicatorLightColor : defaultLightColor;
|
||||||
|
var chatDarkColor = this.AIJobService.HasActiveJobs ? activityIndicatorDarkColor : defaultDarkColor;
|
||||||
|
var assistantsLightColor = this.AssistantSessionService.HasActiveSessions ? activityIndicatorLightColor : defaultLightColor;
|
||||||
|
var assistantsDarkColor = this.AssistantSessionService.HasActiveSessions ? activityIndicatorDarkColor : defaultDarkColor;
|
||||||
|
|
||||||
yield return new(T("Home"), Icons.Material.Filled.Home, palette.DarkLighten, palette.GrayLight, Routes.HOME, true);
|
yield return new(T("Home"), Icons.Material.Filled.Home, defaultLightColor, defaultDarkColor, Routes.HOME, true);
|
||||||
yield return new(T("Chat"), this.AIJobService.HasActiveJobs ? Icons.Material.Filled.Chat : Icons.Material.Outlined.Chat, palette.DarkLighten, palette.GrayLight, Routes.CHAT, false);
|
yield return new(T("Chat"), Icons.Material.Filled.Chat, chatLightColor, chatDarkColor, Routes.CHAT, false);
|
||||||
yield return new(T("Assistants"), this.AssistantSessionService.HasActiveSessions ? Icons.Material.Filled.Apps : Icons.Material.Outlined.Apps, palette.DarkLighten, palette.GrayLight, Routes.ASSISTANTS, false);
|
yield return new(T("Assistants"), Icons.Material.Filled.Apps, assistantsLightColor, assistantsDarkColor, Routes.ASSISTANTS, false);
|
||||||
|
|
||||||
if (PreviewFeatures.PRE_WRITER_MODE_2024.IsEnabled(this.SettingsManager))
|
if (PreviewFeatures.PRE_WRITER_MODE_2024.IsEnabled(this.SettingsManager))
|
||||||
yield return new(T("Writer"), Icons.Material.Filled.Create, palette.DarkLighten, palette.GrayLight, Routes.WRITER, false);
|
yield return new(T("Writer"), Icons.Material.Filled.Create, defaultLightColor, defaultDarkColor, Routes.WRITER, false);
|
||||||
|
|
||||||
yield return new(T("Plugins"), Icons.Material.TwoTone.Extension, palette.DarkLighten, palette.GrayLight, Routes.PLUGINS, false);
|
yield return new(T("Plugins"), Icons.Material.TwoTone.Extension, defaultLightColor, defaultDarkColor, Routes.PLUGINS, false);
|
||||||
yield return new(T("Supporters"), Icons.Material.Filled.Favorite, palette.Error.Value, "#801a00", Routes.SUPPORTERS, false);
|
yield return new(T("Supporters"), Icons.Material.Filled.Favorite, palette.Error.Value, "#801a00", Routes.SUPPORTERS, false);
|
||||||
yield return new(T("Information"), Icons.Material.Filled.Info, palette.DarkLighten, palette.GrayLight, Routes.ABOUT, false);
|
yield return new(T("Information"), Icons.Material.Filled.Info, defaultLightColor, defaultDarkColor, Routes.ABOUT, false);
|
||||||
yield return new(T("Settings"), Icons.Material.Filled.Settings, palette.DarkLighten, palette.GrayLight, Routes.SETTINGS, false);
|
yield return new(T("Settings"), Icons.Material.Filled.Settings, defaultLightColor, defaultDarkColor, Routes.SETTINGS, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task ShowUpdateDialog()
|
private async Task ShowUpdateDialog()
|
||||||
|
|||||||
@ -4,5 +4,10 @@ namespace AIStudio.Layout;
|
|||||||
|
|
||||||
public record NavBarItem(string Name, string Icon, string IconLightColor, string IconDarkColor, string Path, bool MatchAll)
|
public record NavBarItem(string Name, string Icon, string IconLightColor, string IconDarkColor, string Path, bool MatchAll)
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the CSS style that applies the current theme-aware icon color.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="settingsManager">The settings manager used to read the current theme.</param>
|
||||||
|
/// <returns>The CSS style for the nav item icon color.</returns>
|
||||||
public string SetColorStyle(SettingsManager settingsManager) => $"--custom-icon-color: {(settingsManager.IsDarkMode ? this.IconDarkColor : this.IconLightColor)};";
|
public string SetColorStyle(SettingsManager settingsManager) => $"--custom-icon-color: {(settingsManager.IsDarkMode ? this.IconDarkColor : this.IconLightColor)};";
|
||||||
}
|
}
|
||||||
@ -9,4 +9,14 @@ public static class MudThemeExtensions
|
|||||||
true => theme.PaletteDark,
|
true => theme.PaletteDark,
|
||||||
false => theme.PaletteLight,
|
false => theme.PaletteLight,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
public static string GetActivityIndicatorColor(this MudTheme theme, SettingsManager settingsManager) => settingsManager.IsDarkMode switch
|
||||||
|
{
|
||||||
|
true => theme.GetActivityIndicatorDarkColor(),
|
||||||
|
false => theme.GetActivityIndicatorLightColor(),
|
||||||
|
};
|
||||||
|
|
||||||
|
public static string GetActivityIndicatorLightColor(this MudTheme theme) => theme.PaletteLight.Info.Value;
|
||||||
|
|
||||||
|
public static string GetActivityIndicatorDarkColor(this MudTheme theme) => theme.PaletteDark.InfoLighten;
|
||||||
}
|
}
|
||||||
@ -1,3 +1,4 @@
|
|||||||
# v26.6.3, build 243 (2026-06-xx xx:xx UTC)
|
# v26.6.3, build 243 (2026-06-xx xx:xx UTC)
|
||||||
- Improved assistants so running tasks can continue when you leave the assistant and return later.
|
- Improved assistants so running tasks can continue when you leave the assistant and return later.
|
||||||
|
- Improved the activity indicators for running chats and assistants so they use a consistent blue highlight.
|
||||||
- Improved the chat experience by automatically focusing the message composer again when it becomes available. Thanks, Dominic Neuburg (`donework`), for the contribution.
|
- Improved the chat experience by automatically focusing the message composer again when it becomes available. Thanks, Dominic Neuburg (`donework`), for the contribution.
|
||||||
Loading…
Reference in New Issue
Block a user