Commit graph

5 commits

Author SHA1 Message Date
wfx
fc73e4b76b Complete Clean Architecture migration
Phase 1-7: Full migration from src/app/ to Clean Architecture

BREAKING CHANGES:
- Removed src/app/ (old TEA-style implementation)
- Removed src/constant.rs (constants now local to modules)
- Removed deprecated canvas_to_image_coords functions

NEW STRUCTURE:
- src/ui/           - UI Layer (COSMIC interface)
- src/application/  - Application Layer (DocumentManager, Commands)
- src/domain/       - Domain Layer (Document types, Operations)
- src/infrastructure/ - Infrastructure Layer (Loaders, Cache, System)

FEATURES:
- DocumentManager as Single Source of Truth
- Command Pattern for all operations
- Model caching for render data (performance)
- Sync mechanism between DocumentManager and UI Model
- Wallpaper support (COSMIC, KDE, GNOME, feh)
- Thumbnail cache with disk persistence

IMPROVEMENTS:
- Warnings: 62 → 43 (-31%)
- Deprecated warnings: 2 → 0 (-100%)
- Code removed: src/app/ (~2000 lines), constant.rs, deprecated functions
- Better Locality of Reference (constants local to modules)
- Clean separation of concerns
- No circular dependencies

DOCUMENTATION:
- Updated AGENTS.md (100% migration status)
- Updated README.md (architecture section)
- Updated Workflow.md
- Added Migration-Plan.md with full completion summary

TESTS:
- All 41 tests passing
- Build successful (0 errors, 43 warnings)
- Release build verified

Migration Status:  100% Complete
2026-02-03 08:43:21 +01:00
wfx
9399a008c4 refactor: improve code quality and consistency
Comprehensive code audit addressing naming consistency, dead code removal,
and documentation improvements across the entire codebase.

- Rename panel_pages.rs → pages_panel.rs for consistent naming
- Unify view functions: all panels now use view() convention
- Rename header_start/end() → start/end() for brevity
- Update all imports and references

- Remove Rotation::from_degrees() (only 4 fixed states needed)
- Remove TransformState::identity() and is_identity() (Default suffices)
- Remove duplicate convenience methods from RasterDocument, VectorDocument,
  PortableDocument (rotate_cw/ccw, flip_horizontal/vertical)
- Remove unused imports and constants (ROTATION_STEP, FULL_ROTATION)

- Rename constants: PDF_RENDER_SCALE → PDF_RENDER_QUALITY,
  PDF_THUMBNAIL_SCALE → PDF_THUMBNAIL_SIZE
- Add comprehensive trait documentation explaining type erasure pattern
- Document why large enum variants are acceptable
- Add #[allow(dead_code)] with explanations for trait API types
- Improve all constant and config comments

- Collapse nested if statements using Rust 2024 let-chains
- Replace single-arm match with if-let
- Introduce StateChangeCallback<Message> type alias
- Apply clippy auto-fixes for better code style
2026-01-19 19:42:54 +01:00
wfx
1182b7b55d feature: PDF and PDF thumbnails and refresh UI
- Implement PDF and PDF thumbnail generation with incremental loading
- Add UI refresh mechanism (tick counter + RefreshView message)
- Improve fl! macro with named parameters
- Clean up code organization (mod.rs: wiring, model.rs: state only)
2026-01-18 20:35:12 +01:00
wfx
4de63d8549 chore: fix license header 2026-01-07 20:42:28 +01:00
wfx
ab93f649bd chore: initial commit 2026-01-07 20:22:49 +01:00