Fixed dark mode code blocks (#242)

This commit is contained in:
Thorsten Sommer 2025-01-02 15:24:15 +01:00 committed by GitHub
parent 38a45955fb
commit 3b93841982
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 9 additions and 1 deletions

View File

@ -44,7 +44,7 @@
}
else
{
<MudMarkdown Value="@textContent.Text" OverrideHeaderTypo="@Markdown.OverrideHeaderTypo"/>
<MudMarkdown Value="@textContent.Text" OverrideHeaderTypo="@Markdown.OverrideHeaderTypo" CodeBlockTheme="@this.CodeColorPalette"/>
}
}
}

View File

@ -1,3 +1,5 @@
using AIStudio.Settings;
using Microsoft.AspNetCore.Components;
using RustService = AIStudio.Tools.RustService;
@ -45,6 +47,9 @@ public partial class ContentBlockComponent : ComponentBase
[Inject]
private ISnackbar Snackbar { get; init; } = null!;
[Inject]
private SettingsManager SettingsManager { get; init; } = null!;
private bool HideContent { get; set; }
#region Overrides of ComponentBase
@ -115,4 +120,6 @@ public partial class ContentBlockComponent : ComponentBase
}
private string CardClasses => $"my-2 rounded-lg {this.Class}";
private CodeBlockTheme CodeColorPalette => this.SettingsManager.IsDarkMode ? CodeBlockTheme.Dark : CodeBlockTheme.Default;
}

View File

@ -1,5 +1,6 @@
# v0.9.23, build 198 (2024-12-xx xx:xx UTC)
- Added an ERI server coding assistant as a preview feature behind the RAG feature flag. This helps you implement an ERI server to gain access to, e.g., your enterprise data from within AI Studio.
- Improved dark mode: Code blocks are now displayed in a dark theme as well (previously, they were displayed in a light theme, no matter what).
- Improved profile handling: Every chat remembers the last profile used.
- Improved the chat UI: You can now set the aspect ratio between workspaces and chat as you like.
- Improved provider requests by handling rate limits by retrying requests.