Skip to content

Add interactive menu demo and integrate interactive TUI helpers#2

Merged
joejollands merged 1 commit into
mainfrom
codex/review-project-and-create-improvement-plan-47oaem
Jan 15, 2026
Merged

Add interactive menu demo and integrate interactive TUI helpers#2
joejollands merged 1 commit into
mainfrom
codex/review-project-and-create-improvement-plan-47oaem

Conversation

@joejollands

@joejollands joejollands commented Jan 15, 2026

Copy link
Copy Markdown
Contributor

Motivation

  • Provide a hands-on demo so users can exercise the new interactive TUI primitives (menus, checkboxes, radios) in an obvious, discoverable way.
  • Expose a small, composable API that fits existing command traits so both Laravel and Symfony commands can present interactive menus.
  • Ship safe terminal helpers and tests to avoid leaving the terminal in an unusable state and to validate low-level key/ANSI behavior.

Description

  • Add a new demo command TartInteractiveDemoCommand (php artisan tart:interactive-demo) that walks through a single-select menu, a checkbox multi-select, and a radio selection with a TTY guard and user guidance.
  • Register the demo command in TartServiceProvider and add the demo entry to README.md so it is discoverable in the demo list.
  • Introduce interactive menu infrastructure: IGC art\Support\n - InteractiveMenu` (selection, checkbox, radio flows and rendering),
    • TerminalMode, TerminalInput, TerminalControl, and KeyPress (raw-mode handling, key parsing, ANSI cursor/control sequences).
  • Add the HasInteractiveMenus concern and wire it into both StyledCommand classes so commands gain menu(), checkboxMenu(), and radioMenu() helpers.
  • Add unit tests for low-level behavior: tests/Unit/KeyPressTest.php and tests/Unit/TerminalControlTest.php that validate key parsing and ANSI sequences.

Testing

  • Unit tests were added: tests/Unit/KeyPressTest.php and tests/Unit/TerminalControlTest.php, but an automated test run was not executed in this environment.
  • No CI/test output is available from this rollout, so test pass/fail status is unknown.
  • Interactive demo is gated by a TTY check (stream_isatty(STDIN)) and exercises the runtime behavior only when run in an interactive terminal (php artisan tart:interactive-demo).

@joejollands joejollands merged commit 73e6cdd into main Jan 15, 2026
0 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant