refactor: extract ModalRenderer from ExportConfigModal

Create dedicated ModalRenderer class to handle all DOM rendering logic previously embedded in ExportConfigModal. This comprehensive extraction moves substantive implementation rather than just skeletal structures.

Key changes:
• New ModalRenderer.ts - Complete rendering logic (480+ lines)
• Extracted methods with full implementations:
  - createHeader() - Header creation with note info display
  - renderSections() - Section rendering and clearing logic
  - createProgressContainer() - Progress UI with bar and text
  - createActionButtons() - Button creation with event handlers
  - showProgress()/updateProgress() - Progress update logic
  - addModalStyles() - Complete CSS styling (122 lines)
  - showValidationErrors/Warnings() - Error/warning display
• ExportConfigModal updated to use ModalRenderer via dependency injection
• Proper separation: renderer owns DOM, modal handles business logic
• All TypeScript compilation passes

Follows Step 4.1 of refactoring plan. Ready for modal display testing.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Jarvis committed 2025-09-10 12:30:17 +02:00
1 parent 3b926fce12
commit 41e70e389e
3 files changed
+520 -270

No files matched your search

+3 -3
View File
@@ -194,7 +194,7 @@ The main.ts file is the plugin entry point and most critical to get right.
**STOP** → Verify build → Test resource resolution works
### Step 3.4: Update PandocTypstConverter.ts - IN PROGRESS
### Step 3.4: Update PandocTypstConverter.ts - DONE
**Final size:** ~200 lines
**Keep:**
- Main conversion method
@@ -205,9 +205,9 @@ The main.ts file is the plugin entry point and most critical to get right.
**CHECKPOINT: Test PDF generation with various settings**
## PHASE 4: Refactor ExportConfigModal.ts
## PHASE 4: Refactor ExportConfigModal.ts - IN PROGRESS
### Step 4.1: Create ModalRenderer.ts
### Step 4.1: Create ModalRenderer.ts - IN PROGRESS
**Location:** `src/ui/modal/ModalRenderer.ts` (~150 lines)
**Extract:**
- `createHeader()` method