From 54626c8edf1db2be58848cc86714acedfadc09c8 Mon Sep 17 00:00:00 2001 From: reugenio Date: Tue, 16 Dec 2025 00:30:42 +0100 Subject: [PATCH] =?UTF-8?q?docs:=20Actualizar=20CLAUDE.md=20con=20protocol?= =?UTF-8?q?o=20documentaci=C3=B3n=20y=20tarea=20TTF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Añadir sección PROTOCOLO DE DOCUMENTACIÓN (2025-12-16) - Agenda = índice, detalles en hitos/ - Límite ~300 líneas por archivo - Añadir sección TAREA ACTUAL: Fuentes TTF con Antialiasing - Estado de ttf.zig y fases de implementación - TextInput: añadir text_color/border_color para validación 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- CLAUDE.md | 59 ++++++++++++++++++++++++++++++++++++++ src/widgets/text_input.zig | 9 ++++-- 2 files changed, 66 insertions(+), 2 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index c814285..8c34139 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -40,6 +40,65 @@ Una vez verificado el estado, continúa desde donde se dejó. --- +## REGLA CRÍTICA: NO EJECUTAR BINARIOS GUI + +**NUNCA ejecutar programas GUI directamente con `./programa` o en background** + +Los procesos GUI no terminan correctamente desde Claude Code y dejan shells zombie que: +1. Consumen contexto de la conversación con mensajes "Background Bash running" +2. Fuerzan compactaciones prematuras del contexto +3. Degradan severamente la calidad de la sesión de trabajo + +**Alternativas:** +- Para verificar que compila: `zig build` (sin ejecutar) +- Para probar muy brevemente: `timeout 2s ./programa 2>&1 || true` +- **Mejor opción**: Pedir al usuario que lo pruebe y reporte + +Esta regla está documentada en teamdocs desde 2025-11-30. + +--- + +## PROTOCOLO DE DOCUMENTACIÓN (2025-12-16) + +**LEER PRIMERO**: `/mnt/cello2/arno/re/recode/teamdocs/ESTRUCTURA_DOCUMENTACION.md` + +### Principios clave: +- **Agenda = ÍNDICE** (QUÉ + CUÁNDO + link), NO documento técnico +- **Detalles técnicos → `agenda/hitos/`** +- **Límite ~300 líneas** por archivo +- Si necesita más de 5 líneas de explicación → crear hito en `hitos/` + +### Al documentar: +1. Entrada breve en agenda (3-5 líneas máx) +2. Link a hito si hay detalles técnicos +3. Nomenclatura: `hitos/YYYY-MM-DD_nombre_proyecto.md` + +--- + +## TAREA ACTUAL: Fuentes TTF con Antialiasing + +**Documento completo**: `/mnt/cello2/arno/re/recode/teamdocs/Conversaciones/TAREA_TTF_ZCATGUI.md` + +### Problema +zsimifactu se ve "años 90" con fuentes bitmap 8x16. Necesitamos TTF con antialiasing. + +### Estado de ttf.zig (637 líneas) +- ✅ Parsing TTF completo +- ✅ Lookup de glyphs +- ✅ Métricas +- ❌ `drawGlyphPlaceholder()` solo dibuja rectángulos, NO renderiza contornos + +### Fases de implementación +1. Parsear contornos (puntos + Bezier cuadráticas) +2. Rasterización básica (scanline) +3. Antialiasing (coverage-based) +4. Integración con SoftwareRenderer + +### Referencia +- **stb_truetype.h** (~5000 líneas C) - implementación de referencia + +--- + ## INFORMACIÓN DEL PROYECTO | Campo | Valor | diff --git a/src/widgets/text_input.zig b/src/widgets/text_input.zig index 34d2cba..b021eef 100644 --- a/src/widgets/text_input.zig +++ b/src/widgets/text_input.zig @@ -211,6 +211,10 @@ pub const TextInputConfig = struct { password: bool = false, /// Padding inside the input padding: u32 = 4, + /// Override text color (for validation feedback). If null, uses theme default. + text_color: ?Style.Color = null, + /// Override border color (for validation feedback). If null, uses theme default. + border_color: ?Style.Color = null, }; /// Result of text input widget @@ -275,8 +279,9 @@ pub fn textInputRect( // Theme colors const theme = Style.Theme.dark; const bg_color = if (has_focus) theme.input_bg.lighten(5) else theme.input_bg; - const border_color = if (has_focus) theme.primary else theme.input_border; - const text_color = theme.input_fg; + // Use override colors if provided, otherwise use theme defaults + const border_color = config.border_color orelse (if (has_focus) theme.primary else theme.input_border); + const text_color = config.text_color orelse theme.input_fg; const placeholder_color = theme.secondary; // Draw background