feat: simplify output handling - #20
Conversation
Add laravel/prompts package to enable beautiful, interactive CLI prompts with validation, auto-complete, and loading spinners for enhanced UX.
Remove quiet mode suppression from BaseCommand output methods and introduce custom input definition that exposes only essential options. Changes: - Remove $isQuiet property and checks from BaseCommand - Remove quiet mode logic from writeln(), text(), and hr() methods - Add custom getDefaultInputDefinition() in SymfonyApp - Expose only --help, --version, and --ansi options - Add early exit when --version flag is used - Banner now always displays (no quiet mode suppression) BREAKING CHANGE: --quiet, --verbose, and --no-interaction flags are no longer available. Commands always produce output. This aligns with the new philosophy of modern TUI styling over verbosity management.
Replace quiet/verbosity management documentation with modern TUI philosophy emphasizing BaseCommand custom methods and Laravel Prompts. Changes: - Remove quiet mode and verbosity level documentation - Add output method philosophy section - Document mandatory use of BaseCommand custom methods - Add Laravel Prompts integration examples - Remove performance and verbosity pattern guidelines - Simplify to focus on consistent, beautiful output
Remove obsolete quiet mode tests and add new tests for custom input definition and version flag handling. Changes: - Remove quiet mode suppression tests from BaseCommandTest - Remove quiet mode test from HelloCommandTest - Add test for custom input definition (only essential options) - Add test for early exit on --version flag - Add test for banner always displaying - All tests passing with new architecture (14 integration tests)
WalkthroughRemoves quiet-mode handling from BaseCommand helpers, adds a custom InputDefinition and version short-circuit in SymfonyApp, updates tests to reflect new behavior, and introduces laravel/prompts as a dependency. Documentation is rewritten to mandate BaseCommand-driven output and to demonstrate Laravel Prompts usage. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant CLI as SymfonyApp (CLI)
participant Cmd as Command
Note over CLI: getDefaultInputDefinition()<br/>options: --help, --version, --ansi
User->>CLI: Run app with --version
CLI->>CLI: Display banner
CLI->>CLI: hasParameterOption(--version) == true
CLI-->>User: Exit Command::SUCCESS (no further execution)
Note over CLI: Early exit on --version
sequenceDiagram
autonumber
actor User
participant CLI as SymfonyApp (CLI)
participant Cmd as Command
User->>CLI: Run app (e.g., list)
CLI->>CLI: Display banner (always)
CLI->>Cmd: Execute command flow
Cmd->>Cmd: BaseCommand::writeln/text/hr (no quiet suppression)
Cmd-->>CLI: Return status
CLI-->>User: Output result
Note over Cmd: Output not gated by quiet mode
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (7)
💤 Files with no reviewable changes (3)
🧰 Additional context used📓 Path-based instructions (6)**/*.php📄 CodeRabbit inference engine (.cursor/rules/00-main.mdc)
Files:
tests/**📄 CodeRabbit inference engine (.cursor/rules/00-main.mdc)
Files:
tests/**/*.php📄 CodeRabbit inference engine (.cursor/rules/02-tests.mdc)
Files:
composer.json📄 CodeRabbit inference engine (.cursor/rules/00-main.mdc)
Files:
{composer.json,package.json}📄 CodeRabbit inference engine (.cursor/rules/00-main.mdc)
Files:
app/SymfonyApp.php📄 CodeRabbit inference engine (.cursor/rules/01-architecture.mdc)
Files:
🧠 Learnings (9)📚 Learning: 2025-10-01T13:57:29.909ZApplied to files:
📚 Learning: 2025-10-01T13:57:29.909ZApplied to files:
📚 Learning: 2025-10-01T13:57:29.909ZApplied to files:
📚 Learning: 2025-10-01T13:57:29.909ZApplied to files:
📚 Learning: 2025-10-01T13:57:29.909ZApplied to files:
📚 Learning: 2025-10-01T13:56:16.653ZApplied to files:
📚 Learning: 2025-10-01T13:57:29.909ZApplied to files:
📚 Learning: 2025-10-01T13:57:29.909ZApplied to files:
📚 Learning: 2025-10-01T13:57:29.909ZApplied to files:
🧬 Code graph analysis (1)tests/Integration/SymfonyAppTest.php (2)
🔇 Additional comments (10)
Comment |
Summary by CodeRabbit
New Features
Refactor
Documentation
Tests