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
This commit is contained in:
@@ -95,7 +95,7 @@
|
||||
data-cv-format="long"
|
||||
role="radio"
|
||||
aria-checked="false"
|
||||
aria-label="{{if eq .Lang "es"}}CV Extendido - 8 páginas, versión completa{{else}}Extended CV - 8 pages, full version{{end}}"
|
||||
aria-label="{{if eq .Lang "es"}}CV Extendido - 9 páginas, versión completa{{else}}Extended CV - 9 pages, full version{{end}}"
|
||||
tabindex="0"
|
||||
_="on click
|
||||
-- Remove selected from all cards
|
||||
@@ -143,12 +143,12 @@
|
||||
|
||||
<!-- Page count badge -->
|
||||
<div class="thumbnail-badge">
|
||||
{{if eq .Lang "es"}}8 Páginas{{else}}8 Pages{{end}}
|
||||
{{if eq .Lang "es"}}9 Páginas{{else}}9 Pages{{end}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="pdf-option-info">
|
||||
<h3>{{if eq .Lang "es"}}CV Extendido (8 páginas){{else}}Extended CV (8 pages){{end}}</h3>
|
||||
<h3>{{if eq .Lang "es"}}CV Extendido (9 páginas){{else}}Extended CV (9 pages){{end}}</h3>
|
||||
<p>{{if eq .Lang "es"}}Todos los detalles{{else}}All details{{end}}</p>
|
||||
</div>
|
||||
|
||||
@@ -250,14 +250,12 @@
|
||||
// Short CV: clean version (no skills), short length
|
||||
url = `/export/pdf?lang=${lang}&length=short&icons=show&version=clean`;
|
||||
} else if (selectedFormat === 'long') {
|
||||
// Long CV: with skills sidebar, extended length
|
||||
url = `/export/pdf?lang=${lang}&length=extended&icons=show&version=with_skills`;
|
||||
// Long CV: with skills sidebar, long length
|
||||
url = `/export/pdf?lang=${lang}&length=long&icons=show&version=with_skills`;
|
||||
} else if (selectedFormat === 'current') {
|
||||
// Current view: use localStorage settings
|
||||
let currentLength = localStorage.getItem('cv-length') || 'short';
|
||||
// Map old values to new naming convention
|
||||
if (currentLength === 'long') currentLength = 'extended';
|
||||
// 'short' stays as 'short' - no mapping needed
|
||||
// 'long' and 'short' stay as-is - no mapping needed
|
||||
|
||||
const currentIcons = localStorage.getItem('cv-icons') || 'show';
|
||||
const currentTheme = localStorage.getItem('cv-theme') || 'default';
|
||||
|
||||
Reference in New Issue
Block a user