docs: Actualizar CLAUDE.md (v0.28.0)
- Versión actualizada a v0.28.0 - Nuevos hitos: WindowState, Shadow Baking, ColorTransition ε - Optimizaciones detalladas (7 activas) - Métricas: 4.2x más rápido Debug, 0 memory leaks 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
cead6bf26f
commit
6732ac1fc5
1 changed files with 69 additions and 63 deletions
132
CLAUDE.md
132
CLAUDE.md
|
|
@ -105,9 +105,9 @@ Resumen breve (1-2 frases). Resultado principal.
|
||||||
| Campo | Valor |
|
| Campo | Valor |
|
||||||
|-------|-------|
|
|-------|-------|
|
||||||
| **Nombre** | zcatgui |
|
| **Nombre** | zcatgui |
|
||||||
| **Versión** | v0.21.2 |
|
| **Versión** | v0.28.0 |
|
||||||
| **Fecha inicio** | 2025-12-09 |
|
| **Fecha inicio** | 2025-12-09 |
|
||||||
| **Estado** | ✅ COMPLETO - 37 widgets, ~35K LOC, 4 backends, TTF funcional |
|
| **Estado** | ✅ COMPLETO - 38 widgets, ~36K LOC, 4 backends, WindowState, TTF funcional |
|
||||||
| **Lenguaje** | Zig 0.15.2 |
|
| **Lenguaje** | Zig 0.15.2 |
|
||||||
| **Paradigma** | Immediate Mode GUI |
|
| **Paradigma** | Immediate Mode GUI |
|
||||||
| **Inspiración** | Gio (Go), microui (C), DVUI (Zig), Dear ImGui (C++) |
|
| **Inspiración** | Gio (Go), microui (C), DVUI (Zig), Dear ImGui (C++) |
|
||||||
|
|
@ -247,14 +247,14 @@ zcatgui/
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## ESTADO ACTUAL (v0.25.0)
|
## ESTADO ACTUAL (v0.28.0)
|
||||||
|
|
||||||
### Widgets (38 total)
|
### Widgets (38 total)
|
||||||
|
|
||||||
| Categoría | Widgets |
|
| Categoría | Widgets |
|
||||||
|-----------|---------|
|
|-----------|---------|
|
||||||
| **Básicos** | Label, Button, Checkbox, Radio, Slider, TextInput, NumberEntry |
|
| **Básicos** | Label, Button, Checkbox, Radio, Slider, TextInput, NumberEntry |
|
||||||
| **Contenedores** | Panel, Split, Modal, Scroll, Tabs, Menu |
|
| **Contenedores** | Panel, Split, Modal, Scroll, Tabs, Menu, **WindowState** |
|
||||||
| **Datos** | List, Table, Tree, ReorderableList, VirtualScroll |
|
| **Datos** | List, Table, Tree, ReorderableList, VirtualScroll |
|
||||||
| **Feedback** | Progress, Tooltip, Toast, Spinner |
|
| **Feedback** | Progress, Tooltip, Toast, Spinner |
|
||||||
| **Input avanzado** | AutoComplete, Select, TextArea, ColorPicker, DatePicker |
|
| **Input avanzado** | AutoComplete, Select, TextArea, ColorPicker, DatePicker |
|
||||||
|
|
@ -268,16 +268,18 @@ zcatgui/
|
||||||
- **iOS**: UIKit bridge (Objective-C)
|
- **iOS**: UIKit bridge (Objective-C)
|
||||||
|
|
||||||
### Core Systems
|
### Core Systems
|
||||||
- Context (FrameArena, dirty rectangles, ID system)
|
- Context (FrameArena, dirty rectangles, ID system, Ghost Drawing)
|
||||||
- Input (keyboard, mouse, touch, shortcuts, gestures)
|
- Input (keyboard, mouse, touch, shortcuts, gestures)
|
||||||
- Rendering (software renderer, AA, effects)
|
- Rendering (software renderer, AA, effects, **Shadow Cache**)
|
||||||
- Animation (20+ easing functions, springs)
|
- Animation (20+ easing functions, springs, **ColorTransition**)
|
||||||
- Themes (dark, light, high_contrast, nord, dracula)
|
- Themes (dark, light, high_contrast, nord, dracula)
|
||||||
|
- **WindowState** (Panel interface a nivel de librería)
|
||||||
|
|
||||||
### Métricas
|
### Métricas
|
||||||
- ~35,000 LOC en 81 archivos fuente
|
- ~36,000 LOC en 85 archivos fuente
|
||||||
- 0 warnings, 0 memory leaks
|
- 0 warnings, 0 memory leaks
|
||||||
- WASM: ~18KB compilado
|
- WASM: ~18KB compilado
|
||||||
|
- **Shadow Baking**: 4.2x más rápido en Debug
|
||||||
|
|
||||||
→ Detalle completo: `REFERENCE.md`
|
→ Detalle completo: `REFERENCE.md`
|
||||||
|
|
||||||
|
|
@ -285,48 +287,55 @@ zcatgui/
|
||||||
|
|
||||||
## HITOS RECIENTES
|
## HITOS RECIENTES
|
||||||
|
|
||||||
|
### WindowState + Panel Interface ✅ (2026-01-04)
|
||||||
|
Panel interface movido a nivel de librería para reutilización:
|
||||||
|
- **WindowState**: Contenedor de paneles con vtable
|
||||||
|
- **Panel**: Interface con draw, handleEvent, onFocus, onBlur
|
||||||
|
- Cualquier app puede usar sin reimplementar lógica de paneles
|
||||||
|
→ Archivo: `src/window.zig`
|
||||||
|
|
||||||
|
### Shadow Baking ✅ (2026-01-02)
|
||||||
|
Cache de sombras prerenderizadas - **4.2x más rápido** en Debug:
|
||||||
|
- Evita recalcular blur por frame
|
||||||
|
- ShadowCache con max 64 entries
|
||||||
|
- initWithCache() para habilitar
|
||||||
|
→ Archivo: `render/software.zig`
|
||||||
|
|
||||||
|
### Glyph Blitting Optimizado ✅ (2026-01-02)
|
||||||
|
Renderizado de texto hasta 3x más rápido:
|
||||||
|
- Early exit si fuera de clip
|
||||||
|
- Pre-cálculo región visible
|
||||||
|
- Fast path para alpha=255
|
||||||
|
→ Archivo: `render/ttf.zig`
|
||||||
|
|
||||||
|
### ColorTransition Epsilon Fix ✅ (2026-01-03)
|
||||||
|
Fix animaciones que no terminaban (loop infinito):
|
||||||
|
- lerpU8 truncaba incrementos <1 → nunca convergía
|
||||||
|
- Epsilon check ANTES del lerp para forzar snap
|
||||||
|
- Umbral <= 2 para margen de seguridad
|
||||||
|
→ Archivo: `render/animation.zig`
|
||||||
|
|
||||||
|
### SIMD fillRect ✅ (2026-01-03)
|
||||||
|
Relleno de rectángulos 8 píxeles por iteración:
|
||||||
|
- @Vector(8, u32) para batch writing
|
||||||
|
- Solo en hot paths (>50% tiempo en framebuffer)
|
||||||
|
→ Archivo: `render/framebuffer.zig`
|
||||||
|
|
||||||
|
### Ghost Drawing ✅ (2026-01-02)
|
||||||
|
Supresión de comandos sin romper input:
|
||||||
|
- `ctx.suppress_commands = true` → pushCommand ignora
|
||||||
|
- Widgets procesan input normalmente
|
||||||
|
- 36% menos tiempo de ejecución
|
||||||
|
→ Archivo: `core/context.zig`
|
||||||
|
|
||||||
### Liquid UI V2 ✅ (2025-12-30)
|
### Liquid UI V2 ✅ (2025-12-30)
|
||||||
Sistema de transiciones de color suaves para paneles:
|
Transiciones de color suaves (500ms) con contraste mejorado.
|
||||||
- **ColorTransition**: 500ms (medio segundo) para transiciones perceptibles
|
→ Archivos: `render/animation.zig`, `core/style.zig`
|
||||||
- **Mayor contraste**: Dark mode 4%/20% base, Light mode 1%/6% base
|
|
||||||
- **requestAnimationFrame()**: Paneles solicitan redraw durante animación
|
|
||||||
- Fondo de paneles "fluye" al cambiar focus
|
|
||||||
→ Archivos: `render/animation.zig`, `core/style.zig`, `core/context.zig`
|
|
||||||
|
|
||||||
### IdleCompanion Widget ✅ (2025-12-30)
|
### IdleCompanion Widget ✅ (2025-12-30)
|
||||||
Mascota animada que aparece tras inactividad del usuario:
|
Mascota animada (gatito) tras inactividad.
|
||||||
- Se asoma por bordes de paneles aleatorios
|
|
||||||
- Ojos que miran a los lados, orejas con movimiento
|
|
||||||
- Salto de pánico al detectar actividad
|
|
||||||
- Clipping correcto (respeta límites del panel)
|
|
||||||
→ Archivo: `widgets/idle_companion.zig`
|
→ Archivo: `widgets/idle_companion.zig`
|
||||||
|
|
||||||
### Primitivas Gráficas 2D ✅ (2025-12-30)
|
|
||||||
Nuevas primitivas para formas orgánicas:
|
|
||||||
- **FilledTriangle**: Rasterización por scanlines (v0.23.0)
|
|
||||||
- **FilledCircle**: Algoritmo Midpoint/Bresenham (v0.24.0)
|
|
||||||
→ Archivos: `core/command.zig`, `render/software.zig`
|
|
||||||
|
|
||||||
### Refactorización Modular ✅ (2025-12-29)
|
|
||||||
Archivos grandes modularizados en carpetas:
|
|
||||||
- `autocomplete/` (910→571 LOC hub, -37%): state, types, filtering
|
|
||||||
- `icon/` (805→515 LOC hub, -36%): types, drawing_helpers
|
|
||||||
→ Detalle: `docs/REFACTORING_MODULAR_2025-12-29.md`
|
|
||||||
|
|
||||||
### AdvancedTable Color por Focus ✅ (2025-12-19)
|
|
||||||
Fila seleccionada cambia color según focus de la tabla:
|
|
||||||
- `selected_row`: color con focus (accent)
|
|
||||||
- `selected_row_unfocus`: color sin focus (gris sutil)
|
|
||||||
- `BasicColors` acepta override desde aplicación
|
|
||||||
|
|
||||||
### TTF Rendering ✅ (2025-12-17)
|
|
||||||
Integración zcatttf v1.0 - texto TTF funciona perfectamente.
|
|
||||||
→ Librería: `/mnt/cello2/arno/re/recode/zig/zcatttf/`
|
|
||||||
|
|
||||||
### Paridad Visual DVUI ✅ (2025-12-17)
|
|
||||||
Sistema dual (simple/fancy), esquinas redondeadas, sombras, transiciones, focus ring AA.
|
|
||||||
→ Detalle: `docs/research/DVUI_AUDIT_2025-12-17.md`
|
|
||||||
|
|
||||||
### AdvancedTable ✅ (2025-12-17)
|
### AdvancedTable ✅ (2025-12-17)
|
||||||
Widget ~3,700 LOC con schema, CRUD, sorting, lookup, multi-select, search, validation.
|
Widget ~3,700 LOC con schema, CRUD, sorting, lookup, multi-select, search, validation.
|
||||||
→ Detalle: `docs/ADVANCED_TABLE_MERGE_PLAN.md`
|
→ Detalle: `docs/ADVANCED_TABLE_MERGE_PLAN.md`
|
||||||
|
|
@ -367,29 +376,26 @@ pub const MacroPlayer = struct {
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## OPTIMIZACIONES DE RENDIMIENTO (2026-01-03)
|
## OPTIMIZACIONES DE RENDIMIENTO (2026-01-05)
|
||||||
|
|
||||||
### Optimizaciones Activas ✅
|
### Optimizaciones Activas ✅
|
||||||
|
|
||||||
| Optimización | Archivo | Descripción |
|
| # | Optimización | Archivo | Impacto |
|
||||||
|--------------|---------|-------------|
|
|---|--------------|---------|---------|
|
||||||
| **Turbo Píxeles** | `render/framebuffer.zig:117` | `@setRuntimeSafety(false)` en `fillRect` - elimina bounds checks en hot path |
|
| 1 | **Shadow Baking** | `render/software.zig` | 4.2x más rápido Debug |
|
||||||
| **Fast Path Texto** | `render/ttf.zig:323,375` | Escritura directa para píxeles opacos (alpha==255), evita blend innecesario |
|
| 2 | **Glyph Blitting** | `render/ttf.zig` | 3x más rápido texto |
|
||||||
|
| 3 | **SIMD fillRect** | `render/framebuffer.zig` | 8 pixels/iteración |
|
||||||
|
| 4 | **Turbo Píxeles** | `render/framebuffer.zig` | Sin bounds checks |
|
||||||
|
| 5 | **Fast Path α=255** | `render/ttf.zig` | Sin blend innecesario |
|
||||||
|
| 6 | **Ghost Drawing** | `core/context.zig` | 36% menos comandos |
|
||||||
|
| 7 | **ColorTransition ε** | `render/animation.zig` | Convergencia garantizada |
|
||||||
|
|
||||||
### Optimización Probada y Revertida ❌
|
### Resultado Final
|
||||||
|
|
||||||
| Optimización | Problema | Alternativa |
|
- **Debug mode:** 180ms → 43ms (4.2x mejora)
|
||||||
|--------------|----------|-------------|
|
- **ReleaseSafe:** ~16.7ms = 60fps objetivo
|
||||||
| **Burst Suppression** (auto-gestión de estrés) | Causaba paneles vacíos durante navegación rápida | El debounce en DataManager ya evita queries excesivas |
|
- **CPU idle:** ~0% (waitEventTimeout)
|
||||||
|
- **Memory leaks:** 0 verificado
|
||||||
**Detalles del Burst Suppression:**
|
|
||||||
- Concepto: suprimir dibujo de paneles durante ráfagas de navegación (<100ms)
|
|
||||||
- Implementación: `if (!frame_result.should_draw) return;` en paneles
|
|
||||||
- Problema: el frame se dibujaba vacío (solo fondo), sin widgets
|
|
||||||
- Causa raíz: suprimía TODO el dibujo, no solo las queries BD
|
|
||||||
- Lección: el debounce a nivel DataManager es más elegante
|
|
||||||
|
|
||||||
**Pendiente verificar:** Mensajes continuos de redraw en idle (posible bug en animaciones).
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue