Skip to content

Split MainWindow.axaml.cs into partial classes#333

Merged
erikdarlingdata merged 1 commit into
devfrom
feature/split-mainwindow
May 13, 2026
Merged

Split MainWindow.axaml.cs into partial classes#333
erikdarlingdata merged 1 commit into
devfrom
feature/split-mainwindow

Conversation

@erikdarlingdata
Copy link
Copy Markdown
Owner

Summary

Move-only refactor of MainWindow.axaml.cs (1,352 lines) into 4 partial-class files.

File sizes

File Lines Contents
MainWindow.axaml.cs (main) 325 Fields, constructor (drag-drop, hotkeys, command-line args), StartPipeServer, StartMcpServer, OnClosed, Exit_Click, About_Click, UpdateEmptyOverlay, ShowError, CheckForUpdatesOnStartupAsync
.FileOps.cs 260 File open/paste/drag-drop, LoadSqlFile, LoadPlanFile, ValidatePlanXml, Save/RestoreOpenPlans
.Tabs.cs 198 CreateTab, close/context menu, StartRename, GetTabFilePath/Label, GetQueryTextFromPlan
.PlanViewer.cs 468 CreatePlanTabContent, ShowAdviceWindow, ShowCompareDialog, GetActualPlanFromFile, ExtractDatabaseFromPlanXml
.RecentPlans.cs 78 TrackRecentPlan, RebuildRecentPlansMenu, RecentPlanItem_Click, ClearRecentPlans_Click

Behavior

  • Move-only. No method bodies were modified.
  • All AXAML-bound event handlers retain their exact names.

Test plan

  • dotnet build PlanViewer.sln — 0 errors
  • File menu: New / Open / Paste XML / Recent Plans / Clear Recent / About / Exit
  • Drag-and-drop a .sql or .sqlplan file onto the window
  • Tab rename (double-click), close (× button + Ctrl+W), context menu
  • Open a plan from file, request Actual Plan (re-execute against live connection)
  • Compare dialog from File → Compare Plans

🤖 Generated with Claude Code

@erikdarlingdata erikdarlingdata changed the base branch from main to dev May 13, 2026 03:17
Move-only refactor; no behavior changes. MainWindow.axaml.cs (1,380
lines) split into 4 partials:

  FileOps     (260) - File open/paste/drag-drop, LoadSqlFile,
                      LoadPlanFile, ValidatePlanXml, Save/RestoreOpenPlans
  Tabs        (209) - CreateTab, Close/Context menu, StartRename,
                      GetTabFilePath/Label, GetQueryTextFromPlan
  PlanViewer  (468) - CreatePlanTabContent, ShowAdviceWindow,
                      ShowCompareDialog, GetActualPlanFromFile,
                      ExtractDatabaseFromPlanXml
  RecentPlans ( 78) - TrackRecentPlan, RebuildRecentPlansMenu,
                      RecentPlanItem_Click, ClearRecentPlans_Click

Main file now 342 lines — fields, ctor (drag-drop wiring, hotkeys,
command-line args, MCP start), StartPipeServer/StartMcpServer, OnClosed,
Exit_Click, About_Click, UpdateEmptyOverlay, ShowError,
CheckForUpdatesOnStartupAsync.

Build clean: 0 errors on PlanViewer.App (existing pre-existing CS0618
on DragEventArgs.Data is unchanged).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@erikdarlingdata erikdarlingdata force-pushed the feature/split-mainwindow branch from 440c224 to c44a675 Compare May 13, 2026 03:24
@erikdarlingdata erikdarlingdata merged commit f2a3989 into dev May 13, 2026
2 checks passed
@erikdarlingdata erikdarlingdata deleted the feature/split-mainwindow branch May 13, 2026 03:31
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