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

Tracking issue for breaking changes for ProgressBar #6501

Open
kt3k opened this issue Mar 21, 2025 · 3 comments
Open

Tracking issue for breaking changes for ProgressBar #6501

kt3k opened this issue Mar 21, 2025 · 3 comments

Comments

@kt3k
Copy link
Member

kt3k commented Mar 21, 2025

@kt3k
Copy link
Member Author

kt3k commented Mar 21, 2025

I think we first need to settle on #6407 to start landing these changes

@BlackAsLight
Copy link
Contributor

On a somewhat related, somewhat different direction, both ProgressBar and Spinner have a flaw in their design in two ways.

  1. You can't print other things to the console at the same time without it becoming a mess.
  2. Their existence as a class gives the impression that you can have multiple running at a time, but doing so would make a mess of the terminal as they all try and overwrite each other.

I think their design needs to be reworked entirely to resolve these issues. I believe the first issue can be fixed by using some different terminal control sequences to move the cursor for rewrites instead of clearing the current line before writing again. For the second issue, I think it would be better if the APIs acted as if they were controlling some global state and not creating a piece of memory to be passed around. With this global state type of design, we could also allow more complex outputs in the terminal like multiple progress bars/ spinners or possibly even getting user input while a progress bar also updates on screen.

@timreichen
Copy link
Contributor

A few other things I noticed:

  • ProgressBarOptions.fmt is an abbreviation which is not very web-apish. Maybe it should be called something like formatter or format instead.
  • ProgressBarFormatter seems overly complex atm. styledTime and styledData seem like they could be getters instead of functions.
  • ProgressBarFormatter progressBar, styledTime and styledData should be strings without a trailing whitespaces.

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

No branches or pull requests

3 participants