Commit Graph

538 Commits

Author SHA1 Message Date
juanatsap 94043ddc3e feat: wave greeting on chat button 2026-04-09 11:35:30 +01:00
juanatsap 84d69fa8db feat: wave greeting animation on chat button to attract clicks
Emoji 👋 pops up 3 times with a waving motion (3s delay after page load),
then disappears. Hidden when chat is open.
2026-04-09 11:35:21 +01:00
juanatsap fafc23bd92 feat: chat icons — image fallbacks, external links, compact sizing 2026-04-09 11:34:26 +01:00
juanatsap 21c33d2833 feat: chat icons — image fallbacks, external links, smaller inline size
- Support image file fallback when no sprite index exists
  (Immich Photo Manager, Cmux Resurrect now show their logos)
- Render external links [text](https://...) as clickable links
  (fixes Third Party Contributions raw markdown)
- Smaller inline icons (20px) to fit chat bubble aesthetic
- Separate icon-chat CSS class for chat-specific sizing
2026-04-09 11:34:14 +01:00
juanatsap 660fa74afc data: fix incorrect React tag in CDC Starter Kit 2026-04-09 11:24:17 +01:00
juanatsap c3f4134daa data: remove incorrect React tag from CDC Starter Kit project
CDC Starter Kit uses vanilla JavaScript + SAP CDC SDK, not React.
This caused the chat agent to incorrectly report React usage in that project.
2026-04-09 11:24:08 +01:00
juanatsap 6bc4f29def fix: correct Go binary path in systemd service (/snap/bin/go) 2026-04-09 11:18:36 +01:00
juanatsap 508e0e873e test+fix: chat layout modes — 38 tests, CSS positioning fixes 2026-04-09 11:09:40 +01:00
juanatsap 823030dcf2 test: 38 layout mode tests + fix half/full/float CSS positioning
- Fix side panel and full screen not covering full viewport
- Fix floating mode initial position (near chat button, not top-right)
- Reset width/height inline styles when switching modes
- Add 84-chat-layout-modes.test.mjs: 38 assertions covering
  compact, side panel, full screen, floating, drag, rapid switching,
  and user avatar rendering
2026-04-09 11:09:30 +01:00
juanatsap 20585c23ec fix: production chat — load API keys from .env via systemd 2026-04-09 11:04:53 +01:00
juanatsap 482350a924 fix: load .env in production systemd service for chat API keys
- Add EnvironmentFile=/home/txeo/Git/yo/cv/.env to systemd unit
- Add production overrides (GO_ENV, BEHIND_PROXY, ALLOWED_ORIGINS)
- Deploy workflow now auto-updates systemd service file on each deploy
2026-04-09 11:04:38 +01:00
juanatsap ceee3dc4dd merge: chat agent feature — GLM local model, UX overhaul, icons, layout modes 2026-04-09 10:57:10 +01:00
juanatsap 8e029d1363 feat: chat UX overhaul — GLM local model, icons, layout modes, instant bubbles
- Add GLM-4.7-Flash as default Ollama model (replaces Mistral)
- Fix WRITE_TIMEOUT (15s→120s) and HTMX timeout (5s→120s) for local LLM
- Auto-warmup model on startup in development mode
- Add /api/chat/status endpoint for model readiness polling
- Show "Initializing AI model..." indicator while model loads
- Add user avatar (mdi:account) on chat messages
- Inject company/project/course sprite icons inline in chat responses
- Replace cramped header icons with 4 icon buttons + tooltips
  (Compact, Side panel, Floating, Full screen)
- Add floating/draggable chat mode with smooth drag support
- Chip questions show user bubble instantly and clear input
- Help modal prefills input instead of auto-sending
- User bubble rendered client-side for immediate feedback
2026-04-09 10:54:23 +01:00
juanatsap d5c90248cc feat: Teams-style chat UX overhaul
Bubbles:
- Teams-style layout: bot avatar (green circle) on left, message beside it
- User messages right-aligned, no avatar (clean, like Teams)
- Rounded bubbles (border-radius: 16px) instead of square
- Distinct corner radii for conversation flow

Navigation:
- Links no longer close the chat — panel stays open for continued navigation
- Added #certifications anchor (alias to courses section)
- Fixed agent instruction to use #courses for certifications references

Theme:
- All colors use CSS variables from _themes.css
- Automatically adapts to light/dark without explicit .theme-clean overrides
- Panel uses --paper-bg (white in light, dark in dark theme)

Size modes:
- 3 discrete toggle buttons: compact, half-screen, fullscreen
- Active state highlighted, direct selection (no confusing cycling)
- Removed chat-half-left (simplified to compact/half/full)

Intelligence:
- React query now returns results (verified: 4 companies + 2 projects + skills)
2026-04-08 17:51:14 +01:00
juanatsap be5fdd03c4 feat: chat avatars + dark theme fix + text overflow fix
Avatars:
- Robot icon (green circle) before each agent message
- Person icon (dark circle) before each user message
- New .chat-bubble wrapper with flex layout for avatar + message

Dark theme fixes:
- Panel background: #1e1e1e (not pure black)
- Agent bubbles: #2d2d2d with light text (not dark/invisible)
- Input area: #2d2d2d (not black)
- Header stays green (--accent-green) in both themes
- Chips, suggestions consistent with panel background

Text overflow:
- overflow-wrap + word-break on messages
- min-width: 0 prevents flex overflow
- User bubble properly right-aligned with avatar
2026-04-08 17:31:07 +01:00
juanatsap 5448c3cf7a feat: resizable chat panel (compact → half-right → half-left → full)
4 size modes cycled via expand button in header:
- Compact: 360px (default, bottom-right corner)
- Half-right: 50vw docked to right edge, full height
- Half-left: 50vw docked to left edge, full height
- Full: 100% viewport overlay

Also fixes text overflow in chat messages (overflow-wrap, word-break).
Messages area expands to fill available height in larger modes.
Size button uses mdi icons: arrow-expand, dock-right, dock-left, arrow-collapse.
CSS transitions for smooth size changes.
2026-04-08 17:24:35 +01:00
juanatsap 465af719e9 test: rewrite mascot tests — 39 assertions, Gemini + navigation links
Complete rewrite matching current architecture:
- Button position (right side x=1838)
- Panel toggle (open/close/reopen)
- Help modal (5 accordion sections, 18 clickable questions)
- Chip click → Gemini response with nav links
- Typed question → certifications response
- Cross-section: Go (finds projects + skills), Java (finds Insa)
- Company listing (Olympic, SAP, Insa)
- Navigation link presence and anchor hrefs
- Spanish language (header, chips, welcome, response in Spanish)
- Response time: 2.0s (under 10s threshold)
- Session persistence, input clear, console errors

37/39 pass (2 nav-click tests fail in headless mode — works in browser)
2026-04-08 17:17:36 +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 c44e9e8c67 feat: CV navigation links in chat responses (GPS for the CV)
Agent instruction now requires markdown links to CV anchors:
- Companies: [Olympic Broadcasting](#exp-olympic-broadcasting)
- Projects: [Immich Photo Manager](#proj-immich-photo-manager)
- Sections: [Skills](#skills), [Experience](#experience)

formatResponse converts [text](#anchor) → clickable green links
that close the chat panel, smooth-scroll to the target, and
pulse a green highlight for 2 seconds.

All existing CV anchor IDs used: exp-{companyID}, proj-{projectID},
course-{courseID}, plus section IDs (experience, projects, skills, etc.)
2026-04-08 17:11:22 +01:00
juanatsap 160be31b31 feat: auto-fallback Gemini→Ollama + model warmup on chat open
Dual-provider architecture:
- Both Gemini and Ollama initialize at startup (if configured)
- Primary (Gemini) tried first for every request
- On any error (429, 503, timeout), automatically falls back to Ollama
- No manual switching needed — completely transparent to the user
- Log shows: "Primary failed (gemini: ...), falling back to ollama: ..."

Warmup:
- POST /api/chat/warmup called silently when chat panel opens
- Pre-loads Ollama model in background (10-15s) while user reads welcome
- By the time user types, model is ready for instant response
- Warms up fallback provider specifically (Gemini doesn't need it)

Timeout:
- Agent context increased to 60s (Ollama first response can be slow)
- Each request creates a fresh session (stateless for fallback compat)
2026-04-08 14:57:38 +01:00
juanatsap 8205a22972 feat: Ollama adapter + chat rate limiter (30 req/hour)
Ollama adapter (internal/chat/ollama.go):
- Implements model.LLM interface for ADK Go
- Talks to Ollama's OpenAI-compatible API (/v1/chat/completions)
- Full tool/function calling support (tested with Mistral Small 3.2)
- Converts ADK types to OpenAI format (messages, tools, tool_calls)
- Configurable via OLLAMA_HOST and OLLAMA_MODEL env vars

Multi-provider handler:
- MODEL_PROVIDER env: "gemini" (default) or "ollama"
- Gemini: requires GOOGLE_API_KEY (pay-as-you-go recommended)
- Ollama: connects to local or Tailscale-remote instance

Rate limiter:
- 30 requests/hour per IP on /api/chat endpoint
- Uses existing middleware.NewRateLimiter pattern

Tested: Ollama + Mistral Small 3.2 on M4 Pro 64GB — correct answers
2026-04-08 14:47:14 +01:00
juanatsap 4f558ac842 fix: replace Hyperscript with plain JS for chat interactions
The Hyperscript trigger/call commands couldn't reliably trigger HTMX
form submissions or call global JS functions. Moved all chat
interactions to plain JavaScript:

- toggleChatPanel(): open/close panel + icon swap
- sendChatQuestion(q): set input + htmx.trigger(form, 'submit')
- closeChatHelpAndAsk(q): close modal + open chat + send question
- htmx:afterRequest listener clears input after submit

Hyperscript kept only for site-wide patterns (closeOnBackdrop) that
work reliably.

Also: better error message for rate-limited API responses (429).
2026-04-08 14:11:11 +01:00
juanatsap 25ddfff0da feat: redesign help modal with accordion and clickable questions
- Replace flat list with <details>/<summary> accordion (5 categories)
- Questions are clickable: close modal → open chat → send question
- closeChatHelpAndAsk() helper bridges modal and chat panel
- Green accent on category icons and question hover
- Chevron arrows for expand/collapse state
- Dark theme support for all accordion elements
- Compact layout with no wasted space
2026-04-08 14:01:17 +01:00
juanatsap 8e93d2b893 style: green theme for chat mascot, neutral back-to-top arrow
- Chat uses --accent-green (#27ae60) matching CV's green theme:
  header, user bubbles, send button, chip hover, input focus
- Dark theme uses deeper greens (#166b3a header, #1e8c4c interactions)
- Back-to-top arrow changed from green to neutral gray (#555555)
  to avoid visual conflict with the mascot button
2026-04-08 13:58:53 +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 16dd150758 fix: restore tooltip, accent-blue colors, fix chip click mechanism
- Restore has-tooltip tooltip-left on toggle button
- Use --accent-blue (#0066cc) as secondary color: header, user bubbles,
  send button, chip hover, input focus — breaks the all-black monotony
- Dark theme uses deeper blue (#003d7a header, #004d99 interactions)
- Fix chip click: replace Hyperscript htmx.trigger() call with direct
  onclick using JS htmx.trigger() — Hyperscript couldn't resolve the
  HTMX global properly
- Remove _chat.css @import from main.css (loaded separately already)
2026-04-08 13:37:32 +01:00
juanatsap c93bfb0450 fix: add cache-busting version to chat CSS link 2026-04-08 13:32:31 +01:00
juanatsap 069d6f860e fix: isolate chat button from fixed-btn stack to ensure right position
- Move chat-widget outside the floating buttons section in index.html
- Remove fixed-btn class from toggle button (was inheriting left-side
  positioning from the button stack's mobile flex layout)
- Chat widget now renders independently just before body-scripts
2026-04-08 13:24:29 +01:00
juanatsap 94976e1c19 feat: help modal, comprehensive intelligence, fix right-side position
Position fix:
- Remove _chat.css @import from main.css (was overriding with old
  left:2rem cached version). Chat CSS now loaded only via head-styles.
- Button confirmed at right:2rem, bottom:6rem (above back-to-top)

Help modal:
- New chat-help-modal.html using same <dialog> pattern as shortcuts
- 6 organized categories: Experience, Technologies, Projects,
  Education, Skills, How it works
- Bilingual EN/ES with example questions per category
- ? button in header opens modal via commandfor/show-modal
- Removed inline help card (modal replaces it)

Intelligence:
- Comprehensive query strategy for 8 question types
- Technology queries always use cross-section search
- Company queries use experience without filter for full listing
- Agent knows CV site is built with Go/HTMX (bonus context)
- Skills report proficiency levels when technology found
2026-04-08 13:15:07 +01:00
juanatsap 795ba88d6f fix: match CV design system, right-side positioning, smarter agent
CSS:
- Button moved to right: 2rem, above back-to-top (bottom: 6rem)
- Uses CV design tokens: --black-bar, --accent-blue, --paper-bg
- Fonts: Quicksand (header), Source Sans Pro (body)
- Tooltip on the left side (tooltip-left class)
- Dark theme uses CV-consistent grays

Intelligence:
- Agent instruction emphasizes exhaustive reporting of ALL matches
- Cross-section search results must not be truncated
- Mentions CV site itself is built with Go when relevant

Tests:
- Updated positioning assertions (right side, x > viewport/2)
- Added 5 intelligence tests: Go cross-section, company count,
  years of experience, React cross-section, Spanish response
- Resilient to API errors (waits for any message, not just user)
- 42 total test assertions
2026-04-08 13:04:47 +01:00
juanatsap 93e33f6496 fix: chat submission and session handling + 37 Playwright tests
- Fix chip auto-submit: use htmx.trigger() instead of native submit
  to bypass browser validation on required field
- Remove required from input (server validates already)
- Fix session_id duplication: use hx-swap-oob to replace single input
- Fix agent context: use background context with 30s timeout instead
  of HTTP request context (prevents premature cancellation)
- Remove redundant close button from header (toggle button handles it)
- Add 83-chat-mascot.test.mjs: 37 tests covering button, panel,
  help card, chips, typed questions, session, Spanish, positioning
2026-04-08 11:31:09 +01:00
juanatsap b0e8e1ced7 feat: evolve chat into CV Assistant mascot with help popup and suggestions
- Mascot identity: robot-happy-outline icon, "CV Assistant" branding
- Help popup: onboarding card explaining what the mascot can do (EN/ES)
- Suggested questions: 5 clickable chips that auto-submit (bilingual)
- Typing indicator: three bouncing dots during agent response
- Icon swap: mascot icon ↔ close icon via Hyperscript class toggle
- Dark theme support for all new elements
- Modular CSS loading in development, chat CSS always loaded separately
2026-04-08 10:49:19 +01:00
juanatsap 55968e022d fix: move chat button to left side matching existing button stack
Chat button and panel now anchor from left: 2rem to match the
zoom, shortcuts, and other fixed buttons. Panel opens rightward
so content is always visible.
2026-04-08 10:36:52 +01:00
juanatsap eddc424962 fix: cross-section search and CSS loading for chat widget
- agent.go: add section="search" that queries experience, projects,
  skills, and courses simultaneously — fixes missing results when
  a technology spans multiple CV sections (e.g. Java at Insa)
- head-styles.html: use modular CSS in development mode and load
  chat CSS separately — fixes unstyled page when bundle is stale
2026-04-08 00:44:16 +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 f5276431ea feat: add AI chat widget powered by ADK Go 1.0
Visitors can ask questions about the CV via a floating chat panel.
The agent uses Gemini to answer questions about experience, projects,
skills, and education by querying the cached CV JSON data.

- internal/chat/agent.go: LLM agent with query_cv tool that searches
  CV data by section (experience, projects, skills, etc.) with keyword filtering
- internal/chat/handler.go: POST /api/chat endpoint with session management,
  graceful degradation when GOOGLE_API_KEY is not set
- chat-widget.html: HTMX-powered floating chat panel with Hyperscript toggle
- _chat.css: Responsive chat UI with dark theme support
- Wired into existing architecture via dependency injection (CVHandler,
  routes, main.go) — zero breaking changes, all existing tests pass
2026-04-08 00:20:48 +01:00
juanatsap 2ac4fbcd92 data: add GitHub badge to CDC Starter Kit project 2026-04-03 23:55:55 +01:00
juanatsap c4c52a68fa data: fix project dates to 2026 and move to top of list 2026-04-03 23:47:57 +01:00
juanatsap 61efe98240 feat: link projects to drolosoft.com pages and add GitHub badge
Main project URLs now point to drolosoft.com product pages with
language-aware links. GitHub repos are shown via a new badge next
to the existing LIVE badge.
2026-04-03 23:15:59 +01:00
juanatsap f54829cb28 data: add Immich Photo Manager project logo 2026-04-03 22:44:21 +01:00
juanatsap bbaf303e62 data: add Cmux Resurrect project logo (phoenix) 2026-04-02 23:37:38 +01:00
juanatsap b68eab10c2 data: add Immich Photo Manager open-source project to CV
Add MCP server for AI-powered Immich photo library management
to projects section in both English and Spanish.
2026-04-02 21:57:47 +01:00
juanatsap afe2ad5017 fix: capitalize Cmux Resurrect properly 2026-03-27 02:10:34 +00:00
juanatsap 5dd01461b3 fix: correct project name from CMAX to cmux Resurrect 2026-03-27 02:10:15 +00:00
juanatsap 623f3b2376 data: add CMAX Resurrect open-source project to CV
Add cmux-resurrect terminal session persistence tool to the
projects section in both English and Spanish CV data files.
2026-03-27 02:00:28 +00:00
juanatsap 1d0cf46dd3 fix: resolve errcheck warnings in security_test.go
Use t.Setenv for env var management in tests.
2026-03-15 20:22:41 +00:00
juanatsap cafd117437 fix: resolve golangci-lint errcheck and staticcheck warnings
Use t.Setenv in tests, add error return handling, and replace
WriteString(fmt.Sprintf(...)) with fmt.Fprintf.
2026-03-15 20:22:41 +00:00
juanatsap 585949b709 chore: update Matomo analytics URL to matomo.txeo.club
Migrate from matomo.morenorub.io to matomo.txeo.club in both
CSP headers and tracking script. Also fix errcheck lint warnings
in cv_streaming.go.
2026-03-15 20:22:41 +00:00
juanatsap 019f610eb5 data: close LIV Golf position (ended Dec 2025) 2026-03-05 22:35:07 +00: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