Repository navigation
Plan viewer: show each warning's actionable fix, and take severity colours from one helper - #4584
Merged
Merged
Conversation
…lours from one helper The properties panel already showed a warning's benefit percentage in its header, but never rendered the ActionableFix text underneath the message even when the analyzer supplied one. Both the plan-level and node-level warning sections now add an italic line for it when present. The properties panel and the tooltip warning list each re-derived the same critical/warning/info colour from the same three-way ternary against literal hex, five times across two files. They now call PlanWarningDisplay.WarningSeverityColorHex, so the colour for a severity is defined once. The colour values are unchanged. Refs #4572, part of #4511. ## CHANGELOG entry SECTION: Changed ENTRY: The plan viewer's warning panel now shows a fix suggestion, when the analyzer has one, under the warning message. ([#PR]) [#PR]: https://github.com/erikdarlingdata/PerformanceMonitor/pull/PR
erikdarlingdata
marked this pull request as ready for review
September 28, 2026 14:36
This was referenced Sep 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4572, part of #4511.
Why
PerformanceStudio's viewer (
erikdarlingdata/PerformanceStudio@3d717e7) closed a gap where awarning's
MaxBenefitPercentandActionableFixwere computed but not rendered everywhere thewarning itself was shown. PM's properties panel already rendered the benefit percentage in the
warning header, but never read
ActionableFix, so a warning with a concrete fix suggestion showedonly its generic message.
Separately, PerformanceStudio (
@51d59ca) replaced four copies of the sameCritical ? "#E57373" : Warning ? "#FFB347" : "#6BB5FF"ternary with oneWarningSeverityBrush(severity)helper. PM had the identical duplicated pattern, five times acrossPlanViewerControl.Properties.csandPlanViewerControl.Tooltips.cs.What changes
PerformanceMonitor.PlanAnalysis.PlanWarningDisplaygets a new pure helper,WarningSeverityColorHex(PlanWarningSeverity), returning the same three hex values PM alreadyused. No colour value changed — this is pure de-duplication, matching PerformanceStudio's shape
going forward.
Properties.cs, two inTooltips.cs, previously alsoduplicated a third time in
Properties.cs) now call the helper instead of repeating theliteral.
PlanViewerControl.Properties.cs(plan-level warnings and per-nodewarnings) now add an italic
TextBlockforw.ActionableFixunder the warning message, shownonly when the field is non-null/non-empty, mirroring PerformanceStudio's Avalonia pattern
(
Margin = new Thickness(16, 2, 0, 0),FontStyle = Italic, same foreground as the messageline). The tooltip warning list (
Tooltips.cs) keeps its existing shorter text — PerformanceStudionever added an
ActionableFixline there either, only the colour-helper change touches that file.Lite: gets this too —
PlanViewerControl.Properties.cs/Tooltips.csare in the sharedPerformanceMonitor.Uiproject, hosted by both the Darling Viewer and Lite.PM-ahead / not ported: none identified for this issue's scope.
Nothing user-visible yet. No analyzer rule in PerformanceMonitor sets
ActionableFixtoday (every assignment inPerformanceMonitor.PlanAnalysisisnull), and neither does PerformanceStudiodev(its only assignment, inBenefitScorer, isnull). So the new italic line renders for no current warning; it is in place for when a rule gains a fix. The colour change is de-duplication with identical values. The italic line is WPF layout with no headless test surface, and with no warning carrying a fix there is nothing to screenshot yet.Test plan
New file
Darling/Darling.Tests/PlanViewerWarningColorAndFixTests.cs:WarningSeverityColorHex_Critical_IsRed/_Warning_IsAmber/_Info_IsBlue— pin the threecolour values through the new helper. RED on dev: compile failure
(
CS0117: 'PlanWarningDisplay' does not contain a definition for 'WarningSeverityColorHex'),confirmed by building this test file against
origin/devin a detached worktree.PlanWarning_WithActionableFix_CarriesTheFixText/_WithoutActionableFix_IsNull— sanity pinson the existing model field (not new; documents the contract the rendering code now reads).
PlanViewerControl_HasNoInlineSeverityColorLiterals— a census pin: no#E57373/#FFB347/#6BB5FFliteral remains in anyPlanViewerControl.*.csfile. Runtime RED on dev, confirmedthe same way (this assertion built cleanly against dev and failed with
Assert.DoesNotContain() Failure: Sub-string found— the old ternaries are still there).Build (all 0 warnings / 0 errors, Release,
-p:EnableWindowsTargeting=true):Darling.Tests,PerformanceMonitor.Ui,Lite/PerformanceMonitorLite.csproj,Lite.Tests,Darling/PerformanceMonitor.Darling.Viewer.Run, in-process on macOS (Microsoft.WindowsDesktop.App stripped from the runtimeconfig):
the new class, every
PlanSync*/Viewer*class and the plan-analysis classes:Total: 1810, Errors: 0, Failed: 86, Skipped: 137. All 86 failures are pre-existingSystem.IO.FileNotFoundException: PresentationFramework(and oneTypeInitializationExceptionwrapping the same) platform failures in classes this change doesn't touch (
ViewerDrillDownTests,ViewerChartContextMenuTests,ViewerHistoryWindowTests, etc. — WPF-type-dependent tests thatcan't load
PresentationFrameworkon macOS). None of the failing testnames are in a
PlanViewer*file. The macOS-runnable subset (the new class, thePlanSync*classes and the plan-analysis classes) ran green atTotal: 249, Errors: 0, Failed: 0, Skipped: 2.Lite.Testsbuilds (0/0) but cannot run on macOS (discovery dies on WindowsBase); this change addsno new Lite.Tests file since the touched files are shared through
PerformanceMonitor.Uiandalready covered by the Darling.Tests pins above. CI decides Lite/Darling.Tests-on-Windows and the
WPF-dependent classes.
Screenshot plan (pure layout, for a human on Windows):
ActionableFix(any serial-plan or missing-index warning the analyzer scores). In the Properties panel's "Plan Warnings" or
node "Warnings" section, confirm an italic line appears under the warning message, indented to
match the message (not the header), in the same muted foreground colour as the message text.
ActionableFixshows no extra line (no blank italic row).PR in both the properties panel and node tooltips — the colour helper returns the same hex
values, so there should be no difference to see.
CHANGELOG
None: no user-visible change yet. The fix line renders only for a warning that carries an ActionableFix, and no rule sets one today; the severity colours are unchanged.