diff --git a/Dashboard/Controls/MemoryContent.xaml.cs b/Dashboard/Controls/MemoryContent.xaml.cs index f78b0ab0..f381af58 100644 --- a/Dashboard/Controls/MemoryContent.xaml.cs +++ b/Dashboard/Controls/MemoryContent.xaml.cs @@ -82,6 +82,14 @@ public MemoryContent() SetupChartContextMenus(); Loaded += OnLoaded; + // Apply dark theme immediately so charts don't flash white before data loads + TabHelpers.ApplyDarkModeToChart(MemoryStatsOverviewChart); + TabHelpers.ApplyDarkModeToChart(MemoryGrantSizingChart); + TabHelpers.ApplyDarkModeToChart(MemoryGrantActivityChart); + TabHelpers.ApplyDarkModeToChart(MemoryClerksChart); + TabHelpers.ApplyDarkModeToChart(PlanCacheChart); + TabHelpers.ApplyDarkModeToChart(MemoryPressureEventsChart); + _memoryStatsOverviewHover = new Helpers.ChartHoverHelper(MemoryStatsOverviewChart, "MB"); _memoryGrantSizingHover = new Helpers.ChartHoverHelper(MemoryGrantSizingChart, "MB"); _memoryGrantActivityHover = new Helpers.ChartHoverHelper(MemoryGrantActivityChart, "count"); diff --git a/Dashboard/Controls/ResourceMetricsContent.xaml.cs b/Dashboard/Controls/ResourceMetricsContent.xaml.cs index 9c8c8896..aa3def9d 100644 --- a/Dashboard/Controls/ResourceMetricsContent.xaml.cs +++ b/Dashboard/Controls/ResourceMetricsContent.xaml.cs @@ -109,6 +109,23 @@ public ResourceMetricsContent() SetupChartContextMenus(); Loaded += OnLoaded; + // Apply dark theme immediately so charts don't flash white before data loads + TabHelpers.ApplyDarkModeToChart(LatchStatsChart); + TabHelpers.ApplyDarkModeToChart(SpinlockStatsChart); + TabHelpers.ApplyDarkModeToChart(TempdbStatsChart); + TabHelpers.ApplyDarkModeToChart(TempDbLatencyChart); + TabHelpers.ApplyDarkModeToChart(SessionStatsChart); + TabHelpers.ApplyDarkModeToChart(UserDbReadLatencyChart); + TabHelpers.ApplyDarkModeToChart(UserDbWriteLatencyChart); + TabHelpers.ApplyDarkModeToChart(FileIoReadThroughputChart); + TabHelpers.ApplyDarkModeToChart(FileIoWriteThroughputChart); + TabHelpers.ApplyDarkModeToChart(PerfmonCountersChart); + TabHelpers.ApplyDarkModeToChart(WaitStatsDetailChart); + TabHelpers.ApplyDarkModeToChart(ServerUtilTrendsCpuChart); + TabHelpers.ApplyDarkModeToChart(ServerUtilTrendsTempdbChart); + TabHelpers.ApplyDarkModeToChart(ServerUtilTrendsMemoryChart); + TabHelpers.ApplyDarkModeToChart(ServerUtilTrendsPerfmonChart); + _sessionStatsHover = new Helpers.ChartHoverHelper(SessionStatsChart, "sessions"); _latchStatsHover = new Helpers.ChartHoverHelper(LatchStatsChart, "ms/sec"); _spinlockStatsHover = new Helpers.ChartHoverHelper(SpinlockStatsChart, "collisions/sec"); diff --git a/Lite/Controls/ServerTab.xaml.cs b/Lite/Controls/ServerTab.xaml.cs index ea704080..800d2a87 100644 --- a/Lite/Controls/ServerTab.xaml.cs +++ b/Lite/Controls/ServerTab.xaml.cs @@ -158,6 +158,31 @@ public ServerTab(ServerConnection server, DuckDbInitializer duckDb, CredentialSe grid.CopyingRowClipboardContent += Helpers.DataGridClipboardBehavior.FixHeaderCopy; } + /* Apply dark theme immediately so charts don't flash white before data loads */ + ApplyDarkTheme(WaitStatsChart); + ApplyDarkTheme(QueryDurationTrendChart); + ApplyDarkTheme(ProcDurationTrendChart); + ApplyDarkTheme(QueryStoreDurationTrendChart); + ApplyDarkTheme(ExecutionCountTrendChart); + ApplyDarkTheme(CpuChart); + ApplyDarkTheme(MemoryChart); + ApplyDarkTheme(MemoryClerksChart); + ApplyDarkTheme(MemoryGrantSizingChart); + ApplyDarkTheme(MemoryGrantActivityChart); + ApplyDarkTheme(FileIoReadChart); + ApplyDarkTheme(FileIoWriteChart); + ApplyDarkTheme(FileIoReadThroughputChart); + ApplyDarkTheme(FileIoWriteThroughputChart); + ApplyDarkTheme(TempDbChart); + ApplyDarkTheme(TempDbFileIoChart); + ApplyDarkTheme(LockWaitTrendChart); + ApplyDarkTheme(BlockingTrendChart); + ApplyDarkTheme(DeadlockTrendChart); + ApplyDarkTheme(CurrentWaitsDurationChart); + ApplyDarkTheme(CurrentWaitsBlockedChart); + ApplyDarkTheme(PerfmonChart); + ApplyDarkTheme(CollectorDurationChart); + /* Chart hover tooltips */ _waitStatsHover = new Helpers.ChartHoverHelper(WaitStatsChart, "ms/sec"); _perfmonHover = new Helpers.ChartHoverHelper(PerfmonChart, "");