Skip to content

Add HTML export for plan analysis (#182)#190

Merged
erikdarlingdata merged 34 commits intodevfrom
feature/182-plan-sharing-export
Apr 7, 2026
Merged

Add HTML export for plan analysis (#182)#190
erikdarlingdata merged 34 commits intodevfrom
feature/182-plan-sharing-export

Conversation

@erikdarlingdata
Copy link
Copy Markdown
Owner

Summary

  • Adds "Export HTML" button to the web app toolbar (Option B from Web: Plan sharing and export #182)
  • Generates a self-contained HTML file with embedded CSS — works offline, no server needed
  • Includes insights cards, warnings, operator tree, parameters, wait stats, and full text analysis
  • 3 unit tests covering basic export, multi-statement plans, and HTML escaping

Files

  • New: HtmlExporter.cs (Core/Output) — HTML report generator
  • New: HtmlExporterTests.cs — unit tests
  • Modified: Index.razor — Export button + JS interop
  • Modified: index.htmldownloadFile() JS function
  • Modified: .csproj / _Imports.razor — link + import

Test plan

  • Upload .sqlplan file, click Export HTML, verify download
  • Open exported HTML in browser — renders correctly offline
  • Multi-statement plan exports all statements
  • HTML-unsafe characters in query text are properly escaped
  • Unit tests pass

🤖 Generated with Claude Code

erikdarlingdata and others added 30 commits March 4, 2026 21:05
Release v0.8.0 — MCP server, rename, release automation
Fix release workflow for v0.8.0
Release v0.8.1 — Screenshots, docs, workflow improvements
Release v0.8.1 — Fix release workflow, screenshots, docs
Release v0.8.2 — Screenshots, docs, release automation fix
v1.2.0 Release (with #105 crash fix)
Merge dev to main: web plan analysis (v1.5.0)
Click any plan tree node to open a right-side properties panel with full
operator details. Matches desktop app parity across all 37 sections
including per-thread stats, predicates, costs, memory, and root-only
statement info.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The plan XML's MemoryGrantWarning element fires for any grant size, including
trivially small ones (1 MB). Gate at 1 GB to suppress noise, consistent with
the analyzer's Rule 9 threshold. All values confirmed as KB across all example
plans. Updated test to verify small grants are suppressed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Gate XML MemoryGrantWarning at 1 GB threshold
- Rule 3 (Serial Plan): Skip trivial statements with cost < 0.01 — a 0ms
  variable assignment shouldn't warn about MAXDOP 1
- Rule 15 (Join OR Clause): Exclude Merge Interval patterns inside anti/semi
  joins — NOT IN subqueries produce the same operator chain but aren't OR
  expansions
- Rule 26 (Row Goal): Require >= 2x reduction — "1 to 1 (1x reduction)" and
  tiny floating-point differences are noise

Tests load from .internal/examples (gitignored) and skip gracefully on CI.

Closes items 5, 9, 12 from #178.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Rule 1 (Filter Operator): Suppress when child subtree is trivial —
  actual plans: < 128 reads AND < 10ms; estimated plans: cost < 1.0
- Rule 20 (Local Variables): Gate on statement cost >= 0.01 to skip
  trivial variable assignments where estimate quality doesn't matter

Both fixes work correctly for estimated and actual plans, using
cost-based fallbacks when runtime stats aren't available.

Closes items 6, 7, 11 from #178.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Rule 4/6 (Scalar UDF): Expanded remediation options — mention assigning
  to a variable, SQL Server 2019+ automatic UDF inlining
- Warning badge: Split count by severity (critical/warning/info) with
  color-coded badges instead of a single combined number
- Statement tabs: Show elapsed time instead of cost for actual plans
- Wait stats: Wider wait type column (180px) and double-width card when
  populated for better readability

Closes items 2, 3 (partial), 4, 10 from #178.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Statement tabs sorted by elapsed time (actual plans) or cost (estimated
  plans), slowest first — problem statement is always immediately visible
- Replaced small PNG logo with full Darling Data barbell logo from
  erikdarling.com, bumped height to 40px for legibility
- Default active statement is the first tab (sorted, so the slowest)

Closes items 1, 3 from #178.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…provements

Fix false positive warnings and UI improvements (#178)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Link header logo to erikdarling.com
- Switched from Armata to Montserrat globally
- Header: "Free SQL Server Query Plan Analysis" title, nav links for
  Blog, Consulting, Training, Monitoring, Request a Call
- Landing heading and privacy text bold (700/600 weight)
- Footer: Copyright 2019-{year} Darling Data, larger link text (1.1rem)
- Page title updated for SEO

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
erikdarlingdata and others added 4 commits April 7, 2026 11:22
Web UI refresh: font, header nav, footer
- Rule 3 (Serial Plan): Suppress for TRIVIAL plans and 0ms actual elapsed;
  demote to Info unless user explicitly forced serial (MAXDOP 1 / hint)
- Statement tab warning count: Use total (statement + node) warnings to
  match the main warnings strip count
- Parameters card: Span 2 columns when populated for more horizontal space

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Self-contained HTML export that works offline — no server needed.
Includes insights, warnings, operator tree, and full text analysis.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@erikdarlingdata erikdarlingdata merged commit af2a03f into dev Apr 7, 2026
2 checks passed
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