From f2eb1c154e9c24de66c2f040d7dd3fea204904e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A1udio=20Silva?= Date: Fri, 17 Apr 2026 21:28:07 +0100 Subject: [PATCH 1/6] Fix: Query Editor losing syntax highlighting on tab switch (#234) * fixes #233 * Improve the fix --- .../Controls/QuerySessionControl.axaml.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/PlanViewer.App/Controls/QuerySessionControl.axaml.cs b/src/PlanViewer.App/Controls/QuerySessionControl.axaml.cs index ea2ce29..3c5ac67 100644 --- a/src/PlanViewer.App/Controls/QuerySessionControl.axaml.cs +++ b/src/PlanViewer.App/Controls/QuerySessionControl.axaml.cs @@ -68,13 +68,22 @@ public QuerySessionControl(ICredentialService credentialService, ConnectionStore QueryEditor.TextArea.TextEntered += OnTextEntered; // Focus the editor when the control is attached to the visual tree + // Re-install TextMate if it was disposed on detach (tab switching disposes it) AttachedToVisualTree += (_, _) => { + if (_textMateInstallation == null) + SetupSyntaxHighlighting(); + QueryEditor.Focus(); QueryEditor.TextArea.Focus(); }; - DetachedFromVisualTree += (_, _) => _textMateInstallation?.Dispose(); + // Dispose TextMate when detached (e.g. tab switch) to release renderers/transformers + DetachedFromVisualTree += (_, _) => + { + _textMateInstallation?.Dispose(); + _textMateInstallation = null; + }; // Focus the editor when the Editor tab is selected; toggle plan-dependent buttons SubTabControl.SelectionChanged += (_, _) => From fad40b8f336e16795c72f098d7158dd704dffbb9 Mon Sep 17 00:00:00 2001 From: Erik Darling <2136037+erikdarlingdata@users.noreply.github.com> Date: Sat, 18 Apr 2026 11:46:21 -0400 Subject: [PATCH 2/6] Polish PlanViewer toolbars, Query Store headers, and tab accent - Query Store grid: dropped "(Local)" from Last Executed (the Time display dropdown already controls timezone), shortened "Physical Reads" to "Phys Reads", and widened CPU / Duration / Memory / Phys Reads / Executions columns by 5-15px so the "(ms)" and "(MB)" unit suffixes no longer truncate in the default layout. - Toolbar density: reduced button padding 10,0 -> 8,0, StackPanel Spacing 6 -> 4, and pipe-separator margins 4,0 -> 2,0 (and 12,0 -> 6,0) across both QuerySessionControl and PlanViewerControl toolbars. Dropped redundant per-button margins now that Spacing handles them. - Wait palette: Worker Thread #19ff25 -> #52E3B5 (teal, distinct from CPU green), Parallelism #fd01d3 -> #7B4FFF (vivid purple, out of the pink/magenta cluster) so neighboring wait categories read as different colors on the stacked wait profile bar. - Added SystemAccentColor (+ Dark1/Dark2/Light1/Light2 variants) to DarkTheme. Fluent theme's TabItem selected pipe reads from SystemAccentColor, so Plan 1 / Plan 2 tabs now get the brand-blue underline consistently. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../Controls/PlanViewerControl.axaml | 20 +++++------ .../Controls/QuerySessionControl.axaml | 34 +++++++++---------- .../Controls/QueryStoreGridControl.axaml | 20 +++++------ src/PlanViewer.App/Themes/DarkTheme.axaml | 11 ++++-- 4 files changed, 46 insertions(+), 39 deletions(-) diff --git a/src/PlanViewer.App/Controls/PlanViewerControl.axaml b/src/PlanViewer.App/Controls/PlanViewerControl.axaml index 1eec781..0f3acb1 100644 --- a/src/PlanViewer.App/Controls/PlanViewerControl.axaml +++ b/src/PlanViewer.App/Controls/PlanViewerControl.axaml @@ -13,39 +13,39 @@ - +