Skip to content

Latest commit

 

History

History
149 lines (130 loc) · 6.19 KB

PHASE_5_COMPLETION.md

File metadata and controls

149 lines (130 loc) · 6.19 KB

Phase 5: Wizard Implementation - Validation Checklist

Deliverables Status

1. ✅ Wizard Container (WizardView.xaml)

  • Title: "Entity Class Generator"
  • Left panel: Step indicator (1/5, 2/5, ... 5/5)
  • Step titles: Connection, Tables, Naming, Output, Preview
  • Center: Scrollable content area for step views
  • Bottom bar with Cancel, Back (disabled on step 1), Next/Generate (disabled when invalid)
  • Progress bar (visible when busy)
  • Status message display
  • Fluent WPF-UI styling with brand colors

2. ✅ WizardViewModel (WizardViewModel.cs)

  • CurrentStep property (1-5)
  • CanGoBack → CurrentStep > 1
  • CanGoNext → CurrentStep < 5 && StepIsValid
  • CanGenerate → CurrentStep == 5 && StepIsValid
  • Next() → increment step, validate on entry
  • Back() → decrement step
  • Generate() → call MainViewModel.GenerateAsync()
  • Step validation properties: Step1Valid, Step2Valid, Step3Valid, Step4Valid, Step5Valid
  • Property binding to MainViewModel for auto-validation
  • Preview code generation

3. ✅ Five Step Views

Step 1: Connection (Step1ConnectionView.xaml)

  • Server name input (TextBox)
  • Database name input (TextBox)
  • Authentication type (Windows/SQL)
  • Username/Password fields (conditional on SQL auth)
  • Test Connection button
  • Status message display
  • IsValid = server non-empty AND database non-empty

Step 2: Tables (Step2TablesView.xaml)

  • Schema filter (ComboBox)
  • Table filter (TextBox)
  • Multi-select DataGrid with checkboxes
  • Columns: Schema, Table Name, Column Count, PK Count
  • Select All / Deselect All / Invert buttons
  • Selected count display
  • IsValid = at least 1 table selected

Step 3: Naming (Step3NamingView.xaml)

  • Namespace input
  • DbContext name input
  • Class naming style (ComboBox)
  • Property naming style (ComboBox)
  • Prefix to remove (TextBox)
  • Suffix to remove (TextBox)
  • Class suffix (TextBox)
  • Singularize class names (CheckBox)
  • IsValid = non-empty namespace AND non-empty DbContext name

Step 4: Output (Step4OutputView.xaml)

  • Output directory path (TextBox)
  • Browse button placeholder
  • Existing file handling: Skip (selected), Overwrite, Diff (disabled)
  • Code generation options: Nullable refs, Data annotations, Fluent API
  • IsValid = valid directory path format

Step 5: Preview (Step5PreviewView.xaml)

  • TabControl with 3 tabs
  • Tab 1: Entity class preview (first table)
  • Tab 2: DbContext preview
  • Tab 3: Fluent configuration preview
  • AvalonEdit code editors (read-only)
  • Syntax highlighting support
  • Code formatted as "// File: {name}\n{code}"
  • Shows first 15-20 lines of generated code
  • IsValid = always true (preview is always available)

4. ✅ Preserve Existing MainViewModel

  • Connection validation logic untouched
  • Table loading logic untouched
  • Naming convention state unchanged
  • Generation logic unchanged
  • Made GenerateAsync() public for WizardViewModel access
  • All commands still available (TestConnection, LoadTables, etc.)

5. ✅ Styling & Colors

  • Step indicator active dot: #00B3F0 (System Accent)
  • Step indicator completed: #A6CE39 (Green/Success)
  • Step indicator pending: #EEEEEE (Light Gray)
  • Button appearance: Primary (Next/Generate), Secondary (Back/Cancel)
  • Card-based layout with WPF-UI CardBackgroundFill
  • Responsive layout with proper spacing

6. ✅ AvalonEdit Setup

  • NuGet: AvalonEdit 6.3.0.90 added
  • Configured in Step5PreviewView
  • Three editors (Entity, DbContext, FluentConfig)
  • Read-only mode
  • No line numbers (first pass)
  • No drag-drop enabled
  • Word wrap disabled
  • Monospace font (Consolas)

7. ✅ No Breaking Changes

  • Existing connection logic intact
  • Existing naming logic intact
  • Existing output logic intact
  • Existing generation logic intact
  • All 80 existing tests remain valid
  • Phases 0-4 architecture preserved

Build Status

  • ✅ Build Succeeded: 0 errors, 0 warnings
  • ✅ Project: EntityClassGenerator.App
  • ✅ Target Framework: net10.0-windows
  • ✅ Dependencies: All resolved (AvalonEdit, WPF-UI, CommunityToolkit.Mvvm)

Files Created/Modified

New Files

  • src/EntityClassGenerator.App/ViewModels/WizardViewModel.cs (9.8 KB)
  • src/EntityClassGenerator.App/Views/WizardView.xaml (10.4 KB)
  • src/EntityClassGenerator.App/Views/WizardView.xaml.cs (4.1 KB)
  • src/EntityClassGenerator.App/Views/Steps/Step1ConnectionView.xaml (6.2 KB)
  • src/EntityClassGenerator.App/Views/Steps/Step1ConnectionView.xaml.cs (0.25 KB)
  • src/EntityClassGenerator.App/Views/Steps/Step2TablesView.xaml (5.2 KB)
  • src/EntityClassGenerator.App/Views/Steps/Step2TablesView.xaml.cs (0.22 KB)
  • src/EntityClassGenerator.App/Views/Steps/Step3NamingView.xaml (6.7 KB)
  • src/EntityClassGenerator.App/Views/Steps/Step3NamingView.xaml.cs (0.22 KB)
  • src/EntityClassGenerator.App/Views/Steps/Step4OutputView.xaml (5.4 KB)
  • src/EntityClassGenerator.App/Views/Steps/Step4OutputView.xaml.cs (0.22 KB)
  • src/EntityClassGenerator.App/Views/Steps/Step5PreviewView.xaml (3.8 KB)
  • src/EntityClassGenerator.App/Views/Steps/Step5PreviewView.xaml.cs (0.75 KB)
  • src/EntityClassGenerator.App/Converters/WizardConverters.cs (4.2 KB)

Modified Files

  • Directory.Packages.props: Added AvalonEdit 6.3.0.90
  • src/EntityClassGenerator.App/EntityClassGenerator.App.csproj: Added AvalonEdit package reference
  • src/EntityClassGenerator.App/App.xaml: Registered 7 converters
  • src/EntityClassGenerator.App/App.xaml.cs: DI registration for WizardViewModel
  • src/EntityClassGenerator.App/MainWindow.xaml: Replaced with minimal frame + WizardView
  • src/EntityClassGenerator.App/ViewModels/MainViewModel.cs: Made GenerateAsync public

Next Steps (Phase 6)

  • Implement diff view for existing-file handling
  • Add file browser dialog for output directory picker
  • Add theme support switching in wizard
  • Add keyboard navigation (Enter = Next, Escape = Cancel)
  • Add validation error messages per step
  • Generate test cases for wizard navigation