juanatsap
7b60fdcf9c
refactor: Separate CV domain and UI presentation models into distinct packages
...
**Main Changes:**
1. **Package Restructuring** - Separated mixed concerns into focused packages:
- Created `internal/models/cv/` for CV domain logic (CV, Personal, Experience, etc.)
- Created `internal/models/ui/` for UI presentation logic (InfoModal, ShortcutsModal, etc.)
- Removed monolithic `internal/models/cv.go` (300+ lines → organized packages)
2. **Testing** - Added comprehensive unit tests:
- `internal/models/cv/loader_test.go` - CV data loading and validation
- `internal/models/ui/loader_test.go` - UI translations loading
- All tests passing ✅
3. **Documentation** - Added Go learning knowledge base:
- `_go-learning/architecture/server-design.md` - Goroutines, graceful shutdown explained
- `_go-learning/refactorings/001-cv-model-separation.md` - This refactoring documented
- Public documentation showcasing Go expertise (README.md kept private)
4. **Handler Updates** - Updated imports to use new package structure:
- `internal/handlers/cv.go` - Uses `cvmodel` and `uimodel` aliases
**Benefits:**
- ✅ Clear separation of concerns (domain vs presentation)
- ✅ Better testability (isolated package testing)
- ✅ Improved maintainability (smaller, focused files)
- ✅ Scalability (each domain can evolve independently)
- ✅ Follows Go best practices (small, cohesive packages)
**Other Updates:**
- Updated middleware security checks
- Template improvements
- Organized completed prompts
**Testing:**
- All Go unit tests pass (cv, ui, handlers)
- Server verified with curl tests (English, Spanish, Health endpoints)
- Frontend functionality unchanged (refactoring is transparent to UI)
2025-11-20 16:17:56 +00:00
juanatsap
6e2b042c8d
feat(pdf-modal): implement interactive thumbnail selection
...
Transform PDF modal from placeholder to functional UI with three
interactive thumbnail cards using skeleton/placeholder styling.
Features:
- Three thumbnail options: Short CV (1 page), Long CV (2 pages), Custom (coming soon)
- Skeleton shimmer animations (1.8s, 60fps, GPU-accelerated)
- Click-to-select with visual feedback (green border, shadow, checkmark)
- Radio button behavior (only one selection at a time)
- Download button with enable/disable state management
- Keyboard navigation support (Tab, Enter, Space, ESC)
- Full ARIA attributes for screen reader accessibility
- Responsive layout (3 cols desktop, 2 cols tablet, 1 col mobile)
- Multilingual support (EN/ES) using Go template conditionals
- Download stub (shows alert, ready for backend integration)
Implementation:
- templates/partials/modals/pdf-modal.html: Complete rewrite (244 lines)
- static/css/main.css: Add PDF modal section (+290 lines)
- tests/mjs/14-pdf-modal.test.mjs: Comprehensive E2E test suite (570 lines)
- prompts/005-pdf-download-thumbnails-IMPLEMENTATION.md: Documentation
Tests: ✅ 12/12 PASSED
- Modal structure validation
- Three thumbnail cards display
- Selection interaction (click, keyboard)
- Download button state management
- ESC key closes modal
- Accessibility compliance (ARIA, roles, tabindex)
- Responsive layout (375px, 768px, 1920px)
- Multilingual support validation
- No console errors
Screenshots:
- tests/screenshots/pdf-modal-initial.png
- tests/screenshots/pdf-modal-short-selected.png
- tests/screenshots/pdf-modal-long-selected.png
Technical Details:
- Uses Hyperscript for state management (consistent with project)
- Native <dialog> element for accessibility
- Reuses skeleton.css patterns for shimmer animation
- Follows existing modal patterns (shortcuts-modal.html)
- Performance: <5KB gzipped overhead
- Browser support: 95%+ (all modern browsers)
Next Steps:
- Backend PDF generation (/download-pdf endpoint)
- Custom wizard implementation (Phase 3)
- PDF preview feature (Phase 4)
Refs: prompts/005-pdf-download-thumbnails.md
2025-11-18 20:25:49 +00:00