Skip to content

Split PlanViewerControl.axaml.cs into partial classes#327

Merged
erikdarlingdata merged 37 commits into
devfrom
feature/split-planviewercontrol
May 13, 2026
Merged

Split PlanViewerControl.axaml.cs into partial classes#327
erikdarlingdata merged 37 commits into
devfrom
feature/split-planviewercontrol

Conversation

@erikdarlingdata
Copy link
Copy Markdown
Owner

Summary

Move-only refactor of the largest file in the repo. Splits PlanViewerControl.axaml.cs (4,497 lines) into 7 topical partial-class files, mirroring the pattern used in PerformanceMonitor's Dashboard god-class split.

File sizes

File Lines Contents
PlanViewerControl.axaml.cs (main) 504 Fields, brushes, ctor, public API, connection state, AXAML-bound PlanConnect_Click / PlanDatabase_SelectionChanged
.Rendering.cs 550 RenderStatement, RenderNodes, CreateNodeVisual, RenderEdges, BuildEdgeTooltipContent, edge/link coloring
.Properties.cs 1,860 ShowPropertiesPanel + all Show* panels (missing indexes, parameters, wait stats, runtime, server context) + property row/section helpers
.Tooltips.cs 278 BuildNodeTooltipContent, tooltip section/row helpers
.Interaction.cs 327 Node_Click, SelectNode, context menus, zoom (ZoomIn/ZoomOut/ZoomFit_Click, SetZoom), pointer events, SavePlan_Click
.Statements.cs 222 Statements grid panel — populate, selection, copy, open in editor, show/close
.Minimap.cs 502 Minimap rendering, drag, resize, viewport-box sync, click-to-center, zoom-to-node
.Schema.cs 347 Context-menu schema lookup (AddSchemaMenuItems, FetchAndShowSchemaAsync, FormatIndexes, FormatColumns)

Behavior

  • Move-only. No method bodies were modified.
  • All AXAML-bound event handlers (Click="...", SelectionChanged="...") retain their exact names.
  • LongComparer and DoubleComparer (top-level helper classes) stay at the bottom of the main file.

Test plan

  • dotnet build PlanViewer.sln — 0 errors, 0 warnings
  • Load a plan from file — renders nodes/edges, tooltips work
  • Click a node — properties panel shows, minimap highlights
  • Open minimap — drag, resize, click-to-navigate
  • Show statements grid — selection re-renders the active statement
  • Right-click a scan node — schema lookup menu items (Show Indexes / Show Table Definition) work
  • Connect via toolbar, get actual plan — full flow

🤖 Generated with Claude Code

erikdarlingdata and others added 30 commits April 7, 2026 11:43
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Uses the Darling Data barbell logo as hero image when shared on
social media. Also adds meta description for SEO.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add Open Graph meta tags for social sharing
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Merge dev: HTML export for plan analysis (#182)
This reason means something in the query blocks parallelism (scalar UDFs,
table variable inserts, etc.) — that's worth a Warning, not Info.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Fix Rule 3: CouldNotGenerateValidParallelPlan stays Warning
Adds human-readable messages for all 25 known reasons. Severity:
- Warning: actionable reasons (UDFs, cursors, table variables, remote
  queries, trace flags, hints, DML OUTPUT, writeback variables)
- Info: passive/environmental (cost below threshold, edition limits,
  memory-optimized tables, upgrade mode, index build edge cases)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Expand Rule 3 to cover all NonParallelPlanReason values
Merge dev: plan sharing and export (#182)
Merge dev to main (v1.4.3 + logo fix)
Merge dev: HTTPS plan sharing API
Release: issue #178 round 3 feedback (items 17-25)
Release v1.5.0 — maximum benefit scoring
Release: analytics for Plan Analyzer web app
Merge dev to main — Joe #215 feedback through b1/b7
Release v1.7.0 — wait stats as warnings
Release v1.7.1 — render benefit % and actionable fix
Release v1.7.2 — operator self-time fix + decimal benefit %
Release v1.7.3 — visible web viewer version
Release v1.7.4 — external-wait formula + CPU:Elapsed adjustment
erikdarlingdata and others added 7 commits April 22, 2026 13:21
Release v1.7.6 — C1 memory color + C4 compile time + C8 expensive-op + C9 columnstore
Release v1.7.7 — D3 content strip + legacy marker + drop Rule 21
Release v1.7.8 — batch-mode pipelined self-time (#215 D1)
Release v1.8.0 — Joe feedback E1-E12 batch
Move-only refactor; no behavior changes. PlanViewerControl.axaml.cs
(4,497 lines) split into 7 partials:

  Rendering    (550) - RenderStatement/Nodes/Edges + edge tooltips
  Properties   (1860) - ShowPropertiesPanel + all property/runtime/wait panels
  Tooltips     (278) - BuildNodeTooltipContent + helpers
  Interaction  (327) - Node_Click, Select, zoom, pointer events, save
  Statements   (222) - statements grid panel
  Minimap      (502) - minimap render/drag/resize/navigation
  Schema       (347) - context-menu schema lookup + index/column formatting

Main file (PlanViewerControl.axaml.cs) now 504 lines — fields, brushes,
constructor, public API (LoadPlan/Clear/NavigateToNode), connection
state, and PlanConnect/PlanDatabase event handlers.

Build clean: 0 errors, 0 warnings on PlanViewer.sln.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@erikdarlingdata erikdarlingdata changed the base branch from main to dev May 13, 2026 03:16
@erikdarlingdata erikdarlingdata merged commit ef6142c into dev May 13, 2026
3 of 4 checks passed
@erikdarlingdata erikdarlingdata deleted the feature/split-planviewercontrol branch May 13, 2026 03:28
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