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

Support progress bars #1

Open
3 tasks
killercup opened this issue Oct 5, 2018 · 4 comments
Open
3 tasks

Support progress bars #1

killercup opened this issue Oct 5, 2018 · 4 comments
Labels
design decision required It's not yet decided how best to implement this. help wanted Extra attention is needed

Comments

@killercup
Copy link
Owner

  • Render and update a progress bar for humans
    • will probably need to return something non-() from Output::print
  • Render other stuff above it while progress bar is visible
  • Render usable stuff to JSON (e.g. a 'tick' with current state each n seconds)
@killercup killercup added the help wanted Extra attention is needed label Oct 6, 2018
@killercup
Copy link
Owner Author

killercup commented Oct 7, 2018

Cargo's impl lives here

@killercup
Copy link
Owner Author

killercup commented Oct 8, 2018

Termcolor doesn't support advanced Windows stuff. We might be able to use some of what console does, though.

@killercup killercup added the design decision required It's not yet decided how best to implement this. label Oct 9, 2018
@killercup killercup added this to the v0.2 milestone Nov 1, 2018
@killercup
Copy link
Owner Author

Some notes from talking with @waywardmonkeys:

  • Output "records" can have different types
    • additive
    • replacing
  • Replacing works by supplying the UUID of the record to replace
    • introduce records that have UUIDs
    • track them in the output to be able to replace them
    • not all output media will be able to do replacements, e.g. json streams
  • Maybe the replacement mechanism is part of the layout (cf. Write a demo "layout" component #3), e.g. in a layout with "additive on top", "replaceable progressbar sticky at the bottom"

@killercup killercup removed this from the v0.2 milestone Dec 31, 2018
@killercup
Copy link
Owner Author

This will require some more refactoring and design work before I'm happy with the API. Currently, my idea was to have something like

output.progress(convey::Progress::bar(i, 10).message(msg));

which would always replace the current progress bar. (Something like convey::Progress::none() would remove it.)

I think we should go one step further, though, and also help with managing the state of the progress bar in between calls. Maybe even have an iterator adapter to quickly update the progress bar in an iterator chain.

My experiments so far have been just that, experiments. I'll try to write more of this down in the future, and come up with more test cases to evaluate a design against.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design decision required It's not yet decided how best to implement this. help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant