diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 99dcb14..2e269f5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -46,20 +46,17 @@ jobs: gh release create "v${{ steps.version.outputs.VERSION }}" --title "v${{ steps.version.outputs.VERSION }}" --generate-notes --target main - name: Setup .NET 8.0 - if: steps.check.outputs.EXISTS == 'false' uses: actions/setup-dotnet@v4 with: dotnet-version: 8.0.x - name: Build and test - if: steps.check.outputs.EXISTS == 'false' run: | dotnet restore dotnet build -c Release dotnet test tests/PlanViewer.Core.Tests/PlanViewer.Core.Tests.csproj -c Release --no-build --verbosity normal - name: Publish App (all platforms) - if: steps.check.outputs.EXISTS == 'false' run: | dotnet publish src/PlanViewer.App/PlanViewer.App.csproj -c Release -r win-x64 --self-contained -o publish/win-x64 dotnet publish src/PlanViewer.App/PlanViewer.App.csproj -c Release -r linux-x64 --self-contained -o publish/linux-x64 @@ -68,7 +65,6 @@ jobs: # ── SignPath code signing (Windows only, skipped if secret not configured) ── - name: Check if signing is configured - if: steps.check.outputs.EXISTS == 'false' id: signing shell: bash run: | @@ -80,7 +76,7 @@ jobs: fi - name: Upload Windows build for signing - if: steps.check.outputs.EXISTS == 'false' && steps.signing.outputs.ENABLED == 'true' + if: steps.signing.outputs.ENABLED == 'true' id: upload-unsigned uses: actions/upload-artifact@v4 with: @@ -88,7 +84,7 @@ jobs: path: publish/win-x64/ - name: Sign Windows build - if: steps.check.outputs.EXISTS == 'false' && steps.signing.outputs.ENABLED == 'true' + if: steps.signing.outputs.ENABLED == 'true' uses: signpath/github-action-submit-signing-request@v1 with: api-token: '${{ secrets.SIGNPATH_API_TOKEN }}' @@ -101,7 +97,7 @@ jobs: output-artifact-directory: 'signed/win-x64' - name: Replace unsigned Windows build with signed - if: steps.check.outputs.EXISTS == 'false' && steps.signing.outputs.ENABLED == 'true' + if: steps.signing.outputs.ENABLED == 'true' shell: pwsh run: | Remove-Item -Recurse -Force publish/win-x64 @@ -109,7 +105,6 @@ jobs: # ── Velopack (uses signed Windows binaries) ─────────────────────── - name: Create Velopack release (Windows) - if: steps.check.outputs.EXISTS == 'false' shell: pwsh env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -126,7 +121,6 @@ jobs: # ── Package and upload ──────────────────────────────────────────── - name: Package and upload - if: steps.check.outputs.EXISTS == 'false' shell: pwsh env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/src/PlanViewer.App/Controls/PlanViewerControl.axaml.cs b/src/PlanViewer.App/Controls/PlanViewerControl.axaml.cs index 9f092f0..854b987 100644 --- a/src/PlanViewer.App/Controls/PlanViewerControl.axaml.cs +++ b/src/PlanViewer.App/Controls/PlanViewerControl.axaml.cs @@ -1754,6 +1754,18 @@ private void ShowPropertiesPanel(PlanNode node) TextWrapping = TextWrapping.Wrap, Margin = new Thickness(16, 0, 0, 0) }); + if (!string.IsNullOrEmpty(w.ActionableFix)) + { + warnPanel.Children.Add(new TextBlock + { + Text = w.ActionableFix, + FontSize = 11, + FontStyle = FontStyle.Italic, + Foreground = TooltipFgBrush, + TextWrapping = TextWrapping.Wrap, + Margin = new Thickness(16, 2, 0, 0) + }); + } planWarningsPanel.Children.Add(warnPanel); } diff --git a/src/PlanViewer.App/PlanViewer.App.csproj b/src/PlanViewer.App/PlanViewer.App.csproj index c04c93b..c00ff0c 100644 --- a/src/PlanViewer.App/PlanViewer.App.csproj +++ b/src/PlanViewer.App/PlanViewer.App.csproj @@ -6,7 +6,7 @@ app.manifest EDD.ico true - 1.7.0 + 1.7.1 Erik Darling Darling Data LLC Performance Studio diff --git a/src/PlanViewer.Core/Output/HtmlExporter.cs b/src/PlanViewer.Core/Output/HtmlExporter.cs index e945151..897598c 100644 --- a/src/PlanViewer.Core/Output/HtmlExporter.cs +++ b/src/PlanViewer.Core/Output/HtmlExporter.cs @@ -187,6 +187,7 @@ .card h3 { .warn-type { font-size: 0.75rem; font-weight: 600; } .warn-benefit { font-size: 0.7rem; font-weight: 600; color: var(--text-muted); padding: 0.05rem 0.3rem; border-radius: 3px; background: rgba(0,0,0,0.04); } .warn-msg { font-size: 0.8rem; color: var(--text); flex-basis: 100%; } +.warn-fix { font-size: 0.75rem; color: var(--text-secondary); font-style: italic; flex-basis: 100%; border-left: 2px solid var(--border); padding-left: 0.5rem; margin-top: 0.15rem; } /* Query text */ details { margin-bottom: 0.75rem; } @@ -459,6 +460,8 @@ private static void WriteWarnings(StringBuilder sb, StatementResult stmt) if (w.MaxBenefitPercent.HasValue) sb.AppendLine($"up to {w.MaxBenefitPercent:N0}% benefit"); sb.AppendLine($"{Encode(w.Message)}"); + if (!string.IsNullOrEmpty(w.ActionableFix)) + sb.AppendLine($"{Encode(w.ActionableFix)}"); sb.AppendLine(""); } sb.AppendLine(""); diff --git a/src/PlanViewer.Core/Output/TextFormatter.cs b/src/PlanViewer.Core/Output/TextFormatter.cs index da655ad..d5ec7d1 100644 --- a/src/PlanViewer.Core/Output/TextFormatter.cs +++ b/src/PlanViewer.Core/Output/TextFormatter.cs @@ -172,6 +172,8 @@ public static void WriteText(AnalysisResult result, TextWriter writer) ? $" (up to {w.MaxBenefitPercent:N0}% benefit)" : ""; writer.WriteLine($" [{w.Severity}] {w.Type}{benefitTag}: {EscapeNewlines(w.Message)}"); + if (!string.IsNullOrEmpty(w.ActionableFix)) + writer.WriteLine($" Fix: {EscapeNewlines(w.ActionableFix)}"); } } diff --git a/src/PlanViewer.Web/Pages/Index.razor b/src/PlanViewer.Web/Pages/Index.razor index 3a54c88..0fc82d5 100644 --- a/src/PlanViewer.Web/Pages/Index.razor +++ b/src/PlanViewer.Web/Pages/Index.razor @@ -332,7 +332,10 @@ else @if (infoCount > 0) { @infoCount }
- @foreach (var w in GetAllWarnings(ActiveStmt!)) + @foreach (var w in GetAllWarnings(ActiveStmt!) + .OrderByDescending(x => x.MaxBenefitPercent ?? -1) + .ThenByDescending(x => x.Severity == "Critical" ? 3 : x.Severity == "Warning" ? 2 : 1) + .ThenBy(x => x.Type)) {
@w.Severity @@ -341,7 +344,15 @@ else @w.Operator } @w.Type + @if (w.MaxBenefitPercent.HasValue) + { + up to @w.MaxBenefitPercent.Value.ToString("N0")% benefit + } @w.Message + @if (!string.IsNullOrEmpty(w.ActionableFix)) + { + @w.ActionableFix + }
}
diff --git a/src/PlanViewer.Web/wwwroot/css/app.css b/src/PlanViewer.Web/wwwroot/css/app.css index f512855..542cb5a 100644 --- a/src/PlanViewer.Web/wwwroot/css/app.css +++ b/src/PlanViewer.Web/wwwroot/css/app.css @@ -807,6 +807,26 @@ textarea::placeholder { font-size: 0.75rem; } +.warn-benefit { + font-size: 0.7rem; + font-weight: 600; + color: var(--text-muted); + padding: 0.05rem 0.35rem; + border-radius: 3px; + background: rgba(0, 0, 0, 0.05); + margin-right: 0.4rem; +} + +.warning-fix { + color: var(--text-secondary); + display: block; + margin-top: 0.25rem; + font-size: 0.75rem; + font-style: italic; + border-left: 2px solid var(--border); + padding-left: 0.5rem; +} + /* === Query Text === */ .stmt-text-section { margin-bottom: 0.75rem;