Skip to content

Give the Plan Insights strip one card system instead of per-card tints - #4599

Merged
erikdarlingdata merged 2 commits into
devfrom
viewer/4573-insight-cards
Sep 28, 2026
Merged

erikdarlingdata merged 2 commits into
devfrom
viewer/4573-insight-cards

Conversation

@erikdarlingdata

@erikdarlingdata erikdarlingdata commented Sep 28, 2026 •

Copy link
Copy Markdown
Owner

Fixes #4573. Part of #4511, plan viewer parity with PerformanceStudio.

Why

PerformanceStudio dev (erikdarlingdata/PerformanceStudio@87bad14) replaced five differently-tinted insight cards with one neutral surface and a per-card accent edge, and added a "quiet" empty state so a panel with nothing to report no longer reads as an alert. PM's plan viewer (shared by the Darling Viewer and Lite) still used full-bleed tinted backgrounds for its Missing Indexes and Wait Stats cards, and an empty Missing Indexes panel kept its full tint. Users now see the same neutral-surface, accent-edge, quiet-empty-state system PerformanceStudio uses.

Card inventory (PS vs PM)

PS card PM equivalent Notes
Server Context none PM's plan model has no ServerMetadata surface wired to the viewer yet. Not in this PR.
Runtime Summary Runtime Summary ported (neutral centre, blank edge)
Missing Index Suggestions Missing Index Suggestions ported
Parameters none PM's plan model carries a parameter list (PlanStatement.Parameters), but no panel renders it. Not in this PR — would need a new card, in scope for a follow-up issue, not this card-system port.
Wait Stats Wait Stats ported

This PR is the card system applied to PM's three existing cards; it does not add the Server Context or Parameters cards PS has. They're filed as #4597 (Server Context) and #4598 (Parameters).

What changes

  • PerformanceMonitor.Ui/PlanViewerControl.xaml: the three insight cards (Runtime Summary, Missing Indexes, Wait Stats) now share one BackgroundLightBrush surface and BorderBrush separator, with a 3px accent-edge Border per card (RuntimeSummaryAccent blank, MissingIndexAccent → InsightIndexBrush, WaitStatsAccent → InsightWaitsBrush).
  • New theme tokens InsightIndexBrush/InsightWaitsBrush replace the old PlanMissingIndexBgBrush/PlanMissingIndexBorderBrush/PlanMissingIndexHeaderBrush/PlanWaitStatsBgBrush/PlanWaitStatsHeaderBrush in all three themes (Dark/Light/CoolBreeze) for both Lite and the Darling Viewer.
  • PerformanceMonitor.Ui/PlanViewerControl.xaml.cs: a new SetInsightQuiet(header, accentBrush, accentEdge, isEmpty) helper (mirrors PS's), plus IndexAccentBrush/WaitsAccentBrush theme-token lookups.
  • PerformanceMonitor.Ui/PlanViewerControl.Properties.cs: ShowMissingIndexes, ShowWaitStats and ShowRuntimeSummary now call SetInsightQuiet so an empty card's header and accent edge go quiet.
  • New pure helper PerformanceMonitor.PlanAnalysis/InsightCardStyle.cs: the quiet/non-quiet accent-opacity and header-colour decision, testable outside WPF (AccentOpacity, HeaderUsesMutedForeground, matching PS's 0.35 dimmed-edge value).

Lite: gets this too (shared control).

PM-ahead

PM has three themes (Dark/Light/CoolBreeze); PS has one (dark only). The Light/CoolBreeze InsightIndexBrush/InsightWaitsBrush values are carried over unchanged from the old per-card header colours (#E65100/#1565C0 for Light, #BF4700/#0D47A1 for CoolBreeze) — a choice made here, since PS supplies no light-theme reference for these tokens.

Not in this PR

Test plan

Build (0 warnings, 0 errors on each):

  • dotnet build Darling/Darling.Tests/Darling.Tests.csproj -c Release -p:EnableWindowsTargeting=true
  • dotnet build Lite.Tests/Lite.Tests.csproj -c Release -p:EnableWindowsTargeting=true
  • dotnet build Darling/PerformanceMonitor.Darling.Viewer/PerformanceMonitor.Darling.Viewer.csproj -c Release -p:EnableWindowsTargeting=true

New pins: Darling/Darling.Tests/Viewer4573Tests.cs (4 tests) — Total: 4, Failed: 0.

  • AccentOpacity_MatchesPerformanceStudios0Point35QuietValue / HeaderUsesMutedForeground_IsTrueOnlyWhenEmpty / QuietAndNormalAccentOpacity_AreMutuallyExclusiveExtremes: compile-only RED against dev (InsightCardStyle doesn't exist there) — labelled as such, since this is an all-new helper.
  • InsightCardMarkup_CarriesNoInlineHexColour: runtime RED confirmed against dev's PlanViewerControl.xaml (worktree at 461d5030e, dev tip) — the old code's PlanMissingIndexBgBrush/etc. definitions are literal hex; GREEN on this branch. Verified via git worktree add --detach, built and ran in-process, then removed the worktree.

Also ran (0 failed beyond pre-existing live-Postgres connection failures, no rig running on this machine): ShowPlanParserCondAndMultiplePlanTests, ActualPlanRequestTests, ActualPlanDispatchTests, ActualPlanResultParseTests, QueryModificationDetectorTests, ActualPlanCaptureLoopTests, ActualPlanGatingTests, ReproScriptBuilderHardeningTests, DarlingAnalysisPipelineTests (11 failures, all Npgsql...Connection refused — no local Postgres rig), TsqlConventionGuardTests, DocCommentHygieneTests, CommentFilterAdoptionTests, McpPayloadContractCensusTests, MigrationDataMovingRungCensusPins, McpServiceParameterDiSeatCensusTests, DailyDeadlockWindowCensusTests, EntraProviderPackageCensusTests, FileGrowthRiseUnitCensusTests, MeasurementContractCensusTests, SameStatementPileupSourceCensusTests, StoreSessionTimeZonePinCensusTests (1 failure, live-Postgres connection refused), WebExceptionTextCensusTests (38 failures, all live-Postgres connection refused).

Not run: Lite.Tests.dll (discovery dies on WindowsBase on macOS per the repo convention) — build-only, 0 warnings/errors. PerformanceMonitor.Darling.Viewer-hosted WPF Viewer* classes that need PresentationFramework — skipped for the same reason; CI decides these.

Screenshot plan (Darling Viewer and Lite, both light/dark/CoolBreeze themes, per card):

  • Runtime Summary, populated: neutral surface, blank left edge, full-strength header.
  • Missing Indexes, populated: same neutral surface, orange-family accent edge and header at full strength.
  • Missing Indexes, empty ("No missing index suggestions"): same surface, edge dimmed, header muted — no longer a full-bleed tinted block.
  • Wait Stats, populated and empty: same pattern with the blue-family accent.

CHANGELOG

SECTION: Changed
ENTRY: - Plan viewer: one neutral card design for the insights strip ([#4599]) - Runtime Summary, Missing Index Suggestions, and Wait Stats now share one neutral surface with a thin per-card accent edge instead of a full-color tinted background, and an empty card (for example, no missing index suggestions) shows a dimmed, muted state instead of a loud tinted block.
REF: [#4599]: #4599

Ports PerformanceStudio dev's insights-strip card system
(erikdarlingdata/PerformanceStudio@87bad14) to the shared plan viewer used by
both the Darling Viewer and Lite. All three cards (Runtime Summary, Missing
Indexes, Wait Stats) now sit on the same neutral BackgroundLightBrush surface
with a 3px per-card accent edge (InsightIndexBrush, InsightWaitsBrush) instead
of a full-bleed tinted background. Runtime Summary keeps a blank edge as the
neutral centre.

A card with nothing to report now goes quiet: its header drops to the muted
foreground and its accent edge dims to 0.35, via a shared SetInsightQuiet
helper whose quiet/non-quiet values live in the new pure
PerformanceMonitor.PlanAnalysis.InsightCardStyle so they are testable outside
WPF.

No inline hex is left in the insight-card markup or code.
# Conflicts:
#	PerformanceMonitor.Ui/PlanViewerControl.xaml
@erikdarlingdata
erikdarlingdata marked this pull request as ready for review September 28, 2026 16:14
@erikdarlingdata
erikdarlingdata merged commit 9731d54 into dev Sep 28, 2026
15 of 16 checks passed
@erikdarlingdata
erikdarlingdata deleted the viewer/4573-insight-cards branch September 28, 2026 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant