progressbar icon indicating copy to clipboard operation
progressbar copied to clipboard

Add support for child ProgressBar

Open vehovsky opened this issue 5 years ago • 10 comments

Initial implementation. Build on top of https://github.com/ctongfei/progressbar/pull/69

progressbar

Fixes #66

vehovsky avatar Apr 13 '20 22:04 vehovsky

Wow! Thanks @vehovsky !!! This change would merit the 1.0 release I think. I'll review and release asap.

ctongfei avatar Apr 14 '20 03:04 ctongfei

I think that this proposal need more discussion. There are two cases with parent/children progress bars:

  • The parent m steps, and for each step there is n steps (there could be sub-progressbars spawning and dying in the process).
  • The parent finishes if all its children finishes (the parent does not have its own progress)

I think what you implemented here is the second case.

ctongfei avatar Apr 24 '20 14:04 ctongfei

Yes it is initial implementation only.

Well the actual progress of the parent is calculated as average of all it children/subchildren/etc. progresses.

It is true the "max" of parent is only size of immediate children, not subchildren/etc.

So instead:

max = children.size();

Something like:

int getSize(List<ProgressState> children) {
    AtomicInteger result = new AtomicInteger(children.size());
    if (children.size() > 0) {
        children.forEach(state -> result.addAndGet(getSize(state.children)));
    }
    return result.get();
}

vehovsky avatar Apr 24 '20 16:04 vehovsky

Yes and I think that we need to discuss to understand the subtle semantics of the two cases. In the meantime, I'm thinking of releasing an interim 0.9 version with your fabulous multi-line contribution, and leave this for a later 1.0.

ctongfei avatar Apr 25 '20 03:04 ctongfei

Yes and I think that we need to discuss to understand the subtle semantics of the two cases. In the meantime, I'm thinking of releasing an interim 0.9 version with your fabulous multi-line contribution, and leave this for a later 1.0.

@ctongfei Can you release 0.9?

nadilas avatar Aug 16 '20 13:08 nadilas

@nadilas 0.9.0 was relased https://github.com/ctongfei/progressbar/blob/master/CHANGELOG.md

I am a bit worried about the conflicts here. Maybe @vehovsky can fix them? 😇

koppor avatar Oct 24 '20 20:10 koppor

Hey,

don't mean to be annoying, but is there any ETA on when this can be released?

talemke avatar Aug 20 '21 10:08 talemke

@nadilas 0.9.0 was relased https://github.com/ctongfei/progressbar/blob/master/CHANGELOG.md

I am a bit worried about the conflicts here. Maybe @vehovsky can fix them? 😇

Let's try this again 😅 @koppor How can we help?

nadilas avatar Jul 09 '22 08:07 nadilas

It would be great if better multiline support could be added for 0.9.

And I would also like to add another scenario to this, or clarify if it is already covered by this.

The parent m steps, and for each step there is n steps (there could be sub-progressbars spawning and dying in the process).

My scenario would be similar, e.g. parent has m steps (files) and can process up to n files in parallel, i.e. it would show up to n child progress bars. The child progress bars would depend on the individual files and can have a different number of steps. Once a files is processed, the thread would pickup another file and process it, either reusing a child progress bar or creating a new one - whatever is the correct strategy.

leonard84 avatar Sep 19 '22 18:09 leonard84

@leonard84 Seems someone needs to redo this PR - and @vehovsky seems to be inactive. Anyone volunteering for the sake of hacktoberfest?

koppor avatar Oct 27 '22 20:10 koppor