65 Commits

Author SHA1 Message Date
juanatsap 982257b4c1 feat: update repo URL to repos.txeo.club/txeo/cv-site
Deploy CV Server / Pull and Restart (push) Failing after 0s
Test CV Site / Test on Go 1.25.1 (push) Failing after 0s
Migrate all user-facing links from GitHub to self-hosted Forgejo.
Go module imports unchanged (separate concern).
2026-05-20 18:30:25 +01:00
juanatsap 37ef0648d7 docs: add Phase 11 (self-hosted deps) and ADR-005 for HTMX/Hyperscript vendoring
Document why HTMX and Hyperscript are self-hosted instead of CDN-loaded:
zero external SPOF, faster same-origin loading, reduced CSP surface,
and controlled version upgrades.
2026-05-14 13:06:20 +01:00
juanatsap 8f4d0e9433 feat: self-host HTMX 2.0.10 and Hyperscript 0.9.91, remove unpkg CDN
- Download htmx.min.js v2.0.10 and _hyperscript.min.js v0.9.91 locally
- Update head-scripts.html to load from /static/ instead of unpkg CDN
- Remove https://unpkg.com from CSP script-src whitelist
- Update all documentation references to reflect self-hosted paths
- No breaking changes: all hx-* attributes are HTMX 2.0 compatible
2026-05-14 12:59:30 +01:00
juanatsap ff7cd4287b docs: add LLM provider evolution & benchmarks (section 16)
Document the full history of local LLM selection:
- Mistral → GLM → Gemma 4 26B MoE with reasons for each change
- Side-by-side benchmarks: Gemini vs Gemma4 vs GLM vs Mistral
- Quality comparison (language, tool calling, links, hallucination)
- Resource usage (params, RAM, disk, offline capability)
- Configuration examples for dev and prod
2026-04-09 20:48:52 +01:00
juanatsap 328faae953 feat: chat module portability guide + fix mobile wave position
- doc/30-CHAT-MODULE-PORTABILITY.md: step-by-step guide to port the
  chat agent to other Go apps (files, dependencies, customization)
- Fix wave emoji position on mobile (follows button to bottom:5rem right:1rem)
2026-04-09 13:08:17 +01:00
juanatsap f8b48b92a3 docs: update SEO guide — duplicate content fix, Search Console, AI-era strategy
- Document /text noindex + canonical header solution
- Add duplicate content prevention checklist
- Document Google Search Console verification setup
- Update files overview table with correct paths
- Add AI chat agent as modern SEO signal
2026-04-09 12:56:22 +01:00
juanatsap afa93be8fe docs: add AI Chat Showcase — public technical writeup for GitHub
doc/29-AI-CHAT-SHOWCASE.md: comprehensive technical showcase covering
the AI-powered CV navigation feature for potential clients/employers.

9 technical decisions explained with code:
1. ADK Go 1.0 as agent framework
2. Single agent, single tool design
3. Cross-section search across all CV data
4. CV navigation links (GPS for the CV)
5. Dual-provider with auto-fallback (Gemini→Ollama)
6. Model warmup on chat open
7. HTMX + plain JS (no SPA framework)
8. Rate limiting (30 req/hour/IP)
9. Graceful degradation

Linked from README.md and doc index.
2026-04-08 17:13:18 +01:00
juanatsap e21418b80e fix: Hyperscript chip submit + comprehensive mascot documentation
Chips:
- Replace broken onclick with Hyperscript: `on click set #chat-input.value
  to '...' then trigger submit on #chat-form` — Hyperscript dispatches a
  native DOM submit event that HTMX intercepts correctly

Documentation (doc/28-AI-CHAT-AGENT.md — complete rewrite, ~544 lines):
- 18 sections covering full mascot feature reference
- Architecture diagram with end-to-end flow (11 steps)
- All 4 component files documented with code patterns
- query_cv tool: 11 section types in tables with examples
- Cross-section search mechanics explained
- Agent intelligence: 8 question-type strategies
- Suggested questions: chip-to-question mapping for both languages
- Design system: CV color tokens, typography, dark theme comparison
- Session management: OOB swap lifecycle
- Security: input/output sanitization, privacy rules
- Testing: 46 Playwright assertions across 25 test groups
- Configuration, dependencies, ADK Go concepts table
2026-04-08 13:49:39 +01:00
juanatsap f67126e8c3 docs: add AI Chat Agent documentation and update README
- doc/28-AI-CHAT-AGENT.md: comprehensive technical documentation covering
  architecture, agent design, query_cv tool, HTMX integration, graceful
  degradation, security, and example conversations
- README.md: add AI Chat Agent section with examples, ADK Go badge,
  updated tech stack and documentation index
- doc/00-GO-DOCUMENTATION-INDEX.md: add chat agent to doc index
2026-04-08 00:30:01 +01:00
juanatsap 15723dfbe6 docs: rewrite doc/README.md as comprehensive master index v2.0.0
- Catalog 40+ documentation files across 4 sections
- Add architecture quick reference (13 internal packages, 6-layer CSS, template structure)
- Add complete E2E test suite matrix (83 Playwright tests grouped by range)
- Add JavaScript modules inventory (7 files)
- Add security features matrix (CSRF, rate limiting, bot detection, CSP)
- Add Makefile commands reference (16 targets)
- Add deployment scripts and CI/CD reference
- Add metrics dashboard
- Follow same pattern as commando and morenocuadrillero docs/README.md
2026-02-21 17:20:39 +00:00
juanatsap 69012bb1ae test: add comprehensive Go test suite with ~75% coverage
New test files:
- config/config_test.go (100% coverage)
- constants/constants_test.go (100% coverage)
- httputil/response_test.go (100% coverage)
- validation/rules_test.go (91.9% coverage)
- middleware/logger_test.go, security_test.go, security_logger_test.go
- handlers/errors_test.go

Updated documentation:
- doc/27-GO-TESTING.md: Complete testing guide
- doc/00-GO-DOCUMENTATION-INDEX.md: Added testing section
- doc/01-ARCHITECTURE.md: Updated package structure
- doc/DECISIONS.md: Added ADR-004 caching decision
- PROJECT-MEMORY.md: Added Go testing section
2025-12-06 17:51:20 +00:00
juanatsap 2c7f8de242 refactor: centralize constants and reorganize documentation
- Create internal/constants package with all hardcoded values
  (environment, cookies, themes, headers, routes, cache)
- Create internal/httputil package for HTTP helper functions
- Update all handlers and middleware to use centralized constants
- Reorganize documentation with numbered prefixes (00-26)
- Remove duplicate docs from validation folder and docs/
- Delete handlers/constants.go (moved to internal/constants)
2025-12-06 16:27:12 +00:00
juanatsap c63ce6dd91 docs: add cache busting, mobile FAB, and lint workflow documentation 2025-12-06 11:34:57 +00:00
juanatsap b5a50ca3ef feat: implement CSS sprite system for image optimization
Reduces HTTP requests from 44+ individual images to 3 sprite sheets
(~93% reduction). Includes Go sprite generator tool, CSS classes,
template integration, and E2E tests.

- Add cmd/sprites/main.go for sprite generation (60x60px + 120x120px @2x)
- Add _sprites.css with responsive sizing and retina support
- Update templates to use sprites with logoIndex fallback
- Add Makefile targets: sprites, sprites-clean
- Add 9-test E2E suite for sprite functionality
- Add doc/22-SPRITES.md with usage documentation
2025-12-04 11:38:36 +00:00
juanatsap 7727405c25 docs: fix broken links, update versions and test counts
5-expert orchestrated cleanup audit findings:
- Fix broken security doc links (docs/SECURITY.md → doc/9-SECURITY.md)
- Update Go version requirement (1.21+ → 1.25.1+)
- Correct test count (39 → 44 test files)
- Fix ZOOM_IMPLEMENTATION.md filename reference
- Update last modified dates to 2025-12-02
2025-12-02 21:02:57 +00:00
juanatsap d95c62bad4 refactor: remove outdated server design documentation
Remove 557-line server-design.md from _go-learning/architecture - content is now covered in updated architecture documentation with real implementation examples and test coverage.
2025-12-02 20:25:05 +00:00
juanatsap bd859c318f docs: update architecture and add contact handler unit tests
Architecture updates:
- Add EmailService documentation with config and flow diagram
- Update CVHandler struct to show all dependencies
- Add new middleware components (BrowserOnly, RateLimiter, etc.)
- Update package structure to include services, pdf, validation

New unit tests for HandleContact (9 tests):
- Valid submission
- Missing email/message validation
- Honeypot bot protection
- Timing-based bot protection (too fast)
- Invalid HTTP method (405)
- Invalid email format
- Message too short
- Spanish language support

Includes MockEmailService for isolated testing.
2025-12-02 14:35:37 +00:00
juanatsap 41dbd77c2f feat: responsive HTML email templates with DreamHost SMTP
- Add professional HTML email template matching CV aesthetic
- Implement multipart emails (HTML + plain text fallback)
- Configure DreamHost SMTP with SSL (port 465)
- Add "light only" color scheme for Gmail iOS compatibility
- Include Reply-To header for easy sender response
- Add email validation and integration tests
- Update .env.example with DreamHost/Gmail SMTP examples
- Add .env to .gitignore to protect credentials
- Document email template customization and dark mode approach
2025-12-02 13:42:36 +00:00
juanatsap 40733034ca feat: comprehensive WCAG 2.1 AA accessibility audit
- Add aria-labels to menu action buttons (PDF, Print, Contact)
- Add aria-labelledby to toggle checkboxes (desktop + mobile)
- Add -webkit-user-select prefix for Safari compatibility
- Add DynamicCacheControl middleware for HTML pages
- Add accessibility test suite (60-accessibility.test.mjs)
- Add comprehensive accessibility documentation (21-ACCESSIBILITY.md)
- Update Modern Web Techniques doc to mark audit complete
2025-12-02 10:46:53 +00:00
juanatsap db642c7cc2 docs: Add HTML Invoker Commands and Lazy Loading sections
- Document HTML Invoker Commands API (commandfor/command)
- Document lazy loading pattern for web components
- Include CDN comparison (esm.sh ?bundle vs others)
- Add CSP configuration notes
- Performance metrics before/after
2025-12-02 08:33:18 +00:00
juanatsap 2d3d3de8cd feat: lazy load ninja-keys + HTML Invoker Commands API
- Lazy load ninja-keys only on CMD+K press (0 requests on initial load)
- Use esm.sh bundled module (3 requests vs ~81 previously)
- Add esm.sh to CSP whitelist
- Implement HTML Invoker Commands API for modals:
  - commandfor="modal-id" + command="show-modal" for opening
  - commandfor="modal-id" + command="close" for closing
  - Removes need for onclick handlers on modal buttons
- Refactor index.html into layout partials (head, body-scripts)
- Add comprehensive tests for both features
2025-12-02 08:29:54 +00:00
juanatsap 949c9a0351 docs: Consolidate documentation into single doc/ folder
- Move docs/ contents to doc/ with proper numbering:
  - CONTACT-FORM-QUICKSTART.md → 17-CONTACT-FORM.md
  - SECURITY-AUDIT-REPORT.md → 18-SECURITY-AUDIT.md
  - SECURITY.md → 19-SECURITY-IMPLEMENTATION.md
- Delete duplicate/redundant files from docs/:
  - CMD-K-COMMAND-BAR.md (duplicate of 16-CMD-K-API.md)
  - CONTACT_FORM_IMPLEMENTATION.md (overlaps with quickstart)
  - SECURITY-IMPLEMENTATION-SUMMARY.md (summary of audit)
- Update doc/README.md with new document references
- Update test counts to 39 test files across all READMEs
- Update all "Last Updated" dates to 2025-12-01
- Add new API endpoints documentation (text, cmd-k, contact, toggles)
- Update PROJECT-MEMORY.md with new features and correct paths
2025-12-01 13:30:48 +00:00
juanatsap 9a848e8c53 feat: Add CMD+K command palette with ninja-keys integration
Implement a command palette accessible via CMD+K/Ctrl+K using the ninja-keys
web component. Features include:

- New /api/cmd-k endpoint serving dynamic CV entries (experiences, projects, courses)
- Language-aware responses with 1-hour cache headers
- Scroll-to-section functionality for quick navigation
- Enhanced keyboard shortcuts modal with CMD+K documentation
- Comprehensive test coverage for API and UI interactions

Also includes cleanup of deprecated debug test files and various UI polish
improvements to contact form, themes, and action bar components.
2025-12-01 13:03:06 +00:00
juanatsap 19951b6f42 feat: Auto-detect text browsers and serve plain text CV
- Detect curl, wget, lynx, w3m, links, elinks, browsh, carbonyl
- Check User-Agent and Accept: text/plain header
- Redirect to /text endpoint automatically
- Document in SEO guide and modern techniques
2025-11-30 14:28:51 +00:00
juanatsap ae430e6ea7 feat: Implement comprehensive AI-era SEO optimizations
- Add llms.txt file for AI crawlers (llmstxt.org standard)
- Enhance robots.txt with 15+ AI bot rules (GPTBot, ClaudeBot, etc.)
- Expand JSON-LD structured data from 1 to 12+ schema blocks:
  - Person (enhanced with occupations, languages, employers)
  - WebSite, BreadcrumbList, ProfilePage
  - EducationalOccupationalCredential (dynamic per education)
  - Course (dynamic per certification)
- Create doc/15-SEO.md with comprehensive SEO documentation
- Update MODERN-WEB-TECHNIQUES.md with SEO section (techniques 11-13)

Based on WPBeginner 2025 SEO recommendations for AI Overviews,
structured data, and E-E-A-T signals.
2025-11-30 13:23:22 +00:00
juanatsap 95de841e14 feat: Add CSS bundling with Lightning CSS for production optimization
- Add Lightning CSS integration for CSS bundling and minification
- Create Makefile targets: css-dev, css-prod, css-watch, css-clean
- Implement conditional CSS loading based on GO_ENV (dev=modular, prod=bundled)
- Add IsProduction template variable for environment-aware rendering
- Keep print.css separate with media="print" for PDF export
- Add static/dist/ to .gitignore (generated bundles)
- Fix Go template syntax in _cv-header.css
- Remove redundant font @import in _typography.css

Performance gains:
- 27 HTTP requests → 1 (96% reduction)
- 188KB → 86KB CSS (54% reduction)
- ~15KB gzip network transfer

Documentation:
- Update 12-CSS-ARCHITECTURE.md with bundling section
- Add Phase 9 to 2-MODERN-WEB-TECHNIQUES.md
- Add css-bundling.test.mjs Playwright test (8/8 pass)
2025-11-30 12:32:46 +00:00
juanatsap eb92f64e93 fix: Mobile hamburger menu and iPad sidebar visibility
Mobile fixes:
- Add click toggle handler for hamburger menu (was hover-only)
- Menu now opens/closes on tap and closes when clicking outside
- Keep hover support for desktop

iPad fixes:
- Sidebar content now visible on touch devices (901-1280px)
- Added (hover: hover) media query to prevent hide-on-hover on tablets

Security improvements:
- Replace exec.CommandContext with go-git library for git operations
- Add path traversal and command injection prevention
- Fix race condition in template hot reload
- Add environment-based cookie Secure flag

Code quality:
- Add constants.go for magic numbers
- Remove unused code (ParsePreferenceToggleRequest, DomainError)
- Add FOUC prevention with inline critical CSS
- Add Makefile dev/run/clean targets
- Fix README git clone URL
- Add doc/DECISIONS.md for architectural decisions

Tests:
- Add hamburger menu click toggle tests
- Add iPad sidebar visibility tests
- Update security tests for go-git implementation
- Add cookie Secure flag tests
2025-11-30 09:29:35 +00:00
juanatsap 60c1b5ac2b docs: Update HYPERSCRIPT-RULES.md with new functions and reserved words
- Add 6 new utility functions (closeOnBackdrop, scrollToTop, etc.)
- Add 10 zoom functions including drag handlers
- Document hyperscript reserved words (target, me, it, event)
- Add example showing the 'target' parameter pitfall
- Update file organization descriptions
- Add Phase 2 refactoring details to recent changes
2025-11-30 07:10:33 +00:00
juanatsap ba44b435e7 refactor: Major hyperscript refactoring and JS elimination
Inline Hyperscript Refactoring:
- Body tag keyboard handlers: 20→8 lines (using helper functions)
- Zoom control handlers: 85→35 lines (using zoom._hs)
- PDF modal card selection: 90→6 lines (3 identical blocks eliminated)

New Hyperscript Files:
- zoom._hs: handleZoomInput, handleZoomReset, initZoomControl
- pdf-modal._hs: selectPdfCard, handlePdfCardKey

JavaScript Elimination (232 lines removed):
- cv-functions.js: REMOVED - hyperscript defs are globally available
- scroll-at-bottom-handler.js: REMOVED - duplicate of handleScroll()
- footer-buttons-interaction.js: REMOVED - moved to hyperscript

Added Tests:
- 32-hyperscript-multi-src.test.mjs: Verifies multi-file loading
- 33-keyboard-shortcuts-refactored.test.mjs: Keyboard shortcuts
- 34-hyperscript-refactor-comprehensive.test.mjs: Full test suite

Key Findings:
- No hyperscript multi-file bug in 0.9.14
- Hyperscript def statements are globally accessible
- Previous refactoring failures were syntax errors, not library bugs
2025-11-30 05:58:44 +00:00
juanatsap c23068508f docs: Add comprehensive documentation for architectural enhancements
Created detailed documentation for all 5 architectural improvements:

Educational Documentation (_go-learning/):
- Created 005-architectural-enhancements.md (900+ lines)
- Detailed explanation of each enhancement
- Code examples and usage patterns
- Before/after comparisons
- Benefits and interview talking points
- Future considerations

Public Documentation (doc/):
- Updated 14-BACKEND-HANDLERS.md
- Added "Architectural Enhancements" section
- Response Types with examples
- Validation Tags guide
- Context Helpers usage
- Typed Errors documentation
- Performance Benchmarks guide
- Updated table of contents
- Updated changelog

Documentation Coverage:
- Response Types: Structure, helpers, usage examples
- Validation Tags: Declarative rules, self-documenting
- Context Helpers: 13 functions documented
- Typed Errors: 13 error codes, constructors, usage
- Benchmarks: 23 benchmarks, running instructions

All improvements now fully documented for:
- Internal learning and interviews
- Public consumption and contribution
- Developer onboarding
- Architecture understanding
2025-11-20 18:24:41 +00:00
juanatsap 025c10ac1f docs: Add comprehensive backend handler documentation
Create public-facing documentation explaining backend architecture:

New Documentation:
- doc/14-BACKEND-HANDLERS.md (900+ lines)
  * Handler architecture and file organization
  * Request/response type system with examples
  * Middleware pattern and preferences handling
  * Comprehensive testing strategy
  * Data flow diagrams and best practices
  * Code examples for all major patterns

Updated:
- doc/README.md
  * Add Backend Handlers to technical implementation section
  * Update total active docs count (13 → 14)
  * Add quick navigation links

Content Coverage:
- Handler responsibilities (pages, PDF, HTMX)
- Type-safe request handling with validation
- Middleware architecture and context usage
- Test coverage across all handler types
- Request processing flow diagrams
- Best practices with do/don't examples

Audience:
- Backend developers
- API consumers
- New contributors
- Technical documentation readers

Complements:
- Educational docs in _go-learning/refactorings/
- Internal architecture documentation
- API reference guide
2025-11-20 17:35:58 +00:00
juanatsap 68da6607ad docs: Add Phase 10 UI polish documentation and improve PDF modal spacing
- Document PDF loading modal with animated spinner and time estimates
- Document soft shadow optimization process (3 iterations to 0.06 opacity)
- Document border removal strategy for clean, modern design
- Document enhanced server startup logs with emoji icons
- Improve PDF modal estimate text spacing (1.5rem top margin)
- Update technique count from 10+ to 16+ major optimizations
- Mark Phase 10 as complete (November 2025)
2025-11-20 17:05:27 +00:00
juanatsap 9c5f0b20d8 docs: Add comprehensive toast notification test and documentation
Test Addition:
- Created tests/mjs/29-pdf-toast-notifications.test.mjs (22 assertions)
- Validates toast elements, JavaScript API, animations
- Tests both PDF download scenarios (modal stays open vs. closes early)
- Verifies toast lifecycle: prepare → progress → success → dismiss
- Tests icon/title/message updates and progress bar animation

Test Coverage:
 Toast DOM elements exist
 JavaScript functions available (showPDFToast, hidePDFToast)
 Manual toast trigger and auto-hide
 PDF modal integration - Scenario A (stay in modal)
 PDF modal integration - Scenario B (close modal, toast appears)
 Toast content updates (📥)
 Progress bar animation
 CSS animations defined (toastSlideIn, toastLifecycle, progressShrink)

Documentation Addition:
- Created doc/13-TOAST-NOTIFICATIONS.md (comprehensive guide)
- Architecture and component structure
- User experience flows (2 scenarios documented)
- JavaScript API reference (showPDFToast, hidePDFToast, showError)
- CSS structure and animations
- Template structure with ARIA accessibility
- PDF download integration details
- Accessibility features and testing guide
- Customization guide and troubleshooting

Documentation Updates:
- Updated doc/README.md (added entry #13, total: 12 → 13 docs)
- Updated tests/README.md (test count: 27 → 28)
- Updated tests/TEST-SUMMARY.md (added toast notifications coverage)
- Updated tests/mjs/README.md (added test 29 description)

Test Count: 28 active tests
Doc Count: 13 core documents
Coverage: Complete UX feedback system with dual-mode operation
2025-11-20 13:05:46 +00:00
juanatsap 16194328b6 docs+tests: Document and test references section shortcut URLs
## Documentation Updates (doc/11-PDF-EXPORT.md)
Added "References Section Integration" section with:
- Template code examples for shortcut URL usage
- Data configuration structure
- Key features and use cases
- Security attributes documentation
- Test command reference

## Test Updates (tests/mjs/28-references-pdf-download.test.mjs)
Completely rewrote test to match new direct link behavior:
-  OLD: Tested modal opening, onclick handlers
-  NEW: Tests direct shortcut URLs

New test coverage (5 tests):
1. English direct shortcut URL validation
2. Spanish direct shortcut URL validation
3. HTTP 301 redirect verification
4. Year validation (404 for invalid years)
5. Works without JavaScript (PDF export context)

Verifies:
- Correct href: /cv-jamr-{year}-{lang}.pdf
- No onclick handlers (pure HTML link)
- Security attributes (target="_blank", rel="noopener noreferrer")
- Year-aware dynamic URLs
- Language-aware (es/en)
- Backend 301 redirects working
- 404 for past/future years

## Benefits
- Comprehensive test coverage for new behavior
- Complete documentation with examples
- Easy to maintain and understand
- Validates entire shortcut URL feature end-to-end
2025-11-20 12:43:29 +00:00
juanatsap 1569a81eed docs: Archive obsolete documentation and update README index
## Archived Documentation
- Removed BEFORE-AFTER-COMPARISON.md (skeleton loader redesign - feature complete)
- Removed BROWSER-TESTING-GUIDE.md (HTMX indicators testing - feature complete)

## Updated Documentation Index
- Added CSS Architecture (doc 12) to technical implementation section
- Added PDF Export (doc 11) to user & operations section
- Updated last modified date: 2025-11-18 → 2025-11-20
- Updated total active docs count: 11
2025-11-20 12:36:27 +00:00
juanatsap 1258d61d05 refactor: Modularize CSS into ITCSS architecture + update documentation
CSS Refactoring:
- Split 2,287-line monolith into 6 focused modules
- New structure: Navigation, Scroll, Buttons, Modals, Zoom, Breakpoints
- Organized by ITCSS layers (Interactive + Responsive)
- 245 lines saved through better organization
- Site verified working at localhost:1999

New CSS Files:
- 04-interactive/_navigation.css (357 lines, 8.2KB)
- 04-interactive/_scroll-behavior.css (200 lines, 5.0KB)
- 04-interactive/_buttons.css (184 lines, 4.7KB)
- 04-interactive/_modals.css (487 lines, 16KB)
- 04-interactive/_zoom-control.css (253 lines, 6.3KB)
- 05-responsive/_breakpoints.css (561 lines, 14KB)

Documentation Updates:
- Added doc/12-CSS-ARCHITECTURE.md (comprehensive CSS guide)
- Updated doc/README.md (new entry + correct numbering)
- Updated tests/README.md (test count 8 → 27)
- Updated tests/TEST-SUMMARY.md (coverage expansion)
- Rewrote tests/mjs/README.md (complete test listing)

Removed:
- static/css/04-interactive/_remaining.css (replaced by modules)
2025-11-20 12:34:42 +00:00
juanatsap d93e37ddc9 docs: Merge LONG-PDF-GENERATION.md into comprehensive PDF documentation
## Merged Content
- Merged LONG-PDF-GENERATION.md technical details into doc/11-PDF-EXPORT.md
- Removed duplicate documentation file
- Single source of truth for all PDF export documentation

## Added Technical Details
- PDF generation flow diagram
- 2-column vs 3-column layout architecture decision
- Sidebar width configuration guide (18%-30% analysis)
- Detailed CSS injection strategy with code examples
- HTML structure examples for page layouts
- Expanded compact sidebar fonts implementation details
- Font size breakdown table (2-6% reduction)

## Result
- Comprehensive PDF documentation: 966 lines (was 793)
- Added 173 lines of technical implementation details
- Removed 411-line duplicate file
- Better organized, single reference for developers and users

Benefits:
- Single source of truth for PDF features
- No duplication between docs
- Easier maintenance
- Complete technical and user-facing documentation in one place
2025-11-20 12:31:28 +00:00
juanatsap 9f3b8853a3 docs: Cleanup and consolidate PDF documentation
## Documentation Cleanup
- Moved PDF-EXPORT-FEATURE.md → doc/11-PDF-EXPORT.md
- Added shortcut URL documentation section
- Updated changelog to v2.1.0 with shortcut URL feature
- Removed ephemeral reports (validation, shortcut implementation)

## Removed Backup Files
- Deleted static/css/main.css.backup
- Deleted static/js/main.js.backup

## Consolidated PDF Documentation
The comprehensive PDF export documentation now includes:
- Year-aware shortcut URLs (/cv-jamr-{year}-{lang}.pdf)
- Automatic year validation and updates
- Default CV modal integration
- All PDF export options and features
- Complete API reference

Benefits:
- Single source of truth for PDF feature documentation
- Removed temporary/ephemeral documentation files
- Cleaner repository structure
- Updated versioning to 2.1.0
2025-11-20 12:25:41 +00:00
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 925a95c1b4 refactor: externalize navigation handlers and fix hyperscript syntax errors
- Created keyboard._hs as reference documentation (inline handler in body tag)
- Externalized 9 hamburger menu navigation links to scrollToSection()
- Added scrollToSection() as JavaScript function (CSP-safe, no eval needed)
- Restored original keyboard handler format in body tag (working correctly)
- Removed problematic navigation._hs (had syntax/CSP issues)
- Added Rule 4 to HYPERSCRIPT-RULES.md on event handler externalization
- Updated PROJECT-MEMORY.md with externalization guidelines

Key learnings:
- Complex event handlers that inspect event properties must stay inline
- JavaScript functions avoid CSP unsafe-eval restrictions
- Navigation successfully externalized: 9 links → 1 function (91% reduction)
2025-11-20 09:46:06 +00:00
juanatsap f8948413bc docs: add comprehensive user-oriented PDF export guide
Add detailed, user-friendly documentation for PDF export feature in
CUSTOMIZATION.md to help template users understand and customize
PDF generation.

New Documentation:
- Clear explanation of how PDF export works
- All 4 parameters (lang, length, icons, version) with examples
- Filename convention and patterns
- Frontend integration examples (HTML, HTMX)
- Tips for best PDF results
- Troubleshooting common issues
- Advanced customization guidance

Audience:
- Template users who want to customize their own CV
- Non-technical users who need to understand PDF options
- Developers who want to extend PDF functionality

Examples include:
- Complete URL patterns for all parameter combinations
- Code snippets for frontend buttons
- CSS customizations for print appearance
- Common troubleshooting solutions
2025-11-19 10:56:01 +00:00
juanatsap 12bd9c7cd8 feat: enhance PDF export with 4 customizable parameters
Add comprehensive parameter support to /export/pdf endpoint:
- lang: Language selection (en/es)
- length: CV length (short/long)
- icons: Icon visibility (show/hide)
- version: Theme variant (extended/clean)

Backend Changes:
- Enhanced PDF generator with cookie injection for user preferences
- Cookies set before chromedp navigation to apply all preferences
- Updated filename pattern: CV-{Name}-{lang}-{length}-{version}.pdf
- Comprehensive parameter validation with descriptive error messages
- All parameters optional with sensible defaults (en, short, show, extended)

Testing:
- Added pdf_test.go with parameter validation tests
- Tests cover all valid/invalid parameter combinations
- Tests verify default parameter application

Documentation:
- Updated API documentation (doc/3-API.md)
- Added detailed parameter descriptions and examples
- Updated quick reference with all parameter options
- Added process flow diagram showing cookie injection
- Documented error responses for each invalid parameter

Implementation Details:
- Cookie domain set to "localhost" for chromedp context
- Cookies: cv-language, cv-length, cv-icons, cv-theme
- PDF generation leverages existing @media print CSS
- No changes to frontend CSS or templates

Tested:
- Parameter validation ( All invalid params rejected correctly)
- Default parameters ( Applied when params omitted)
- PDF generation with all parameter combinations ( Working)
2025-11-19 10:43:19 +00:00
juanatsap 2ca13a218e feat: Extend skeleton loaders to all 13 CV sections with structural fidelity
Implemented comprehensive skeleton loaders for the entire CV curriculum,
providing smooth loading animations during language transitions across
all sections.

**Sections Implemented (13 total):**
- Header (title-badges + personal info)
- Education
- Skills Summary
- Experience (with company logos, descriptions, responsibilities)
- Awards (with logos, issuers, descriptions)
- Projects (with icons, descriptions, tech stacks)
- Courses (with icons, institutions, dates)
- Languages
- References
- Other Information
- Skills Sidebars (left and right)
- Footer

**Key Features:**
- Structural fidelity: Skeletons mirror exact HTML structure of actual content
- Each section has realistic placeholders (e.g., 3 experience items, 2 projects)
- Smooth CSS transitions with shimmer animations
- Zero layout shift
- Component-level architecture allows independent loading states

**Technical Implementation:**
- Modified all section templates in templates/partials/sections/
- Added .component-wrapper with .actual-content + .skeleton-content structure
- Extended skeleton.css with structural skeleton classes
- JavaScript event handlers in main.js already handle all sections via CSS cascade

**Testing:**
- Manual Playwright test: 13/13 component wrappers verified
- Automated test: 7/7 tests passing
- All skeleton loaders show during language switches
- No stuck loading states

**Documentation:**
- Updated tests/TEST-SUMMARY.md with all 13 sections
- Updated doc/2-MODERN-WEB-TECHNIQUES.md with comprehensive details
- Added structural fidelity table showing skeleton elements for each section

Files modified: 14 templates + CSS + 2 docs
2025-11-18 20:18:28 +00:00
juanatsap 1f6f8e417e docs: Update skeleton loader implementation from hyperscript to JavaScript
MIGRATION SUMMARY:
- Moved skeleton loader logic from hyperscript to JavaScript (main.js)
- Changed from htmx:oobAfterSwap to htmx:afterSettle event
- Changed OOB swap from innerHTML to outerHTML for proper element replacement
- Added languageSwitching flag for state tracking
- Added 100ms delay after afterSettle for final render completion

DOCUMENTATION UPDATES:
- 2-MODERN-WEB-TECHNIQUES.md: Updated skeleton loader section with
2025-11-18 19:32:28 +00:00
juanatsap 65eb91b00b docs: Rename 0-README.md to README.md (standard convention)
Keep README.md as the standard filename for better GitHub integration
and platform recognition. All other docs remain numbered (1-10).
2025-11-18 19:28:40 +00:00
juanatsap 3fa5d1e5ca docs: Rename all documentation with numbered prefixes for clarity
RENAMING:
- README.md → 0-README.md (start here)
- ARCHITECTURE.md → 1-ARCHITECTURE.md (backend overview)
- MODERN-WEB-TECHNIQUES.md → 2-MODERN-WEB-TECHNIQUES.md (frontend architecture)
- API.md → 3-API.md (API reference)
- HYPERSCRIPT-RULES.md → 4-HYPERSCRIPT-RULES.md (conventions)
- ZOOM_IMPLEMENTATION.md → 5-ZOOM-IMPLEMENTATION.md (zoom feature)
- USER_GUIDE.md → 6-USER-GUIDE.md (user docs)
- CUSTOMIZATION.md → 7-CUSTOMIZATION.md (customization guide)
- DEPLOYMENT.md → 8-DEPLOYMENT.md (deployment)
- SECURITY.md → 9-SECURITY.md (security)
- PRIVACY.md → 10-PRIVACY.md (privacy policy)

CROSS-REFERENCE UPDATES:
- Updated all internal links in all documentation files
- Updated README navigation with numbered references
- Added # column to documentation tables
- Made all links use numbered filenames

BENEFITS:
 Clear reading order (0-10)
 Logical progression (overview → technical → user → ops → compliance)
 Easy sorting and navigation
 Professional organization
 Zero broken links
2025-11-18 19:12:50 +00:00
juanatsap 81e8b3c25e docs: Clean up documentation directory - eliminate redundancy
CLEANUP SUMMARY:
- Moved to archive: 3 files (historical/debugging docs)
  - ZOOM-CONTROL-FIX-REPORT.md
  - ZOOM-FIXES-COMPLETE-SUMMARY.md
  - PROJECT_IMPROVEMENT_SUMMARY.md.ASPIRATIONAL → PROJECT_IMPROVEMENT_SUMMARY.md

- Deleted: 1 file (duplicate content)
  - COLOR-THEME-IMPLEMENTATION.md (content already in MODERN-WEB-TECHNIQUES.md)

- Created: 1 file (navigation index)
  - README.md with complete documentation navigation

RESULT:
- Before: 14 files (403 lines redundant)
- After: 11 files (clean, organized, zero redundancy)
- Archive: 20 files (properly categorized historical docs)

BENEFITS:
- Zero documentation duplication
- Clear navigation structure
- Canonical source for each topic
- Historical docs preserved in archive
2025-11-18 18:59:41 +00:00
juanatsap 8745a3661e docs: Phase 3 Complete - Strategic Documentation (ADRs, Budgets, Scalability, Debt, Migrations)
- Add 5 Architectural Decision Records (ADRs)
  - ADR-001: Hypermedia-Driven Architecture with HTMX
  - ADR-002: Hyperscript for Declarative Behaviors
  - ADR-003: CSS Custom Properties for Theming
  - ADR-004: Component-Level Skeleton Loaders
  - ADR-005: Modular File Organization Pattern

- Add Performance Budgets table (12 metrics)
  - Core Web Vitals targets (FCP <1.8s, LCP <2.5s, CLS <0.1)
  - Bundle size budgets (JS <30KB, CSS <50KB)
  - Monitoring and enforcement strategy

- Add Scalability Guidance
  - 4-level horizontal scaling strategy (single server → 1M users)
  - Caching layer architecture (browser → CDN → app → origin)
  - HTMX-specific scaling considerations

- Add Technical Debt Inventory
  - 8 prioritized debt items (High/Medium/Low)
  - 17 days total estimated effort
  - Categorized by impact and solutions

- Add Migration Paths (5 scenarios)
  - HTMX → Alpine.js → React (framework migration)
  - Adding build tooling (Vite/esbuild)
  - Static → Dynamic content (CMS integration)
  - Monolith → Microservices
  - Self-hosted → Serverless (Cloudflare Workers/Lambda)

Total: 468 lines of strategic planning documentation
Grade: Documentation now A- (95% accuracy)
2025-11-18 17:24:38 +00:00
juanatsap 1a6467a43a docs: Phase 2 Complete - HTMX Patterns Enhancement & Hover Sync
FINAL PHASE 2 ADDITIONS:

### HTMX Patterns Section Enhancement (lines 558-689)
Added advanced production patterns used in the project:

1. **Advanced Swap Timing**
   - swap:250ms settle:250ms modifiers
   - Coordinated fade-out/fade-in transitions
   - Use cases: language switching, skeleton loaders

2. **Out-of-Band Swaps (Multi-Target Updates)**
   - Problem statement and solution
   - Complete code examples (main + OOB targets)
   - Real example from language switching
   - Benefits: Single round-trip, atomic updates
   - Key Points: ID matching, DOM transaction atomicity

3. **History Management (hx-push-url)**
   - SPA-like navigation patterns
   - Shareable URLs for dynamic content
   - Back/forward button support
   - Real example: /?lang=es URLs

4. **Loading States Reference**
   - External indicator pattern
   - Cross-reference to Section 10
   - Opacity transitions instead of display toggle

LINES ADDED: 131 lines comprehensive HTMX patterns

### Hover Synchronization Pattern (lines 1164-1279)
JavaScript wrapper → Hyperscript call bridge pattern

**Complete Documentation:**
- Problem: Duplicate buttons (PDF/Print/Zoom) need sync hover
- Challenge: JavaScript events can't directly call hyperscript
- Solution: Wrapper function bridge pattern

**Architecture Layers:**
1. JavaScript layer (main.js)
   - mouseenter/mouseleave event listeners
   - Calls hyperscript functions as bridge

2. Hyperscript layer (hover-sync._hs)
   - syncPdfHover(show), syncPrintHover(show)
   - highlightZoomControl(show)
   - Class manipulation logic

3. CSS layer
   - .pdf-hover-sync, .print-hover-sync classes
   - Visual feedback with transforms

**Step-by-Step Flow:**
- 8-step detailed breakdown
- User action → JS event → Hyperscript logic → CSS transition
- Complete cycle from mouseenter to mouseleave

**Benefits:**
- Visual coherence across UI components
- No refresh needed (pure CSS)
- JavaScript-Hyperscript paradigm bridge
- Performance optimized (class toggling)

LINES ADDED: 115 lines comprehensive hover sync documentation

---

PHASE 2 SUMMARY:
- Section 11: Skeleton Loaders (127 lines)
- Section 12: Color Theme System (173 lines)
- HTMX Patterns Enhancement (131 lines)
- Hover Synchronization Pattern (115 lines)

TOTAL PHASE 2: 546 lines comprehensive documentation
QUALITY: Production-ready reference with real examples
TESTING: All patterns verified with automated tests

PHASE 2 STATUS: 100% COMPLETE 
2025-11-18 17:14:11 +00:00
juanatsap 0e33d7c886 docs: Phase 2 - Add Skeleton Loaders and Color Theme System sections
MAJOR FEATURES DOCUMENTED:

### Section 11: Skeleton Loaders (lines 1638-1764)
Component-level content placeholders for smooth loading transitions

KEY FEATURES:
- Pixel-perfect skeleton matching (header, photo, sections, experience)
- GPU-accelerated shimmer animation (1.8s ease-in-out infinite)
- Component-wrapper architecture (dual-state: actual + skeleton)
- HTMX event integration (beforeSwap → show, afterSettle → hide)
- Zero layout shift during transitions
- Accessibility: Respects prefers-reduced-motion
- Print-friendly: Skeletons hidden in @media print

IMPLEMENTATION:
- static/css/skeleton.css (341 lines)
- templates/partials/skeleton-loader.html
- HTMX event listeners in main.js
- tests/mjs/12-skeleton-language-transitions.test.mjs

BENEFITS:
- Professional UX like modern SPAs (LinkedIn, Facebook)
- Smooth 250ms fade transitions
- Reusable for any HTMX swap operation
- Independent component loading states

### Section 12: Color Theme System (lines 1767-1939)
Dynamic light/dark/auto theme switching with CSS custom properties

KEY FEATURES:
- Three theme modes: Auto (system), Light, Dark
- CSS custom properties for instant switching
- localStorage persistence across sessions
- System integration via prefers-color-scheme
- Dynamic button colors per theme mode:
  * Auto: Purple (#9b59b6)
  * Light: Orange/Yellow (#f39c12)
  * Dark: Blue (#3498db)
- Dual-theme architecture (Color + Layout independent)

IMPLEMENTATION:
- static/css/color-theme.css (258 lines)
- static/hyperscript/color-theme._hs (59 lines)
- setColorTheme(), initColorTheme() functions
- Fixed floating button with theme cycling
- tests/mjs/13-color-theme-switcher.test.mjs

BENEFITS:
- User comfort (choose preference or follow system)
- Instant switching (CSS custom properties, no reflow)
- Accessible (WCAG AA contrast compliance)
- Zero JavaScript for theme application
- Separation of concerns (color vs. layout)

DOCUMENTATION QUALITY:
- Complete before/after code examples
- Architecture pattern breakdowns
- Comprehensive benefits lists
- Testing information included
- Pixel-perfect matching tables (skeletons)
- CSS custom properties reference (theme)

IMPACT: +306 lines comprehensive documentation
TIME: ~90 minutes (partial Phase 2 complete)
REMAINING: HTMX patterns enhancement, hover sync documentation
2025-11-18 17:07:13 +00:00