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>
Extract process execution and PDF embed processing to dedicated modules:
- PandocExecutor: handles pandoc process spawning, monitoring, and error parsing
- PdfEmbedProcessor: manages PDF to image conversion and embed replacement
PandocTypstConverter reduced from 741 to 202 lines, now serves as clean
orchestrator delegating to specialized modules. Maintains identical functionality
while improving maintainability and testability.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Remove unused regex patterns (WIKILINK_PATTERN, TAG_PATTERN)
- Fix step numbering in processing pipeline (1-6 sequential)
- Remove extra whitespace and improve code organization
- Reduce from 213 to 204 lines (target ~200 lines achieved)
- Clean orchestration focused on delegation to processors
- Build verification passes without errors
MarkdownPreprocessor now serves as pure orchestrator:
- Configuration management and processor coordination
- 6-step processing pipeline with clear delegation
- No trapped implementation details in main class
- Clean error handling and result compilation
Phase 2 complete: 1792 → 204 lines (88% reduction)
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Extract comprehensive wikilink processing functionality into separate module:
- Move processWikilinks() method with complete implementation
- Extract sanitizeFilePath() as public method for reuse by embed processors
- Move sanitizeHeadingForLink() and resolveRelativePath() methods
- Remove duplicate WikilinkConfig interface
- Update all embed processors to use WikilinkProcessor.sanitizeFilePath()
- Add WikilinkProcessor configuration sync in updateConfig()
- Preserve all existing functionality and error handling
Reduces MarkdownPreprocessor from 895 to 816 lines (-79 lines).
WikilinkProcessor: 172 lines of focused wikilink processing logic.
Build passes successfully with no breaking changes.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Reduce file type classification from 6+ types to 3: image, pdf, file
- Remove processVideoEmbed, processAudioEmbed, processDocumentEmbed methods
- Fix DOCX files not being embedded (were classified as 'document' → links only)
- All non-image/non-PDF files now properly embedded via processFileEmbed
- Update switch statement to handle only the 3 simplified file types
- Maintain backward compatibility for existing functionality
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>