Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rendering issue with long confirm labels #124

Closed
duncanmcclean opened this issue Mar 12, 2024 · 4 comments · Fixed by #125
Closed

Rendering issue with long confirm labels #124

duncanmcclean opened this issue Mar 12, 2024 · 4 comments · Fixed by #125
Assignees

Comments

@duncanmcclean
Copy link
Contributor

Laravel Prompts Version

0.1.16

Laravel Version

11.0.3

PHP Version

8.3.0

Operating System & Version

macOS 14.3.1

Terminal Application

iTerm & VS Code's integrated terminal

Description

We're migrating some of our commands to Laravel Prompts, now we no longer support PHP 8.1, they're all looking really nice, thanks for your hard work. 🪄

However, in converting one of our commands with a longish confirm label, I noticed an issue where the top right of the prompt isn't being rendered correctly:

CleanShot 2024-03-12 at 20 34 50

I would assume the "border line" should connect to the "border lines" on the right.

Steps To Reproduce

  1. Create a fresh Laravel application
  2. Install Laravel Prompts
  3. Add this command to your routes/console.php file:
Artisan::command('long-confirm-label', function () {
    $date = now()->format('Y-m-d');

    if (confirm("The current date is [<comment>{$date}</comment>]. The label for this prompt is very long. Is this okay?")) {
        $this->info('You chose to continue');
    } else {
        $this->info('You chose to cancel');
    }
});

Alternatively, I've also spun up a fresh Laravel 11 app which you can clone to replicate the issue.

@duncanmcclean
Copy link
Contributor Author

I think it may be related to the [<comment>...</comment>] stuff we have going on. Removing that seems to sort it.

I'm new to Prompts, so if that syntax isn't intended to work, feel free to close this issue. Apologies for the time waste!

@jessarcher
Copy link
Member

Hi @duncanmcclean,

I think it may be related to the [<comment>...</comment>] stuff we have going on. Removing that seems to sort it.

You are correct. So far we've only added support for Symfony's fg, bg, and options tags. E.g. <fg=yellow>{$date}</>.

I'm new to Prompts, so if that syntax isn't intended to work, feel free to close this issue. Apologies for the time waste!

I hadn't even considered some of the named styles like info, comment, etc! Definitely not a waste of time 🙂 It should be straightforward to support them, but supporting any custom-named styles would be more complex.

@jessarcher
Copy link
Member

I've created #125 to address this!

@duncanmcclean
Copy link
Contributor Author

Thanks for the quick fix! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants