Commit graph

11 commits

Author SHA1 Message Date
96810d80ea feat: Add focus management, themes, and comprehensive tests
Focus management system (src/focus.zig):
- FocusRing for tab-order navigation within widget groups
- FocusManager for managing multiple focus rings
- Focusable interface with vtable pattern
- Focus trapping for modals

Theme system (src/theme.zig):
- Theme struct with full color properties
- Style builder methods (primaryStyle, errorStyle, etc.)
- 10 predefined themes: dark, light, dracula, nord, gruvbox,
  solarized_dark, monokai, one_dark, tokyo_night, catppuccin

Comprehensive test suite (src/tests/):
- widget_tests.zig: Block, Gauge, Checkbox, RadioGroup, Select,
  Slider, StatusBar, Toast, Panel, TabbedPanel, Rect, Buffer, Style
- theme_tests.zig: Theme system and predefined themes
- layout_tests.zig: Layout constraints and splits
- tests.zig: Test aggregator

Bug fixes:
- Fixed Zig 0.15 API compatibility in inline tests
- style.fg -> style.foreground
- std.time.sleep -> std.Thread.sleep
- Cell.char -> Cell.symbol with proper Symbol comparison

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-08 18:29:00 +01:00
79c0bb1a58 feat: Add form widgets, status bar, toast system, and documentation
Form widgets:
- Checkbox and CheckboxGroup for boolean inputs
- RadioGroup for single-selection options
- Select dropdown with keyboard navigation
- Slider and RangeSlider for numeric inputs
- TextArea for multi-line text input

UI utilities:
- StatusBar for bottom-of-screen information
- Toast and ToastManager for notifications

Examples:
- form_demo.zig: Interactive form widgets showcase
- panel_demo.zig: Docking panel system demo

Documentation:
- Complete README.md with Quick Start, widget examples, and API reference

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-08 18:02:06 +01:00
d3e42a241d feat: Add LEGO Panel System
A modular panel system for building complex layouts:

Panel:
- Basic container with borders, title, focus state
- Min/max width/height constraints
- Content render callback

PanelSplit:
- Split container (horizontal/vertical)
- Configurable ratios per child
- Gap between panels

TabbedPanel:
- Multiple panels with tab navigation
- Tab bar rendering
- Per-tab content renderers

DockingPanel:
- Dockable positions (left/right/top/bottom/center)
- Floating mode with custom position/size
- Show/hide/close functionality

PanelManager:
- Manages collection of panels
- Focus navigation
- Layered rendering (docked → center → floating)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-08 17:40:38 +01:00
04e18ff0c1 feat: Add lazy rendering and scrollable containers
Lazy rendering (src/lazy.zig):
- RenderCache: Cache rendered content with TTL
- RenderTask: Background thread-based rendering
- Throttle: Rate-limit render updates
- Debounce: Delay processing until quiet period
- DeferredRender: First-access rendering

Scrollable containers (src/widgets/scroll.zig):
- ScrollView: Basic scrollable container
- ScrollState: Scroll position management
- VirtualList: Efficient virtual scrolling for large datasets
- InfiniteScroll: Load-more-on-demand container

Note: Zig 0.15's new io.Async is still in development.
Thread-based implementation provided for compatibility.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-08 17:38:47 +01:00
5ac74ebff5 feat: Add terminal extensions and new widgets
Hyperlinks (OSC 8):
- Clickable hyperlinks with URL and display text
- ID support for link grouping
- URL encoding utility

Notifications (OSC 9/777):
- iTerm2-style (OSC 9) and urxvt-style (OSC 777)
- NotificationManager with title/body support

Image display (Kitty/iTerm2):
- Kitty Graphics Protocol with chunked transmission
- iTerm2 inline images
- File and raw data display

Tree widget:
- Hierarchical tree view with expand/collapse
- Customizable symbols (Unicode/ASCII)
- TreeState for selection navigation

FilePicker widget:
- File browser using Tree widget
- Lazy-loading directory contents
- Hidden files toggle, file icons

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-08 17:34:33 +01:00
8c218a3f0d feat: Add ContextMenu and Tooltip widgets
ContextMenu:
- Right-click context menu support
- Auto-adjust position to fit in bounds
- containsPoint for hit testing
- Wraps existing Menu widget

Tooltip:
- Single and multiline text support
- Configurable positioning (above/below/left/right/auto)
- Customizable style, border, padding
- TooltipManager with hover delay timing

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-08 17:18:45 +01:00
e7045097e5 Add Popup/Modal and Menu widgets
Popup widget:
- Floating overlay with optional backdrop dimming
- Configurable size and position (or centered)
- Block wrapper support

Modal widget:
- Title, message, and action buttons
- Keyboard navigation (Tab/arrows to switch buttons)
- Helper functions: confirmDialog, alertDialog, yesNoCancelDialog

Menu widgets:
- MenuItem: action, separator, submenu, toggle types
- Menu: Dropdown menu with selection navigation
- MenuBar: Horizontal menu bar with dropdown support
- Shortcut display support
- Enabled/disabled state

Example: menu_demo.zig with interactive menu bar and dialogs

Tests: 11 tests for popup/menu, all pass

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-08 16:52:38 +01:00
4d27a7b13d Add readline-style Input widget with history support
New widget: src/widgets/input.zig
- Basic editing (insert, delete, backspace)
- Cursor movement (home, end, left, right)
- Word navigation (Ctrl+Left/Right, Ctrl+B/F)
- Kill/yank operations (Ctrl+K, Ctrl+U, Ctrl+Y)
- Delete word (Ctrl+W)
- History navigation (Up/Down arrows)
- Unicode support (UTF-8 encoding)
- Password masking support

New example: examples/input_demo.zig
- Interactive demo with normal and password inputs
- Tab to switch focus between inputs
- Shows submitted values in message log

Run with: zig build input-demo

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-08 13:26:56 +01:00
b9223dec85 Add 3 new interactive demo examples
New examples:
- list_demo.zig: Interactive list with j/k navigation
- table_demo.zig: Table with row selection and status colors
- dashboard.zig: Multi-widget demo (Tabs, Gauges, Sparklines, List)

Also includes:
- build.zig: Added build targets for all new examples
- table.zig: Fixed Cell.content default, HighlightSpacing check, ColumnPos type

Run with: zig build list-demo / table-demo / dashboard

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-08 13:22:42 +01:00
560ed1b355 zcatui v1.0 - Implementacion completa de todos los widgets ratatui
Widgets implementados (13):
- Block, Paragraph, List, Table
- Gauge, LineGauge, Tabs, Sparkline
- Scrollbar, BarChart, Canvas, Chart
- Calendar (Monthly), Clear

Modulos:
- src/text.zig: Span, Line, Text, Alignment
- src/symbols/: line, border, block, bar, braille, half_block, scrollbar, marker
- src/widgets/: todos los widgets con tests

Documentacion:
- docs/ARCHITECTURE.md: arquitectura tecnica
- docs/WIDGETS.md: guia completa de widgets
- docs/API.md: referencia rapida
- CLAUDE.md: actualizado con estado v1.0

Tests: 103+ tests en widgets, todos pasan

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-08 12:18:41 +01:00
2a62c0f60b Inicio proyecto zcatui - TUI library para Zig
Librería TUI inspirada en ratatui (Rust), implementada en Zig 0.15.2.

Estructura inicial:
- src/style.zig: Color, Style, Modifier
- src/buffer.zig: Cell, Buffer, Rect
- src/layout.zig: Layout, Constraint, Direction
- src/terminal.zig: Terminal abstraction
- src/backend/backend.zig: ANSI escape sequences
- src/widgets/block.zig: Block con borders y título
- src/widgets/paragraph.zig: Paragraph con wrapping
- examples/hello.zig: Demo funcional

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-08 01:56:44 +01:00