juanatsap
|
b44f9b9a99
|
refactor: Rename 'extended' → 'long' + add compact sidebar fonts
BREAKING CHANGE: API parameter renamed from 'extended' to 'long'
## Breaking Change: Terminology Standardization
Renamed 'extended' to 'long' across entire codebase for consistency:
**Backend (Go):**
- internal/handlers/cv.go (7 locations)
- Migration logic to auto-convert 'extended' → 'long' cookies
- API validation now rejects 'extended', requires 'long'
- Toggle state logic updated
- internal/handlers/pdf_test.go (17 occurrences)
- Test function renamed: TestExportPDF_ExtendedWithSkills → TestExportPDF_LongWithSkills
- All test cases, parameters, and expected filenames updated
- internal/pdf/generator.go (2 comment updates)
**Frontend:**
- PDF-EXPORT-FEATURE.md (3 occurrences)
- doc/3-API.md (parameter documentation)
- doc/7-CUSTOMIZATION.md (examples updated)
- templates/partials/modals/pdf-modal.html (button text, URLs)
- static/js/main.js (migration logic)
- static/hyperscript/toggles._hs (toggle logic)
- tests/mjs/24-pdf-download-params.test.mjs (test expectations)
- tests/mjs/test-preference-migration.test.mjs (NEW)
- tests/mjs/verify-migration.test.mjs (NEW)
**PDFs Renamed:**
- cv-extended-with_skills-jamr-2025-en.pdf → cv-long-with_skills-jamr-2025-en.pdf
- cv-extended-with_skills-jamr-2025-es.pdf → cv-long-with_skills-jamr-2025-es.pdf
**Migration:** Automatic cookie migration from 'extended' → 'long' for seamless UX
## New Feature: Compact Sidebar Fonts
Reduces page count for short CV with skills from 6 → 5 pages:
**Implementation:**
- Location: internal/pdf/generator.go (lines 154-215)
- Cookie detection: `cookies["cv-length"] == "short"`
- Font reduction: 2-6% (0.94-0.98em) - very subtle
- Only activates for: `length=short` + `version=with_skills`
- Long version: Always uses full-size fonts
**Impact:**
- Page count: 6 pages → 5 pages (16.7% reduction)
- Readability: Maintained - fonts remain professional
- Design philosophy: Subtle, natural content flow
**Testing:**
- New test: TestPDFGenerator_CompactSidebarFonts
- Comprehensive coverage of cookie detection and PDF generation
- Manual verification: 5-page PDF with compact but readable fonts
**Documentation:**
- doc/LONG-PDF-GENERATION.md (NEW, 13 KB)
- Complete feature documentation
- Implementation details with code examples
- Font size breakdown table
- Testing and troubleshooting guides
- Compact sidebar fonts section (comprehensive)
**Files Changed:**
- 11 modified (backend + frontend + docs)
- 5 new files (2 PDFs, 1 doc, 2 tests)
- 2 files renamed (PDFs)
**Tests:** All Go tests passing, API validation verified, PDF generation tested
|
2025-11-20 11:21:43 +00:00 |
|
juanatsap
|
f7cda5dba3
|
refactor: Modularize CSS and fix theme-aware text colors
CSS Restructuring:
- Reorganize monolithic main.css into modular architecture
- Create foundation/ (reset, variables, typography, themes)
- Create layout/ (container, page, grid, paper)
- Create components/ (8 component files)
- Create interactive/ (toggles, remaining for future split)
- Create effects/ (skeleton loading)
- Create contexts/ (print styles)
Theme Support Fixes:
- Replace all hardcoded text colors with CSS variables
- Fix .section-title: rgb(51,51,51) → var(--text-primary)
- Fix .cv-name, .intro-text: hardcoded → theme-aware
- Fix .experience-period, .duration-text: #555/#aaa → variables
- Fix course/project/experience text colors
- Support proper light/dark theme text contrast
Icon & Layout Fixes:
- Standardize all icon sizes to 80×80px
- Change all icon backgrounds to transparent
- Fix award section layout (missing flexbox)
- Update HTML templates (experience.html, awards.html) to width='80'
- Fix default icon sizing conflicts
View Switcher Fix:
- Fix toggleTheme() to target .cv-container instead of body
- Ensures clean/default theme toggle works correctly
Files: 40+ CSS files modularized, 3 templates updated, 7 tests added
|
2025-11-19 14:31:17 +00:00 |
|
juanatsap
|
d2330f5d48
|
refactor: migrate toggle and hover sync functions from JavaScript to Hyperscript
BREAKING: Removed JavaScript toggle functions in favor of organized Hyperscript architecture
Changes:
- Created organized Hyperscript file structure (no def limit with latest version):
• static/hyperscript/utils._hs (utility functions)
• static/hyperscript/toggles._hs (CV length, icons, theme toggles)
• static/hyperscript/hover-sync._hs (PDF/Print hover sync + zoom highlight)
- Removed functions._hs (renamed to utils._hs for better organization)
- Emptied static/js/cv-functions.js (kept file with migration notice)
• toggleCVLength, toggleIcons, toggleTheme → toggles._hs
• syncPdfHover, syncPrintHover, highlightZoomControl → hover-sync._hs
- Updated templates/index.html to load all 3 new hyperscript files
- Updated tests/mjs/1-toggles.test.mjs for responsive design
• Added viewport detection for desktop vs mobile toggles
• Tests now adapt to screen size
Rationale:
- Test 9 confirmed NO def limit with latest hyperscript (tested up to 5 defs)
- Better separation of concerns with category-based file organization
- Aligns with server-side hypermedia pattern (HTMX + Hyperscript)
- Eliminates workaround JavaScript duplication
- 9 total def statements across 3 files (proving no limit)
Verified:
✅ All hyperscript files load successfully (HTTP 200)
✅ Hyperscript library loads without errors
✅ Functions work correctly in browser
✅ No console errors
✅ Test 9 (def limit) passes with 5 def statements
Related: Test 9 verification (tests/mjs/9-hyperscript-def-limit.test.mjs)
|
2025-11-17 16:28:52 +00:00 |
|