close
Skip to content

Releases: phoenix-tui/phoenix

Phoenix TUI v0.2.4

23 Feb 21:56
decebfb

Choose a tag to compare

What's New

Added

  • tea: InlineRenderer for non-alt-screen rendering — per-line diffing, ANSI-preserving width truncation, height clipping, thread-safe
  • tea: InlineRenderer integration in Program — lazy init on first View(), automatic WindowSizeMsg forwarding, Repaint() on Resume()
  • tea: 35 new InlineRenderer tests (99.4% coverage) covering rendering, diffing, resize, repaint, truncation, concurrency, ANSI handling, Unicode/CJK width
  • docs: Public docs/ARCHITECTURE.md with Mermaid dependency graph and bounded contexts

Fixed

  • tea: Fix 6 flaky inputReader tests on Windows — replace racy inputReaderRunning checks with race-free inputReaderGeneration counter
  • tea: Remove all t.Skip("flaky on Windows") from exec_process_test.go (4 tests) and suspend_resume_test.go (2 tests)
  • ci: Fix duplicate workflow triggers for release branches

Changed

  • docs: Make all README.md files version-agnostic (no more hardcoded versions, week references, or coverage percentages)

Full Changelog: v0.2.3...v0.2.4

Install:

go get github.com/phoenix-tui/phoenix/tea@v0.2.4
go get github.com/phoenix-tui/phoenix/components@v0.2.4

Phoenix TUI v0.2.3

06 Feb 15:23
98419d7

Choose a tag to compare

Phoenix TUI v0.2.3 (Patch)

Fixed

  • tea: Fix execWithTTYControl defer restoring cooked mode AFTER Resume() on Windows
    • defer SetConsoleMode(originalMode) fired after Resume()EnterRawMode(), undoing raw mode
    • Symptoms: arrow keys broken, OS echo enabled, line buffering after ExecProcessWithTTY
    • Fix: removed harmful defer — Resume() already restores correct console mode
    • Affected: Windows Console, Windows Terminal
  • tea: Fix errorlint warning — use %w for both errors in execWithTTYControl
  • examples: Cascade rivo/uniseg removal from context-menu and hover-highlight go.mod

Install

go get github.com/phoenix-tui/phoenix/tea@tea/v0.2.3

Reported by: GoSh Shell Project

Phoenix TUI v0.2.2

06 Feb 02:13
39dd96f

Choose a tag to compare

Phoenix TUI v0.2.2 (Patch)

Fixed

  • layout/style: Cascade removal of rivo/uniseg indirect dependency from go.mod (missed in v0.2.1)

This is a minor follow-up to v0.2.1 — the rivo/uniseg removal from core was not cascaded to layout and style modules which had it as an indirect dependency.

Install

go get github.com/phoenix-tui/phoenix/layout@layout/v0.2.2
go get github.com/phoenix-tui/phoenix/style@style/v0.2.2

For all modules at v0.2.2:

go get github.com/phoenix-tui/phoenix/tea@tea/v0.2.2
go get github.com/phoenix-tui/phoenix/components@components/v0.2.2
go get github.com/phoenix-tui/phoenix/core@core/v0.2.2

Phoenix TUI Framework v0.2.0

03 Dec 21:18
8306d2e

Choose a tag to compare

🎉 Phoenix TUI Framework v0.2.0 - Theme System + Form Components + TTY Control

🚀 Major Features

TTY Control System (Complete)

  • Level 1: ExecProcess() for simple commands (vim, less, git)
  • Level 1+: Suspend() / Resume() API for manual control
  • Level 2: ExecProcessWithTTY() with platform-specific TTY control
    • Unix: tcsetpgrp() for proper job control
    • Windows: SetConsoleMode() for VT processing
  • Documentation: Complete TTY Control Guide (docs/user/TTY_CONTROL_GUIDE.md)

Form Components (Complete - 4 new components)

  • Select: Single-choice dropdown with fuzzy filtering, generics support (86.9% coverage)
  • Confirm: Yes/No/Cancel dialog with safe defaults, DefaultNo() for destructive actions (90%+ coverage)
  • MultiSelect: Multi-choice with toggle, select all/none, min/max limits (92.7% coverage)
  • Form: Container with validation, Tab navigation, field management (70.8% coverage)

Theme System (Complete)

  • Core: Theme struct with ColorPalette, BorderStyles, SpacingScale, Typography
  • Presets: 4 built-in themes (Default, Dark, Light, HighContrast)
  • ThemeManager: Thread-safe runtime theme switching
  • Component Integration: All 10 components support Theme() API
  • Coverage: 94.7% in domain model, 100% in application layer

🐛 Bug Fixes

  • Windows stdin: WriteConsoleInputW to unblock blocking Read() calls
  • Multiselect examples: Updated to Phoenix tea API (was using Bubbletea patterns)

🖥️ Platform Support

  • Linux: Full TTY control with ioctl TIOCGPGRP/TIOCSPGRP
  • macOS: Full TTY control with ioctl TIOCGPGRP/TIOCSPGRP
  • Windows: Console mode control with SetConsoleMode

📊 Statistics

  • +12,369 lines added (new features)
  • -155 lines removed (cleanups)
  • 75 files changed
  • Test Coverage: 91.8% maintained
  • Performance: 29,000 FPS (489x faster than 60 FPS target)

📚 Documentation

  • Updated README.md with v0.2.0 status and features
  • Updated CHANGELOG.md with comprehensive release notes
  • Updated ROADMAP.md with v0.2.0 completion
  • Added Phoenix logo to repository

🔗 Links


Full Changelog: v0.1.1...v0.2.0

v0.1.1: ExecProcess stdin fix (hotfix)

03 Dec 09:28

Choose a tag to compare

What's Fixed

ExecProcess stdin conflict without Alt Screen

This hotfix resolves a critical bug where running ExecProcess() without Alt Screen mode caused stdin race conditions with child processes.

Problem

When ExecProcess() was called without alt screen, the inputReader goroutine remained blocked in Read(), creating a race condition for stdin access. This caused issues with interactive commands like vim, ssh, python.

Solution

  • Added CancelableReader wrapper with channel-based cancellation support
  • stopInputReader() now calls Cancel() to immediately unblock any pending reads
  • Fixed goroutine defer to properly clean up state on natural exit (EOF)

Reported by

GoSh Shell Project


Full Changelog: v0.1.0...v0.1.1

Phoenix TUI Framework v0.1.0 - Production Ready 🚀

04 Nov 20:59

Choose a tag to compare

Phoenix TUI Framework v0.1.0 - FIRST STABLE RELEASE 🚀

Status: ✅ PRODUCTION READY - API Quality 9/10

Phoenix TUI Framework v0.1.0 is the first stable release! This marks the completion of 20 weeks of development with comprehensive features, professional documentation, and production-ready API validated against Go best practices 2025.

✨ Highlights

  • 8 production-ready libraries with 91.8% average test coverage
  • Perfect Unicode/Emoji support (fixes Charmbracelet Lipgloss #562)
  • 489x faster than 60 FPS target (29,000 FPS achieved!)
  • Professional documentation (10,568 lines)
  • API quality: 9/10 (validated against Go 2025 best practices)
  • Zero external TUI dependencies (stdlib + platform APIs only)

📦 What's Included

Core Libraries (10 modules):

  • core v0.1.0 - Terminal primitives (98.4% coverage)
  • style v0.1.0 - CSS-like styling (100% coverage)
  • layout v0.1.0 - Box model + Flexbox (98.5% coverage)
  • tea v0.1.0 - Elm Architecture (82.1% coverage)
  • render v0.1.0 - High-performance rendering (93.0% coverage)
  • components v0.1.0 - UI components (100% coverage)
  • mouse v0.1.0 - Mouse interaction (100% coverage)
  • clipboard v0.1.0 - Clipboard operations (72.7% coverage)
  • terminal v0.1.0 - Platform abstraction
  • testing v0.1.0 - Testing utilities (72.1% coverage)

UI Components (6 ready-to-use):

  • TextInput, List, Viewport, Table, Modal, Progress

🎯 Week 20: API Validation & Compliance

Comprehensive API review and compliance with modern Go standards:

  1. Zero Value Documentation (20 types documented)

    • Consistent zero value behavior docs across all modules
    • Clear guidance: "will panic if used" vs "valid but empty"
    • Template-based documentation for consistency
  2. API Quality Research

    • Comprehensive Go API best practices research (42KB document)
    • Validated against top Go libraries (Cobra, Zap, Testify, Prometheus)
    • Phoenix API Quality Assessment: 9/10 - Excellent!
  3. Cobra + Phoenix Integration Example

    • Production-ready CLI+TUI hybrid pattern
    • Real-world pattern for DevOps/database/config tools

📚 Professional Documentation (Week 19)

Complete documentation overhaul (10,568 lines):

  • API documentation for all 10 modules
  • Architecture patterns and DDD guide
  • Testing guide with strategies
  • Performance optimization guide
  • Migration guides (Bubbletea → Phoenix)
  • Troubleshooting and FAQ

⚡ Performance

  • 29,000 FPS rendering (489x faster than 60 FPS target)
  • Zero allocations in hot paths
  • Optimized Unicode width calculations
  • Efficient differential rendering algorithm

🌍 Cross-Platform Support

  • ✅ Windows (native)
  • ✅ macOS (tested in CI)
  • ✅ Linux (primary platform)
  • ✅ WSL2 (Gentoo/Ubuntu tested)

📊 Project Statistics

  • Lines of Code: ~45,000+ (production code)
  • Test Coverage: 91.8% (all modules >70%)
  • Documentation: 10,568 lines
  • Modules: 10 (all production-ready)
  • Components: 6 (fully functional)
  • Development: 20 weeks (6 months)
  • API Quality: 9/10 (validated)

🚀 Getting Started

# Install Phoenix
go get github.com/phoenix-tui/phoenix@v0.1.0

# Or specific module
go get github.com/phoenix-tui/phoenix/core@v0.1.0
go get github.com/phoenix-tui/phoenix/tea@v0.1.0
go get github.com/phoenix-tui/phoenix/components@v0.1.0

Quick Example:

package main

import (
    "fmt"
    "github.com/phoenix-tui/phoenix/tea"
    "github.com/phoenix-tui/phoenix/core"
)

type model struct {
    count int
}

func (m model) Init() tea.Cmd { return nil }

func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
    switch msg := msg.(type) {
    case tea.KeyMsg:
        switch msg.String() {
        case "q", "ctrl+c":
            return m, tea.Quit
        case "up":
            m.count++
        case "down":
            m.count--
        }
    }
    return m, nil
}

func (m model) View() string {
    return fmt.Sprintf("Count: %d\n\nPress ↑/↓ to change, q to quit", m.count)
}

func main() {
    p := tea.NewProgram(model{})
    if _, err := p.Run(); err != nil {
        panic(err)
    }
}

📖 Documentation

🔮 Version Strategy

Phoenix follows cautious versioning:

  • v0.1.0 = First public release (API may evolve based on feedback)
  • v0.2.0, v0.3.0 = Iterations with community input
  • v1.0.0-RC = API freeze (6-12 months after v0.1.0)
  • v1.0.0 = Production certification (backwards compatibility guaranteed)

This approach allows us to gather real-world feedback before committing to API stability.

🎯 Next: v0.2.0

Planned features:

  • Signals integration (reactive views with hybrid approach)
  • Form components (Select, MultiSelect, Confirm)
  • Theme system with presets
  • Animation framework
  • Advanced layout (Grid support)
  • Context support (Add *Context() methods for async operations)

🙏 Acknowledgments

Built with:

  • Domain-Driven Design (DDD) architecture
  • Test-Driven Development (TDD) methodology
  • Elm Architecture pattern (MVU)
  • Go 1.25+ modern features (generics, workspace mode)
  • Community feedback from beta testing

Full Changelog: https://github.com/phoenix-tui/phoenix/blob/main/CHANGELOG.md

Installation: go get github.com/phoenix-tui/phoenix@v0.1.0

Phoenix TUI v0.1.0-beta.6 - Documentation Sprint + CI Hardening

03 Nov 23:49

Choose a tag to compare

Release Date: 2025-11-04
Status: Beta Release (Week 19/20 complete - 95% progress)
Focus: Professional Documentation + CI Reliability


🎯 Highlights

📚 Professional Documentation (10,568 lines)

Week 19 Documentation Sprint delivers comprehensive, production-ready documentation:

  • 8 Developer Guides: STATUS, ARCHITECTURE_PATTERNS, TESTING_GUIDE, PERFORMANCE_GUIDE, CONTRIBUTING, FAQ, TROUBLESHOOTING, API design principles
  • 6 API References: Complete API documentation for STYLE, LAYOUT, TEA, RENDER, MOUSE, CLIPBOARD modules
  • 4 User Tutorials: Getting Started, Building Components, Advanced Patterns, complete with examples
  • Module READMEs: All 10 modules updated with current status, examples, and usage guides
  • Migration Guides: Updated for beta.6+ (Charm ecosystem → Phoenix)

🔧 CI/Quality Improvements

Multi-platform reliability enhancements:

  • macOS CI: Fixed Example test for headless environment (explicit capabilities)
  • Windows CI: Skip flaky inputReader test (stdin blocking timing issues)
  • Cross-platform: go vet runs only on Linux (prevents platform-specific false positives)
  • WSL2 Support: Fixed race detector path conversion (pwd -W for Git Bash/MSYS2)

🔀 Git-Flow Best Practices

Modern release workflow documented and applied:

  • Feature → develop: --squash merge (9 commits → 1 clean commit)
  • Release → main: --no-ff merge (preserve release history)
  • Updated .claude/RELEASE_PROCESS.md with comprehensive merge strategy guide

📊 Metrics

Metric Value Status
Test Coverage 91.8% ✅ Target exceeded (90%+)
Progress 95% (19/20 weeks) ✅ On track
Documentation 10,568 lines ✅ Complete
CI Reliability 100% green ✅ All platforms
Sprint Duration 5 days ✅ Ahead of schedule

📦 Module Versions

All 10 Phoenix libraries released together:

  • github.com/phoenix-tui/phoenix/clipboard@clipboard/v0.1.0-beta.6
  • github.com/phoenix-tui/phoenix/components@components/v0.1.0-beta.6
  • github.com/phoenix-tui/phoenix/core@core/v0.1.0-beta.6
  • github.com/phoenix-tui/phoenix/layout@layout/v0.1.0-beta.6
  • github.com/phoenix-tui/phoenix/mouse@mouse/v0.1.0-beta.6
  • github.com/phoenix-tui/phoenix/render@render/v0.1.0-beta.6
  • github.com/phoenix-tui/phoenix/style@style/v0.1.0-beta.6
  • github.com/phoenix-tui/phoenix/tea@tea/v0.1.0-beta.6
  • github.com/phoenix-tui/phoenix/terminal@terminal/v0.1.0-beta.6
  • github.com/phoenix-tui/phoenix/testing@testing/v0.1.0-beta.6

🚀 Installation

Individual Modules (Recommended)

# Install specific modules you need
go get github.com/phoenix-tui/phoenix/tea@tea/v0.1.0-beta.6
go get github.com/phoenix-tui/phoenix/components@components/v0.1.0-beta.6
go get github.com/phoenix-tui/phoenix/style@style/v0.1.0-beta.6

Root Module (All Libraries)

# Install umbrella module with all libraries
go get github.com/phoenix-tui/phoenix@v0.1.0-beta.6

📚 Documentation

New in Beta.6

  • Developer Guides: Architecture patterns, testing strategies, performance optimization
  • API References: Complete API documentation for all modules
  • User Tutorials: Step-by-step guides (Getting Started, Building Components, Advanced Patterns)
  • Migration Guide: Charm ecosystem → Phoenix (updated for beta.6+)

Quick Links


🔄 What's Changed Since Beta.5

Added

  • 📚 10,568 lines professional documentation (8 guides + 6 API refs + 4 tutorials)
  • 📖 30 testable examples (Example*() functions in all modules)
  • 📝 Package documentation expanded (comprehensive overviews for all 10 modules)
  • 🔧 WSL2 race detector support (pre-release-check.sh improvements)

Fixed

  • 🐛 macOS CI Example test - Use explicit capabilities instead of AutoDetect()
  • 🐛 Windows flaky test - Skip TestProgram_ExecProcess_InputReaderRestarted
  • 🐛 WSL2 path conversion - Use pwd -W for Git Bash/MSYS2 compatibility

Changed

  • 🔀 CI workflow - go vet runs only on Linux (prevents platform false positives)
  • 📋 Git-Flow docs - Modern merge strategies documented (--squash vs --no-ff)
  • 📅 Documentation dates - All docs updated to 2025-11-04, target version beta.6+

⚠️ Migration Notes

No breaking changes - This is a documentation-only release with CI improvements.

For Developers

  1. Update your dependencies: go get -u github.com/phoenix-tui/phoenix/...
  2. Review new documentation in docs/dev/ and docs/api/
  3. Check .claude/RELEASE_PROCESS.md for updated git-flow practices

For Contributors

  1. Read docs/dev/CONTRIBUTING.md for onboarding guide
  2. Check docs/dev/FAQ.md for common questions
  3. Use docs/dev/TROUBLESHOOTING.md for issues

🎯 Next Steps

Week 20 (Final Polish)

  • Final bug fixes and polish
  • Migration guide completion (Charm → Phoenix)
  • Community engagement (Reddit, HN, Twitter)
  • v0.1.0 FINAL release preparation

Target: v0.1.0 GA (November 2025)

After 6 beta cycles and real-world validation (GoSh migration), Phoenix is production-ready:

  • ✅ 91.8% test coverage (target exceeded)
  • ✅ All 10 libraries complete and tested
  • ✅ Performance: 29,000 FPS (489x faster than target)
  • ✅ Real-world validation successful
  • ✅ Comprehensive documentation
  • 🎯 Final polish and v0.1.0 GA launch

🙏 Acknowledgments

  • GoSh Team: Real-world validation and feedback (successful production migration)
  • Contributors: Community feedback and bug reports
  • Charm Ecosystem: Inspiration and lessons learned

📞 Support


Full Changelog: v0.1.0-beta.5...v0.1.0-beta.6

Phoenix TUI v0.1.0-beta.5 - Advanced Features (Mouse + Clipboard)

30 Oct 22:20

Choose a tag to compare

Release Date: 2025-10-30
Status: 🚀 FEATURE RELEASE
Coverage: 91.8% (exceeded 90% target)

Week 15-16 sprint completed ahead of schedule (3 days vs 10 days planned). Focus on mouse enhancements and clipboard advanced features.


🖱️ Mouse Enhancements (Week 15)

Hover Detection System

  • HoverState domain model with component tracking
  • ProcessHover() API with enter/leave/move event callbacks
  • IsHovering() query for current hover state
  • 100% test coverage (18 new tests)

Drag Scrolling

  • Click-and-drag scrolling for Viewport component
  • Natural scroll direction support
  • Drag state tracking (isDragging, dragStartY, scrollStartY)
  • 98.6% coverage (14 new tests)

Mouse Wheel Configuration

  • ConfigurableScrollAmount() for wheel events
  • Direction control (up/down)
  • Smooth scrolling UX
  • 100% coverage (8 new tests)

Context Menu Positioning

  • CalculatePosition() helper for menu placement
  • Boundary detection (prevent off-screen menus)
  • Smart fallback positioning
  • 100% coverage (14 new tests)

Mouse Module: 100% coverage (57.9% → 100%, +590 lines tests)


📋 Clipboard Advanced Features (Week 16)

Image Support

  • PNG, JPEG, GIF, BMP format support
  • Cross-platform clipboard integration
  • Image encoding/decoding with Go stdlib
  • SSH clipboard forwarding compatible
  • 95.3% coverage (31 new tests)

Rich-Text Clipboard

  • HTML and RTF format support
  • Styled text with formatting preservation
  • Bold, italic, underline, color support
  • TextStyles value object with builder pattern
  • 100% coverage (18 new tests)

Clipboard History API

  • Track up to 100 entries with timestamps
  • GetAll(), GetByID(), Clear() operations
  • FIFO eviction when limit reached
  • Thread-safe with mutex protection
  • 94.5% coverage (22 new tests)

Clipboard Module: 88.5% coverage (29% → 88.5%, +1,800 lines tests)


🛠️ Technical Improvements

Windows Compatibility

  • Fixed race condition in TestProgram_ExecProcess_InputReaderStopped
  • Added platform-specific skip for non-deterministic stdin blocking
  • All tests pass on Windows/Linux/macOS

WSL2 Auto-Detection

  • pre-release-check.sh now auto-detects WSL2 distros (Ubuntu, Gentoo, etc.)
  • Runs race detector tests via WSL2 when GCC not available locally
  • Automatic Windows path → WSL path conversion
  • Fallback to tests without -race with helpful warnings

Code Quality

  • All code properly formatted (gofmt)
  • Zero linter issues
  • 91.8% average coverage across all 10 modules
  • 6,600+ lines of code added (production + tests + examples)

📊 Module Status

Module Coverage Status
clipboard 88.5% ✅ Complete
components 100% ✅ Complete
core ✅ Complete
layout 98.5% ✅ Complete
mouse 100% ✅ Complete
render 93.0% ✅ Complete
style 100% ✅ Complete
tea 82.1% ✅ Complete
terminal ✅ Complete
testing 72.1% ✅ Complete

Average: 91.8% (target: 90% ✅)


📦 Installation

# Install all modules
go get github.com/phoenix-tui/phoenix@v0.1.0-beta.5

# Or specific modules
go get github.com/phoenix-tui/phoenix/mouse@mouse/v0.1.0-beta.5
go get github.com/phoenix-tui/phoenix/clipboard@clipboard/v0.1.0-beta.5

---
🎯 Sprint Performance

- Planned: 10 days (Week 15-16)
- Actual: 3 days
- Tasks: 9/9 completed (100%)
- Code: 6,600+ lines added
- Tests: +2,400 lines
- Examples: 4 new examples

---
🔗 Links

- Documentation: https://pkg.go.dev/github.com/phoenix-tui/phoenix@v0.1.0-beta.5
- Changelog: CHANGELOG.md
- Roadmap: ROADMAP.md
- Issues: https://github.com/phoenix-tui/phoenix/issues

---
⚠️ Breaking Changes

None. All changes are additive.

---
🙏 Acknowledgments

This release includes contributions from:
- Advanced mouse interaction patterns inspired by modern TUI frameworks
- Cross-platform clipboard research from Go community best practices
- WSL2 integration inspired by developer workflow optimizations

Next up: v0.1.0-beta.6 - Documentation & Examples Polish

Phoenix TUI Framework v0.1.0-beta.4

28 Oct 18:10

Choose a tag to compare

Pre-release

Release Date: October 28, 2025Status: Beta (API may change)

Overview

This release brings Phoenix to industry-standard API patterns with improved public API ergonomics, cross-platform reliability, and professional component styling.


Highlights

API Modernization (BREAKING CHANGE)

  • Refactored all 10 modules to follow Relica/OpenTelemetry patterns
  • Public APIs now at package root (input.NewTextArea() vs model.NewTextArea())
  • Internal DDD implementation protected under /internal/
  • Better pkg.go.dev documentation (internals hidden, public API clean)

Performance Improvement

  • Migrated type aliases to wrapper types (+5% performance)
  • All methods/constants now properly visible on pkg.go.dev
  • Wrapper types optimize better than simple type aliases

Component Enhancements

  • TextArea scrolling with proper cursor positioning
  • Professional cursor styling (ANSI reverse video)
  • Gray placeholder text (RGB 88,88,88)
  • 100% test coverage for new features

Build Quality

  • Terminal cross-compilation fix (Unix stubs for Windows functions)
  • Pre-release checks now validate GOOS=linux builds
  • Prevents "works on Windows, fails on Linux" scenarios

Breaking Changes

Import Path Changes:
// Before:
import "github.com/phoenix-tui/phoenix/components/input/domain/model"
ta := model.NewTextArea()

// After:
import "github.com/phoenix-tui/phoenix/components/input"
ta := input.NewTextArea()

Migration: See https://github.com/phoenix-tui/phoenix/blob/main/CHANGELOG.md#migration-guide for complete migration guide.


Installation

Individual modules (recommended)

go get github.com/phoenix-tui/phoenix/tea@tea/v0.1.0-beta.4
go get github.com/phoenix-tui/phoenix/components@components/v0.1.0-beta.4

All modules

go get github.com/phoenix-tui/phoenix@v0.1.0-beta.4


Quality Metrics

  • Files changed: 401
  • Code changes: +6,334 / -4,777 lines
  • Test coverage: 72.1-100% across modules
  • Platforms tested: Linux, macOS, Windows
  • Pre-release checks: PASSED

What's Next

  • Week 15-16: Advanced features (mouse, clipboard enhancements)
  • Week 17-18: GoSh shell migration (real-world validation)
  • Week 19-20: Documentation & polish

Documentation


Known Issues

None. All critical issues resolved.


Contributors

Thanks to all contributors who made this release possible!

Note: This is a beta release. API may change based on community feedback. Breaking changes are acceptable until v0.1.0 stable.

Phoenix TUI v0.1.0-beta.2 - Multi-Module + TextArea Cursor Control + Linter Cleanup

20 Oct 05:11

Choose a tag to compare

[0.1.0-beta.2] - 2025-10-20 (Multi-Module + TextArea Cursor Control)

Status: 🎉 FEATURE RELEASE

This release fixes the multi-module monorepo structure AND adds advanced cursor control API for TextArea component, requested by GoSh shell project.

Changed

Multi-Module Monorepo Structure

  • Added root go.mod for pkg.go.dev indexing
    • Umbrella module pattern (like OpenTelemetry, Kubernetes)
    • Contains replace directives for all 10 libraries
    • No require section (pure umbrella module)
    • Enables GitHub badges and Go proxy discovery
  • Module tagging strategy documented
    • 11 tags per release (10 module-specific + 1 root tag)
    • Example: clipboard/v0.1.0-beta.2, components/v0.1.0-beta.2, v0.1.0-beta.2
    • All tags point to the same commit for consistency

Added

TextArea Cursor Control API ⭐ NEW FEATURE

Phoenix TextArea now supports advanced cursor control for shell-like applications (requested by GoSh project):

  1. SetCursorPosition(row, col) - Programmatic cursor positioning

    • Set cursor to exact position with automatic bounds clamping
    • Enables shell-like navigation (e.g., "Up on first line → jump to end")
    • Example: ta.SetCursorPosition(0, len([]rune(firstLine)))
  2. OnMovement(validator) - Movement validation

    • Validator called BEFORE cursor moves
    • Return false to block movement (boundary protection)
    • Example: Block cursor from editing shell prompt area
  3. OnCursorMoved(handler) - Cursor movement observer

    • Handler called AFTER successful movement
    • React to cursor changes (update UI, refresh syntax highlighting)
    • Observer pattern (cannot block movement)
  4. OnBoundaryHit(handler) - Boundary hit feedback

    • Handler called when movement blocked by validator
    • Provides user feedback for accessibility/UX
    • Know when and why cursor couldn't move

Complete Example (Shell REPL):

ta := textarea.New().
    OnMovement(func(from, to textarea.CursorPos) bool {
        // Don't allow cursor to edit prompt area
        if to.Row == 0 && to.Col < 2 {
            return false  // Block movement
        }
        return true
    }).
    OnCursorMoved(func(from, to textarea.CursorPos) {
        // Update syntax highlighting when row changes
        if from.Row != to.Row {
            refreshSyntaxHighlight(to.Row)
        }
    }).
    OnBoundaryHit(func(attemptedPos textarea.CursorPos, reason string) {
        // Visual feedback for user
        flash("Cannot edit prompt area")
    })

New Files:
- components/input/textarea/domain/model/cursor_position.go - CursorPos value object
- components/input/textarea/api/textarea_cursor_control_test.go - 11 unit tests (90%+ coverage)
- components/input/textarea/api/textarea_shell_integration_test.go - 8 integration tests
- components/input/textarea/examples/shell_prompt/main.go - Interactive demo
- components/input/textarea/CURSOR_CONTROL_API.md - Complete API documentation

Modified Files:
- components/input/textarea/api/textarea.go - Added 4 new methods + types + godoc examples
- components/input/textarea/domain/model/textarea.go - Added callbacks support + SetCursorPosition()
- components/input/textarea/domain/service/navigation.go - Integrated validator checks (all 10 navigation methods)

Benefits:
-Enables shell REPLs (GoSh, custom shells)
-Enables code editors with gutters/line numbers
-Enables SQL clients with multiline queries
-Accessibility (screen reader integration)
-Follows industry patterns (PSReadLine, GNU Readline, prompt_toolkit)
-100% backward compatible (all features opt-in)

Open Source Best Practices
-CODE_OF_CONDUCT.md - Contributor Covenant 2.1
-SECURITY.md - Security policy and vulnerability reporting
- ✅ .github/FUNDING.yml - Sponsorship configuration (placeholder)
- ✅ .github/ISSUE_TEMPLATE/ - Bug report, feature request, question templates
- ✅ .github/PULL_REQUEST_TEMPLATE.md - Comprehensive PR checklist

Documentation
-Updated RELEASE_PROCESS.md - Multi-module tagging workflow
-scripts/create-release-tags.sh - Automated multi-module tagging script
-Issue templates - Structured bug reports and feature requests
-PR template - Code quality, testing, and architecture checklists

Fixed

Code Quality - Linter CleanupNEW
- Fixed 204 linter issues across style, terminal, testing, and mouse modules:
  - style: 870 (godot, revive, unconvert, staticcheck, gosec, gocritic, dupl, gocyclo, goconst, funlen, nestif, makezero)
  - terminal: 620 (godot, unused, gosec, gocritic, gocognit, cyclop, nestif, revive)
  - testing: 500 (revive - exported methods comments)
  - mouse: 50 (gocritic, nestif)
- Critical fixes:
  -redefines-builtin-id (Go 1.21+ compatibility) - Removed custom max() function
  -godot (comment style) - All comments now end with periods
  -revive (package comments, unused params) - Added package documentation
  -gocritic (code improvements) - ifElseChain, appendAssign, hugeParam
  -gosec (security) - Mathematical proofs for color math (no overflow)
  -gocyclo/cyclop (complexity) - Suppressed with justification
  -nestif (nesting) - Inline nolint directives where justified
  -makezero (slice diagnostics) - Suppressed where size known
- All modules now pass golangci-lint v2.5 with exit code 0
- Benefits:
  -CI will pass (no linter failures)
  -Go 1.21+ compatibility guaranteed
  -Code quality improved
  -Production ready

pkg.go.dev Indexing
- Previously: v0.1.0-beta.1 cached on commit a3668cd (414 files, no root go.mod)
- Now: v0.1.0-beta.2 on commit with root go.mod (415 files)
- Go proxy will index the root module correctly
- GitHub badges will work (Go version, Go Report Card, pkg.go.dev)

Technical Details

File Changes
- Added: go.mod (root module with 10 replace directives)
- Added: CODE_OF_CONDUCT.md (1,134 lines)
- Added: SECURITY.md (166 lines)
- Added: .github/FUNDING.yml (27 lines)
- Added: .github/ISSUE_TEMPLATE/ (4 templates + config)
- Added: .github/PULL_REQUEST_TEMPLATE.md (156 lines)
- Added: scripts/create-release-tags.sh (automated tagging script)
- Added: TextArea cursor control (5 new files, 3 modified, ~1,500 lines total)
- Updated: .claude/RELEASE_PROCESS.md (multi-module workflow)
- Updated: CHANGELOG.md (this file)
- Modified: 83 files for linter cleanup (1,286 insertions, 1,179 deletions)

Why This Release?
- Go proxy has immutable cache - cannot update existing v0.1.0-beta.1
- Root go.mod required for GitHub badges and pkg.go.dev root module index
- Better to release beta.2 with proper structure than wait for v0.2.0
- Linter cleanup ensures CI passes and Go 1.21+ compatibility

Migration from beta.1 to beta.2
No code changes! Just update your import paths if you were using the root module:

# Before (beta.1) - still works
go get github.com/phoenix-tui/phoenix/components@v0.1.0-beta.1

# After (beta.2) - now root module also available
go get github.com/phoenix-tui/phoenix@v0.1.0-beta.2
go get github.com/phoenix-tui/phoenix/components@components/v0.1.0-beta.2

Recommended: Continue importing individual libraries directly. Root module is mainly for tooling/discovery.