Skip to content

Refactor success message display and enhance next steps output - #19

Merged
roble merged 4 commits into
mainfrom
dev
Jul 22, 2026
Merged

Refactor success message display and enhance next steps output#19
roble merged 4 commits into
mainfrom
dev

Conversation

@roble

@roble roble commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

This pull request updates the installation success messaging to use improved formatting and clearer next steps, and refactors related logic for better testability and maintainability. The most important changes are grouped below:

User-Facing Improvements:

  • The displaySuccess method in InstallCommand now uses a callout with a numbered list for next steps and a styled link, improving clarity and visual presentation.
  • Next steps in both DockerEnvironment and NativeEnvironment are now formatted using backticks for code snippets, making instructions easier to copy and recognize as commands. [1] [2]
  • A "cd" step is automatically added to the next steps if the target app was installed outside the current directory, guiding the user to the correct directory after installation.

Testing and Internal Refactoring:

  • The success callout content logic was extracted to a protected method (successCalloutContent), and a test helper (exposedSuccessCalloutContent) was added to facilitate unit testing of the new output structure. [1] [2]
  • The test for step numbering was updated to check for the presence of a NumberedList element with the correct items, rather than relying on line output parsing.

Dependency Updates:

  • Imports for Laravel\Prompts\Elements\Element and related prompt utilities were added to support the new callout and list formatting. [1] [2]

Summary by CodeRabbit

  • New Features

    • Installation completion now uses a clearer callout with numbered next steps and a project link.
    • Installers now include a “change directory” step when the target directory differs from the current working directory.
  • Improvements

    • Setup instructions, frontend commands, app URLs, and Mailpit links are displayed with cleaner inline formatting (without extra color markup).
  • Tests

    • Updated installation and environment tests to validate the rendered callout/next-step content and directory-change behavior more directly.

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Installation success output now uses a Laravel Prompts callout with structured numbered steps and a repository link. Environment output adds a conditional directory-change step, and Docker and Native next-step messages use backtick formatting.

Changes

Installation success output

Layer / File(s) Summary
Environment next-step composition
src/Environments/Environment.php, src/Environments/DockerEnvironment.php, src/Environments/NativeEnvironment.php, tests/Feature/Environments/NativeEnvironmentTest.php
Success output optionally includes a cd command, environment-specific instructions remove terminal color tags and use backticks, and tests cover normalized target-directory handling.
Structured success callout and validation
src/Console/Commands/InstallCommand.php, tests/Feature/InstallCommandTest.php
Installation completion content is rendered through a Laravel Prompts callout with numbered steps and a repository link; tests inspect the structured NumberedList content.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: sauce-base

Sequence Diagram(s)

sequenceDiagram
  participant Environment
  participant InstallCommand
  participant LaravelPrompts
  Environment->>Environment: combine cdStep and nextSteps
  Environment->>InstallCommand: pass success steps
  InstallCommand->>LaravelPrompts: render Installation complete callout
  LaravelPrompts-->>InstallCommand: display numbered steps and repository link
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: refactoring success messaging and improving next-step output.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/Environments/Environment.php`:
- Around line 42-51: Update Environment::cdStep to keep the full normalized
target path in the generated cd command instead of reducing it with
basename($target). Continue comparing normalized paths to return an empty array
when already in the target directory, and preserve correct quoting/formatting
for relative and absolute targets. Add regression coverage for nested relative
and absolute target paths.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 694cebc7-17f3-4442-84d8-8ad4a77bf5aa

📥 Commits

Reviewing files that changed from the base of the PR and between a4e8475 and 58224da.

📒 Files selected for processing (5)
  • src/Console/Commands/InstallCommand.php
  • src/Environments/DockerEnvironment.php
  • src/Environments/Environment.php
  • src/Environments/NativeEnvironment.php
  • tests/Feature/InstallCommandTest.php

Comment thread src/Environments/Environment.php Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/Feature/Environments/NativeEnvironmentTest.php`:
- Around line 189-194: Wrap the assertion in the test around
envExposingCdStep()->exposedCdStep($command) in a try/finally block, keeping the
expected-value assertion unchanged and moving removeDirectory($elsewhere) into
finally so the external temporary directory is always cleaned up.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: a5ceb81e-0cab-4196-a35d-5295d4113f48

📥 Commits

Reviewing files that changed from the base of the PR and between 58224da and f3e36b4.

📒 Files selected for processing (2)
  • src/Environments/Environment.php
  • tests/Feature/Environments/NativeEnvironmentTest.php
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/Environments/Environment.php

Comment thread tests/Feature/Environments/NativeEnvironmentTest.php
@roble
roble merged commit 5c24a37 into main Jul 22, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant