ConnorYoh
|
7e3321ee16
|
Feature/v2/filemanager (#4121)
FileManager Component Overview
Purpose: Modal component for selecting and managing PDF files with
preview capabilities
Architecture:
- Responsive Layouts: MobileLayout.tsx (stacked) vs DesktopLayout.tsx
(3-column)
- Central State: FileManagerContext handles file operations, selection,
and modal state
- File Storage: IndexedDB persistence with thumbnail caching
Key Components:
- FileSourceButtons: Switch between Recent/Local/Drive sources
- FileListArea: Scrollable file grid with search functionality
- FilePreview: PDF thumbnails with dynamic shadow stacking (1-2 shadow
pages based on file count)
- FileDetails: File info card with metadata
- CompactFileDetails: Mobile-optimized file info layout
File Flow:
1. Users select source → browse/search files → select multiple files →
preview with navigation → open in
tools
2. Files persist across tool switches via FileContext integration
3. Memory management handles large PDFs (up to 100GB+)
```mermaid
graph TD
FM[FileManager] --> ML[MobileLayout]
FM --> DL[DesktopLayout]
ML --> FSB[FileSourceButtons<br/>Recent/Local/Drive]
ML --> FLA[FileListArea]
ML --> FD[FileDetails]
DL --> FSB
DL --> FLA
DL --> FD
FLA --> FLI[FileListItem]
FD --> FP[FilePreview]
FD --> CFD[CompactFileDetails]
```
---------
Co-authored-by: Connor Yoh <connor@stirlingpdf.com>
|
2025-08-08 15:15:09 +01:00 |
|
ConnorYoh
|
9c9acbfb5b
|
V2: Convert Tool (#3828)
🔄 Dynamic Processing Strategies
- Adaptive routing: Same tool uses different backend endpoints based on
file analysis
- Combined vs separate processing: Intelligently chooses between merge
operations and individual file processing
- Cross-format workflows: Enable complex conversions like "mixed files →
PDF" that other tools can't handle
⚙️ Format-Specific Intelligence
Each conversion type gets tailored options:
- HTML/ZIP → PDF: Zoom controls (0.1-3.0 increments) with live preview
- Email → PDF: Attachment handling, size limits, recipient control
- PDF → PDF/A: Digital signature detection with warnings
- Images → PDF: Smart combining vs individual file options
File Architecture
Core Implementation:
├── Convert.tsx # Main stepped workflow UI
├── ConvertSettings.tsx # Centralized settings with smart detection
├── GroupedFormatDropdown.tsx # Enhanced format selector with grouping
├── useConvertParameters.ts # Smart detection & parameter management
├── useConvertOperation.ts # Multi-strategy processing logic
└── Settings Components:
├── ConvertFromWebSettings.tsx # HTML zoom controls
├── ConvertFromEmailSettings.tsx # Email attachment options
├── ConvertToPdfaSettings.tsx # PDF/A with signature detection
├── ConvertFromImageSettings.tsx # Image PDF options
└── ConvertToImageSettings.tsx # PDF to image options
Utility Layer
Utils & Services:
├── convertUtils.ts # Format detection & endpoint routing
├── fileResponseUtils.ts # Generic API response handling
└── setupTests.ts # Enhanced test environment with crypto mocks
Testing & Quality
Comprehensive Test Coverage
Test Suite:
├── useConvertParameters.test.ts # Parameter logic & smart detection
├── useConvertParametersAutoDetection.test.ts # File type analysis
├── ConvertIntegration.test.tsx # End-to-end conversion workflows
├── ConvertSmartDetectionIntegration.test.tsx # Mixed file scenarios
├── ConvertE2E.spec.ts # Playwright browser tests
├── convertUtils.test.ts # Utility function validation
└── fileResponseUtils.test.ts # API response handling
Advanced Test Features
- Crypto API mocking: Proper test environment for file hashing
- File.arrayBuffer() polyfills: Complete browser API simulation
- Multi-file scenario testing: Complex batch processing validation
- CI/CD integration: Vitest runs in GitHub Actions with proper artifacts
---------
Co-authored-by: Connor Yoh <connor@stirlingpdf.com>
Co-authored-by: Anthony Stirling <77850077+Frooodle@users.noreply.github.com>
|
2025-08-01 16:08:04 +01:00 |
|