Phase 5c review fixes: dark-mode contrast, Home layout, log/cursor alignment
Addresses issues found while testing the running app: - Dark mode: the Deep Purple accent was too dark to read on dark backgrounds. ThemeService now applies a lighter primary (Deep Purple 200) for the dark base theme and keeps Deep Purple 500 for light, so flat-button text, tabs, sidebar selection and the favorite star stay legible. Fixes it everywhere via the shared PrimaryHueMid brushes. - Report bug: the multiline description caret now starts at the top (VerticalContentAlignment=Top). - Log Viewer: entries pin to the top instead of appearing centred. - Home: more left padding; recent/favorites rows grow to fit the two- line (title + description) content instead of clipping; the sidebar Settings button no longer sits flush against the bottom edge. - Settings: config.json is recreated with defaults on startup if it was deleted while the app was closed. 102 tests pass; 0-warning Release build; app verified to launch cleanly. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
6a198872d1
commit
a8fd0bf78d
6 files changed
+22
-5
No files matched your search
@@ -83,6 +83,13 @@ public partial class App : System.Windows.Application
|
||||
private void ApplyUserPreferences()
|
||||
{
|
||||
var settings = _host!.Services.GetRequiredService<ISettingsService>();
|
||||
|
||||
// Recreate config.json with defaults if it was deleted while the app was closed.
|
||||
if (!File.Exists(AppPaths.ConfigFilePath))
|
||||
{
|
||||
settings.Save();
|
||||
}
|
||||
|
||||
LocalizationManager.Instance.SetCulture(ResolveCulture(settings.Language));
|
||||
_host.Services.GetRequiredService<IFontScaleService>().Apply(settings.FontSize);
|
||||
_host.Services.GetRequiredService<IThemeService>().Apply(settings.Theme);
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using System.Windows.Media;
|
||||
using CommandForge.Application.Settings;
|
||||
using MaterialDesignThemes.Wpf;
|
||||
using Microsoft.Win32;
|
||||
@@ -11,6 +12,11 @@ namespace CommandForge.Wpf.Theming;
|
||||
/// </summary>
|
||||
public sealed class ThemeService : IThemeService, IDisposable
|
||||
{
|
||||
// Deep Purple 500 reads well on light backgrounds; a lighter Deep Purple 200 keeps the accent
|
||||
// legible on dark backgrounds (the mid hue drives flat-button text, tabs, selection and the star).
|
||||
private static readonly Color LightPrimary = Color.FromRgb(0x67, 0x3A, 0xB7);
|
||||
private static readonly Color DarkPrimary = Color.FromRgb(0xB3, 0x9D, 0xDB);
|
||||
|
||||
private AppTheme _current = AppTheme.System;
|
||||
private bool _subscribed;
|
||||
|
||||
@@ -29,6 +35,7 @@ public sealed class ThemeService : IThemeService, IDisposable
|
||||
var palette = new PaletteHelper();
|
||||
var current = palette.GetTheme();
|
||||
current.SetBaseTheme(baseTheme);
|
||||
current.SetPrimaryColor(baseTheme == BaseTheme.Dark ? DarkPrimary : LightPrimary);
|
||||
palette.SetTheme(current);
|
||||
|
||||
if (theme == AppTheme.System)
|
||||
|
||||
@@ -13,8 +13,10 @@
|
||||
<DataTemplate x:Key="HomeCommandItem">
|
||||
<!-- No explicit AutomationProperties.Name: the button auto-names from its content
|
||||
(title + description), giving screen-reader users the same context as sighted users. -->
|
||||
<!-- Height=Auto/MinHeight: the Material flat-button style fixes a short height that would
|
||||
otherwise clip the two-line (title + description) content. -->
|
||||
<Button Style="{StaticResource MaterialDesignFlatButton}" HorizontalContentAlignment="Stretch"
|
||||
Padding="10,8" Margin="0,1"
|
||||
Padding="10,8" Margin="0,1" Height="Auto" MinHeight="52" VerticalContentAlignment="Center"
|
||||
Command="{Binding DataContext.OpenCommand, RelativeSource={RelativeSource AncestorType=UserControl}}"
|
||||
CommandParameter="{Binding}">
|
||||
<Grid>
|
||||
@@ -51,7 +53,7 @@
|
||||
</Style>
|
||||
</UserControl.Resources>
|
||||
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto" Padding="24,18">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto" Padding="28,20,28,24">
|
||||
<StackPanel MaxWidth="1000" HorizontalAlignment="Left">
|
||||
<TextBlock Text="{res:Loc SidebarHome}" FontSize="24" FontWeight="Bold"
|
||||
AutomationProperties.HeadingLevel="Level1" />
|
||||
|
||||
@@ -53,8 +53,8 @@
|
||||
<!-- Body -->
|
||||
<Border Grid.Row="1" Background="{DynamicResource MaterialDesignToolBarBackground}" CornerRadius="4">
|
||||
<ScrollViewer beh:AutoScroll.Enabled="{Binding AutoScroll}" VerticalScrollBarVisibility="Auto"
|
||||
HorizontalScrollBarVisibility="Auto" Padding="8">
|
||||
<ItemsControl ItemsSource="{Binding View}">
|
||||
HorizontalScrollBarVisibility="Auto" Padding="8" VerticalContentAlignment="Top">
|
||||
<ItemsControl ItemsSource="{Binding View}" VerticalAlignment="Top">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid>
|
||||
|
||||
@@ -122,6 +122,7 @@
|
||||
</Button>
|
||||
|
||||
<Button DockPanel.Dock="Bottom" Style="{StaticResource SidebarButtonStyle}"
|
||||
Margin="0,0,0,10"
|
||||
Command="{Binding ShowSettingsCommand}"
|
||||
AutomationProperties.Name="{res:Loc SidebarSettings}"
|
||||
ToolTip="{res:Loc SidebarSettings}">
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
</Border>
|
||||
|
||||
<TextBox Grid.Row="3" Margin="0,0,0,16" MinHeight="70" TextWrapping="Wrap" AcceptsReturn="True"
|
||||
VerticalScrollBarVisibility="Auto"
|
||||
VerticalScrollBarVisibility="Auto" VerticalContentAlignment="Top"
|
||||
AutomationProperties.Name="{res:Loc ReportBug_DescriptionHint}"
|
||||
materialDesign:HintAssist.Hint="{res:Loc ReportBug_DescriptionHint}"
|
||||
Text="{Binding Description, UpdateSourceTrigger=PropertyChanged}" />
|
||||
|
||||
Reference in new issue
Block a user