Commit Graph

5 Commits

Author SHA1 Message Date
juanatsap 9636b3659f refactor: Extract all hardcoded content to JSON files
- Move all bilingual text from templates to UI JSON (labels, buttons, modals)
- Move skills summary paragraph to CV JSON with HTML support
- Add new UI sections: navigation, viewControls, sections, footer, portfolio,
  pdfModal, shortcutsModal, infoModal, widgets
- Update Go structs to match expanded JSON structure
- Add template.HTML type for CV.SkillsSummary field
- Add JSON content validation test (70-json-content-validation.test.mjs)

Templates now contain only structural logic (CSS classes, HTML attributes)
while all user-visible text loads from JSON files for proper i18n support.
2025-11-30 10:13:37 +00:00
juanatsap 9015cef098 fix: Update tooltip text to match action bar buttons
Changed tooltip text for fixed buttons to match action bar wording:
- Print button: "Print CV" → "Print Friendly"
- Download button: "Download PDF" → "Download as PDF"

This ensures consistency across all button locations (fixed left buttons,
action bar, and hamburger menu).

Changes:
- templates/partials/widgets/print-friendly-button.html: Updated tooltip text
- templates/partials/widgets/download-button.html: Updated tooltip text
2025-11-20 20:06:47 +00:00
juanatsap 4528e04bad feat: Complete all remaining Future Improvements (#4-8)
Implemented 5 additional architectural improvements:

1. Response Types (types.go)
   - APIResponse with Success, Data, Error, Meta fields
   - ErrorInfo with Code, Message, Field, Details
   - MetaInfo with Timestamp, Version, RequestID
   - SuccessResponse() and NewErrorResponse() helpers
   - HealthCheckResponse for health endpoint
   - Consistent JSON API responses

2. Validation Tags (types.go)
   - Added struct tags to LanguageRequest
   - Added struct tags to PDFExportRequest
   - Declarative validation rules (oneof, required)
   - Self-documenting validation constraints
   - Ready for go-playground/validator integration

3. Context Helper Functions (middleware/preferences.go)
   - GetLanguage(), GetCVLength(), GetCVIcons(), GetCVTheme(), GetColorTheme()
   - IsLongCV(), IsShortCV() boolean helpers
   - ShowIcons(), HideIcons() boolean helpers
   - IsCleanTheme(), IsDefaultTheme() boolean helpers
   - IsDarkMode(), IsLightMode() boolean helpers
   - 13 new convenience functions for cleaner code

4. Typed Errors (errors.go)
   - ErrorCode constants for all error types
   - DomainError with Code, Message, Err, StatusCode, Field
   - Unwrap() support for error chains
   - WithError() and WithField() fluent builders
   - InvalidLanguageError(), InvalidLengthError(), etc.
   - PDFGenerationError(), MethodNotAllowedError(), RateLimitError()
   - 13 error codes, domain-specific constructors

5. Benchmark Tests
   - handlers/benchmarks_test.go (11 benchmarks)
   - middleware/benchmarks_test.go (12 benchmarks)
   - Sequential benchmarks for handlers, middleware, request parsing
   - Parallel benchmarks for concurrent load testing
   - Response creation benchmarks
   - Helper function benchmarks

Benefits:
- Type Safety: Validation tags and structured types
- Developer Experience: 13 context helpers reduce boilerplate
- Error Handling: Domain-specific errors with codes
- Performance Monitoring: 23 benchmarks for regression detection
- API Consistency: Standardized response formats
- Maintainability: Self-documenting validation and errors

Testing:
- All unit tests pass
- All benchmarks working
- Build succeeds
- No breaking changes
2025-11-20 18:05:45 +00:00
juanatsap 585f620bd6 refactor: organize hyperscript code and implement mobile button layout
This commit includes two major improvements:

1. Hyperscript Code Organization:
   - Extracted all hyperscript blocks >3 lines into reusable functions
   - Created 6 new functions in functions._hs:
     * toggleCVLength(isLong) - CV length toggle sync
     * toggleIcons(showIcons) - Icons toggle sync
     * toggleTheme(isClean) - Theme toggle sync
     * syncPdfHover(show) - PDF button synchronized hover
     * syncPrintHover(show) - Print button synchronized hover
     * highlightZoomControl(show) - Zoom control highlight effect
   - Reduced inline hyperscript from 11+ lines to 1-2 lines per element
   - Updated 8 template files to use function calls:
     * hamburger-menu.html
     * view-controls.html
     * action-buttons.html
     * download-button.html
     * print-friendly-button.html
     * zoom-toggle-button.html

2. Mobile Button Layout (max-width: 900px):
   - Repositioned three fixed buttons (PDF, Print, Info) horizontally at bottom center
   - Print button perfectly centered in viewport
   - Download button on left, Info button on right
   - Hidden zoom and shortcuts buttons on mobile (available in hamburger menu)
   - Removed conflicting old mobile styles that were hiding print button
   - Smooth hover transitions maintained with proper transform calculations

Technical details:
- Used CSS transform with calc() for precise horizontal positioning
- Maintained hover effects with combined translateX/translateY transforms
- Ensured accessibility with proper ARIA labels and spacing
- All functions check element existence before manipulation
- LocalStorage sync maintained across desktop/mobile toggles
2025-11-16 14:03:22 +00:00
juanatsap bfb7b35c50 feat: add synchronized hover effect for PDF and print-friendly buttons
- PDF buttons (fixed, action bar, menu) now sync hover states across all instances
- Print-friendly buttons (fixed, action bar, menu) sync green hover states
- White PDF icon with red hover background (#cd6060)
- Green print button hover (#27ae60)
- Implemented using hyperscript with .pdf-hover-sync and .print-hover-sync classes
- Creates cool visual feedback showing all related buttons simultaneously
2025-11-16 13:19:56 +00:00