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

Feature Request: Progress Bar #51

Closed
adrianspacely opened this issue Aug 16, 2023 · 2 comments · Fixed by #82
Closed

Feature Request: Progress Bar #51

adrianspacely opened this issue Aug 16, 2023 · 2 comments · Fixed by #82
Assignees

Comments

@adrianspacely
Copy link

adrianspacely commented Aug 16, 2023

Amazing work, Jess. laravel/prompts is mint 👌

I would love to suggest a progress bar component.

It's not really an input, but it is something you could cancel, or it could be combined with a text input - for example entering a URL to download from.

For example:

  • Label
  • Cancelled state
  • Customise the display value for the numerator/denominator
  • Pending mode (like a loading spinner variant if progress is unknowable)
  • Parallel progress bars? - or maybe parallel output could be a seperate feature of its own
  • Maybe Http download support, i.e. sugar for Http::sink('/path/to/file')->withOptions(['progress' => ...])->get($url)
@adrianspacely adrianspacely changed the title Progress Bar Feature Request: Progress Bar Aug 16, 2023
@devajmeireles
Copy link
Contributor

devajmeireles commented Aug 16, 2023

Particularly I think the idea of progress bar is very old. Why not use the spin instead? It is enough that when a process finishes, you call another spin, sequentially:

CleanShot 2023-08-16 at 11 38 26

Perhaps something like that would be awesome:

spin(fn () => sleep(3), 'Installing dependencies...')
    ->then(fn () => sleep(3), 'Preparing environment...')
    ->then(fn () => sleep(3), 'Finishing up...');

@adrianspacely
Copy link
Author

adrianspacely commented Aug 18, 2023

Why not use the spin instead?

I had no idea that spin was in here. It's not documented. Thank you for the tip.

Particularly I think the idea of progress bar is very old.

Subjective. For most cases I'd agree. For my needs:

  • I have a large file download that I'd prefer to see progress, time elapsed, and time remaining for.
  • I've also worked on import commands that work through many files (an unknown amount) where you'd want to know the progress.

I also think a progress component would look cool for job batches as a use-case for the framework.

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.

4 participants