From a8fd0bf78d0a875cffd7b3d02dfb10cbccf9a4ea Mon Sep 17 00:00:00 2001 From: poli0981 <127664709+poli0981@users.noreply.github.com> Date: Thu, 18 Jun 2026 15:32:18 +0700 Subject: [PATCH] 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 --- src/CommandForge.Wpf/App.xaml.cs | 7 +++++++ src/CommandForge.Wpf/Theming/ThemeService.cs | 7 +++++++ src/CommandForge.Wpf/Views/HomeView.xaml | 6 ++++-- src/CommandForge.Wpf/Views/LogViewerView.xaml | 4 ++-- src/CommandForge.Wpf/Views/MainWindow.xaml | 1 + src/CommandForge.Wpf/Views/ReportBugDialog.xaml | 2 +- 6 files changed, 22 insertions(+), 5 deletions(-) diff --git a/src/CommandForge.Wpf/App.xaml.cs b/src/CommandForge.Wpf/App.xaml.cs index e6207d1..15c7877 100644 --- a/src/CommandForge.Wpf/App.xaml.cs +++ b/src/CommandForge.Wpf/App.xaml.cs @@ -83,6 +83,13 @@ public partial class App : System.Windows.Application private void ApplyUserPreferences() { var settings = _host!.Services.GetRequiredService(); + + // 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().Apply(settings.FontSize); _host.Services.GetRequiredService().Apply(settings.Theme); diff --git a/src/CommandForge.Wpf/Theming/ThemeService.cs b/src/CommandForge.Wpf/Theming/ThemeService.cs index 25c0ac4..778a97d 100644 --- a/src/CommandForge.Wpf/Theming/ThemeService.cs +++ b/src/CommandForge.Wpf/Theming/ThemeService.cs @@ -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; /// 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) diff --git a/src/CommandForge.Wpf/Views/HomeView.xaml b/src/CommandForge.Wpf/Views/HomeView.xaml index 1622b19..14925aa 100644 --- a/src/CommandForge.Wpf/Views/HomeView.xaml +++ b/src/CommandForge.Wpf/Views/HomeView.xaml @@ -13,8 +13,10 @@ +