Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions src/PlanViewer.App/Controls/PlanViewerControl.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,17 @@ private Border CreateNodeVisual(PlanNode node, int totalWarningCount = -1)
// Map border to node (replaces WPF Tag)
_nodeBorderMap[border] = node;

// Tooltip
ToolTip.SetTip(border, BuildNodeTooltipContent(node));
// Tooltip — root node gets all collected warnings so the tooltip shows them
if (totalWarningCount > 0)
{
var allWarnings = new List<PlanWarning>();
CollectWarnings(node, allWarnings);
ToolTip.SetTip(border, BuildNodeTooltipContent(node, allWarnings));
}
else
{
ToolTip.SetTip(border, BuildNodeTooltipContent(node));
}

// Click to select + show properties
border.PointerPressed += Node_Click;
Expand Down Expand Up @@ -1649,7 +1658,7 @@ private void ClosePropertiesPanel()

#region Tooltips

private object BuildNodeTooltipContent(PlanNode node)
private object BuildNodeTooltipContent(PlanNode node, List<PlanWarning>? allWarnings = null)
{
var tipBorder = new Border
{
Expand Down Expand Up @@ -1790,11 +1799,12 @@ private object BuildNodeTooltipContent(PlanNode node)
AddTooltipRow(stack, "Columns", node.OutputColumns, isCode: true);
}

// Warnings
if (node.HasWarnings)
// Warnings — use allWarnings (all nodes) for root, node.Warnings for others
var warnings = allWarnings ?? (node.HasWarnings ? node.Warnings : null);
if (warnings != null && warnings.Count > 0)
{
stack.Children.Add(new Separator { Margin = new Thickness(0, 6, 0, 6) });
foreach (var w in node.Warnings)
foreach (var w in warnings)
{
var warnColor = w.Severity == PlanWarningSeverity.Critical ? "#E57373"
: w.Severity == PlanWarningSeverity.Warning ? "#FFB347" : "#6BB5FF";
Expand Down
Loading