Commit graph

21 commits

Author SHA1 Message Date
31362b6d48 style: Z-Design V6 - Colores más vivos (30%/20%)
Cambios en deriveDarkPalette y derivePanelFrameColors:
- focus_blend: 80 → 70 (30% color visible, antes 20%)
- unfocus_blend: 88 → 80 (20% color visible, antes 12%)

Objetivo: Mejor identificación visual de tipos de documento/cliente
sin perder la estética oscura profesional.

Tests actualizados para reflejar nuevos valores.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-01 13:28:44 +01:00
d657a25ba7 fix(visual): Títulos legibles + botones centrados
Fix legibilidad títulos:
- title_color: 85% soft_white + 15% tinte del base_color
- Antes: base.lightenHsl(90) → azul claro sobre azul oscuro (ilegible)
- Ahora: blanco con tinte sutil → máximo contraste + identidad visual

Fix centrado vertical botones:
- Añadido char_height al Context (default 14px para TTF)
- button.zig: usa char_height en vez de char_width
- Offset visual -1px para compensar efecto 3D del bisel

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 12:15:13 +01:00
f7e1e346be feat(context): Títulos integrados con color adaptativo
Z-Design V5 - Títulos Adaptativos:
- derivePanelFrameColors: title_color según luminosidad del fondo
  - Fondo oscuro (L < 0.5) → base.lightenHsl(90) (blanco teñido)
  - Fondo claro → base.darkenHsl(90) (negro teñido)
- drawPanelFrame: siempre usa title_color (no border_unfocus)
- Márgenes título mejorados: x+10, y+5

Resultado: máximo contraste y legibilidad en todos los paneles.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 01:54:58 +01:00
203a1e6ee5 fix(style): Z-Design V5 final - Focus 20% / Unfocus 12%
Ajuste consensuado:
- deriveDarkPalette: 80% black (20% color) focus, 88% black (12% color) unfocus
- derivePanelFrameColors: mismos valores
- Elimina compensación perceptual completamente

Unfocus 12% es más visible que el anterior 4%.
2025-12-31 01:29:06 +01:00
f41e502f9c fix(style): Z-Design V5 - Blend fijo sin compensación perceptual
Simplificación consensuada:
- Eliminar compensación perceptual (causaba más problemas)
- Blend fijo para TODOS los colores:
  - Focus: 18% base / 82% negro
  - Unfocus: 6% base / 94% negro

La fluidez viene de pasar bg_transition.current a widgets,
no de compensar matemáticamente.
2025-12-31 00:43:24 +01:00
23204bdd0a fix(style): Z-Design V4 - El rojo es el estándar, boost para azul
Corrección de rumbo consensuada:
- Colores brillantes (L > 0.2): 22% intensidad (estándar del rojo)
- Colores oscuros (L <= 0.2): 35% intensidad (boost para azul/violeta)

El objetivo es que todos los paneles tengan la vibrancia del rojo.
El azul debe 'saltar' del negro tanto como lo hace el rojo.
2025-12-31 00:31:01 +01:00
797cca736c feat(context): Smart Panel V2 - base_color derivación genérica + título
- PanelFrameConfig: añadir base_color, title, title_color
- drawPanelFrame: modo híbrido (explícito vs Z-Design)
- derivePanelFrameColors: fórmula genérica luminosidad (L inversamente proporcional)
- Documentar decisión de omitir clipping (performance + control)

Consensuado: Claude + Gemini + R.Eugenio (2025-12-31)
2025-12-31 00:19:18 +01:00
5ba0cc9f25 docs(colors): Document perceptual correction algorithm in detail
Added extensive documentation explaining:
- The problem (blue goes to black, red stays red when darkened)
- Technical cause (ITU-R BT.709 luminance formula)
- Solution (threshold 0.15, correction factor)
- How to disable if needed

Status: PENDING CONSENSUS - needs team input on colors.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 21:35:08 +01:00
0a2f02a0a4 fix(colors): Correct perceptual correction threshold
Changed threshold from 0.45 to 0.15 so that:
- Blue (~0.07 luminance) gets boost to avoid "goes to black" effect
- Red (~0.21 luminance) is NOT affected (already darkens nicely)

This fixes the issue where red panels became too saturated.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 21:29:01 +01:00
b63cf44d88 fix(colors): Disable perceptual correction (wrong logic)
The current implementation boosts red colors when it should
compensate blue colors instead. Disabled until the algorithm
is revised.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 21:19:53 +01:00
16fc528415 feat(colors): Add perceptual luminance correction (Z-Design V3)
E1 task from PLAN_REFINAMIENTO_UI_2025-12-30.md:
- Add Color.perceptualLuminance() using ITU-R BT.709 weights
- Add global perceptual_correction_enabled flag (default: true)
- deriveDarkPalette/deriveLightPalette now boost low-luminance colors
- Colors like red/magenta now have comparable contrast to blue
- Correction capped at 0.7 to avoid excessive boost

Algorithm: if base_lum < 0.45, reduce blend % by ratio (more color visible)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 20:15:48 +01:00
ed2701fbd8 feat(animation): Liquid UI V2 - Mayor fluidez y contraste
- ColorTransition: 200ms → 500ms (transiciones más perceptibles)
- deriveDarkPalette: 4%/20% base color (mayor contraste focus/unfocus)
- deriveLightPalette: 1%/6% base color (proporcional)
- Context: añadir requestAnimationFrame/needsAnimationFrame
- Tests actualizados para nuevos umbrales

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 19:24:36 +01:00
b67de1ce01 style: Z-Design V2 - Atmósfera en vez de fogonazo
Refinamiento Visual Premium:
- Dark mode fondo_sin_focus: negro puro → 7% base color
- Dark mode fondo_con_focus: mantiene 15% base color
- Light mode sincronizado: 1%/3% base color

Efecto: Los paneles siempre tienen su "identidad" de color,
incluso sin focus. El cambio de focus es ahora una transición
suave de "iluminación" en vez de un fogonazo negro→color.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 18:12:28 +01:00
9559b14a33 feat(style): Z-Design blend 85/15 para fondos visibles
Cambio en deriveDarkPalette(): 85% negro + 15% color base
(antes era 95/5, imperceptible)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 18:33:45 +01:00
b5a4205c29 feat(style): Mejorar derivePanelPalette con HSL
- Header usa darkenHsl/lightenHsl (preserva tono mejor que RGB)
- Selección sin foco usa desaturate + lightenHsl (más elegante)
- Nueva función contrastTextColor() para texto automático b/n
- Test adicional para contrastTextColor

Z-Design ahora produce paletas más armónicas desde color base.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 15:36:20 +01:00
c330492022 feat(style): Motor HSL para derivación de colores
Añadido espacio de color HSL para transformaciones perceptualmente uniformes:

- Struct Hsl con campos h (0-360), s (0-1), l (0-1)
- Funciones rgbToHsl() y hslToRgb() con algoritmo estándar
- Métodos Hsl: lighten, darken, saturate, desaturate, rotate
- Métodos Color: toHsl, lightenHsl, darkenHsl, saturate, desaturate
- Color.rotateHue, Color.complementary para teoría del color
- 15 tests unitarios para validar conversiones

Esto permite derivar paletas armónicas desde un color base (Z-Design).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 15:33:57 +01:00
9c9c53afea feat(style): Z-Design panel color derivation system
Laravel-inspired color system for semantic panel coloring:

- Add blendTowards(target, percent) for color washing
- Add Laravel color constants (red, blue, green, amber, cyan, etc.)
- Add soft_black/soft_white for better aesthetics
- Add ThemeMode enum (dark/light)
- Add PanelColorScheme with 10 documented fields
- Implement derivePanelPalette(base, mode) to derive full palette
- deriveDarkPalette: 5% tint on dark background
- deriveLightPalette: 3% tint on light background
- Tests for blendTowards and derivePanelPalette

This enables deriving a complete 10-color panel palette from
a single base color, achieving Laravel Forge/Nova aesthetics.
2025-12-27 22:23:58 +01:00
364a7d963f feat: Paridad visual DVUI - RenderMode dual (simple/fancy)
Sistema de rendering dual para zcatgui:

Core:
- RenderMode enum (simple/fancy) en style.zig
- global_render_mode con helpers: isFancy(), setRenderMode()
- fillRoundedRect con edge-fade AA en framebuffer.zig (~350 LOC)
- Nuevos comandos: rounded_rect, rounded_rect_outline

Widgets actualizados:
- Button: corner_radius=4, usa roundedRect en fancy mode
- Panel: corner_radius=6, show_shadow=true, sombra offset 4px
- TextInput: corner_radius=3
- Select: corner_radius=3
- Modal: corner_radius=8, show_shadow=true, sombra offset 6px
  - Botones y input field del modal también redondeados

Técnica edge-fade (de DVUI):
- Anti-aliasing por gradiente alfa en bordes
- Sin supersampling, mínimo impacto en rendimiento
- Bordes suaves sin multisampling

+589 líneas, 9 archivos modificados

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-17 01:02:46 +01:00
91e13f6956 feat: zcatgui Gio parity - 12 new widgets + gesture system
New widgets (12):
- Switch: Toggle switch with animation
- IconButton: Circular icon button (filled/outlined/ghost/tonal)
- Divider: Horizontal/vertical separator with optional label
- Loader: 7 spinner styles (circular/dots/bars/pulse/bounce/ring/square)
- Surface: Elevated container with shadow layers
- Grid: Layout grid with scrolling and selection
- Resize: Draggable resize handle (horizontal/vertical/both)
- AppBar: Application bar (top/bottom) with actions
- NavDrawer: Navigation drawer with items, icons, badges
- Sheet: Side/bottom sliding panel with modal support
- Discloser: Expandable/collapsible container (3 icon styles)
- Selectable: Clickable region with selection modes

Core systems added:
- GestureRecognizer: Tap, double-tap, long-press, drag, swipe
- Velocity tracking and fling detection
- Spring physics for fluid animations

Integration:
- All widgets exported via widgets.zig
- GestureRecognizer exported via zcatgui.zig
- Spring/SpringConfig exported from animation.zig
- Color.withAlpha() method added to style.zig

Stats: 47 widget files, 338+ tests, +5,619 LOC
Full Gio UI parity achieved.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-09 17:21:15 +01:00
8adc93a345 feat: zcatgui v0.6.0 - Phase 1 Optimization Complete
Performance Infrastructure:
- FrameArena: O(1) per-frame allocator with automatic reset
- ObjectPool: Generic object pool for frequently allocated types
- CommandPool: Specialized pool for draw commands
- RingBuffer: Circular buffer for streaming data
- ScopedArena: RAII pattern for temporary allocations

Dirty Rectangle System:
- Context now tracks dirty regions for partial redraws
- Automatic rect merging to reduce overdraw
- invalidateRect(), needsRedraw(), getDirtyRects() API
- Falls back to full redraw when > 32 dirty rects

Benchmark Suite:
- Timer: High-resolution timing
- Benchmark: Stats collection (avg, min, max, stddev, median)
- FrameTimer: FPS and frame time tracking
- AllocationTracker: Memory usage monitoring
- Pre-built benchmarks for arena, pool, and commands

Context Improvements:
- Integrated FrameArena for zero-allocation hot paths
- frameAllocator() for per-frame widget allocations
- FrameStats for performance monitoring
- Context.init() now returns error union (breaking change)

New Widgets (from previous session):
- Slider: Horizontal/vertical with customization
- ScrollArea: Scrollable content region
- Tabs: Tab container with keyboard navigation
- RadioButton: Radio button groups
- Menu: Dropdown menus (foundation)

Theme System Expansion:
- 5 built-in themes: dark, light, high_contrast, nord, dracula
- ThemeManager with runtime switching
- TTF font support via stb_truetype

Documentation:
- DEVELOPMENT_PLAN.md: 9-phase roadmap to DVUI/Gio parity
- Updated WIDGET_COMPARISON.md with detailed analysis
- Lego Panels architecture documented

Stats: 17 widgets, 123 tests, 5 themes

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-09 12:45:00 +01:00
59c597fc18 feat: zCatGui v0.1.0 - Initial project setup
Immediate Mode GUI library for Zig with software rendering.

Core features:
- SDL2 backend for cross-platform window/events
- Software rasterizer (works everywhere, including SSH)
- Macro recording system (cornerstone feature, like Vim)
- Command-list rendering (DrawRect, DrawText, etc.)
- Layout system with constraints
- Color/Style system with themes

Project structure:
- src/core/: context, command, input, layout, style
- src/macro/: MacroRecorder, MacroPlayer, MacroStorage
- src/render/: Framebuffer, SoftwareRenderer, Font
- src/backend/: Backend interface, SDL2 implementation
- examples/: hello.zig, macro_demo.zig
- docs/: Architecture, research (Gio, immediate-mode libs, Simifactu)

Build: zig build (requires SDL2-devel)
Tests: 16 tests passing

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-09 01:30:05 +01:00